ug4
ug::Face Class Reference

Faces are 2-dimensional objects. More...

#include <grid_base_objects.h>

+ Inheritance diagram for ug::Face:

Public Types

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

Public Member Functions

virtual int base_object_id () const
 
virtual bool collapse_edge (std::vector< Face * > &vNewFacesOut, int edgeIndex, Vertex *newVertex, Vertex **pSubstituteVertices=NULL)
 
virtual bool collapse_edges (std::vector< Face * > &vNewFacesOut, std::vector< Vertex * > &vNewEdgeVertices, Vertex **pSubstituteVertices=NULL)
 
virtual int container_section () const
 
virtual Edgecreate_edge (int index)
 create the edge with index i and return it. More...
 
virtual void create_faces_by_edge_split (int splitEdgeIndex, Vertex *newVertex, std::vector< Face * > &vNewFacesOut, Vertex **pSubstituteVertices=NULL)
 
virtual EdgeDescriptor edge_desc (int index) const
 returns the i-th edge of the face. More...
 
virtual void edge_desc (int index, EdgeDescriptor &edOut) const
 returns the i-th edge of the face. More...
 
int get_local_side_index (EdgeVertices *e) const
 returns the local index of the specified edge. More...
 
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 face to the given vertex. More...
 
virtual bool get_opposing_side (EdgeVertices *e, EdgeDescriptor &edOut) const
 retrieves the edge-descriptor for the opposing side to the specified one. More...
 
virtual bool is_regular_ref_rule (int edgeMarks) const
 returns true if the specified edgeMarks would lead to a regular refinement More...
 
uint num_edges () const
 
uint num_sides () const
 
virtual ReferenceObjectID reference_object_id () const
 
virtual bool refine (std::vector< Face * > &vNewFacesOut, Vertex **newFaceVertexOut, Vertex **newEdgeVertices, Vertex *newFaceVertex=NULL, Vertex **pSubstituteVertices=NULL, int snapPointIndex=-1)
 
virtual ~Face ()
 
- Public Member Functions inherited from ug::GridObject
virtual GridObjectcreate_empty_instance () const
 create an instance of the derived type More...
 
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::FaceVertices
virtual size_t num_vertices () const
 
Vertexoperator[] (size_t index) const
 returns the i-th vertex. More...
 
size_t size () const
 returns the number of vertices. More...
 
virtual Vertexvertex (size_t index) const
 
virtual ConstVertexArray vertices () const
 
virtual ~FaceVertices ()
 
- 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 Attributes

static const int BASE_OBJECT_ID = FACE
 
static const bool CAN_BE_SIDE = true
 
static const int dim = 2
 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...
 

Friends

class Grid
 

Additional Inherited Members

- Protected Attributes inherited from ug::GridObject
uint m_gridDataIndex
 

Detailed Description

Faces are 2-dimensional objects.

Base class for all 2-dimensional objects. Faces connect three or more vertices. A face should always be flat (if viewed in 3 dimensions). You can not create an instance of Face. grids are constructed from derivatives of face. The vertices of a face have always to be specified in counterclockwise order!

Member Typedef Documentation

◆ grid_base_object

◆ higher_dim_base_object

◆ lower_dim_base_object

◆ side

◆ sideof

Constructor & Destructor Documentation

◆ ~Face()

virtual ug::Face::~Face ( )
inlinevirtual

Member Function Documentation

◆ base_object_id()

virtual int ug::Face::base_object_id ( ) const
inlinevirtual

Implements ug::GridObject.

References ug::FACE.

◆ collapse_edge()

virtual bool ug::Face::collapse_edge ( std::vector< Face * > &  vNewFacesOut,
int  edgeIndex,
Vertex newVertex,
Vertex **  pSubstituteVertices = NULL 
)
inlinevirtual

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 faces 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 faces will reference the vertices in pvSubstituteVertices. Note that pvSubstituteVertices has to contain exactly as many vertices as the face in which you collapse the edge. Vertices with the same index correlate.

