Plugins
Loading...
Searching...
No Matches
ug::smile::SmartRescaler< TDomain, TAlgebra > Class Template Reference

#include <smile_rescale.hpp>

Classes

struct  GetScalingFactors
 Helper class for the computation of the factors. More...
 

Public Types

typedef ANumber a_factor_type
 Attachment type for the factors.
 
typedef Grid::VertexAttachmentAccessor< a_factor_typeaa_factor_type
 Attachment accessor type for the factors.
 
typedef TAlgebra algebra_type
 Type of algebra.
 
typedef TDomain domain_type
 Type of Domain.
 
typedef UserData< number, WDimfactor_type
 User data scaling factor type.
 
typedef GridFunction< domain_type, algebra_typegf_type
 Grid function type.
 
typedef TDomain::grid_type grid_type
 Type of Grid:
 
typedef domain_type::position_accessor_type position_accessor_type
 Type of the position accessor.
 
typedef domain_type::position_type position_type
 Type of the position coordinate vectors.
 
typedef domain_type::subset_handler_type subset_handler_type
 Type of subset handler.
 

Public Member Functions

void divide (SmartPtr< gf_type > gf, const char *cmps)
 Divide the given components of the grid function by the factors.
 
void multiply (SmartPtr< gf_type > gf, const char *cmps)
 Multiplies the given components of the grid function by the factors.
 
void set_factor (SmartPtr< factor_type > factor)
 Sets the scaling factor.
 
 SmartRescaler ()
 Constructor.
 

Static Public Attributes

static const int WDim = TDomain::dim
 World dimention.
 

Private Types

typedef SmartRescaler< TDomain, TAlgebra > this_type
 This type.
 

Private Member Functions

void get_scaling_factors (gf_type &gf, a_factor_type &factor)
 Compute (sum up) the scaling factors (over the entire grid)
 
template<typename TElem >
void get_scaling_factors_for_ (int si, gf_type &gf, aa_factor_type &factor)
 Compute (sum up) the scaling factors (for one element type)
 

Private Attributes

SmartPtr< factor_typem_spFactor
 

Detailed Description

template<typename TDomain, typename TAlgebra>
class ug::smile::SmartRescaler< TDomain, TAlgebra >

A class for rescaling grid functions with values computed by a user data object

Member Typedef Documentation

◆ a_factor_type

template<typename TDomain , typename TAlgebra >
typedef ANumber ug::smile::SmartRescaler< TDomain, TAlgebra >::a_factor_type

Attachment type for the factors.

◆ aa_factor_type

template<typename TDomain , typename TAlgebra >
typedef Grid::VertexAttachmentAccessor<a_factor_type> ug::smile::SmartRescaler< TDomain, TAlgebra >::aa_factor_type

Attachment accessor type for the factors.

◆ algebra_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra ug::smile::SmartRescaler< TDomain, TAlgebra >::algebra_type

Type of algebra.

◆ domain_type

template<typename TDomain , typename TAlgebra >
typedef TDomain ug::smile::SmartRescaler< TDomain, TAlgebra >::domain_type

Type of Domain.

◆ factor_type

template<typename TDomain , typename TAlgebra >
typedef UserData<number, WDim> ug::smile::SmartRescaler< TDomain, TAlgebra >::factor_type

User data scaling factor type.

◆ gf_type

template<typename TDomain , typename TAlgebra >
typedef GridFunction<domain_type, algebra_type> ug::smile::SmartRescaler< TDomain, TAlgebra >::gf_type

Grid function type.

◆ grid_type

template<typename TDomain , typename TAlgebra >
typedef TDomain::grid_type ug::smile::SmartRescaler< TDomain, TAlgebra >::grid_type

Type of Grid:

◆ position_accessor_type

template<typename TDomain , typename TAlgebra >
typedef domain_type::position_accessor_type ug::smile::SmartRescaler< TDomain, TAlgebra >::position_accessor_type

Type of the position accessor.

◆ position_type

template<typename TDomain , typename TAlgebra >
typedef domain_type::position_type ug::smile::SmartRescaler< TDomain, TAlgebra >::position_type

Type of the position coordinate vectors.

◆ subset_handler_type

template<typename TDomain , typename TAlgebra >
typedef domain_type::subset_handler_type ug::smile::SmartRescaler< TDomain, TAlgebra >::subset_handler_type

Type of subset handler.

◆ this_type

template<typename TDomain , typename TAlgebra >
typedef SmartRescaler<TDomain, TAlgebra> ug::smile::SmartRescaler< TDomain, TAlgebra >::this_type
private

This type.

Constructor & Destructor Documentation

◆ SmartRescaler()

template<typename TDomain , typename TAlgebra >
ug::smile::SmartRescaler< TDomain, TAlgebra >::SmartRescaler ( )
inline

Constructor.

Member Function Documentation

◆ divide()

template<typename TDomain , typename TAlgebra >
void ug::smile::SmartRescaler< TDomain, TAlgebra >::divide ( SmartPtr< gf_type gf,
const char *  cmps 
)

Divide the given components of the grid function by the factors.

Parameters
gfthe grid function to rescale
cmpscomponent to rescale

References ug::DoFRef().

◆ get_scaling_factors()

template<typename TDomain , typename TAlgebra >
void ug::smile::SmartRescaler< TDomain, TAlgebra >::get_scaling_factors ( gf_type gf,
a_factor_type factor 
)
private

Compute (sum up) the scaling factors (over the entire grid)

Parameters
gfthe grid function
factorattachment for the factors at vertices

References ug::GridFunction< typename TDomain, typename TAlgebra >::domain(), ug::DoFDistributionInfoProvider::function_pattern(), PCL_RO_SUM, ug::SetAttachmentValues(), and UG_THROW.

◆ get_scaling_factors_for_()

template<typename TDomain , typename TAlgebra >
template<typename TElem >
void ug::smile::SmartRescaler< TDomain, TAlgebra >::get_scaling_factors_for_ ( int  si,
gf_type gf,
aa_factor_type factor 
)
private

Compute (sum up) the scaling factors (for one element type)

Parameters
sisubset index
gfthe grid function
factorattachment accessor for the factors at vertices

References ug::GridFunction< typename TDomain, typename TAlgebra >::domain(), ug::GeomProvider< typename TGeom >::get(), ug::GetLocalVector(), ug::GridFunction< typename TDomain, typename TAlgebra >::indices(), ug::LocalVector::resize(), and UG_CATCH_THROW.

◆ multiply()

template<typename TDomain , typename TAlgebra >
void ug::smile::SmartRescaler< TDomain, TAlgebra >::multiply ( SmartPtr< gf_type gf,
const char *  cmps 
)

Multiplies the given components of the grid function by the factors.

Parameters
gfthe grid function to rescale
cmpscomponent to rescale

References ug::DoFRef().

◆ set_factor()

template<typename TDomain , typename TAlgebra >
void ug::smile::SmartRescaler< TDomain, TAlgebra >::set_factor ( SmartPtr< factor_type factor)
inline

Sets the scaling factor.

References ug::smile::SmartRescaler< TDomain, TAlgebra >::m_spFactor.

Member Data Documentation

◆ m_spFactor

template<typename TDomain , typename TAlgebra >
SmartPtr<factor_type> ug::smile::SmartRescaler< TDomain, TAlgebra >::m_spFactor
private

◆ WDim

template<typename TDomain , typename TAlgebra >
const int ug::smile::SmartRescaler< TDomain, TAlgebra >::WDim = TDomain::dim
static

World dimention.


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