ug4
ug::Prism Class Reference

A volume element with 2 triangle and 3 quadrilateral sides. More...

#include <grid_objects_3d.h>

+ Inheritance diagram for ug::Prism:

Public Types

typedef Volume BaseClass
 
- Public Types inherited from ug::Volume
typedef Volume grid_base_object
 
typedef void higher_dim_base_object
 
typedef Face lower_dim_base_object
 
typedef Face side
 
typedef Volume sideof
 
- Public Types inherited from ug::IVertexGroup
typedef Vertex *const * ConstVertexArray
 

Public Member Functions

virtual bool collapse_edge (std::vector< Volume * > &vNewVolumesOut, int edgeIndex, Vertex *newVertex, std::vector< Vertex * > *pvSubstituteVertices=NULL)
 
virtual int container_section () const
 
virtual Edgecreate_edge (int index)
 create the edge with index i and return it. More...
 
virtual GridObjectcreate_empty_instance () const
 create an instance of the derived type More...
 
virtual Facecreate_face (int index)
 create the face with index i and return it. More...
 
virtual EdgeDescriptor edge_desc (int index) const
 
virtual void edge_desc (int index, EdgeDescriptor &edOut) const
 
virtual FaceDescriptor face_desc (int index) const
 
virtual void face_desc (int index, FaceDescriptor &fdOut) const
 
virtual int get_edge_index_from_vertices (const size_t vi0, const size_t vi1) const
 returns the local index of the edge which connects the two vertex indices. More...
 
virtual int get_face_edge_index (const size_t faceInd, const size_t faceEdgeInd) const
 returns the local index of the j-th edge of the i-th face of the volume More...
 
virtual void get_flipped_orientation (VolumeDescriptor &vdOut) const
 
virtual std::pair< GridBaseObjectId, int > get_opposing_object (Vertex *vrt) const
 returns an index to the obbject, which lies on the opposite side of the volume to the given vertex. More...
 
virtual bool get_opposing_side (FaceVertices *f, FaceDescriptor &fdOut) const
 retrieves the face-descriptor for the opposing side to the specified one. More...
 
virtual void get_vertex_indices_of_edge (size_t &ind1Out, size_t &ind2Out, size_t edgeInd) const
 returns the local indices of an edge of the volume. More...
 
virtual void get_vertex_indices_of_face (std::vector< size_t > &indsOut, size_t side) const
 returns the local indices of a face of the volume. More...
 
virtual bool is_regular_ref_rule (int edgeMarks) const
 returns true if the specified edgeMarks would lead to a regular refinement More...
 
virtual uint num_edges () const
 
virtual uint num_faces () const
 
virtual size_t num_vertices () const
 
 Prism ()
 
 Prism (const PrismDescriptor &td)
 
 Prism (Vertex *v1, Vertex *v2, Vertex *v3, Vertex *v4, Vertex *v5, Vertex *v6)
 
virtual ReferenceObjectID reference_object_id () const
 
virtual bool refine (std::vector< Volume * > &vNewVolumesOut, Vertex **ppNewVertexOut, Vertex **newEdgeVertices, Vertex **newFaceVertices, Vertex *newVolumeVertex, const Vertex &prototypeVertex, Vertex **pSubstituteVertices=NULL, vector3 *corners=NULL, bool *isSnapPoint=NULL)
 see Volume::refine for a detailed description. More...
 
virtual Vertexvertex (size_t index) const
 
virtual ConstVertexArray vertices () const
 
- Public Member Functions inherited from ug::Volume
virtual int base_object_id () const
 
int get_local_side_index (FaceVertices *f) const
 returns the local index of the given face or -1, if the face is not part of the volume. More...
 
uint num_sides () const
 
virtual ~Volume ()
 
- Public Member Functions inherited from ug::GridObject
uint grid_data_index () const
 Returns the grid attachment data index of a geometric object. More...
 
virtual bool is_constrained () const
 returns true if the object is constrained by other objects. More...
 
virtual bool is_constraining () const
 returns the id of the reference-object. More...
 
virtual ~GridObject ()
 
virtual void remove_constraint_link (const Vertex *vrt)
 removes a constraint link to the grid object. More...
 
virtual void remove_constraint_link (const Edge *e)
 removes a constraint link to the grid object. More...
 
virtual void remove_constraint_link (const Face *f)
 removes a constraint link to the grid object. More...
 
- Public Member Functions inherited from ug::VolumeVertices
Vertexoperator[] (size_t index) const
 returns the i-th vertex. More...
 
size_t size () const
 returns the number of vertices. More...
 
virtual ~VolumeVertices ()
 
- Public Member Functions inherited from ug::IVertexGroup
Vertexoperator[] (size_t index) const
 returns the i-th vertex. More...
 
size_t size () const
 returns the number of vertices. More...
 
virtual ~IVertexGroup ()
 

Static Public Member Functions

static bool type_match (GridObject *pObj)
 
- Static Public Member Functions inherited from ug::Volume
static bool type_match (GridObject *pObj)
 

Static Public Attributes

static const size_t NUM_VERTICES = 6
 
