Plugins
Loading...
Searching...
No Matches
ug::LevelSet::LSVolume< TGridFunc > Class Template Reference

#include <ls_volume.h>

Classes

struct  AddVolumes
 helper class for the computation of the volumes More...
 
struct  AddWeightedVolumes
 helper class for the computation of the weighted volumes More...
 

Public Types

typedef grid_func_type::algebra_type algebra_type
 algebra type
 
typedef grid_func_type::domain_type domain_type
 domain type
 
typedef TGridFunc grid_func_type
 grid function type
 
typedef domain_type::position_accessor_type position_accessor_type
 type of the position accessor
 
typedef LSVolume< TGridFunc > this_type
 'this' type
 

Public Member Functions

void check_positivity (bool v)
 set the check-positivity flag
 
void compute ()
 computes the volumes
 
void compute (SmartPtr< UserData< number, dim > > spDensity)
 computes the weights (weighted volumes) without the time argument
 
void compute (SmartPtr< UserData< number, dim > > spDensity, number time)
 computes the weights (weighted volumes)
 
 LSVolume (SmartPtr< grid_func_type > spLSF)
 class constructor
 
void on_subsets (const char *ss_names)
 sets the subsets to restrict the computation on
 
void print_details () const
 prints the details
 
void volume_in_subsets (const char *ss_names, number &vol_plus, number &vol_minus) const
 extracts the volumes enclosed in given subsets
 
number volume_minus () const
 returns the volume of the negative part
 
number volume_minus_in_subsets (const char *ss_names) const
 returns the volume in the negative part of subsets
 
number volume_plus () const
 returns the volume in the positive part
 
number volume_plus_in_subsets (const char *ss_names) const
 returns the volume in the positive part of subsets
 

Static Public Attributes

static const int dim = domain_type::dim
 world dimension
 

Private Member Functions

template<typename TElem >
void add_volumes_of_all ()
 adds contributions of all elements of a given type
 
template<typename TElem >
void add_volumes_of_all (UserData< number, dim > *pDensity, number time)
 adds weighted contributions of all elements of a given type
 
void allreduce_volumes ()
 

Private Attributes

bool m_check_positivity
 if to check the positivity of the volumes in the elements
 
SmartPtr< TGridFunc > m_spLSF
 the specified LSF
 
std::vector< numberm_ss_vol_minus
 volume in the 'negative' subsets
 
std::vector< numberm_ss_vol_plus
 volume in the 'positive' subsets
 
SubsetGroup m_ssGrp
 the subset group (if subsets specified)
 
number m_volume_minus
 computed volume in the "negative part" of the domain
 
number m_volume_plus
 computed volume in the "positive part" of the domain
 

Detailed Description

template<typename TGridFunc>
class ug::LevelSet::LSVolume< TGridFunc >

A class for computation of the volume of the parts of the domain separated by the level set.

Template Parameters
TGridFunctype of the grid function for the LSF

Member Typedef Documentation

◆ algebra_type

template<typename TGridFunc >
typedef grid_func_type::algebra_type ug::LevelSet::LSVolume< TGridFunc >::algebra_type

algebra type

◆ domain_type

template<typename TGridFunc >
typedef grid_func_type::domain_type ug::LevelSet::LSVolume< TGridFunc >::domain_type

domain type

◆ grid_func_type

template<typename TGridFunc >
typedef TGridFunc ug::LevelSet::LSVolume< TGridFunc >::grid_func_type

grid function type

◆ position_accessor_type

template<typename TGridFunc >
typedef domain_type::position_accessor_type ug::LevelSet::LSVolume< TGridFunc >::position_accessor_type

type of the position accessor

◆ this_type

template<typename TGridFunc >
typedef LSVolume<TGridFunc> ug::LevelSet::LSVolume< TGridFunc >::this_type

'this' type

Constructor & Destructor Documentation

◆ LSVolume()

template<typename TGridFunc >
ug::LevelSet::LSVolume< TGridFunc >::LSVolume ( SmartPtr< grid_func_type spLSF)
inline

class constructor

Parameters
spLSFthe grid function with the LSF

Member Function Documentation

◆ add_volumes_of_all() [1/2]

template<typename TGridFunc >
template<typename TElem >
void ug::LevelSet::LSVolume< TGridFunc >::add_volumes_of_all ( )
private

adds contributions of all elements of a given type

Sums up the (partial) volumes of all the elements of one type.

References ug::LevelSet::LSElementSize< TRefElem, WDim >::compute(), ug::DoFRef(), UG_LOG, and UG_THROW.

◆ add_volumes_of_all() [2/2]

template<typename TGridFunc >
template<typename TElem >
void ug::LevelSet::LSVolume< TGridFunc >::add_volumes_of_all ( UserData< number, dim > *  pDensity,
number  time 
)
private

adds weighted contributions of all elements of a given type

Sums up the (partial) volumes of all the elements of one type with weights.

Parameters
pDensitythe weight (density) function
timethe time argument for the density

References ug::LevelSet::LSElementSize< TRefElem, WDim >::compute(), ug::DoFRef(), UG_LOG, and UG_THROW.

◆ allreduce_volumes()

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::allreduce_volumes ( )
private

