Plugins
Loading...
Searching...
No Matches
ug::LevelSet::LSHeavisideIntegral< TGridFunction > Class Template Reference

#include <ls_integral.h>

Classes

struct  AddIntegrals
 helper class for the computation of the volumes More...
 

Public Types

typedef gf_type::algebra_type algebra_type
 algebra type
 
typedef gf_type::domain_type domain_type
 domain type
 
typedef TGridFunction gf_type
 type of the grid function
 
typedef GridFunction< domain_type, lsf_algebra_typels_gf_type
 grid function type for the LSF
 
typedef CPUAlgebra lsf_algebra_type
 algebra type for the LSF
 
typedef domain_type::position_accessor_type position_accessor_type
 type of the position accessor
 
typedef LSHeavisideIntegral< gf_typethis_type
 this type
 

Public Member Functions

void compute_for (SmartPtr< gf_type > sp_gf, const char *fct_name, number limval)
 computes the integrals
 
number ge_vol () const
 return the integral over the entire negative subdomain where gf <= limval
 
number ge_vol_over_subsets (const char *ss_names) const
 returns the volume for gf >= limval over the given subsets
 
number le_vol () const
 return the integral over the entire negative subdomain where gf <= limval
 
number le_vol_over_subsets (const char *ss_names) const
 returns the volume for gf <= limval over the given subsets
 
 LSHeavisideIntegral (SmartPtr< ls_gf_type > sp_lsf)
 Constructor.
 
void on_subsets (const char *ss_names)
 sets the subsets to restrict the computation on
 
virtual ~LSHeavisideIntegral ()
 Destructor.
 

Static Public Attributes

static const int dim = gf_type::dim
 world dimension
 

Private Member Functions

template<typename TElem >
void add_integrals_of_all ()
 adds contributions of all elements of a given type
 

Private Attributes

size_t m_fct
 the function inside of the grid function
 
number m_gevol
 
number m_levol
 the entire integral for gf >= limval and gf <= limval
 
number m_limval
 the switch value for the Heaviside function
 
SmartPtr< gf_typem_sp_gf
 the grid function
 
SmartPtr< ls_gf_typem_spLSF
 the specified LSF
 
std::vector< numberm_ss_gevol
 integrals over the subsets for gf >= limval
 
std::vector< numberm_ss_levol
 integrals over the subsets for gf <= limval
 
SubsetGroup m_ssGrp
 the subset group (if subsets specified)
 

Detailed Description

template<typename TGridFunction>
class ug::LevelSet::LSHeavisideIntegral< TGridFunction >

Class for integration of the 'Heaviside function' times a grid function in the elements

This class computes the volume of the part of the domain under the level set where a given grid function is less or eq. and greater or eq. then a given number.

Template Parameters
TGridFunctype of the grid function with the values to check

Member Typedef Documentation

◆ algebra_type

template<typename TGridFunction >
typedef gf_type::algebra_type ug::LevelSet::LSHeavisideIntegral< TGridFunction >::algebra_type

algebra type

◆ domain_type

template<typename TGridFunction >
typedef gf_type::domain_type ug::LevelSet::LSHeavisideIntegral< TGridFunction >::domain_type

domain type

◆ gf_type

template<typename TGridFunction >
typedef TGridFunction ug::LevelSet::LSHeavisideIntegral< TGridFunction >::gf_type

type of the grid function

◆ ls_gf_type

template<typename TGridFunction >
typedef GridFunction<domain_type, lsf_algebra_type> ug::LevelSet::LSHeavisideIntegral< TGridFunction >::ls_gf_type

grid function type for the LSF

◆ lsf_algebra_type

template<typename TGridFunction >
typedef CPUAlgebra ug::LevelSet::LSHeavisideIntegral< TGridFunction >::lsf_algebra_type

algebra type for the LSF

◆ position_accessor_type

template<typename TGridFunction >
typedef domain_type::position_accessor_type ug::LevelSet::LSHeavisideIntegral< TGridFunction >::position_accessor_type

type of the position accessor

◆ this_type

template<typename TGridFunction >
typedef LSHeavisideIntegral<gf_type> ug::LevelSet::LSHeavisideIntegral< TGridFunction >::this_type

this type

Constructor & Destructor Documentation

◆ LSHeavisideIntegral()