- Static Public Attributes inherited from ug::Volume
static const int BASE_OBJECT_ID = VOLUME
 
static const bool CAN_BE_SIDE = false
 
static const int dim = 3
 reference dimension More...
 
static const bool HAS_SIDES = true
 

Protected Member Functions

virtual void set_vertex (uint index, Vertex *pVrt)
 
- Protected Member Functions inherited from ug::GridObject
void set_grid_data_index (uint index)
 ATTENTION: Use this method with extreme care! More...
 

Protected Attributes

Vertexm_vertices [6]
 
- Protected Attributes inherited from ug::GridObject
uint m_gridDataIndex
 

Detailed Description

A volume element with 2 triangle and 3 quadrilateral sides.

order of vertices should be the same as described in

See also
PrismDescriptor

Member Typedef Documentation

◆ BaseClass

Constructor & Destructor Documentation

◆ Prism() [1/3]

ug::Prism::Prism ( )
inline

◆ Prism() [2/3]

ug::Prism::Prism ( const PrismDescriptor td)

◆ Prism() [3/3]

ug::Prism::Prism ( Vertex v1,
Vertex v2,
Vertex v3,
Vertex v4,
Vertex v5,
Vertex v6 
)

Member Function Documentation

◆ collapse_edge()

bool ug::Prism::collapse_edge ( std::vector< Volume * > &  vNewVolumesOut,
int  edgeIndex,
Vertex newVertex,
std::vector< Vertex * > *  pvSubstituteVertices = NULL 
)
virtual

The collapse_edge method creates new geometric objects by collapsing the specified edge. The user that calls this function is responsible to either register the new volumes with a grid (the grid from which the vertices are), or to take responsibility for deletion of the acquired memory (delete each element in vNewFacesOut).

  • edgeIndex specifies the edge which shall be collapsed. edgeIndex has to lie between 0 and this->num_edges().
  • Vertices adjacent to the collapsed edge will be replaced by newVertex.
  • If you specify pvSubstituteVertices, the created volumes will reference the vertices in pvSubstituteVertices. Note that pvSubstituteVertices has to contain exactly as many vertices as the volume in which you collapse the edge. Vertices with the same index correlate.

Reimplemented from ug::Volume.

References CollapseEdge(), ug::CreateVolumesFromElementIndexList(), ug::hex_rules::EDGE_VRT_INDS, and ug::prism_rules::MAX_NUM_COLLAPSE_INDS_OUT.

◆ container_section()

virtual int ug::Prism::container_section ( ) const
inlinevirtual

Reimplemented from ug::Volume.

References ug::CSVOL_PRISM.

◆ create_edge()

Edge * ug::Prism::create_edge ( int  index)
virtual

create the edge with index i and return it.

Reimplemented from ug::Volume.

References ug::hex_rules::EDGE_VRT_INDS, and ug::hex_rules::NUM_EDGES.

◆ create_empty_instance()

virtual GridObject* ug::Prism::create_empty_instance ( ) const
inlinevirtual

create an instance of the derived type

Make sure to overload this method in derivates of this class!

Reimplemented from ug::GridObject.

◆ create_face()

Face * ug::Prism::create_face ( int  index)
virtual

create the face with index i and return it.

Reimplemented from ug::Volume.

References ug::hex_rules::FACE_VRT_INDS, and ug::hex_rules::NUM_FACES.

◆ edge_desc() [1/2]

EdgeDescriptor ug::Prism::edge_desc ( int  index) const
virtual

Reimplemented from ug::Volume.

◆ edge_desc() [2/2]

void ug::Prism::edge_desc ( int  index,
EdgeDescriptor edOut 
) const
virtual

◆ face_desc() [1/2]

FaceDescriptor ug::Prism::face_desc ( int  index) const
virtual

Reimplemented from ug::Volume.

◆ face_desc() [2/2]

void ug::Prism::face_desc ( int  index,
FaceDescriptor fdOut 
) const
virtual

◆ get_edge_index_from_vertices()

int ug::Prism::get_edge_index_from_vertices ( const size_t  vi0,
const size_t  vi1 
) const
virtual

returns the local index of the edge which connects the two vertex indices.

Default implementation throws a UGError

Reimplemented from ug::Volume.

References ug::hex_rules::EDGE_FROM_VRTS.

◆ get_face_edge_index()

int ug::Prism::get_face_edge_index ( const size_t  faceInd,
const size_t  faceEdgeInd 
) const
virtual

returns the local index of the j-th edge of the i-th face of the volume

Default implementation throws a UGError

Reimplemented from ug::Volume.

References ug::hex_rules::FACE_EDGE_INDS.

◆ get_flipped_orientation()

void ug::Prism::get_flipped_orientation ( VolumeDescriptor vdOut) const
virtual

Writes vertices to the volume-descriptor so that it defines a volume with flipped orientation. If you want to flip the orientation of a volume in a grid, please consider using the grids flip_orientation method.

Please note: The default implementation returns the original volume and has to be reimplemented by derived classes.

Reimplemented from ug::Volume.

