33 #ifndef __H__LIB_GRID__SUBSET_UTIL__
34 #define __H__LIB_GRID__SUBSET_UTIL__
59 template <
class TElem>
76 template <
class TElem>
121 template <
class TIterator>
123 TIterator elemsEnd,
int subsetIndex);
129 template <
class TIterator>
131 TIterator elemsEnd,
bool toUnassignedOnly);
141 bool toUnassignedOnly);
151 bool toUnassignedOnly);
181 bool keepExistingInterfaceSubsets =
false);
200 int targetIndex,
bool strictSplitting =
false);
224 int applyToSubset = -2);
247 std::vector<vector3> vNormals,
250 int applyToSubset = -2);
271 const ISubsetHandler& shFaces,
272 Volume* proxyVol,
int newSubsetIndex);
289 const ISubsetHandler& shFaces,
290 const MarkerPointManager& mpm,
291 int firstSubsetIndex);
301 template <
class TElem>
303 bool appendAtEnd =
false);
313 template <
class TElem>
315 Selector& sel,
bool appendAtEnd =
false);
332 template <
class TElem>
335 boost::function<
bool (
typename TElem::lower_dim_base_object*)>
343 int inSubset,
int bndSubset);
373 template <
class TElem>
378 template <
class TElem,
class TSubsetHandler>
396 template <
class TSubsetHandler>
398 bool preserveExistingSubsets);
422 template <
class TAAPosVRT>
424 number FaceArea(ISubsetHandler& sh,
int si,
size_t lvl, TAAPosVRT& aaPos);
442 template <
class TElem,
class TSubsetHandler>
444 const ISubsetHandler& srcIndHandler);
461 template <
class TElem,
class TSubsetHandler>
463 const ISubsetHandler& srcIndHandler);
480 template <
class TElem,
class TSubsetHandler>
482 const ISubsetHandler& srcIndHandler);
497 template <
class TElem,
class TSubsetHandlerDest,
class TSubsetHandlerSrc>
499 const TSubsetHandlerSrc& srcIndHandler);
517 template <
class TElem,
class TSubsetHandlerDest,
class TSubsetHandlerSrc>
519 const TSubsetHandlerSrc& srcIndHandler);
544 template <
typename TBaseObj>
546 std::vector<int> & minCondInd,
547 const std::vector<bool> & isMarked,
548 const ISubsetHandler & sh,
572 bool includeUnassigned);
static number FaceArea(TDomain &dom, ISubsetHandler &sh, int si, size_t lvl)
Definition: domain_bridge.cpp:262
NeighborhoodType
Constants to specify a neighborhood.
Definition: neighborhood.h:53
@ NHT_VERTEX_NEIGHBORS
Definition: neighborhood.h:55
void AdjustSubsetsForSimulation(TSubsetHandler &sh, bool preserveExistingSubsets)
Adjust the grid so that it is ready for simulation with ug4.
Definition: subset_util_impl.hpp:252
void SeparateSubsetsByLowerDimSubsets(Grid &grid, SubsetHandler &sh, bool appendAtEnd=false)
Assigns all elements of the given type to subsets.
Definition: subset_util_impl.hpp:97
void CopySubsetIndicesToSides(ISubsetHandler &sh, GridObjectCollection goc, bool toUnassignedOnly)
copies subset-indices to sides of the specified elements
Definition: subset_util.cpp:306
void AssignVolumeInterfaceFacesToSubsets(Grid &grid, SubsetHandler &sh)
assigns faces which belong to no subset and are adjacent to volumes of different subsets to new subse...
Definition: subset_util.cpp:178
void AssignSelectionToSubset(ISelector &sel, ISubsetHandler &sh, int subsetInd)
Assigns all selected elements to the specified subset.
Definition: subset_util.cpp:97
bool SplitIrregularManifoldSubset(SubsetHandler &sh, int srcIndex, int targetIndex, bool strictSplitting)
Keeps a regular part in the subset and assigns all other faces to another one.
Definition: subset_util.cpp:583
void AdjustSubsetsForLgmNg(Grid &grid, SubsetHandler &sh, bool keepExistingInterfaceSubsets)
reorders subsets in a way that allows for easy export to lgm-ng.
Definition: subset_util.cpp:354
void AssignRegionToSubset(Grid &grid, ISubsetHandler &shVolsOut, const ISubsetHandler &shFaces, Volume *proxyVol, int newSubsetIndex)
assigns a region of volumes to a subset.
Definition: subset_util.cpp:914
vector3 GetColorFromStandardPalette(int index)
Returns an rgb vector (values ranging from 0 to 1), with the i-th default color.
Definition: subset_util.cpp:1084
void AssignSidesToSubsets(ISubsetHandler &sh, ISelector *psel)
Assigns all sides of elements of the given type to a separate subset.
Definition: subset_util.cpp:1098
bool SeparateRegions(Grid &grid, ISubsetHandler &shVolsOut, const ISubsetHandler &shFaces, const MarkerPointManager &mpm, int firstSubsetIndex)
finds regions by marker-points
Definition: subset_util.cpp:967
void AssignFaceInterfaceEdgesToSubsets(Grid &grid, SubsetHandler &sh)
assigns edges which belong to no subset and are adjacent to faces of different subsets to new subsets...
Definition: subset_util.cpp:118
void AssignAssociatedVerticesToSubsets(TSubsetHandler &sh, const ISubsetHandler &srcIndHandler)
Assigns associated vertices of elements of type TElem in sh to sh.
Definition: subset_util_impl.hpp:365
void AssignInnerAndBoundarySubsets(Grid &grid, ISubsetHandler &shOut, int inSubset, int bndSubset)
assigns objects to subsets depending on whether they are inner or boundary objects.
Definition: subset_util.cpp:1003
void AssignSubsetsByElementType(ISubsetHandler &sh)
Assigns subset depending on the element type.
Definition: subset_util.cpp:1216
void SeparateSubsetsByLowerDimSeparators(Grid &grid, SubsetHandler &sh, bool appendAtEnd, boost::function< bool(typename TElem::lower_dim_base_object *)> cbIsSeparator)
Assigns all elements of the given type to subsets.
Definition: subset_util_impl.hpp:113
void AssignUnassignedElemsToSubset(TSubsetHandler &sh, int si)
Assigns all elements of type TElem with subset index -1 to subset at index si.
Definition: subset_util_impl.hpp:226
void MakeSubsetsConsecutive(SubsetHandler &sh)
moves subsets so that no empty subset of type TElem is between filled ones.
Definition: subset_util_impl.hpp:66
void SeparateSubsetsByLowerDimSelection(Grid &grid, SubsetHandler &sh, Selector &sel, bool appendAtEnd=false)
Assigns all elements of the given type to subsets.
Definition: subset_util_impl.hpp:105
void SeparateFaceSubsetsByNormal(Grid &grid, SubsetHandler &sh, APosition aPos, ANormal *paNorm, int applyToSubset)
separates faces by orthogonal axis-aligned normals.
Definition: subset_util.cpp:721
void AssignAssociatedFacesToSubsets(TSubsetHandler &sh, const ISubsetHandler &srcIndHandler)
Assigns associated faces of elements of type TElem in sh to sh.
Definition: subset_util_impl.hpp:413
void AssignSubsetColors(ISubsetHandler &sh)
assigns a different color to each subset
Definition: subset_util.cpp:1090
void ComputeLocalSubsetDimensions(ISubsetHandler &sh, AChar aDimension, bool includeUnassigned)
Computes the local subset dimension for each element and stores it in the given attachment.
Definition: subset_util.cpp:1338
void AssignAssociatedEdgesToSubsets(TSubsetHandler &sh, const ISubsetHandler &srcIndHandler)
Assigns associated edges of elements of type TElem in sh to sh.
Definition: subset_util_impl.hpp:387
void AssignAssociatedSidesToSubsets(TSubsetHandlerDest &sh, const TSubsetHandlerSrc &srcIndHandler)
Assigns associated sides of elements of type TElem in sh to sh.
Definition: subset_util_impl.hpp:438
void AssignAssociatedLowerDimElemsToSubsets(TSubsetHandlerDest &sh, const TSubsetHandlerSrc &srcIndHandler)
Assigns associated elements of elements of type TElem in sh to sh.
Definition: subset_util_impl.hpp:505
void AssignAssociatedVerticesToSubset(ISubsetHandler &sh, TIterator elemsBegin, TIterator elemsEnd, int subsetIndex)
assigns vertices of the given elements to the subset at subsetIndex
Definition: subset_util_impl.hpp:349
int GetMaxSubsetIndex(SubsetHandler &sh)
returns the index of the last subset, that contains elements of type TElem.
Definition: subset_util_impl.hpp:47
void AssignGridToSubset(Grid &g, ISubsetHandler &sh, int subsetInd)
Assigns all elements of the given grid to the given subset.
Definition: subset_util.cpp:85
void FindSubsetGroups(std::vector< int > &minCondInd, const std::vector< bool > &isMarked, const ISubsetHandler &sh, const NeighborhoodType nbhType=NHT_VERTEX_NEIGHBORS)
Definition: subset_util_impl.hpp:515
int GetFirstFreeSubset(const ISubsetHandler &sh)
returns the first subset, which does not contain any elements at all
Definition: subset_util.cpp:49
#define UG_API
Definition: ug_config.h:65
double number
Definition: types.h:124
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
GridSubsetHandler SubsetHandler
Definition: subset_handler_grid.h:376
APosition3 APosition
Definition: common_attachments.h:76
ANormal3 ANormal
Definition: common_attachments.h:77
APosition aPosition("position", true)
The standard 3d position type.
Definition: common_attachments.h:84
Attachment< char > AChar
Definition: common_attachments.h:53