33 #ifndef __H__UG__LIB_GRID__TOOLS__CREATOR_GRID_UTIL__
34 #define __H__UG__LIB_GRID__TOOLS__CREATOR_GRID_UTIL__
45 template<
typename TPosition>
70 UG_LOG(
"Can't create edge: RegularEdge already exists.\n");
75 UG_LOG(
"Can't create edge: Bad number of vertices. 2 are required.\n");
88 UG_ASSERT(hash0!=hash1,
"Can't create edge: they are identical vertices.");
107 UG_ASSERT(numVrts>2 || numVrts<5,
"Bad number of vertices! Can't create a face element from " << numVrts <<
" vertices.");
112 for(
size_t i = 0; i < numVrts; ++i)
116 UG_LOG(
"A face connecting the given vertices already exists. Won't create a new one!");
132 UG_LOG(
"Can't create face: Bad number of vertices. 3 or 4 are supported.\n");
149 UG_ASSERT(numVrts>3 || numVrts<9,
"Bad number of vertices! Can't create a volume element from " << numVrts <<
" vertices.");
152 for(
size_t i = 0; i < numVrts; ++i)
156 UG_LOG(
"A volume connecting the given vertices already exists. Won't create a new one!");
169 vrts[2], vrts[3], vrts[4]));
174 vrts[3], vrts[4], vrts[5]));
179 vrts[4], vrts[5], vrts[6], vrts[7]));
183 UG_LOG(
"Can't create volume: Bad number of vertices. 4, 5, 6, and 8 are supported.\n");
206 template<
typename TPosition>
208 const TPosition& upLeft,
209 const TPosition& upRight,
210 const TPosition& lowLeft,
211 const TPosition& lowRight,
216 for(
size_t i = 0; i < 4; ++i)
219 aaPos[vrts[0]] = upLeft;
220 aaPos[vrts[1]] = lowLeft;
221 aaPos[vrts[2]] = lowRight;
222 aaPos[vrts[3]] = upRight;
227 for(
size_t i = 0; i < 4; ++i){
229 int i1 = (i + 1) % 4;
A generic specialization of IAttachment.
Definition: attachment_pipe.h:263
Can be used to store information about an edge and to construct an edge.
Definition: grid_base_objects.h:464
Base-class for edges.
Definition: grid_base_objects.h:397
Can be queried for the edges and vertices of a face.
Definition: grid_base_objects.h:684
void set_vertex(uint index, Vertex *vrt)
Definition: grid_base_objects.h:706
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
Edge * get_edge(Vertex *v1, Vertex *v2)
returns the edge between v1 and v2, if it exists. Returns NULL if not.
Definition: grid.cpp:1069
Face * get_face(const FaceVertices &fv)
returns the face that is described by fv.
Definition: grid.cpp:1135
Volume * get_volume(const VolumeVertices &vv)
returns the volume that is described by ev.
Definition: grid.cpp:1163
geometry_traits< TGeomObj >::iterator create(GridObject *pParent=NULL)
create a custom element.
Definition: grid_impl.hpp:69
only used to initialize a hexahedron. for all other tasks you should use VolumeDescriptor.
Definition: grid_objects_3d.h:203
A volume element with 6 quadrilateral sides.
Definition: grid_objects_3d.h:227
only used to initialize a prism. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:336
A volume element with 2 triangle and 3 quadrilateral sides.
Definition: grid_objects_3d.h:360
only used to initialize a pyramids. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:469
A volume element with 4 triangle and 1 quadrilateral sides.
Definition: grid_objects_3d.h:493
only used to initialize a quadrilateral. for all other tasks you should use FaceDescriptor.
Definition: grid_objects_2d.h:220
a face with four points.
Definition: grid_objects_2d.h:323
Edges connect two vertices.
Definition: grid_objects_1d.h:66
A basic vertex-type.
Definition: grid_objects_0d.h:62
only used to initialize a tetrahedron. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:68
the most simple volume-element.
Definition: grid_objects_3d.h:91
only used to initialize a triangle. for all other tasks you should use FaceDescriptor.
Definition: grid_objects_2d.h:78
the most simple form of a face
Definition: grid_objects_2d.h:174
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
uint32 get_hash_value() const
returns a value that can be used for hashing.
Definition: grid_base_objects.h:272
Holds a set of vertices which represent the corners of a volume element.
Definition: grid_base_objects.h:951
void set_vertex(uint index, Vertex *vrt)
Definition: grid_base_objects.h:967
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
ugtypes::uint32_t uint32
Definition: types.h:116
#define UG_LOG(msg)
Definition: log.h:367
Edge * CreateEdge(Grid &grid, Vertex *vrts[], const size_t, numVrts)
Definition: creator_grid_util.h:59
void CreatePlane(Grid &grid, const TPosition &upLeft, const TPosition &upRight, const TPosition &lowLeft, const TPosition &lowRight, Grid::VertexAttachmentAccessor< Attachment< TPosition > > &aaPos bool fill)
Definition: creator_grid_util.h:207
Volume * CreateVolume(Grid &grid, Vertex *vrts, const size_t numVrts)
Definition: creator_grid_util.h:147
Face * CreateFace(Grid &grid, Vertex *vrts[], const size_t numVrts)
Definition: creator_grid_util.h:105
Vertex * CreateVertex(Grid &grid, const TPosition &pos, Grid::VertexAttachmentAccessor< Attachment< TPosition > > &aaPos)
Definition: creator_grid_util.h:46