References ug::VolumeDescriptor::set_num_vertices(), and ug::VolumeDescriptor::set_vertex().

Referenced by ug::Extrude().

◆ get_opposing_object()

std::pair< GridBaseObjectId, int > ug::Prism::get_opposing_object ( Vertex vrt) const
virtual

returns an index to the obbject, which lies on the opposite side of the volume to the given vertex.

The method returs a pair <GridBaseObjectId, int>, where GridBaseObjectId is either VERTEX, EDGE, or FACE and where the second entry specifies the local index of the object in the given volume.

Reimplemented from ug::Volume.

References ug::hex_rules::NUM_VERTICES, ug::hex_rules::OPPOSED_OBJECT, and UG_THROW.

◆ get_opposing_side()

bool ug::Prism::get_opposing_side ( FaceVertices f,
FaceDescriptor fdOut 
) const
virtual

retrieves the face-descriptor for the opposing side to the specified one.

If no opposing side exists false is returned. If an opposing side exists, the method returns true and fills the specified descriptor.

Reimplemented from ug::Volume.

References ug::hex_rules::OPPOSED_FACE.

◆ get_vertex_indices_of_edge()

void ug::Prism::get_vertex_indices_of_edge ( size_t &  ind1Out,
size_t &  ind2Out,
size_t  edgeInd 
) const
virtual

returns the local indices of an edge of the volume.

Default implementation throws a UGError

Reimplemented from ug::Volume.

References ug::hex_rules::EDGE_VRT_INDS, and ug::hex_rules::NUM_EDGES.

◆ get_vertex_indices_of_face()

void ug::Prism::get_vertex_indices_of_face ( std::vector< size_t > &  indsOut,
size_t  side 
) const
virtual

returns the local indices of a face of the volume.

Default implementation throws a UGError

Reimplemented from ug::Volume.

References ug::hex_rules::FACE_VRT_INDS, and ug::hex_rules::NUM_FACES.

◆ is_regular_ref_rule()

bool ug::Prism::is_regular_ref_rule ( int  edgeMarks) const
virtual

returns true if the specified edgeMarks would lead to a regular refinement

A regular refinement leads to new elements which are all similar to the original element. I.e. which are of the same type and which have similar angles.

Note
this method does not perform refinement. Use 'refine' with the specified edges instead.
Parameters
edgeMarksIf the i-th edge shall be refined, the expression 'edgeMarks & (1<<i) != 0' has to be true. You can specify multiple refine-edges using or-combinations: 'edgeMarks = (1<<i) | (1<<j)' would indicate that the i-th and the j-th edge shall be refined.

Reimplemented from ug::Volume.

References ug::hex_rules::IsRegularRefRule().

◆ num_edges()

uint ug::Prism::num_edges ( ) const
virtual

Reimplemented from ug::Volume.

◆ num_faces()

uint ug::Prism::num_faces ( ) const
virtual

Reimplemented from ug::Volume.

◆ num_vertices()

virtual size_t ug::Prism::num_vertices ( ) const
inlinevirtual

Reimplemented from ug::VolumeVertices.

◆ reference_object_id()

virtual ReferenceObjectID ug::Prism::reference_object_id ( ) const
inlinevirtual

A reference object represents a class of geometric objects. Tetrahedrons, Triangles etc are such classes. Reference ids should be defined in the file in which concrete geometric objects are defined.

Reimplemented from ug::Volume.

References ug::ROID_PRISM.

◆ refine()

bool ug::Prism::refine ( std::vector< Volume * > &  vNewVolumesOut,
Vertex **  ppNewVertexOut,
Vertex **  newEdgeVertices,
Vertex **  newFaceVertices,
Vertex newVolumeVertex,
const Vertex prototypeVertex,
Vertex **  pSubstituteVertices = NULL,
vector3 corners = NULL,
bool *  isSnapPoint = NULL 
)
virtual

see Volume::refine for a detailed description.

Reimplemented from ug::Volume.

References ug::Refine().

◆ set_vertex()

virtual void ug::Prism::set_vertex ( uint  index,
Vertex pVrt 
)
inlineprotectedvirtual

creates the volumes that result from the splitting of the edge with index 'splitEdgeIndex'. creates the volumes that result from the collapsing of the edge with index 'splitEdgeIndex'.

Reimplemented from ug::Volume.

◆ type_match()

static bool ug::Prism::type_match ( GridObject pObj)
inlinestatic

◆ vertex()

virtual Vertex* ug::Prism::vertex ( size_t  index) const
inlinevirtual

Reimplemented from ug::VolumeVertices.

Referenced by ug::CalculateVolume().

◆ vertices()

virtual ConstVertexArray ug::Prism::vertices ( ) const
inlinevirtual

Reimplemented from ug::VolumeVertices.

Referenced by ug::CreateHexahedronFromPrisms().

Member Data Documentation

◆ m_vertices

Vertex* ug::Prism::m_vertices[6]
protected

◆ NUM_VERTICES

const size_t ug::Prism::NUM_VERTICES = 6
static

The documentation for this class was generated from the following files: