ug4
ug::RefinementProjector Class Reference

Adjusts vertex coordinates during refinement. More...

#include <refinement_projector.h>

+ Inheritance diagram for ug::RefinementProjector:

Public Member Functions

virtual SPIGeometry3d geometry () const
 
virtual number new_vertex (Vertex *vrt, Edge *parent)
 called when a new vertex was created from an old edge. More...
 
virtual number new_vertex (Vertex *vrt, Face *parent)
 called when a new vertex was created from an old face. More...
 
virtual number new_vertex (Vertex *vrt, Vertex *parent)
 called when a new vertex was created from an old vertex. More...
 
virtual number new_vertex (Vertex *vrt, Volume *parent)
 called when a new vertex was created from an old volume. More...
 
virtual void refinement_begins (const ISubGrid *sg)
 called before refinement begins More...
 
virtual bool refinement_begins_requires_subgrid () const
 
virtual void refinement_ends ()
 called when refinement is done More...
 
 RefinementProjector ()
 
 RefinementProjector (SPElementCallback cb)
 
 RefinementProjector (SPIGeometry3d geometry)
 
 RefinementProjector (SPIGeometry3d geometry, SPElementCallback concernedElems)
 
virtual void set_concerned_elements (SPElementCallback cb)
 
virtual void set_geometry (SPIGeometry3d geometry)
 
virtual ~RefinementProjector ()
 

Protected Member Functions

IGeometry3dgeom ()
 
const IGeometry3dgeom () const
 
template<class TElem >
bool is_concerned (TElem *e)
 
vector3 pos (Vertex *v) const
 
void set_pos (Vertex *v, const vector3 &p)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

SPElementCallback m_concernedElementsCallback
 
SPIGeometry3d m_geometry
 

Friends

class boost::serialization::access
 

Detailed Description

Adjusts vertex coordinates during refinement.

The refinement projector serves as a base class for other refinement projectors and serves as a simple linear projector at the same time. I.E. new vertices are always placed at the center of their parent element.

Internally, refinement projectors are implemented for 3d coordinates. Geometries of lower dimension can still be treated since they are wrapped in a IGeometry3d class. While this adds a small overhead it simplifies implementation and usability considerably, since no additional template dependencies have to be considered.

Constructor & Destructor Documentation

◆ RefinementProjector() [1/4]

ug::RefinementProjector::RefinementProjector ( )
inline

◆ RefinementProjector() [2/4]

ug::RefinementProjector::RefinementProjector ( SPIGeometry3d  geometry)
inline

References new().

◆ RefinementProjector() [3/4]

ug::RefinementProjector::RefinementProjector ( SPElementCallback  cb)
inline

◆ RefinementProjector() [4/4]

ug::RefinementProjector::RefinementProjector ( SPIGeometry3d  geometry,
SPElementCallback  concernedElems 
)
inline

◆ ~RefinementProjector()

virtual ug::RefinementProjector::~RefinementProjector ( )
inlinevirtual

Member Function Documentation

◆ geom() [1/2]

◆ geom() [2/2]

const IGeometry3d& ug::RefinementProjector::geom ( ) const
inlineprotected

References m_geometry.

◆ geometry()

◆ is_concerned()

template<class TElem >
bool ug::RefinementProjector::is_concerned ( TElem *  e)
inlineprotected

◆ new_vertex() [1/4]

virtual number ug::RefinementProjector::new_vertex ( Vertex vrt,
Edge parent 
)
inlinevirtual

◆ new_vertex() [2/4]

virtual number ug::RefinementProjector::new_vertex ( Vertex vrt,
Face parent 
)
inlinevirtual

◆ new_vertex() [3/4]

virtual number ug::RefinementProjector::new_vertex ( Vertex vrt,
Vertex parent 
)
inlinevirtual

◆ new_vertex() [4/4]

virtual number ug::RefinementProjector::new_vertex ( Vertex vrt,
Volume parent 
)
inlinevirtual

◆ pos()

◆ refinement_begins()

virtual void ug::RefinementProjector::refinement_begins ( const ISubGrid sg)
inlinevirtual

called before refinement begins

if not NULL, the specified sub-grid will contains all elements that will be refined and are affected by the given projector.

If the specialized implementation of refinement_begins requires this subgrid, the method 'refinement_begins_requires_subgrid' should be specialized and should return 'true'. In this case the subgrid should always be provided by the caller. If you call 'RefinementProjector::refinement_begins(sg);' at the beginning of your specialization, an error will be thrown if this is not the case.

Reimplemented in ug::SubdivisionProjector, ug::SmoothProjector, and ug::ProjectionHandler.

References SmartPtr< T, FreePolicy >::invalid(), m_geometry, refinement_begins_requires_subgrid(), and UG_COND_THROW.

Referenced by ug::Refine(), ug::ProjectionHandler::refinement_begins(), and ug::SmoothProjector::refinement_begins().

◆ refinement_begins_requires_subgrid()

virtual bool ug::RefinementProjector::refinement_begins_requires_subgrid ( ) const
inlinevirtual

returns 'true' if a specialized projector requires the subgrid during its 'refinement_begins' method.

Note
Implementers of derived classes should overload this method and return 'true' if their 'refinement_begins' method requires a subgrid. Please have a look at the documentation of 'RefinementProjector::refinement_begins' for more information.

Reimplemented in ug::SubdivisionProjector, and ug::ProjectionHandler.

Referenced by ug::ProjectionHandler::refinement_begins(), and refinement_begins().

◆ refinement_ends()

virtual void ug::RefinementProjector::refinement_ends ( )
inlinevirtual

called when refinement is done

Reimplemented in ug::SubdivisionProjector, ug::SmoothProjector, and ug::ProjectionHandler.

Referenced by ug::Refine(), and ug::ProjectionHandler::refinement_ends().

◆ serialize()

template<class Archive >
void ug::RefinementProjector::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

◆ set_concerned_elements()

virtual void ug::RefinementProjector::set_concerned_elements ( SPElementCallback  cb)
inlinevirtual

◆ set_geometry()

◆ set_pos()

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ m_concernedElementsCallback

SPElementCallback ug::RefinementProjector::m_concernedElementsCallback
private

◆ m_geometry

SPIGeometry3d ug::RefinementProjector::m_geometry
private

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