33 #ifndef __H__UG_smooth_partition_bounds
34 #define __H__UG_smooth_partition_bounds
36 #include "../partitioner.h"
42 template <
class elem_t>
95 bool assignToSmallerSubsetsOnly =
true;
97 for(
int main_iteration = 0; main_iteration < 2; ++main_iteration){
99 mg.
end<
side_t>(partitionLvl), pair<int, int>(-1, -1));
107 if(aaSubsetNbrs[
s].first == -1)
108 aaSubsetNbrs[
s].first = si;
110 aaSubsetNbrs[
s].second = si;
124 int numOwnSubsetNbrs = 0;
128 if(nbrs.first == si && nbrs.second == si)
130 else if(nbrs.first != -1 && nbrs.first != si)
131 nbrSubs.push_back(nbrs.first);
132 else if(nbrs.second != -1 && nbrs.second != si)
133 nbrSubs.push_back(nbrs.second);
138 int newSubsetNbrs = numOwnSubsetNbrs;
141 for(
size_t i_nbrSub = 0; i_nbrSub < nbrSubs.size(); ++i_nbrSub){
142 int nbrSub = nbrSubs[i_nbrSub];
145 for(
size_t i = i_nbrSub + 1; i < nbrSubs.size(); ++i){
146 if(nbrSubs[i] == nbrSub){
152 if(count > newSubsetNbrs){
153 newSubsetNbrs = count;
162 && ((assignToSmallerSubsetsOnly && newSub < si)
163 || (!assignToSmallerSubsetsOnly && newSub != si)))
171 assignToSmallerSubsetsOnly =
false;
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_attachment(IAttachment &attachment)
Definition: grid.h:796
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
early draft. Currently only useful for prism-geometries in the d3f-wipp setting
Definition: smooth_partition_bounds.h:44
SmoothPartitionBounds()
Definition: smooth_partition_bounds.h:46
std::pair< int, int > subset_pair_t
Definition: smooth_partition_bounds.h:182
a_subset_pair_t m_aSubsetNbrs
Definition: smooth_partition_bounds.h:187
MultiGrid * m_mg
Definition: smooth_partition_bounds.h:185
void partitioning_done()
Definition: smooth_partition_bounds.h:175
SubsetHandler * m_partitions
Definition: smooth_partition_bounds.h:186
void post_process(int partitionLvl)
Definition: smooth_partition_bounds.h:81
Attachment< subset_pair_t > a_subset_pair_t
Definition: smooth_partition_bounds.h:183
elem_t::side side_t
Definition: smooth_partition_bounds.h:181
void init_post_processing(MultiGrid *mg, SubsetHandler *partitions)
Definition: smooth_partition_bounds.h:58
virtual ~SmoothPartitionBounds()
Definition: smooth_partition_bounds.h:52
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
#define lg_for_each_in_lvl_template(_feType, _feVar, _feCon, _feLvl)
Definition: lg_for_each.h:59
Definition: smart_pointer.h:814
@ ROID_QUADRILATERAL
Definition: grid_base_objects.h:79
The traits class holds some important types for each element-type.
Definition: grid.h:136
#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