Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::SubsetGroup Class Reference

Group of subsets. More...

#include <subset_group.h>

Public Member Functions

void add (const char *name)
 adds subset with a name to this group
 
void add (const std::string &name)
 adds subset with a name to this group
 
void add (const std::vector< std::string > &vName)
 adds all subset with by name to this group
 
void add (const SubsetGroup &ssGroup)
 adds all subsets of another subset to the group
 
void add (int si)
 adds a subset by number to this group
 
void add_all ()
 select all subsets of underlying subset handler
 
void clear ()
 clear all subsets
 
bool contains (const char *name) const
 returns true if at least one subset of a name is contained in this group
 
bool contains (int si) const
 returns true if subset is contained in this group
 
int dim (size_t i) const
 dimension of subset
 
bool empty () const
 returns if function group is empty
 
int get_highest_subset_dimension () const
 highest dimension of all subset
 
const std::vector< int > & index_vector () const
 vector of the subset indices in the group
 
const char * name (size_t i) const
 name of subset
 
int operator[] (size_t i) const
 index of the subset # i in this group
 
bool regular_grid (size_t i) const
 returns if a subset is a regular grid
 
void remove (const char *name)
 removes subset with a given name from this group
 
void remove (const std::string &name)
 removes subset with a given name from this group
 
void remove (const std::vector< std::string > &vName)
 removes subsets with given names from this group
 
void remove (const SubsetGroup &ssGroup)
 removes all subsets of another subset from the group
 
void remove (int si)
 removes a subset from this group
 
void set_subset_handler (ConstSmartPtr< ISubsetHandler > sh)
 set an underlying subset handler
 
size_t size () const
 number of subsets in this group
 
ConstSmartPtr< ISubsetHandlersubset_handler () const
 get underlying subset handler
 
 SubsetGroup ()
 Default Constructor.
 
 SubsetGroup (ConstSmartPtr< ISubsetHandler > sh)
 Constructor setting subset handler.
 
 SubsetGroup (ConstSmartPtr< ISubsetHandler > sh, const char *names)
 Constructor setting subset handler and subsets.
 
 SubsetGroup (ConstSmartPtr< ISubsetHandler > sh, const std::string &names)
 Constructor setting subset handler and subsets.
 
 SubsetGroup (ConstSmartPtr< ISubsetHandler > sh, const std::vector< std::string > &vName)
 Constructor setting subset handler and subsets.
 

Protected Member Functions

bool is_init () const
 

Protected Attributes

ConstSmartPtr< ISubsetHandlerm_pSH
 underlying SubsetHandler
 
std::vector< int > m_vSubset
 selected Subset Indices
 

Detailed Description

Group of subsets.

A SubsetGroup is used to describe a group of Subsets. Therefore, it has an underlying SubsetHandler from which the subsets can be chosen. It is very light-weight, since internally it is just a vector of the subset indices. But it provides several comfort functions. Note, that the subset indices are always sorted by increasing index in this subset group.

Constructor & Destructor Documentation

◆ SubsetGroup() [1/5]

ug::SubsetGroup::SubsetGroup ( )

Default Constructor.

References clear().

◆ SubsetGroup() [2/5]

ug::SubsetGroup::SubsetGroup ( ConstSmartPtr< ISubsetHandler sh)

Constructor setting subset handler.

References clear().

◆ SubsetGroup() [3/5]

ug::SubsetGroup::SubsetGroup ( ConstSmartPtr< ISubsetHandler sh,
const char *  names 
)

Constructor setting subset handler and subsets.

References add().

◆ SubsetGroup() [4/5]

ug::SubsetGroup::SubsetGroup ( ConstSmartPtr< ISubsetHandler sh,
const std::string &  names 
)

Constructor setting subset handler and subsets.

References add().

◆ SubsetGroup() [5/5]

ug::SubsetGroup::SubsetGroup ( ConstSmartPtr< ISubsetHandler sh,
const std::vector< std::string > &  vName 
)

Constructor setting subset handler and subsets.

References add().

Member Function Documentation

◆ add() [1/5]

void ug::SubsetGroup::add ( const char *  name)