Sum up the volumes from different processes

References pcl::ProcessCommunicator::allreduce(), and PCL_RO_SUM.

◆ check_positivity()

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::check_positivity ( bool  v)
inline

set the check-positivity flag

References ug::LevelSet::LSVolume< TGridFunc >::m_check_positivity.

◆ compute() [1/3]

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::compute ( )

computes the volumes

Sums up the (partial) volumes of all the elements of all the types.

Referenced by ug::LevelSet::LSVolume< TGridFunc >::compute().

◆ compute() [2/3]

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::compute ( SmartPtr< UserData< number, dim > >  spDensity)
inline

computes the weights (weighted volumes) without the time argument

Parameters
spDensitythe weight (density) function

References ug::LevelSet::LSVolume< TGridFunc >::compute().

◆ compute() [3/3]

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::compute ( SmartPtr< UserData< number, dim > >  spDensity,
number  time 
)

computes the weights (weighted volumes)

Sums up the (partial) weights (weighted volumes) of all the elements of all the types.

Parameters
spDensitythe weight (density) function
timethe time argument for the density

◆ on_subsets()

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::on_subsets ( const char *  ss_names)

sets the subsets to restrict the computation on

Initializes the subsets group to restrict the computation to the specified subsets.

Parameters
ss_namesnames of the subsets

References ug::TokenizeString().

◆ print_details()

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::print_details ( ) const

prints the details

Prints the details over the subsets

References UG_LOG.

◆ volume_in_subsets()

template<typename TGridFunc >
void ug::LevelSet::LSVolume< TGridFunc >::volume_in_subsets ( const char *  ss_names,
number vol_plus,
number vol_minus 
) const

extracts the volumes enclosed in given subsets

Extracts the volumes enclosed in given subsets

Parameters
ss_namesname of the subset
vol_plusthe "positive" volume
vol_minusthe "negative" volume

References ug::SubsetGroup::add(), ug::SubsetGroup::size(), and ug::TokenizeString().

Referenced by ug::LevelSet::LSVolume< TGridFunc >::volume_minus_in_subsets(), and ug::LevelSet::LSVolume< TGridFunc >::volume_plus_in_subsets().

◆ volume_minus()

template<typename TGridFunc >
number ug::LevelSet::LSVolume< TGridFunc >::volume_minus ( ) const
inline

returns the volume of the negative part

References ug::LevelSet::LSVolume< TGridFunc >::m_volume_minus.

◆ volume_minus_in_subsets()

template<typename TGridFunc >
number ug::LevelSet::LSVolume< TGridFunc >::volume_minus_in_subsets ( const char *  ss_names) const
inline

returns the volume in the negative part of subsets

Parameters
ss_namesname of the subset

References ug::LevelSet::LSVolume< TGridFunc >::volume_in_subsets().

◆ volume_plus()

template<typename TGridFunc >
number ug::LevelSet::LSVolume< TGridFunc >::volume_plus ( ) const
inline

returns the volume in the positive part

References ug::LevelSet::LSVolume< TGridFunc >::m_volume_plus.

◆ volume_plus_in_subsets()

template<typename TGridFunc >
number ug::LevelSet::LSVolume< TGridFunc >::volume_plus_in_subsets ( const char *  ss_names) const
inline

returns the volume in the positive part of subsets

Parameters
ss_namesname of the subset

References ug::LevelSet::LSVolume< TGridFunc >::volume_in_subsets().

Member Data Documentation

◆ dim

template<typename TGridFunc >
const int ug::LevelSet::LSVolume< TGridFunc >::dim = domain_type::dim
static

world dimension

◆ m_check_positivity

template<typename TGridFunc >
bool ug::LevelSet::LSVolume< TGridFunc >::m_check_positivity
private

if to check the positivity of the volumes in the elements

Referenced by ug::LevelSet::LSVolume< TGridFunc >::check_positivity().

◆ m_spLSF

template<typename TGridFunc >
SmartPtr<TGridFunc> ug::LevelSet::LSVolume< TGridFunc >::m_spLSF
private

the specified LSF

◆ m_ss_vol_minus

template<typename TGridFunc >
std::vector<number> ug::LevelSet::LSVolume< TGridFunc >::m_ss_vol_minus
private

volume in the 'negative' subsets

◆ m_ss_vol_plus

template<typename TGridFunc >
std::vector<number> ug::LevelSet::LSVolume< TGridFunc >::m_ss_vol_plus
private

volume in the 'positive' subsets

◆ m_ssGrp

template<typename TGridFunc >
SubsetGroup ug::LevelSet::LSVolume< TGridFunc >::m_ssGrp
private

the subset group (if subsets specified)

◆ m_volume_minus

template<typename TGridFunc >
number ug::LevelSet::LSVolume< TGridFunc >::m_volume_minus
private

computed volume in the "negative part" of the domain

Referenced by ug::LevelSet::LSVolume< TGridFunc >::volume_minus().

◆ m_volume_plus

template<typename TGridFunc >
number ug::LevelSet::LSVolume< TGridFunc >::m_volume_plus
private

computed volume in the "positive part" of the domain

Referenced by ug::LevelSet::LSVolume< TGridFunc >::volume_plus().


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