ug4
ug::ProjectionHandler Class Reference

Associates different projectors with individual subsets. More...

#include <projection_handler.h>

+ Inheritance diagram for ug::ProjectionHandler:

Public Member Functions

void clear ()
 
SPRefinementProjector default_projector ()
 
ConstSmartPtr< RefinementProjectordefault_projector () 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...
 
size_t num_projectors () const
 
 ProjectionHandler ()
 
template<class TGeomProvider >
 ProjectionHandler (const TGeomProvider &geometry, SmartPtr< ISubsetHandler > psh)
 
 ProjectionHandler (ISubsetHandler *psh)
 
 ProjectionHandler (SmartPtr< ISubsetHandler > psh)
 
 ProjectionHandler (SPIGeometry3d geometry, ISubsetHandler *psh)
 
SPRefinementProjector projector (size_t i)
 
ConstSmartPtr< RefinementProjectorprojector (size_t i) const
 
virtual void refinement_begins (const ISubGrid *psg)
 prepares associated projectors for refinement More...
 
virtual bool refinement_begins_requires_subgrid () const
 
virtual void refinement_ends ()
 called when refinement is done More...
 
void set_default_projector (SPRefinementProjector projector)
 
virtual void set_geometry (SPIGeometry3d geometry)
 
virtual void set_geometry_all (SPIGeometry3d geometry)
 Sets the geometry of the ProjectionHandler and of all associated projectors. More...
 
void set_projector (const char *subsetName, SPRefinementProjector projector)
 associate a projector with a subset of the given name. More...
 
void set_projector (int subsetIndex, SPRefinementProjector projector)
 associate a projector with a given subsetIndex. Note that '-1' is a valid index, too. More...
 
void set_subset_handler (ISubsetHandler *psh)
 
void set_subset_handler (SmartPtr< ISubsetHandler > psh)
 
const ISubsetHandlersubset_handler () const
 return the subset handler that the projection handler is based on More...
 
virtual ~ProjectionHandler ()
 
- Public Member Functions inherited from ug::RefinementProjector
virtual SPIGeometry3d geometry () const
 
 RefinementProjector ()
 
 RefinementProjector (SPElementCallback cb)
 
 RefinementProjector (SPIGeometry3d geometry)
 
 RefinementProjector (SPIGeometry3d geometry, SPElementCallback concernedElems)
 
virtual void set_concerned_elements (SPElementCallback cb)
 
virtual ~RefinementProjector ()
 

Private Member Functions

template<class TParent >
number handle_new_vertex (Vertex *vrt, TParent *parent)
 
void projector_required (int index)
 

Private Attributes

SmartPtr< RefinementProjectorm_defaultProjector
 
std::vector< SmartPtr< RefinementProjector > > m_projectors
 
ISubsetHandlerm_sh
 
SmartPtr< ISubsetHandlerm_spSH
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from ug::RefinementProjector
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)
 

Detailed Description

Associates different projectors with individual subsets.

In many cases it is useful to use different RefinementProjectors on different parts of a grid. To do so one may use a SubsetHandler to partition the grid into different parts. This SubsetHandler can then be passed to the ProjectionHandler and different RefinementProjectors can be associated with each subset through 'set_projector'.

Constructor & Destructor Documentation

◆ ProjectionHandler() [1/5]

ug::ProjectionHandler::ProjectionHandler ( )

References m_defaultProjector, and make_sp().

◆ ProjectionHandler() [2/5]

ug::ProjectionHandler::ProjectionHandler ( ISubsetHandler psh)

Please makre sure that the given subset-handler outlives the ProjectionHandler. Please note that an alternative constructor taking a smart-pointer to a SubsetHandler exists.

See also
ug::RefinementProjector::RefinementProjector

References m_defaultProjector, and make_sp().

◆ ProjectionHandler() [3/5]

ug::ProjectionHandler::ProjectionHandler ( SmartPtr< ISubsetHandler psh)

◆ ProjectionHandler() [4/5]

ug::ProjectionHandler::ProjectionHandler ( SPIGeometry3d  geometry,
ISubsetHandler psh 
)

Please makre sure that the given subset-handler outlives the ProjectionHandler. Please note that an alternative constructor taking a smart-pointer to a SubsetHandler exists.

See also
ug::RefinementProjector::RefinementProjector

References m_defaultProjector, and make_sp().

◆ ProjectionHandler() [5/5]

template<class TGeomProvider >
ug::ProjectionHandler::ProjectionHandler ( const TGeomProvider &  geometry,
SmartPtr< ISubsetHandler psh 
)
inline

◆ ~ProjectionHandler()

ug::ProjectionHandler::~ProjectionHandler ( )
virtual

Member Function Documentation

◆ clear()

void ug::ProjectionHandler::clear ( )

◆ default_projector() [1/2]

◆ default_projector() [2/2]