adds subset with a name to this group

References add(), and name.

◆ add() [2/5]

void ug::SubsetGroup::add ( const std::string &  name)

adds subset with a name to this group

◆ add() [3/5]

void ug::SubsetGroup::add ( const std::vector< std::string > &  vName)

adds all subset with by name to this group

This function adds all subset with by name to this group.

Parameters
[in]vNameName of Subset(s) to be added

◆ add() [4/5]

void ug::SubsetGroup::add ( const SubsetGroup ssGroup)

adds all subsets of another subset to the group

References add(), is_init(), m_pSH, size(), subset_handler(), and UG_THROW.

◆ add() [5/5]

◆ add_all()

◆ clear()

◆ contains() [1/2]

bool ug::SubsetGroup::contains ( const char *  name) const

returns true if at least one subset of a name is contained in this group

References is_init(), m_pSH, name, and UG_THROW.

◆ contains() [2/2]

◆ dim()

int ug::SubsetGroup::dim ( size_t  i) const

dimension of subset

Returns the dimension of the subset. The dimension of the subset is defined as the highest dimension of geometric objects contained in the subset. This maximum is taken over all procs in parallel.

References ug::DimensionOfSubset(), is_init(), m_pSH, m_vSubset, size(), and UG_THROW.

Referenced by get_highest_subset_dimension(), ug::Integral(), ug::IntegralNormalComponentOnManifoldSubsets(), ug::IntegrateDiscFlux(), ug::IntegrateNormalGradientOnManifold(), ug::IntegrateSubsets(), ug::InterpolateOnDiffElements(), ug::InterpolateOnElements(), ug::InterpolateOnElementsInner(), ug::MaxErrorOnElements(), ug::RemoveLowerDimSubsets(), and ug::SameDimensionsInAllSubsets().

◆ empty()

bool ug::SubsetGroup::empty ( ) const
inline

returns if function group is empty

References m_vSubset.

Referenced by ug::OutNormCmp< TDomain >::evaluate().

◆ get_highest_subset_dimension()

int ug::SubsetGroup::get_highest_subset_dimension ( ) const

highest dimension of all subset

Returns the highest dimension of all subset. The dimension of a subset is defined as the highest dimension of geometric objects contained in the subset. No check between different processes is performed in parallel.

Returns
-1 if no dimension available dim >= 0 highest dimension of all subsets in this group

References dim(), is_init(), size(), and UG_THROW.

Referenced by ug::IApproximationSpace::add(), ug::IApproximationSpace::add(), and ug::FunctionPattern::add().

◆ index_vector()

const std::vector< int > & ug::SubsetGroup::index_vector ( ) const
inline

vector of the subset indices in the group

References m_vSubset.

Referenced by ug::DomainRayTracer::init().

◆ is_init()

bool ug::SubsetGroup::is_init ( ) const
inlineprotected

◆ name()

const char * ug::SubsetGroup::name ( size_t  i) const

name of subset

References is_init(), m_pSH, m_vSubset, size(), and UG_THROW.

◆ operator[]()

int ug::SubsetGroup::operator[] ( size_t  i) const
inline

index of the subset # i in this group

References is_init(), m_vSubset, size(), and UG_ASSERT.

◆ regular_grid()

◆ remove() [1/5]

void ug::SubsetGroup::remove ( const char *  name)

removes subset with a given name from this group

References name, and remove().

◆ remove() [2/5]

void ug::SubsetGroup::remove ( const std::string &  name)

removes subset with a given name from this group

◆ remove() [3/5]

void ug::SubsetGroup::remove ( const std::vector< std::string > &  vName)

removes subsets with given names from this group

This function removes all subsets by name from this group

Parameters
[in]nameName of Subset(s) to be removed

◆ remove() [4/5]

void ug::SubsetGroup::remove ( const SubsetGroup ssGroup)

removes all subsets of another subset from the group

References is_init(), m_pSH, remove(), size(), subset_handler(), and UG_THROW.

◆ remove() [5/5]

void ug::SubsetGroup::remove ( int  si)

◆ set_subset_handler()