Reimplemented in ug::CustomQuadrilateral< ConstrainedQuadrilateral, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomQuadrilateral< Quadrilateral, Face, Triangle, Quadrilateral >, ug::CustomQuadrilateral< ConstrainingQuadrilateral, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, ug::CustomTriangle< ConstrainedTriangle, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomTriangle< ConstrainingTriangle, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, and ug::CustomTriangle< Triangle, Face, Triangle, Quadrilateral >.

Referenced by ug::CollapseEdge().

◆ collapse_edges()

virtual bool ug::Face::collapse_edges ( std::vector< Face * > &  vNewFacesOut,
std::vector< Vertex * > &  vNewEdgeVertices,
Vertex **  pSubstituteVertices = NULL 
)
inlinevirtual

The collapse_edgea method creates new geometric objects by collapsing the specified edges simultaneously. This method makes sense only for faces with more than 4 edges. The user that calls this function is responsible to either register the new faces 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).

  • for each entry in vNewEdgeVertices which is not NULL, the edge with the same index will be collapsed and replaced by the specified vertex. The size of vNewEdgeVertices has thus to be between 0 and this->num_edges().
  • If you specify pvSubstituteVertices, the created faces will reference the vertices in pvSubstituteVertices. Note that pvSubstituteVertices has to contain exactly as many vertices as the face in which you collapse the edge. Vertices with the same index correlate.

Reimplemented in ug::CustomQuadrilateral< ConstrainedQuadrilateral, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomQuadrilateral< Quadrilateral, Face, Triangle, Quadrilateral >, ug::CustomQuadrilateral< ConstrainingQuadrilateral, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, ug::CustomTriangle< ConstrainedTriangle, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomTriangle< ConstrainingTriangle, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, and ug::CustomTriangle< Triangle, Face, Triangle, Quadrilateral >.

◆ container_section()

◆ create_edge()

virtual Edge* ug::Face::create_edge ( int  index)
inlinevirtual

create the edge with index i and return it.

A default implementation is featured to allow empty instances of this class. This is required to allow the use of this class for compile-time method selection by dummy-parameters. It is cruical that derived classes overload this method.

Reimplemented in ug::ConstrainingQuadrilateral, ug::ConstrainingTriangle, ug::ConstrainedQuadrilateral, ug::ConstrainedTriangle, ug::Quadrilateral, and ug::Triangle.

Referenced by ug::Grid::face_autogenerate_edges(), and ug::Grid::register_face().

◆ create_faces_by_edge_split()

virtual void ug::Face::create_faces_by_edge_split ( int  splitEdgeIndex,
Vertex newVertex,
std::vector< Face * > &  vNewFacesOut,
Vertex **  pSubstituteVertices = NULL 
)
inlinevirtual

creates the faces that result from the splitting of the edge with index 'splitEdgeIndex'. The user that calls this function is responsible to either register those faces with the same grid in which 'this' was registered, or to take over responsibility for deletion of the acquired memory. With pvSubstituteVertices you can optionally pass a vector of vertices, which will be used instead of the original vertices of this face. If specified, pvSubstituteVertices has to contain exactly as many vertices as the face itself.

Reimplemented in ug::CustomQuadrilateral< ConstrainedQuadrilateral, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomQuadrilateral< Quadrilateral, Face, Triangle, Quadrilateral >, ug::CustomQuadrilateral< ConstrainingQuadrilateral, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, ug::CustomTriangle< ConstrainedTriangle, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomTriangle< ConstrainingTriangle, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, and ug::CustomTriangle< Triangle, Face, Triangle, Quadrilateral >.

Referenced by ug::CreateEdgeSplitGeometry().

◆ edge_desc() [1/2]

◆ edge_desc() [2/2]

◆ get_local_side_index()

int ug::Face::get_local_side_index ( EdgeVertices e) const

returns the local index of the specified edge.

If the edge is not part of the face, then -1 is returned.

References ug::CompareVertices(), edge_desc(), and num_sides().

◆ get_opposing_object()

◆ get_opposing_side()