ConstSmartPtr<RefinementProjector> ug::ProjectionHandler::default_projector ( ) const
inline

References m_defaultProjector.

◆ handle_new_vertex()

template<class TParent >
number ug::ProjectionHandler::handle_new_vertex ( Vertex vrt,
TParent *  parent 
)
private

◆ new_vertex() [1/4]

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

called when a new vertex was created from an old edge.

Reimplemented from ug::RefinementProjector.

References handle_new_vertex().

◆ new_vertex() [2/4]

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

called when a new vertex was created from an old face.

Reimplemented from ug::RefinementProjector.

References handle_new_vertex().

◆ new_vertex() [3/4]

number ug::ProjectionHandler::new_vertex ( Vertex vrt,
Vertex parent 
)
virtual

called when a new vertex was created from an old vertex.

Reimplemented from ug::RefinementProjector.

References handle_new_vertex().

◆ new_vertex() [4/4]

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

called when a new vertex was created from an old volume.

Reimplemented from ug::RefinementProjector.

References handle_new_vertex().

◆ num_projectors()

◆ projector() [1/2]

◆ projector() [2/2]

ConstSmartPtr<RefinementProjector> ug::ProjectionHandler::projector ( size_t  i) const
inline

References m_projectors.

◆ projector_required()

void ug::ProjectionHandler::projector_required ( int  index)
private

References m_projectors.

Referenced by projector(), refinement_begins(), and set_projector().

◆ refinement_begins()

◆ refinement_begins_requires_subgrid()

bool ug::ProjectionHandler::refinement_begins_requires_subgrid ( ) const
virtual

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 from ug::RefinementProjector.

References m_projectors.

◆ refinement_ends()

void ug::ProjectionHandler::refinement_ends ( )
virtual

called when refinement is done

Reimplemented from ug::RefinementProjector.

References m_projectors, and ug::RefinementProjector::refinement_ends().

◆ set_default_projector()

◆ set_geometry()

void ug::ProjectionHandler::set_geometry ( SPIGeometry3d  geometry)
virtual

◆ set_geometry_all()

void ug::ProjectionHandler::set_geometry_all ( SPIGeometry3d  geometry)
virtual

Sets the geometry of the ProjectionHandler and of all associated projectors.

Note
If you'd like to change the geometry of the ProjectionHandler only, please use 'set_geometry' instead.

References ug::RefinementProjector::geometry(), m_defaultProjector, m_projectors, and set_geometry().

◆ set_projector() [1/2]

void ug::ProjectionHandler::set_projector ( const char *  subsetName,
SPRefinementProjector  projector 
)

associate a projector with a subset of the given name.

Note
a valid subset-handler has to be set to ProjectionHandler before a subset can be specified by a name. Note that it is possible to specify a subset by index before setting a SubsetHandler.
if no geometry-object was set to the ProjectionHandler and if the given projector has an associated geometry-object, the handler will copy the geometry-object of the projector for its own use.

References ug::ISubsetHandler::get_subset_index(), m_sh, projector(), set_projector(), and UG_COND_THROW.

◆ set_projector() [2/2]

void ug::ProjectionHandler::set_projector ( int  subsetIndex,
SPRefinementProjector  projector 
)

associate a projector with a given subsetIndex. Note that '-1' is a valid index, too.

Note
if no geometry-object was set to the ProjectionHandler and if the given projector has an associated geometry-object, the handler will copy the geometry-object of the projector for its own use.

References ug::RefinementProjector::geometry(), m_projectors, projector(), projector_required(), set_geometry(), UG_COND_THROW, and SmartPtr< T, FreePolicy >::valid().

Referenced by ug::IDomain< TGrid, TSubsetHandler >::broadcast_refinement_projector(), ug::DeserializeProjectionHandler(), ug::GridReaderUGX::projection_handler(), and set_projector().

◆ set_subset_handler() [1/2]

void ug::ProjectionHandler::set_subset_handler ( ISubsetHandler psh)

Please make sure that the given subset-handler outlives the ProjectionHandler. Please note that an alternative 'set_subset_handler' exists, which takes a smart-pointer to a SubsetHandler.

References m_sh, and m_spSH.

◆ set_subset_handler() [2/2]

void ug::ProjectionHandler::set_subset_handler ( SmartPtr< ISubsetHandler psh)

◆ subset_handler()

const ISubsetHandler* ug::ProjectionHandler::subset_handler ( ) const
inline

return the subset handler that the projection handler is based on

References m_sh.

Referenced by ug::GridWriterUGX::add_projection_handler(), ug::IDomain< TGrid, TSubsetHandler >::broadcast_refinement_projector(), and ug::SaveGridToLGB().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ m_defaultProjector

◆ m_projectors

◆ m_sh

◆ m_spSH

SmartPtr<ISubsetHandler> ug::ProjectionHandler::m_spSH
private

Referenced by set_subset_handler().


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