33 #ifndef __H__UG__grid_objects_3d__
34 #define __H__UG__grid_objects_3d__
36 #include "../grid/grid.h"
76 inline Vertex*
vertex(
size_t index)
const {
return m_vertex[index];}
112 virtual uint num_edges()
const;
116 virtual uint num_faces()
const;
118 virtual Edge* create_edge(
int index);
119 virtual Face* create_face(
int index);
121 virtual void get_vertex_indices_of_edge(
size_t& ind1Out,
123 size_t edgeInd)
const;
125 virtual void get_vertex_indices_of_face(std::vector<size_t>& indsOut,
128 virtual int get_edge_index_from_vertices(
const size_t vi0,
129 const size_t vi1)
const;
131 virtual int get_face_edge_index (
const size_t faceInd,
132 const size_t faceEdgeInd)
const;
134 virtual std::pair<GridBaseObjectId, int> get_opposing_object(
Vertex* vrt)
const;
139 virtual bool refine(std::vector<Volume*>& vNewVolumesOut,
144 const Vertex& prototypeVertex,
145 Vertex** pSubstituteVertices = NULL,
147 bool* isSnapPoint = NULL);
149 virtual bool is_regular_ref_rule(
int edgeMarks)
const;
151 virtual bool collapse_edge(std::vector<Volume*>& vNewVolumesOut,
152 int edgeIndex,
Vertex* newVertex,
153 std::vector<Vertex*>* pvSubstituteVertices = NULL);
249 virtual uint num_edges()
const;
253 virtual uint num_faces()
const;
255 virtual Edge* create_edge(
int index);
256 virtual Face* create_face(
int index);
258 virtual void get_vertex_indices_of_edge(
size_t& ind1Out,
260 size_t edgeInd)
const;
262 virtual void get_vertex_indices_of_face(std::vector<size_t>& indsOut,
265 virtual int get_edge_index_from_vertices(
const size_t vi0,
266 const size_t vi1)
const;
268 virtual int get_face_edge_index (
const size_t faceInd,
269 const size_t faceEdgeInd)
const;
273 virtual std::pair<GridBaseObjectId, int> get_opposing_object(
Vertex* vrt)
const;
276 virtual bool refine(std::vector<Volume*>& vNewVolumesOut,
281 const Vertex& prototypeVertex,
282 Vertex** pSubstituteVertices = NULL,
284 bool* isSnapPoint = NULL);
286 virtual bool is_regular_ref_rule(
int edgeMarks)
const;
288 virtual bool collapse_edge(std::vector<Volume*>& vNewVolumesOut,
289 int edgeIndex,
Vertex* newVertex,
290 std::vector<Vertex*>* pvSubstituteVertices = NULL);
382 virtual uint num_edges()
const;
386 virtual uint num_faces()
const;
388 virtual Edge* create_edge(
int index);
389 virtual Face* create_face(
int index);
391 virtual void get_vertex_indices_of_edge(
size_t& ind1Out,
393 size_t edgeInd)
const;
395 virtual void get_vertex_indices_of_face(std::vector<size_t>& indsOut,
398 virtual int get_edge_index_from_vertices(
const size_t vi0,
399 const size_t vi1)
const;
401 virtual int get_face_edge_index (
const size_t faceInd,
402 const size_t faceEdgeInd)
const;
406 virtual std::pair<GridBaseObjectId, int> get_opposing_object(
Vertex* vrt)
const;
409 virtual bool refine(std::vector<Volume*>& vNewVolumesOut,
414 const Vertex& prototypeVertex,
415 Vertex** pSubstituteVertices = NULL,
417 bool* isSnapPoint = NULL);
419 virtual bool is_regular_ref_rule(
int edgeMarks)
const;
421 virtual bool collapse_edge(std::vector<Volume*>& vNewVolumesOut,
422 int edgeIndex,
Vertex* newVertex,
423 std::vector<Vertex*>* pvSubstituteVertices = NULL);
515 virtual uint num_edges()
const;
519 virtual uint num_faces()
const;
521 virtual Edge* create_edge(
int index);
522 virtual Face* create_face(
int index);
524 virtual void get_vertex_indices_of_edge(
size_t& ind1Out,
526 size_t edgeInd)
const;
528 virtual void get_vertex_indices_of_face(std::vector<size_t>& indsOut,
531 virtual int get_edge_index_from_vertices(
const size_t vi0,
532 const size_t vi1)
const;
534 virtual int get_face_edge_index (
const size_t faceInd,
535 const size_t faceEdgeInd)
const;
537 virtual std::pair<GridBaseObjectId, int> get_opposing_object(
Vertex* vrt)
const;
540 virtual bool refine(std::vector<Volume*>& vNewVolumesOut,
545 const Vertex& prototypeVertex,
546 Vertex** pSubstituteVertices = NULL,
548 bool* isSnapPoint = NULL);
550 virtual bool is_regular_ref_rule(
int edgeMarks)
const;
552 virtual bool collapse_edge(std::vector<Volume*>& vNewVolumesOut,
553 int edgeIndex,
Vertex* newVertex,
554 std::vector<Vertex*>* pvSubstituteVertices = NULL);
647 virtual uint num_edges()
const;
651 virtual uint num_faces()
const;
653 virtual Edge* create_edge(
int index);
654 virtual Face* create_face(
int index);
656 virtual void get_vertex_indices_of_edge(
size_t& ind1Out,
658 size_t edgeInd)
const;
660 virtual void get_vertex_indices_of_face(std::vector<size_t>& indsOut,
663 virtual int get_edge_index_from_vertices(
const size_t vi0,
664 const size_t vi1)
const;
666 virtual int get_face_edge_index (
const size_t faceInd,
667 const size_t faceEdgeInd)
const;
669 virtual std::pair<GridBaseObjectId, int> get_opposing_object(
Vertex* vrt)
const;
674 virtual bool refine(std::vector<Volume*>& vNewVolumesOut,
679 const Vertex& prototypeVertex,
680 Vertex** pSubstituteVertices = NULL,
682 bool* isSnapPoint = NULL);
684 virtual bool is_regular_ref_rule(
int edgeMarks)
const;
686 virtual bool collapse_edge(std::vector<Volume*>& vNewVolumesOut,
687 int edgeIndex,
Vertex* newVertex,
688 std::vector<Vertex*>* pvSubstituteVertices = NULL);
Use this class as a tool to create const_iterators to your own geometric objects.
Definition: generic_grid_object_iterator.h:70
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
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Definition: grid_base_objects.h:483
Use this class as a tool to create iterators to your own geometric objects.
Definition: generic_grid_object_iterator.h:44
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
only used to initialize a hexahedron. for all other tasks you should use VolumeDescriptor.
Definition: grid_objects_3d.h:203
HexahedronDescriptor()
Definition: grid_objects_3d.h:205
Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:212
uint num_vertices() const
Definition: grid_objects_3d.h:211
A volume element with 6 quadrilateral sides.
Definition: grid_objects_3d.h:227
virtual Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:243
virtual ConstVertexArray vertices() const
Definition: grid_objects_3d.h:244
virtual int container_section() const
Definition: grid_objects_3d.h:294
virtual ReferenceObjectID reference_object_id() const
Definition: grid_objects_3d.h:295
virtual size_t num_vertices() const
Definition: grid_objects_3d.h:245
virtual void set_vertex(uint index, Vertex *pVrt)
Definition: grid_objects_3d.h:298
virtual GridObject * create_empty_instance() const
create an instance of the derived type
Definition: grid_objects_3d.h:241
Hexahedron()
Definition: grid_objects_3d.h:236
Volume BaseClass
Definition: grid_objects_3d.h:229
static bool type_match(GridObject *pObj)
Definition: grid_objects_3d.h:234
Vertex *const * ConstVertexArray
Definition: grid_base_objects.h:319
only used to initialize a octahedron. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:602
Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:610
OctahedronDescriptor()
Definition: grid_objects_3d.h:604
uint num_vertices() const
Definition: grid_objects_3d.h:609
platonic solid with eight faces.
Definition: grid_objects_3d.h:626
virtual void set_vertex(uint index, Vertex *pVrt)
Definition: grid_objects_3d.h:696
virtual GridObject * create_empty_instance() const
create an instance of the derived type
Definition: grid_objects_3d.h:639
Octahedron()
Definition: grid_objects_3d.h:635
static bool type_match(GridObject *pObj)
Definition: grid_objects_3d.h:633
virtual int container_section() const
Definition: grid_objects_3d.h:692
virtual size_t num_vertices() const
Definition: grid_objects_3d.h:643
virtual ReferenceObjectID reference_object_id() const
Definition: grid_objects_3d.h:693
virtual ConstVertexArray vertices() const
Definition: grid_objects_3d.h:642
virtual Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:641
Volume BaseClass
Definition: grid_objects_3d.h:628
only used to initialize a prism. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:336
Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:345
PrismDescriptor()
Definition: grid_objects_3d.h:338
uint num_vertices() const
Definition: grid_objects_3d.h:344
A volume element with 2 triangle and 3 quadrilateral sides.
Definition: grid_objects_3d.h:360
virtual ReferenceObjectID reference_object_id() const
Definition: grid_objects_3d.h:428
Volume BaseClass
Definition: grid_objects_3d.h:362
static bool type_match(GridObject *pObj)
Definition: grid_objects_3d.h:367
virtual Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:376
virtual GridObject * create_empty_instance() const
create an instance of the derived type
Definition: grid_objects_3d.h:374
virtual ConstVertexArray vertices() const
Definition: grid_objects_3d.h:377
virtual int container_section() const
Definition: grid_objects_3d.h:427
Prism()
Definition: grid_objects_3d.h:369
virtual void set_vertex(uint index, Vertex *pVrt)
Definition: grid_objects_3d.h:431
virtual size_t num_vertices() const
Definition: grid_objects_3d.h:378
only used to initialize a pyramids. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:469
PyramidDescriptor()
Definition: grid_objects_3d.h:471
Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:478
uint num_vertices() const
Definition: grid_objects_3d.h:477
A volume element with 4 triangle and 1 quadrilateral sides.
Definition: grid_objects_3d.h:493
virtual Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:509
virtual size_t num_vertices() const
Definition: grid_objects_3d.h:511
Volume BaseClass
Definition: grid_objects_3d.h:495
Pyramid()
Definition: grid_objects_3d.h:502
virtual ConstVertexArray vertices() const
Definition: grid_objects_3d.h:510
static bool type_match(GridObject *pObj)
Definition: grid_objects_3d.h:500
virtual GridObject * create_empty_instance() const
create an instance of the derived type
Definition: grid_objects_3d.h:507
virtual ReferenceObjectID reference_object_id() const
Definition: grid_objects_3d.h:559
virtual int container_section() const
Definition: grid_objects_3d.h:558
virtual void set_vertex(uint index, Vertex *pVrt)
Definition: grid_objects_3d.h:562
only used to initialize a tetrahedron. for all other tasks you should use VolumeDescripor.
Definition: grid_objects_3d.h:68
Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:76
TetrahedronDescriptor()
Definition: grid_objects_3d.h:70
uint num_vertices() const
Definition: grid_objects_3d.h:75
the most simple volume-element.
Definition: grid_objects_3d.h:91
Tetrahedron()
Definition: grid_objects_3d.h:100
virtual void set_vertex(uint index, Vertex *pVrt)
Definition: grid_objects_3d.h:164
Volume BaseClass
Definition: grid_objects_3d.h:93
virtual int container_section() const
Definition: grid_objects_3d.h:157
virtual ConstVertexArray vertices() const
Definition: grid_objects_3d.h:107
static bool type_match(GridObject *pObj)
Definition: grid_objects_3d.h:98
virtual GridObject * create_empty_instance() const
create an instance of the derived type
Definition: grid_objects_3d.h:104
virtual ReferenceObjectID reference_object_id() const
Definition: grid_objects_3d.h:160
virtual size_t num_vertices() const
Definition: grid_objects_3d.h:108
virtual Vertex * vertex(size_t index) const
Definition: grid_objects_3d.h:106
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Holds a set of vertices which represent the corners of a volume element.
Definition: grid_base_objects.h:951
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
holds the vertices of a Volume or a VolumeDescriptor
Definition: grid_base_objects.h:723
HexahedronDescriptor Descriptor
Definition: grid_objects_3d.h:312
Volume grid_base_object
Definition: grid_objects_3d.h:313
GenericGridObjectIterator< Hexahedron *, VolumeIterator > iterator
Definition: grid_objects_3d.h:308
ConstGenericGridObjectIterator< Hexahedron *, VolumeIterator, ConstVolumeIterator > const_iterator
Definition: grid_objects_3d.h:310
ConstGenericGridObjectIterator< Octahedron *, VolumeIterator, ConstVolumeIterator > const_iterator
Definition: grid_objects_3d.h:708
GenericGridObjectIterator< Octahedron *, VolumeIterator > iterator
Definition: grid_objects_3d.h:706
OctahedronDescriptor Descriptor
Definition: grid_objects_3d.h:710
Volume grid_base_object
Definition: grid_objects_3d.h:711
GenericGridObjectIterator< Prism *, VolumeIterator > iterator
Definition: grid_objects_3d.h:441
PrismDescriptor Descriptor
Definition: grid_objects_3d.h:445
ConstGenericGridObjectIterator< Prism *, VolumeIterator, ConstVolumeIterator > const_iterator
Definition: grid_objects_3d.h:443
Volume grid_base_object
Definition: grid_objects_3d.h:446
ConstGenericGridObjectIterator< Pyramid *, VolumeIterator, ConstVolumeIterator > const_iterator
Definition: grid_objects_3d.h:574
GenericGridObjectIterator< Pyramid *, VolumeIterator > iterator
Definition: grid_objects_3d.h:572
Volume grid_base_object
Definition: grid_objects_3d.h:577
PyramidDescriptor Descriptor
Definition: grid_objects_3d.h:576
Volume grid_base_object
Definition: grid_objects_3d.h:179
GenericGridObjectIterator< Tetrahedron *, VolumeIterator > iterator
Definition: grid_objects_3d.h:174
ConstGenericGridObjectIterator< Tetrahedron *, VolumeIterator, ConstVolumeIterator > const_iterator
Definition: grid_objects_3d.h:176
TetrahedronDescriptor Descriptor
Definition: grid_objects_3d.h:178
Definition: grid_base_object_traits.h:68
#define UG_API
Definition: ug_config.h:65
unsigned int uint
Definition: types.h:114
const int NUM_VERTICES
Definition: hexahedron_rules.h:45
geometry_traits< Octahedron >::iterator OctahedronIterator
Definition: grid_objects_3d.h:721
geometry_traits< Pyramid >::const_iterator ConstPyramidIterator
Definition: grid_objects_3d.h:588
geometry_traits< Prism >::iterator PrismIterator
Definition: grid_objects_3d.h:456
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
@ ROID_TETRAHEDRON
Definition: grid_base_objects.h:80
@ ROID_PYRAMID
Definition: grid_base_objects.h:83
@ ROID_PRISM
Definition: grid_base_objects.h:82
@ ROID_OCTAHEDRON
Definition: grid_base_objects.h:84
@ ROID_HEXAHEDRON
Definition: grid_base_objects.h:81
VolumeContainerSections
These numbers define where in the volume-section-container a volume will be stored.
Definition: grid_objects_3d.h:50
@ CSVOL_PRISM
Definition: grid_objects_3d.h:54
@ CSVOL_OCTAHEDRON
Definition: grid_objects_3d.h:56
@ CSVOL_TETRAHEDRON
Definition: grid_objects_3d.h:52
@ CSVOL_HEXAHEDRON
Definition: grid_objects_3d.h:53
@ CSVOL_NONE
Definition: grid_objects_3d.h:51
@ CSVOL_PYRAMID
Definition: grid_objects_3d.h:55
geometry_traits< Prism >::const_iterator ConstPrismIterator
Definition: grid_objects_3d.h:457
geometry_traits< Octahedron >::const_iterator ConstOctahedronIterator
Definition: grid_objects_3d.h:722
@ VOLUME
Definition: grid_base_objects.h:63
geometry_traits< Hexahedron >::iterator HexahedronIterator
Definition: grid_objects_3d.h:323
ElementStorage< Volume >::SectionContainer::const_iterator ConstVolumeIterator
Definition: grid_base_object_traits.h:83
geometry_traits< Tetrahedron >::iterator TetrahedronIterator
Definition: grid_objects_3d.h:189
geometry_traits< Tetrahedron >::const_iterator ConstTetrahedronIterator
Definition: grid_objects_3d.h:190
geometry_traits< Hexahedron >::const_iterator ConstHexahedronIterator
Definition: grid_objects_3d.h:324
geometry_traits< Pyramid >::iterator PyramidIterator
Definition: grid_objects_3d.h:587
ElementStorage< Volume >::SectionContainer::iterator VolumeIterator
Definition: grid_base_object_traits.h:82