virtual bool ug::Face::get_opposing_side ( EdgeVertices e,
EdgeDescriptor edOut 
) const
inlinevirtual

retrieves the edge-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 in ug::CustomQuadrilateral< ConstrainedQuadrilateral, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomQuadrilateral< Quadrilateral, Face, Triangle, Quadrilateral >, and ug::CustomQuadrilateral< ConstrainingQuadrilateral, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >.

Referenced by ug::GetOpposingSide().

◆ is_regular_ref_rule()

virtual bool ug::Face::is_regular_ref_rule ( int  edgeMarks) const
inlinevirtual

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 in ug::CustomQuadrilateral< ConstrainedQuadrilateral, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomQuadrilateral< Quadrilateral, Face, Triangle, Quadrilateral >, ug::CustomQuadrilateral< ConstrainingQuadrilateral, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, ug::CustomTriangle< ConstrainedTriangle, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomTriangle< ConstrainingTriangle, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, and ug::CustomTriangle< Triangle, Face, Triangle, Quadrilateral >.

◆ num_edges()

◆ num_sides()

◆ reference_object_id()

◆ refine()

virtual bool ug::Face::refine ( std::vector< Face * > &  vNewFacesOut,
Vertex **  newFaceVertexOut,
Vertex **  newEdgeVertices,
Vertex newFaceVertex = NULL,
Vertex **  pSubstituteVertices = NULL,
int  snapPointIndex = -1 
)
inlinevirtual

The refine method can be used to create new elements by inserting new vertices on the face. The user that calls this function is responsible to either register the new faces 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).

  • Specify vertices that shall be inserted on edges with newEdgeVertices. Vertices are inserted on the edge that corresponds to their index. Use NULL to indicate that no vertex shall be inserted on the associated edge. newEdgeVertices has to point to an array that holds as many vertices as there are edges in the face.
  • If the method has to create a new inner vertex, it will be returned in newFaceVertexOut.
  • If you specify pvSubstituteVertices, the created faces will reference the vertices in pvSubstituteVertices. Note that pvSubstituteVertices has to contain exactly as many vertices as the refined Face. Vertices with the same index correlate.
  • You may optionally specify a 'snapPointIndex'. Default is -1. If an index >= 0 is specifed, then new inner edges will always be created between new edge vertices and the vertex specified through the snap-point-index. Note that a snap-point must not be a corner of a refined edge.

Reimplemented in ug::CustomQuadrilateral< ConstrainedQuadrilateral, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomQuadrilateral< Quadrilateral, Face, Triangle, Quadrilateral >, ug::CustomQuadrilateral< ConstrainingQuadrilateral, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, ug::CustomTriangle< ConstrainedTriangle, ConstrainedFace, ConstrainedTriangle, ConstrainedQuadrilateral >, ug::CustomTriangle< ConstrainingTriangle, ConstrainingFace, ConstrainingTriangle, ConstrainingQuadrilateral >, and ug::CustomTriangle< Triangle, Face, Triangle, Quadrilateral >.

Referenced by ug::AdaptiveRegularRefiner_MultiGrid::create_closure_elements_2d(), ug::AdaptiveRegularRefiner_MultiGrid::create_closure_elements_3d(), ug::GlobalFracturedMediaRefiner::perform_refinement(), ug::GlobalMultiGridRefiner::perform_refinement(), ug::Refine(), ug::HangingNodeRefinerBase< TSelector >::refine_face_with_normal_vertex(), ug::ResolveEdgeFaceIntersection(), and ug::ResolveVertexFaceIntersection().

◆ set_vertex()

◆ type_match()

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

Friends And Related Function Documentation

◆ Grid

friend class Grid
friend

Member Data Documentation

◆ BASE_OBJECT_ID

const int ug::Face::BASE_OBJECT_ID = FACE
static

◆ CAN_BE_SIDE

const bool ug::Face::CAN_BE_SIDE = true
static

◆ dim

const int ug::Face::dim = 2
static

reference dimension

◆ HAS_SIDES

const bool ug::Face::HAS_SIDES = true
static

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