ug4
|
Group of subsets. More...
#include <subset_group.h>
Public Member Functions | |
void | add (const char *name) |
adds subset with a name to this group More... | |
void | add (const std::string &name) |
adds subset with a name to this group More... | |
void | add (const std::vector< std::string > &vName) |
adds all subset with by name to this group More... | |
void | add (const SubsetGroup &ssGroup) |
adds all subsets of another subset to the group More... | |
void | add (int si) |
adds a subset by number to this group More... | |
void | add_all () |
select all subsets of underlying subset handler More... | |
void | clear () |
clear all subsets More... | |
bool | contains (const char *name) const |
returns true if at least one subset of a name is contained in this group More... | |
bool | contains (int si) const |
returns true if subset is contained in this group More... | |
int | dim (size_t i) const |
dimension of subset More... | |
bool | empty () const |
returns if function group is empty More... | |
int | get_highest_subset_dimension () const |
highest dimension of all subset More... | |
const std::vector< int > & | index_vector () const |
vector of the subset indices in the group More... | |
const char * | name (size_t i) const |
name of subset More... | |
int | operator[] (size_t i) const |
index of the subset # i in this group More... | |
bool | regular_grid (size_t i) const |
returns if a subset is a regular grid More... | |
void | remove (const char *name) |
removes subset with a given name from this group More... | |
void | remove (const std::string &name) |
removes subset with a given name from this group More... | |
void | remove (const std::vector< std::string > &vName) |
removes subsets with given names from this group More... | |
void | remove (const SubsetGroup &ssGroup) |
removes all subsets of another subset from the group More... | |
void | remove (int si) |
removes a subset from this group More... | |
void | set_subset_handler (ConstSmartPtr< ISubsetHandler > sh) |
set an underlying subset handler More... | |
size_t | size () const |
number of subsets in this group More... | |
ConstSmartPtr< ISubsetHandler > | subset_handler () const |
get underlying subset handler More... | |
SubsetGroup () | |
Default Constructor. More... | |
SubsetGroup (ConstSmartPtr< ISubsetHandler > sh) | |
Constructor setting subset handler. More... | |
SubsetGroup (ConstSmartPtr< ISubsetHandler > sh, const char *names) | |
Constructor setting subset handler and subsets. More... | |
SubsetGroup (ConstSmartPtr< ISubsetHandler > sh, const std::string &names) | |
Constructor setting subset handler and subsets. More... | |
SubsetGroup (ConstSmartPtr< ISubsetHandler > sh, const std::vector< std::string > &vName) | |
Constructor setting subset handler and subsets. More... | |
Protected Member Functions | |
bool | is_init () const |
Protected Attributes | |
ConstSmartPtr< ISubsetHandler > | m_pSH |
underlying SubsetHandler More... | |
std::vector< int > | m_vSubset |
selected Subset Indices More... | |
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.
ug::SubsetGroup::SubsetGroup | ( | ) |
Default Constructor.
References clear().
ug::SubsetGroup::SubsetGroup | ( | ConstSmartPtr< ISubsetHandler > | sh | ) |
Constructor setting subset handler.
References clear().
ug::SubsetGroup::SubsetGroup | ( | ConstSmartPtr< ISubsetHandler > | sh, |
const char * | names | ||
) |
Constructor setting subset handler and subsets.
References add().
ug::SubsetGroup::SubsetGroup | ( | ConstSmartPtr< ISubsetHandler > | sh, |
const std::string & | names | ||
) |
Constructor setting subset handler and subsets.
References add().
ug::SubsetGroup::SubsetGroup | ( | ConstSmartPtr< ISubsetHandler > | sh, |
const std::vector< std::string > & | vName | ||
) |
Constructor setting subset handler and subsets.
References add().
void ug::SubsetGroup::add | ( | const char * | name | ) |
void ug::SubsetGroup::add | ( | const std::string & | name | ) |
adds subset with a name to this group
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.
[in] | vName | Name of Subset(s) to be added |
void ug::SubsetGroup::add | ( | const SubsetGroup & | ssGroup | ) |
void ug::SubsetGroup::add | ( | int | si | ) |
adds a subset by number to this group
References ug::find(), is_init(), m_vSubset, and UG_THROW.
Referenced by add(), ug::CompositeUserData< TData, dim, TRet >::add(), add_all(), ug::bridge::Evaluate::CloseVertexExists(), ug::CreateSubsetGroups(), ug::GridFunctionComponentSpace< TGridFunction >::distance2(), ug::bridge::Evaluate::EvaluateAtClosestVertex(), ug::bridge::Evaluate::EvaluateAtClosestVertexAllProcs(), ug::DomainRayTracer::init(), ug::Integral(), ug::IntegralNormalComponentOnManifoldSubsets(), ug::IntegrateDiscFlux(), ug::IntegrateNormalComponentOnManifold(), ug::IntegrateNormalGradientOnManifold(), ug::IntegrateSubsets(), ug::Interpolate(), ug::InterpolateInner(), ug::InterpolateInnerDiff(), ug::MarkSubsets(), ug::MaxError(), ug::GridFunctionComponentSpace< TGridFunction >::norm2(), ug::OutNormCmp< TDomain >::OutNormCmp(), ug::VTKOutput< TDim >::print_subset(), ug::VTKOutput< TDim >::print_subsets(), SubsetGroup(), ug::SubsetIndicatorUserData< TDomain >::SubsetIndicatorUserData(), ug::SumGFValuesAt(), and ug::vtk_export_ho().
void ug::SubsetGroup::add_all | ( | ) |
select all subsets of underlying subset handler
References add(), is_init(), m_pSH, and UG_THROW.
Referenced by ug::FunctionPattern::add(), ug::AddFunctionValuesToGridCoordinatesP1(), ug::FunctionPattern::all_subsets_grp_except_for(), ug::bridge::Evaluate::CloseVertexExists(), ug::GridFunctionComponentSpace< TGridFunction >::distance2(), ug::bridge::Evaluate::EvaluateAtClosestVertex(), ug::bridge::Evaluate::EvaluateAtClosestVertexAllProcs(), ug::IObstacleConstraint< TDomain, TAlgebra >::extract_data(), ug::GlobalGridFunctionGradientData< TGridFunction >::GlobalGridFunctionGradientData(), ug::GlobalGridFunctionNumberData< TGridFunction, elemDim >::GlobalGridFunctionNumberData(), ug::Integral(), ug::IntegralNormalComponentOnManifoldSubsets(), ug::IntegrateDiscFlux(), ug::IntegrateNormalGradientOnManifold(), ug::IntegrateSubsets(), ug::Interpolate(), ug::InterpolateInner(), ug::InterpolateInnerDiff(), ug::MaxError(), ug::GridFunctionComponentSpace< TGridFunction >::norm2(), ug::VTKOutput< TDim >::print(), and ug::vtk_export_ho().
|
inline |
clear all subsets
References m_vSubset.
Referenced by ug::CreateSubsetGroups(), ug::OutNormCmp< TDomain >::OutNormCmp(), set_subset_handler(), SubsetGroup(), and ug::SubsetIndicatorUserData< TDomain >::SubsetIndicatorUserData().
bool ug::SubsetGroup::contains | ( | const char * | name | ) | const |
bool ug::SubsetGroup::contains | ( | int | si | ) | const |
returns true if subset is contained in this group
References ug::find(), is_init(), m_vSubset, and UG_THROW.
Referenced by ug::DegeneratedLayerManager< dim >::contains(), ug::SubsetIndicatorUserData< TDomain >::evaluate(), ug::OutNormCmp< TDomain >::evaluate(), ug::IntegralNormalComponentOnManifoldGeneral(), ug::FunctionPattern::Function::is_def_in_subset(), and ug::SubsetIndicatorUserData< TDomain >::operator()().
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().
|
inline |
returns if function group is empty
References m_vSubset.
Referenced by ug::OutNormCmp< TDomain >::evaluate().
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.
References dim(), is_init(), size(), and UG_THROW.
Referenced by ug::IApproximationSpace::add(), and ug::FunctionPattern::add().
|
inline |
vector of the subset indices in the group
References m_vSubset.
Referenced by ug::DomainRayTracer::init().
|
inlineprotected |
References m_pSH.
Referenced by add(), add_all(), contains(), dim(), get_highest_subset_dimension(), name(), operator[](), regular_grid(), and remove().
const char * ug::SubsetGroup::name | ( | size_t | i | ) | const |
|
inline |
bool ug::SubsetGroup::regular_grid | ( | size_t | i | ) | const |
returns if a subset is a regular grid
References is_init(), m_pSH, m_vSubset, size(), ug::SubsetIsRegularGrid(), and UG_THROW.
Referenced by 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_rhs(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::calc_error(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::finish_timestep_elem(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::init_all_exports(), and ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::prepare_timestep_elem().
void ug::SubsetGroup::remove | ( | const char * | name | ) |
void ug::SubsetGroup::remove | ( | const std::string & | name | ) |
removes subset with a given name from this group
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
[in] | name | Name of Subset(s) to be removed |
void ug::SubsetGroup::remove | ( | const SubsetGroup & | ssGroup | ) |
void ug::SubsetGroup::remove | ( | int | si | ) |
removes a subset from this group
References ug::find(), is_init(), m_vSubset, and UG_THROW.
Referenced by ug::FunctionPattern::all_subsets_grp_except_for(), remove(), and ug::RemoveLowerDimSubsets().
|
inline |
set an underlying subset handler
References clear(), and m_pSH.
Referenced by ug::FunctionPattern::add(), ug::CreateSubsetGroups(), and ug::DegeneratedLayerManager< dim >::DegeneratedLayerManager().
|
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_jacobian(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_linear(), ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::assemble_rhs(), 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::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().
|
inline |
get underlying subset handler
References m_pSH.
Referenced by ug::FunctionPattern::add(), add(), ug::SubsetIndicatorUserData< TDomain >::evaluate(), ug::OutNormCmp< TDomain >::evaluate(), and remove().
|
protected |
underlying SubsetHandler
Referenced by add(), add_all(), contains(), dim(), is_init(), name(), regular_grid(), remove(), set_subset_handler(), size(), and subset_handler().
|
protected |
selected Subset Indices
Referenced by add(), clear(), contains(), dim(), empty(), index_vector(), name(), operator[](), regular_grid(), remove(), and size().