33 #ifndef __H__UG_cluster_element_stacks
34 #define __H__UG_cluster_element_stacks
37 #include "../partitioner.h"
43 template <
class elem_t,
class vector_t>
54 const vector_t& stackingDir) :
84 "Please specify a valid stacking direction. "
85 "Current stacking direction has length 0.");
86 UG_COND_THROW(!
m_mg,
"no valid grid was specified during 'init_post_processing'");
88 "'init_post_processing'");
90 "a valid position attachment (attached to the underlying grid) "
91 "before performing partitioning through "
92 "'ClusterElementStacks::set_position_attachment'.");
102 mg.
end<elem_t>(partitionLvl),
false);
104 vector_t stackingDir;
113 stack<elem_t*> stack;
118 if(aaProcessed[rootElem])
123 stack.push(rootElem);
124 aaProcessed[rootElem] =
true;
126 while(!stack.empty()){
127 elem_t* elem = stack.top();
137 if(!aaProcessed[nbr]){
139 aaProcessed[nbr] =
true;
Definition: cluster_element_stacks.h:45
void partitioning_done()
Definition: cluster_element_stacks.h:149
SubsetHandler * m_partitions
Definition: cluster_element_stacks.h:159
void set_stacking_direction(const vector_t &stackingDir)
Definition: cluster_element_stacks.h:67
void post_process(int partitionLvl)
Definition: cluster_element_stacks.h:79
ClusterElementStacks()
Definition: cluster_element_stacks.h:47
void set_position_attachment(const Attachment< vector_t > &aPos)
Definition: cluster_element_stacks.h:62
Attachment< vector_t > a_position_t
Definition: cluster_element_stacks.h:156
virtual ~ClusterElementStacks()
Definition: cluster_element_stacks.h:59
vector_t m_stackingDir
Definition: cluster_element_stacks.h:162
elem_t::side side_t
Definition: cluster_element_stacks.h:155
void init_post_processing(MultiGrid *mg, SubsetHandler *partitions)
Definition: cluster_element_stacks.h:72
ABool m_aProcessed
Definition: cluster_element_stacks.h:160
ClusterElementStacks(const Attachment< vector_t > &aPos, const vector_t &stackingDir)
Definition: cluster_element_stacks.h:52
a_position_t m_aPos
Definition: cluster_element_stacks.h:161
MultiGrid * m_mg
Definition: cluster_element_stacks.h:158
the generic attachment-accessor for access to grids attachment pipes.
Definition: grid.h:182
void detach_from(IAttachment &attachment)
Definition: grid_impl.hpp:369
void attach_to(IAttachment &attachment, bool passOnValues)
attach with custom pass-on-behaviour and unspecified default value.
Definition: grid_impl.hpp:296
bool has_vertex_attachment(IAttachment &attachment)
Definition: grid.h:798
void associated_elements(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' or which contain 'e' into elemsOut.
Definition: grid_impl.hpp:466
Partitions elements of a grid into several subsets.
Definition: subset_handler_grid.h:53
void assign_subset(Vertex *elem, int subsetIndex)
assigns a vertex to a subset.
Definition: subset_handler_grid.cpp:204
allows to post-process partitions
Definition: partitioner.h:146
int get_subset_index(GridObject *elem) const
Definition: subset_handler_interface.cpp:560
Definition: multi_grid.h:72
geometry_traits< TElem >::iterator end(int level)
Definition: multi_grid.h:168
geometry_traits< TElem >::iterator begin(int level)
Definition: multi_grid.h:158
Container which holds an array of pointers.
Definition: pointer_const_array.h:84
void SetAttachmentValues(TAttachmentAccessor &aaVal, TIter elemsBegin, TIter elemsEnd, const TVal &val)
sets attachment-values for elements between elemsBegin and elemsEnd.
Definition: attachment_util_impl.hpp:44
int CalculateNormal(vector3 &vNormOut, Grid &grid, Edge *e, Grid::AttachmentAccessor< Vertex, APosition > &aaPos, Grid::AttachmentAccessor< Face, ANormal > *paaNormFACE)
Calculates the normal of the given edge.
Definition: edge_util.cpp:314
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
void VecSet(vector_t &vInOut, typename vector_t::value_type s)
Set each vector component to scalar (componentwise)
Definition: math_vector_functions_common_impl.hpp:539
void VecNormalize(vector_t &vOut, const vector_t &v)
scales a vector_t to unit length
Definition: math_vector_functions_common_impl.hpp:501
vector_t::value_type VecLengthSq(const vector_t &v)
returns the squared length of v. Faster than VecLength.
Definition: math_vector_functions_common_impl.hpp:324
vector_t::value_type VecDot(const vector_t &v1, const vector_t &v2)
returns the dot-product of two vector_ts
Definition: math_vector_functions_common_impl.hpp:385
#define lg_for_each_in_lvl_template(_feType, _feVar, _feCon, _feLvl)
Definition: lg_for_each.h:59
#define lg_end_for
Definition: lg_for_each.h:88
Definition: smart_pointer.h:814
const number SMALL
Definition: math_constants.h:41
#define for_each_in_vec(_vfeDecl, _vfeVec)
Allows iteration over all members of an std::vector compatible type.
Definition: vec_for_each.h:52
#define end_for
Allows iteration over all members of an std::vector compatible type.
Definition: vec_for_each.h:56