void ug::SubsetGroup::set_subset_handler ( ConstSmartPtr< ISubsetHandler sh)
inline

◆ size()

size_t ug::SubsetGroup::size ( ) const
inline

number of subsets in this group

References m_pSH, and m_vSubset.

Referenced by ug::CompositeUserData< TData, dim, TRet >::add(), add(), ug::AddFunctionValuesToGridCoordinatesP1(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_defect(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_defect(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_jacobian(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_linear(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_linear(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_rhs(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_rhs(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::calc_error(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::calc_error(), ug::IObstacleConstraint< TDomain, TAlgebra >::check_functions_and_subsets(), ug::DirichletBoundary< TDomain, TAlgebra >::check_functions_and_subsets(), ug::IElemDiscBase< TDomain >::check_setup(), ug::bridge::Evaluate::CloseVertexExists(), ug::VTKOutput< TDim >::count_piece_sizes(), dim(), ug::GridFunctionComponentSpace< TGridFunction >::distance2(), ug::bridge::Evaluate::EvaluateAtVertex(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::finish_timestep_elem(), get_highest_subset_dimension(), ug::GlobalGridFunctionGradientData< TGridFunction >::GlobalGridFunctionGradientData(), ug::GlobalGridFunctionNumberData< TGridFunction, elemDim >::GlobalGridFunctionNumberData(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::init_all_exports(), ug::Integral(), ug::IntegralNormalComponentOnManifoldSubsets(), ug::IntegralNormalComponentOnManifoldUsingFV1Geom(), ug::IntegrateDiscFlux(), ug::IntegrateNormalComponentOnManifold(), ug::IntegrateNormalGradientOnManifold(), ug::IntegrateSubsets(), ug::InterpolateOnDiffElements(), ug::InterpolateOnDiffVertices(), ug::InterpolateOnElements(), ug::InterpolateOnElementsInner(), ug::NeumannBoundaryFE< TDomain >::NumberData::lin_def(), ug::NeumannBoundaryFV< TDomain >::NumberData::lin_def(), ug::NeumannBoundaryFV1< TDomain >::NumberData::lin_def(), ug::MarkSubsets(), ug::MaxErrorOnElements(), ug::MaxErrorOnVertices(), name(), ug::GridFunctionComponentSpace< TGridFunction >::norm2(), ug::DegeneratedLayerManager< dim >::num_subsets(), operator[](), ug::OverlyingSubsetFinder< TDomain >::OverlyingSubsetFinder(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::prepare_timestep_elem(), ug::VTKOutput< TDim >::print_subsets(), regular_grid(), remove(), ug::RemoveLowerDimSubsets(), ug::SameDimensionsInAllSubsets(), ug::SumGFValuesAt(), ug::vtk_export_ho(), ug::VTKOutput< TDim >::write_cell_connectivity(), ug::VTKOutput< TDim >::write_cell_data(), ug::VTKOutput< TDim >::write_cell_offsets(), ug::VTKOutput< TDim >::write_cell_proc_ranks(), ug::VTKOutput< TDim >::write_cell_subsets(), ug::VTKOutput< TDim >::write_cell_types(), ug::VTKOutput< TDim >::write_cell_values(), ug::VTKOutput< TDim >::write_cell_values_piece(), ug::VTKOutput< TDim >::write_nodal_data(), ug::VTKOutput< TDim >::write_nodal_values(), ug::VTKOutput< TDim >::write_nodal_values_piece(), ug::VTKOutput< TDim >::write_points(), and ug::ZRayTracer< TDomain >::ZRayTracer().

◆ subset_handler()

ConstSmartPtr< ISubsetHandler > ug::SubsetGroup::subset_handler ( ) const
inline

Member Data Documentation

◆ m_pSH

ConstSmartPtr<ISubsetHandler> ug::SubsetGroup::m_pSH
protected

◆ m_vSubset

std::vector<int> ug::SubsetGroup::m_vSubset
protected

selected Subset Indices

Referenced by add(), clear(), contains(), dim(), empty(), index_vector(), name(), operator[](), regular_grid(), remove(), and size().


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