33 #ifndef __H__LIB_GRID__GRID_UTIL__
34 #define __H__LIB_GRID__GRID_UTIL__
57 const EdgeVertices* ev2);
72 const FaceVertices* fv2);
87 const VolumeVertices* vv2);
129 template <
class TVrtContainer1,
class TVrtContainer2>
132 const TVrtContainer2& con2);
145 GridObject* obj,
bool clearContainer =
true);
147 inline void CollectVertices(std::vector<Vertex*>& vVertexOut, Grid& grid,
148 GridObject* obj,
bool clearContainer =
true);
157 Vertex* v,
bool clearContainer =
true);
161 Grid& grid, Vertex* v,
bool clearContainer =
true);
171 Edge* e,
bool clearContainer =
true);
175 Grid& grid, Edge* e,
bool clearContainer =
true);
185 Face* f,
bool clearContainer =
true);
189 Grid& grid, Face* f,
bool clearContainer =
true);
199 Volume* v,
bool clearContainer =
true);
202 Grid& grid, Volume* v,
bool clearContainer =
true);
216 inline Vertex*
GetVertex(Vertex* v,
size_t i);
224 inline Vertex*
GetVertex(Edge* e,
size_t i);
232 inline Vertex*
GetVertex(Face* f,
size_t i);
240 inline Vertex*
GetVertex(Volume* v,
size_t i);
265 GridObject* obj,
bool clearContainer =
true);
269 Vertex* v,
bool clearContainer =
true);
277 Edge* e,
bool clearContainer =
true);
285 Face* f,
bool clearContainer =
true);
293 Volume* v,
bool clearContainer =
true);
300 GridObject* obj,
bool clearContainer =
true);
306 void CollectEdges(std::vector<Edge*>& vEdgesOut, Grid& grid,
307 Vertex* vrt,
bool clearContainer =
true);
310 Grid& grid, Vertex* vrt,
bool clearContainer =
true);
319 void CollectEdges(std::vector<Edge*>& vEdgesOut, Grid& grid,
320 Edge* e,
bool clearContainer =
true);
323 Grid& grid, Edge* e,
bool clearContainer =
true);
336 void CollectEdges(std::vector<Edge*>& vEdgesOut, Grid& grid,
337 Face* f,
bool clearContainer =
true);
340 Grid& grid, Face* f,
bool clearContainer =
true);
353 void CollectEdges(std::vector<Edge*>& vEdgesOut, Grid& grid,
354 Volume* v,
bool clearContainer =
true);
357 Grid& grid, Volume* v,
bool clearContainer =
true);
370 inline bool EdgeContains(EdgeVertices* e, Vertex* vrt1, Vertex* vrt2);
377 GridObject* obj,
bool clearContainer =
true);
382 Vertex* v,
bool clearContainer =
true);
387 Edge* e,
bool clearContainer =
true);
392 Face* f,
bool clearContainer =
true);
400 Volume* v,
bool clearContainer =
true);
407 GridObject* obj,
bool clearContainer =
true);
410 void CollectFaces(std::vector<Face*>& vFacesOut, Grid& grid,
411 Vertex* vrt,
bool clearContainer =
true);
414 Grid& grid, Vertex* vrt,
bool clearContainer =
true);
425 void CollectFaces(std::vector<Face*>& vFacesOut, Grid& grid,
426 Edge* e,
bool clearContainer =
true);
429 Grid& grid, Edge* e,
bool clearContainer =
true);
434 void CollectFaces(std::vector<Face*>& vFacesOut, Grid& grid,
435 Face* v,
bool clearContainer =
true);
439 Grid& grid, Face* vol,
bool clearContainer =
true);
451 void CollectFaces(std::vector<Face*>& vFacesOut, Grid& grid,
452 Volume* v,
bool clearContainer =
true);
455 Grid& grid, Volume* v,
bool clearContainer =
true);
483 GridObject* obj,
bool clearContainer =
true);
487 void CollectVolumes(std::vector<Volume*>& vVolumesOut, Grid& grid, Vertex* vrt,
bool clearContainer =
true);
490 Grid& grid, Vertex* vrt,
bool clearContainer =
true);
501 void CollectVolumes(std::vector<Volume*>& vVolumesOut, Grid& grid, Edge* e,
bool clearContainer =
true);
504 Grid& grid, Edge* e,
bool clearContainer =
true);
515 void CollectVolumes(std::vector<Volume*>& vVolumesOut, Grid& grid, Face* f,
bool clearContainer =
true,
bool ignoreAssociatedVolumes =
false);
517 Grid& grid, Face* f,
bool clearContainer =
true,
518 bool ignoreAssociatedVolumes =
false);
521 void CollectVolumes(std::vector<Volume*>& vVolumesOut, Grid& grid, FaceDescriptor& fd,
bool clearContainer =
true);
523 Grid& grid, FaceDescriptor& fd,
bool clearContainer =
true);
528 void CollectVolumes(std::vector<Volume*>& vVolumesOut, Grid& grid, Volume* v,
bool clearContainer =
true);
532 Grid& grid, Volume* vol,
bool clearContainer =
true);
bool EdgeContains(EdgeVertices *e, Vertex *vrt)
Definition: grid_util_impl.hpp:45
bool CompareVertices(const FaceVertices *fv1, const FaceVertices *fv2)
Checks whether fv1 and fv2 contain the same vertices.
Definition: grid_util.cpp:44
bool FaceContains(Face *f, EdgeVertices *ev)
returns true if the given face contains the two given vertices
Definition: grid_util.cpp:561
void CollectVolumes(std::vector< Volume * > &vVolumesOut, Grid &grid, Vertex *vrt, bool clearContainer)
Collects all volumes that exist in the given grid which contain the given vertex.
Definition: grid_util.cpp:592
void CollectEdgesSorted(vector< Edge * > &vEdgesOut, Grid &grid, Vertex *v, bool clearContainer)
Collects all edges of a vertex, thus, none.
Definition: grid_util.cpp:205
void CollectEdges(std::vector< Edge * > &vEdgesOut, Grid &grid, Vertex *vrt, bool clearContainer)
Collects all edges which exist in the given grid and which are part of the given vertex.
Definition: grid_util.cpp:295
void CollectFacesSorted(vector< Face * > &vFacesOut, Grid &grid, Vertex *v, bool clearContainer)
Collects all Faces of a Vertex, thus, none.
Definition: grid_util.cpp:401
void CollectFaces(std::vector< Face * > &vFacesOut, Grid &grid, Vertex *vrt, bool clearContainer)
Collects all faces that exist in the given grid which contain the given vertex.
Definition: grid_util.cpp:458
void CollectVertices(std::vector< Vertex * > &vVertexOut, Grid &grid, Vertex *v, bool clearContainer)
Collects all vertices.
Definition: grid_util.cpp:141
UG_API void CollectAssociated(std::vector< Vertex * > &vVertexOut, Grid &grid, GridObject *obj, bool clearContainer=true)
Definition: grid_util_impl.hpp:169
UG_API bool CompareVertexContainer(const TVrtContainer1 &con1, const TVrtContainer2 &con2)
compares vertices in a container
Definition: grid_util_impl.hpp:62
Vertex * GetVertex(Vertex *v, size_t i)
returns the i'th vertex of a vertex
Definition: grid_util_impl.hpp:99
bool VolumeContains(VolumeVertices *v, Vertex *vrt)
returns true if the given volume contains the given vertex
Definition: grid_util.cpp:748
size_t NumVertices(Vertex *elem)
Returns the number of vertices of the given geometric object.
Definition: grid_util_impl.hpp:123
#define UG_API
Definition: ug_config.h:65
bool VertexGroupsMatch(const IVertexGroup *elem, const IVertexGroup &desc)
Checks whether two vertex groups contain the same vertices.
Definition: grid_util.cpp:101