ug4
ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > Class Template Reference

Global assembler based on the ghost-fluid method with a level-set function. More...

#include <dom_disc_embb.h>

+ Inheritance diagram for ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >:

Public Types

typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef ApproximationSpace< domain_typeapprox_space_type
 type of approximation space More...
 
typedef TDomain domain_type
 Domain type. More...
 
typedef TExtrapolation extrapolation_type
 Extrapolation type. More...
 
typedef extrapolation_type::ls_grid_func_type ls_grid_func_type
 Grid function type for the LSF. More...
 
typedef algebra_type::matrix_type matrix_type
 Matrix type in the algebra. More...
 
typedef algebra_type::vector_type vector_type
 Vector type in the algebra. More...
 

Public Member Functions

template<typename TElem , typename TIterator >
void AssembleDefect (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, vector_type &d, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleDefect (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, vector_type &d, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleJacobian (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &J, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleJacobian (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &J, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number s_a0, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleLinear (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &A, vector_type &rhs, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleLinear (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &A, vector_type &rhs, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleMassMatrix (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &M, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void AssembleStiffnessMatrix (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &A, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
int check_elem_lsf (size_t n_co, GridObject *pElem, int si, int g_level, bool use_hanging, const MathVector< dim > vCornerCoords[], number time)
 checks whether the element is intersected by the interface, or what, and prepares the data More...
 
virtual void clear_outer_values (vector_type &d, const DoFDistribution *dd) const
 sets the values at the outer vertices to 0 More...
 
bool corner_inside (size_t co) const
 returns true if the corner is "inside" (use after check_elem_lsf) More...
 
void exclude_subsets (SmartPtr< approx_space_type > spApproxSpace, const char *subset_names)
 excludes a (boundary) subsets from the extrapolation More...
 
void extrapolate_by_lsf (size_t num_co, number *u, size_t fct) const
 extrapolates a component the solution to the vertices behind the interface (by averaging) More...
 
void extrapolate_by_lsf (size_t num_co, size_t base_co, number *u, size_t fct) const
 extrapolates a component the solution to the vertices behind the interface (w.r.t. a base corner) More...
 
extrapolation_typeextrapolation ()
 returns the extrapolation More...
 
void FinishTimestep (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void FinishTimestepElem (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
number lsf_at (size_t co) const
 returns the effective value of the LSF at a corner (use after check_elem_lsf) More...
 
 LSGFGlobAssembler ()
 class constructor (may not have any arguments!) More...
 
void prepare_interface_bc (SmartPtr< approx_space_type > spApproxSpace)
 prepares the boundary conditions at the interface: sets all them to Dirichlet-0 More...
 
void PrepareTimestep (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
void PrepareTimestepElem (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
void project_LSF ()
 project the level-set function to the coarse levels More...
 
void set_assemble_only_cut (bool b)
 set the "assemble only in cut elements" flag More...
 
void set_Dirichlet_on_if_for (SmartPtr< approx_space_type > spApproxSpace, const char *fct_name, number value)
 adds a Dirichlet BC with a given value on the interface More...
 
void set_Dirichlet_on_if_for (SmartPtr< approx_space_type > spApproxSpace, const char *fct_name, SmartPtr< CplUserData< number, dim > > func)
 adds a Dirichlet BC with a given value on the interface More...
 
void set_LSF (SmartPtr< ls_grid_func_type > spLSF)
 set the level-set function and check it More...
 
void set_Neumann0_on_if_for (SmartPtr< approx_space_type > spApproxSpace, const char *fct_name)
 adds a Neumann-0 with on the interface More...
 
virtual void set_outer_matrices (matrix_type &A, const DoFDistribution *dd) const
 sets the matrices at outer vertices to identity More...
 
virtual void set_outer_values (vector_type &u, const DoFDistribution *dd, number time)
 sets the values at the outer vertices to given values More...
 
void set_plain_Dirichlet_on_if_for (SmartPtr< approx_space_type > spApproxSpace, const char *fct_name, number value)
 adds a "plain" Dirichlet BC with a given value on the interface More...
 
void set_plain_Dirichlet_on_if_for (SmartPtr< approx_space_type > spApproxSpace, const char *fct_name, SmartPtr< CplUserData< number, dim > > func)
 adds a "plain" Dirichlet BC with a given value on the interface More...
 
virtual ~LSGFGlobAssembler ()
 virtual destructor More...
 

Static Public Member Functions

template<typename TElem , typename TIterator >
static void AssembleErrorEstimator (const std::vector< IElemError< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, const vector_type &u)
 
template<typename TElem , typename TIterator >
static void AssembleErrorEstimator (const std::vector< IElemError< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, std::vector< number > vScaleMass, std::vector< number > vScaleStiff, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
 
template<typename TElem , typename TIterator >
static void AssembleRhs (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, vector_type &rhs, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 
template<typename TElem , typename TIterator >
static void AssembleRhs (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, vector_type &rhs, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
 

Static Public Attributes

static const int dim = TDomain::dim
 world dimension More...
 

Private Attributes

bool m_bAssembleOnlyCut
 
extrapolation_type m_extrapol
 the extrapolation at the interface More...
 

Detailed Description

template<typename TDomain, typename TAlgebra, typename TExtrapolation>
class ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >

Global assembler based on the ghost-fluid method with a level-set function.

Template class of the global assembler based on the ghost-fluid method with a piecewise linear level-set function.

Template Parameters
TDomaindomain type
TAlgebraalgebra type
TExtrapolationextrapolation class

Member Typedef Documentation

◆ algebra_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef TAlgebra ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::algebra_type

Algebra type.

◆ approx_space_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef ApproximationSpace<domain_type> ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::approx_space_type

type of approximation space

◆ domain_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef TDomain ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::domain_type

Domain type.

◆ extrapolation_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef TExtrapolation ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::extrapolation_type

Extrapolation type.

◆ ls_grid_func_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef extrapolation_type::ls_grid_func_type ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::ls_grid_func_type

Grid function type for the LSF.

◆ matrix_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef algebra_type::matrix_type ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::matrix_type

Matrix type in the algebra.

◆ vector_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef algebra_type::vector_type ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::vector_type

Vector type in the algebra.

Constructor & Destructor Documentation

◆ LSGFGlobAssembler()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::LSGFGlobAssembler ( )
inline

class constructor (may not have any arguments!)

◆ ~LSGFGlobAssembler()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::~LSGFGlobAssembler ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ AssembleDefect() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleDefect ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
vector_type d,
const vector_type u,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Defect in the stationary case. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]ddefect
[in]usolution
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::hex_rules::NUM_VERTICES, ug::LocalVector::resize(), ug::RHS, ug::LocalVector::scale_append(), ug::STIFF, ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ AssembleDefect() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleDefect ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
vector_type d,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
const std::vector< number > &  vScaleMass,
const std::vector< number > &  vScaleStiff,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Defect in the instationary case. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]ddefect
[in]vSolcurrent and previous solutions
[in]vScaleMassscaling factors for mass part
[in]vScaleStiffscaling factors for stiffness part
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::EXPL, ug::FillCornerCoordinates(), ug::MASS, ug::hex_rules::NUM_VERTICES, ug::PT_INSTATIONARY, ug::PT_STATIONARY, ug::LocalVectorTimeSeries::read_times(), ug::LocalVectorTimeSeries::read_values(), ug::LocalVector::resize(), ug::RHS, ug::LocalVector::scale_append(), ug::LocalVectorTimeSeries::solution(), ug::STIFF, ug::GridLevel::TOP, UG_CATCH_THROW, and UG_THROW.

◆ AssembleErrorEstimator() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
static void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleErrorEstimator ( const std::vector< IElemError< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
const vector_type u 
)
inlinestatic

References UG_THROW.

◆ AssembleErrorEstimator() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
static void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleErrorEstimator ( const std::vector< IElemError< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
std::vector< number vScaleMass,
std::vector< number vScaleStiff,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol 
)
inlinestatic

References UG_THROW.

◆ AssembleJacobian() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleJacobian ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
matrix_type J,
const vector_type u,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Jacobian in the stationary case. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]Jjacobian
[in]usolution
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::hex_rules::NUM_VERTICES, ug::LocalVector::resize(), ug::LocalMatrix::resize(), ug::RHS, ug::STIFF, ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ AssembleJacobian() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleJacobian ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
matrix_type J,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
number  s_a0,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Jacobian in the time-dependent case. Note, that s_m0 == 1 (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]Jjacobian
[in]vSolcurrent and previous solutions
[in]s_a0scaling factor for stiffness part
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::MASS, ug::hex_rules::NUM_VERTICES, ug::PT_INSTATIONARY, ug::PT_STATIONARY, ug::LocalVectorTimeSeries::read_times(), ug::LocalVectorTimeSeries::read_values(), ug::LocalVector::resize(), ug::LocalMatrix::resize(), ug::RHS, ug::LocalVectorTimeSeries::size(), ug::LocalVectorTimeSeries::solution(), ug::STIFF, ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ AssembleLinear() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleLinear ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
matrix_type A,
vector_type rhs,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Matrix and the global Right-Hand Side of the Linear problem in the stationary case. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]AMatrix
[in,out]rhsRight-hand side
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::hex_rules::NUM_VERTICES, ug::LocalVector::resize(), ug::LocalMatrix::resize(), ug::RHS, ug::STIFF, ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ AssembleLinear() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleLinear ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
matrix_type A,
vector_type rhs,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
const std::vector< number > &  vScaleMass,
const std::vector< number > &  vScaleStiff,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Matrix and the global Right-Hand Side of the Linear problem in the time-dependent case. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]AMatrix
[in,out]rhsRight-hand side
[in]vSolcurrent and previous solutions
[in]vScaleMassscaling factors for mass part
[in]vScaleStiffscaling factors for stiffness part
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::MASS, ug::hex_rules::NUM_VERTICES, ug::PT_INSTATIONARY, ug::PT_STATIONARY, ug::LocalVectorTimeSeries::read_times(), ug::LocalVectorTimeSeries::read_values(), ug::LocalVector::resize(), ug::LocalMatrix::resize(), ug::RHS, ug::LocalVector::scale_append(), ug::LocalMatrix::scale_append(), ug::LocalVectorTimeSeries::solution(), ug::STIFF, ug::GridLevel::TOP, UG_CATCH_THROW, and UG_THROW.

◆ AssembleMassMatrix()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleMassMatrix ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
matrix_type M,
const vector_type u,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Mass matrix. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]MMass matrix
[in]usolution
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::MASS, ug::hex_rules::NUM_VERTICES, ug::LocalVector::resize(), ug::LocalMatrix::resize(), ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ AssembleRhs() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
static void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleRhs ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
vector_type rhs,
const vector_type u,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)
inlinestatic

References UG_THROW.

◆ AssembleRhs() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
static void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleRhs ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
vector_type rhs,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
const std::vector< number > &  vScaleMass,
const std::vector< number > &  vScaleStiff,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)
inlinestatic

References UG_THROW.

◆ AssembleStiffnessMatrix()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::AssembleStiffnessMatrix ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
matrix_type A,
const vector_type u,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function adds the contributions of all passed element discretizations on one given subset to the global Stiffness matrix. (This version processes elements in a given interval.)

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in,out]AStiffness matrix
[in]usolution
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::hex_rules::NUM_VERTICES, ug::LocalVector::resize(), ug::LocalMatrix::resize(), ug::STIFF, ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ check_elem_lsf()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
int ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::check_elem_lsf ( size_t  n_co,
GridObject pElem,
int  si,
int  g_level,
bool  use_hanging,
const MathVector< dim vCornerCoords[],
number  time 
)
inline

checks whether the element is intersected by the interface, or what, and prepares the data

Parameters
n_conumber of the corners of the element
pElemthe element to process
sisubset of the element
g_levelgrid level of the element
use_hangingif there can be hanging nodes
vCornerCoordscoordinates of the corners of the element
timethe phisical time

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::check_elem_lsf().

◆ clear_outer_values()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::clear_outer_values ( vector_type d,
const DoFDistribution dd 
) const
inlinevirtual

sets the values at the outer vertices to 0

Parameters
dthe vector where to set
dddof distribution of the grid function to reset

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

◆ corner_inside()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
bool ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::corner_inside ( size_t  co) const
inline

returns true if the corner is "inside" (use after check_elem_lsf)

Parameters
cothe corner

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::corner_inside().

◆ exclude_subsets()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::exclude_subsets ( SmartPtr< approx_space_type spApproxSpace,
const char *  subset_names 
)
inline

excludes a (boundary) subsets from the extrapolation

Parameters
spApproxSpacethe approximation space of the domain discretization
subset_namesnames of the subsets to exclude

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::exclude_subsets().

◆ extrapolate_by_lsf() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::extrapolate_by_lsf ( size_t  num_co,
number u,
size_t  fct 
) const
inline

extrapolates a component the solution to the vertices behind the interface (by averaging)

Parameters
num_conumber of the corners
unodal values to extrapolate
fctindex of the function (to identify to type of the extrapolation)

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

◆ extrapolate_by_lsf() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::extrapolate_by_lsf ( size_t  num_co,
size_t  base_co,
number u,
size_t  fct 
) const
inline

extrapolates a component the solution to the vertices behind the interface (w.r.t. a base corner)

Parameters
num_conumber of the corners
base_cothe base corner
unodal values to extrapolate
fctindex of the function (to identify to type of the extrapolation)

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::extrapolate_by_lsf().

◆ extrapolation()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
extrapolation_type& ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::extrapolation ( )
inline

◆ FinishTimestep()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::FinishTimestep ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< DoFDistribution dd,
bool  bNonRegularGrid,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function finishes the global discretization for a time-stepping scheme by calling the "finish_timestep" methods of all passed element discretizations.

Parameters
[in]vElemDiscelement discretizations
[in]ddDoF Distribution
[in]bNonRegularGridflag to indicate if non regular grid is used
[in]vSolcurrent and previous solutions
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::bridge::AlgebraTypeIDProvider::id(), ug::bridge::AlgebraTypeIDProvider::instance(), ug::NONE, ug::LocalVectorTimeSeries::read_times(), and UG_CATCH_THROW.

◆ FinishTimestepElem()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::FinishTimestepElem ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function finalizes the global discretization in a time-stepping scheme by calling the "finish_timestep_elem" methods of all passed element discretizations on one given subset. (This version processes elements in a given interval.)

REMARK: This version does not extrapolate anything. It merely skips outer elements.

Parameters
[in]vElemDiscelement discretizations
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in]vSolcurrent and previous solutions
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::NONE, ug::hex_rules::NUM_VERTICES, ug::LocalVectorTimeSeries::read_times(), ug::LocalVectorTimeSeries::read_values(), ug::LocalVector::resize(), ug::LocalVectorTimeSeries::time(), ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ lsf_at()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
number ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::lsf_at ( size_t  co) const
inline

returns the effective value of the LSF at a corner (use after check_elem_lsf)

Parameters
cothe corner

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::lsf_at().

◆ prepare_interface_bc()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::prepare_interface_bc ( SmartPtr< approx_space_type spApproxSpace)
inline

prepares the boundary conditions at the interface: sets all them to Dirichlet-0

Parameters
spApproxSpacethe approximation space of the domain discretization

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::LSGFDomainDiscretization().

◆ PrepareTimestep()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::PrepareTimestep ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< DoFDistribution dd,
bool  bNonRegularGrid,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
number  future_time,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function prepares the global discretization for a time-stepping scheme by calling the "prepare_timestep" methods of all passed element discretizations.

Parameters
[in]vElemDiscelement discretizations
[in]ddDoF Distribution
[in]bNonRegularGridflag to indicate if non regular grid is used
[in]vSolcurrent and previous solutions
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::bridge::AlgebraTypeIDProvider::id(), ug::bridge::AlgebraTypeIDProvider::instance(), ug::NONE, ug::LocalVectorTimeSeries::read_times(), and UG_CATCH_THROW.

◆ PrepareTimestepElem()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
template<typename TElem , typename TIterator >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::PrepareTimestepElem ( const std::vector< IElemDisc< domain_type > * > &  vElemDisc,
ConstSmartPtr< domain_type spDomain,
ConstSmartPtr< DoFDistribution dd,
TIterator  iterBegin,
TIterator  iterEnd,
int  si,
bool  bNonRegularGrid,
ConstSmartPtr< VectorTimeSeries< vector_type > >  vSol,
ConstSmartPtr< AssemblingTuner< TAlgebra > >  spAssTuner 
)

This function prepares the global discretization for a time-stepping scheme by calling the "prepare_timestep_elem" methods of all passed element discretizations on one given subset. (This version processes elements in a given interval.)

REMARK: This version does not extrapolate anything. It merely skips outer elements.

Parameters
[in]vElemDiscelement discretizations
[in]spDomaindomain
[in]ddDoF Distribution
[in]iterBeginelement iterator
[in]iterEndelement iterator
[in]sisubset index
[in]bNonRegularGridflag to indicate if non regular grid is used
[in]vSolcurrent and previous solutions
[in]spAssTunerassemble adapter

References ug::bridge::AlgebraCommon::Eval(), ug::FillCornerCoordinates(), ug::GetLocalVector(), ug::NONE, ug::hex_rules::NUM_VERTICES, ug::LocalVectorTimeSeries::read_times(), ug::LocalVectorTimeSeries::read_values(), ug::LocalVector::resize(), ug::GridLevel::TOP, and UG_CATCH_THROW.

◆ project_LSF()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::project_LSF ( )
inline

◆ set_assemble_only_cut()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_assemble_only_cut ( bool  b)
inline

◆ set_Dirichlet_on_if_for() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_Dirichlet_on_if_for ( SmartPtr< approx_space_type spApproxSpace,
const char *  fct_name,
number  value 
)
inline

adds a Dirichlet BC with a given value on the interface

Parameters
spApproxSpacethe approximation space of the domain discretization
fct_namefunction to impose the condition for
valuethe Dirichlet value

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::set_Dirichlet_on_if_for().

◆ set_Dirichlet_on_if_for() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_Dirichlet_on_if_for ( SmartPtr< approx_space_type spApproxSpace,
const char *  fct_name,
SmartPtr< CplUserData< number, dim > >  func 
)
inline

adds a Dirichlet BC with a given value on the interface

Parameters
spApproxSpacethe approximation space of the domain discretization
fct_namefunction to impose the condition for
functhe Dirichlet function

References func(), and ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

◆ set_LSF()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_LSF ( SmartPtr< ls_grid_func_type spLSF)
inline

set the level-set function and check it

Parameters
spLSFthe function to set

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::set_LSF().

◆ set_Neumann0_on_if_for()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_Neumann0_on_if_for ( SmartPtr< approx_space_type spApproxSpace,
const char *  fct_name 
)
inline

adds a Neumann-0 with on the interface

Parameters
spApproxSpacethe approximation space of the domain discretization
fct_namefunction to impose the condition for

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::set_Neumann0_on_if_for().

◆ set_outer_matrices()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_outer_matrices ( matrix_type A,
const DoFDistribution dd 
) const
inlinevirtual

sets the matrices at outer vertices to identity

Parameters
Athe vector where to set
dddof distribution of the grid function to reset

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

◆ set_outer_values()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_outer_values ( vector_type u,
const DoFDistribution dd,
number  time 
)
inlinevirtual

sets the values at the outer vertices to given values

Parameters
uthe vector where to set
dddof distribution of the grid function to reset
timethe physical time

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

◆ set_plain_Dirichlet_on_if_for() [1/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_plain_Dirichlet_on_if_for ( SmartPtr< approx_space_type spApproxSpace,
const char *  fct_name,
number  value 
)
inline

adds a "plain" Dirichlet BC with a given value on the interface

Parameters
spApproxSpacethe approximation space of the domain discretization
fct_namefunction to impose the condition for
valuethe Dirichlet value

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

◆ set_plain_Dirichlet_on_if_for() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_plain_Dirichlet_on_if_for ( SmartPtr< approx_space_type spApproxSpace,
const char *  fct_name,
SmartPtr< CplUserData< number, dim > >  func 
)
inline

adds a "plain" Dirichlet BC with a given value on the interface

Parameters
spApproxSpacethe approximation space of the domain discretization
fct_namefunction to impose the condition for
functhe Dirichlet function

References func(), and ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_extrapol.

Referenced by ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::set_plain_Dirichlet_on_if_for().

Member Data Documentation

◆ dim

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
const int ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::dim = TDomain::dim
static

world dimension

◆ m_bAssembleOnlyCut

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
bool ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::m_bAssembleOnlyCut
private

The following flag is used only for research purposes (measuring the volume sources/sinks at the embedded interface etc.). It switches off assembing in all inner elements (i.e. makes the procedures to assemble only in the cut elements:

Referenced by ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_assemble_only_cut().

◆ m_extrapol


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