template<typename TGridFunction >
ug::LevelSet::LSHeavisideIntegral< TGridFunction >::LSHeavisideIntegral ( SmartPtr< ls_gf_type sp_lsf)
inline

Constructor.

Parameters
sp_lsfthe leve-set function (if any)

◆ ~LSHeavisideIntegral()

template<typename TGridFunction >
virtual ug::LevelSet::LSHeavisideIntegral< TGridFunction >::~LSHeavisideIntegral ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ add_integrals_of_all()

template<typename TGridFunc >
template<typename TElem >
void ug::LevelSet::LSHeavisideIntegral< TGridFunc >::add_integrals_of_all ( )
private

adds contributions of all elements of a given type

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

References ug::DoFRef(), ug::GridFunction< typename TDomain, typename TAlgebra >::domain(), ug::GridFunction< typename TDomain, typename TAlgebra >::inner_dof_indices(), ug::DoFDistributionInfoProvider::num_subsets(), and UG_THROW.

◆ compute_for()

template<typename TGridFunc >
void ug::LevelSet::LSHeavisideIntegral< TGridFunc >::compute_for ( SmartPtr< gf_type sp_gf,
const char *  fct_name,
number  limval 
)

computes the integrals

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

Parameters
sp_gfthe grid function
fct_name'function' to take the data from
limvalthe value for the Heaviside function

References pcl::ProcessCommunicator::allreduce(), ug::LFEID::LAGRANGE, PCL_RO_SUM, and UG_THROW.

◆ ge_vol()

template<typename TGridFunction >
number ug::LevelSet::LSHeavisideIntegral< TGridFunction >::ge_vol ( ) const
inline

return the integral over the entire negative subdomain where gf <= limval

References ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_gevol.

◆ ge_vol_over_subsets()

template<typename TGridFunc >
number ug::LevelSet::LSHeavisideIntegral< TGridFunc >::ge_vol_over_subsets ( const char *  ss_names) const

returns the volume for gf >= limval over the given subsets

Extracts the volume for gf >= limval over the given subsets

Parameters
ss_namesname of the subset

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

◆ le_vol()

template<typename TGridFunction >
number ug::LevelSet::LSHeavisideIntegral< TGridFunction >::le_vol ( ) const
inline

return the integral over the entire negative subdomain where gf <= limval

References ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_levol.

◆ le_vol_over_subsets()

template<typename TGridFunc >
number ug::LevelSet::LSHeavisideIntegral< TGridFunc >::le_vol_over_subsets ( const char *  ss_names) const

returns the volume for gf <= limval over the given subsets

Extracts the volume for gf <= limval over the given subsets

Parameters
ss_namesname of the subset

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

◆ on_subsets()

template<typename TGridFunction >
void ug::LevelSet::LSHeavisideIntegral< TGridFunction >::on_subsets ( const char *  ss_names)
inline

Member Data Documentation

◆ dim

template<typename TGridFunction >
const int ug::LevelSet::LSHeavisideIntegral< TGridFunction >::dim = gf_type::dim
static

world dimension

◆ m_fct

template<typename TGridFunction >
size_t ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_fct
private

the function inside of the grid function

◆ m_gevol

template<typename TGridFunction >
number ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_gevol
private

◆ m_levol

template<typename TGridFunction >
number ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_levol
private

the entire integral for gf >= limval and gf <= limval

Referenced by ug::LevelSet::LSHeavisideIntegral< TGridFunction >::le_vol().

◆ m_limval

template<typename TGridFunction >
number ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_limval
private

the switch value for the Heaviside function

◆ m_sp_gf

template<typename TGridFunction >
SmartPtr<gf_type> ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_sp_gf
private

◆ m_spLSF

template<typename TGridFunction >
SmartPtr<ls_gf_type> ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_spLSF
private

the specified LSF

◆ m_ss_gevol

template<typename TGridFunction >
std::vector<number> ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_ss_gevol
private

integrals over the subsets for gf >= limval

◆ m_ss_levol

template<typename TGridFunction >
std::vector<number> ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_ss_levol
private

integrals over the subsets for gf <= limval

◆ m_ssGrp

template<typename TGridFunction >
SubsetGroup ug::LevelSet::LSHeavisideIntegral< TGridFunction >::m_ssGrp
private

the subset group (if subsets specified)

Referenced by ug::LevelSet::LSHeavisideIntegral< TGridFunction >::on_subsets().


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