Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation > Class Template Reference

domain discretization for the Level-Set Ghost-Fluid method More...

#include <dom_disc_embb.h>

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

Public Types

typedef TAlgebra algebra_type
 Type of algebra.
 
typedef ApproximationSpace< TDomain > approx_space_type
 Type of approximation space.
 
typedef TDomain domain_type
 Type of Domain.
 
typedef TDomain::grid_type grid_type
 Type of the grid.
 
typedef gass_type::ls_grid_func_type ls_grid_func_type
 Type of the LSF grid functions.
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix.
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::DomainDiscretizationBase< TDomain, TAlgebra, LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > >
typedef TAlgebra algebra_type
 Type of algebra.
 
typedef ApproximationSpace< TDomain > approx_space_type
 Type of approximation space.
 
typedef TDomain domain_type
 Type of Domain.
 
typedef CPUAlgebra::vector_type error_vector_type
 Type of error vector.
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix.
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::IDomainDiscretization< TAlgebra >
typedef TAlgebra algebra_type
 Algebra type.
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix.
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::IAssemble< TAlgebra >
typedef TAlgebra algebra_type
 Algebra type.
 
typedef TAlgebra::matrix_type matrix_type
 Type of algebra matrix.
 
typedef TAlgebra::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::IDomainErrorIndicator< TAlgebra >
typedef CPUAlgebra::vector_type error_vector_type
 Type of error vector.
 
typedef TAlgebra::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::IDomainMarker< TDomain >
typedef IElementMarkingStrategy< TDomain > element_marking_strategy_type
 Type of algebra vector.
 
- Public Types inherited from ug::IInterfaceExtrapolation< TDomain, TAlgebra >
typedef TAlgebra algebra_type
 algebra type for the functions to extrapolate
 
typedef TDomain domain_type
 domain type
 
typedef algebra_type::matrix_type matrix_type
 matrix type
 
typedef algebra_type::vector_type vector_type
 vector type (for the functions to extrapolate)
 

Public Member Functions

virtual int check_elem_lsf (size_t n_co, GridObject *pElem, int si, bool use_hanging, const MathVector< dim > vCornerCoords[], number time)
 (slow version) checks whether the element is intersected by the interface, or what, and prepares the data
 
virtual 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
 
virtual bool corner_inside (size_t co) const
 returns true if the corner is "inside" (use after check_elem_lsf)
 
void exclude_subsets (const char *subset_names)
 excludes a (boundary) subsets from the extrapolation
 
virtual void extrapolate_by_lsf (size_t num_co, number *u, size_t fct) const
 extrapolates a component of the solution to the vertices behind the interface (by averaging)
 
virtual void extrapolate_by_lsf (size_t num_co, size_t base_co, number *u, size_t fct) const
 extrapolates a component of the solution to the vertices behind the interface (w.r.t. a base corner)
 
virtual number lsf_at (size_t co) const
 returns the effective value of the LSF at a corner (use after check_elem_lsf)
 
 LSGFDomainDiscretization (SmartPtr< approx_space_type > pApproxSpace)
 default Constructor
 
void project_LSF ()
 project the level-set function to the coarse levels
 
void set_assemble_only_cut (bool b)
 set the "assemble only in cut elements" flag
 
void set_Dirichlet_on_if_for (const char *fct_name, number value)
 sets the Dirichlet boundary condition at the interface for a component of the solution
 
void set_Dirichlet_on_if_for (const char *fct_name, SmartPtr< CplUserData< number, dim > > func)
 sets the Dirichlet boundary condition at the interface for a component of the solution
 
void set_LSF (SmartPtr< ls_grid_func_type > spLSF)
 set the level-set function and check it
 
void set_Neumann0_on_if_for (const char *fct_name)
 sets the Neumann-0 boundary condition at the interface for a component of the solution
 
void set_plain_Dirichlet_on_if_for (const char *fct_name, number value)
 sets the 'plain' Dirichlet boundary condition at the interface for a component of the solution
 
void set_plain_Dirichlet_on_if_for (const char *fct_name, SmartPtr< CplUserData< number, dim > > func)
 sets the 'plain' Dirichlet boundary condition at the interface for a component of the solution
 
virtual ~LSGFDomainDiscretization ()
 virtual destructor
 
- Public Member Functions inherited from ug::DomainDiscretizationBase< TDomain, TAlgebra, LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > >
void add (SmartPtr< IDiscretizationItem< TDomain, TAlgebra > > di)
 adds a disc item to the assembling process
 
void add (SmartPtr< IDomainConstraint< TDomain, TAlgebra > > pp)
 adds a constraint to the assembling process
 
void add (SmartPtr< IElemDisc< TDomain > > elem)
 adds an element discretization to the assembling process
 
void add_elem_error_indicator (SmartPtr< IElemError< TDomain > > elem)
 adds an element error indicator to the assembling process
 
virtual void adjust_solution (vector_type &u, const GridLevel &gl)
 sets dirichlet values in solution vector
 
virtual void adjust_solution (vector_type &u, ConstSmartPtr< DoFDistribution > dd)
 sets dirichlet values in solution vector
 
virtual void adjust_solution (vector_type &u, number time, const GridLevel &gl)
 sets dirichlet values in solution vector
 
virtual void adjust_solution (vector_type &u, number time, ConstSmartPtr< DoFDistribution > dd)
 sets dirichlet values in solution vector
 
SmartPtr< approx_space_typeapproximation_space ()
 
ConstSmartPtr< approx_space_typeapproximation_space () const
 
virtual void assemble_defect (vector_type &d, const vector_type &u, const GridLevel &gl)
 assembles Defect
 
virtual void assemble_defect (vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
 assembles Defect
 
virtual void assemble_defect (vector_type &d, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl)
 assembles Defect
 
virtual void assemble_defect (vector_type &d, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, ConstSmartPtr< DoFDistribution > dd)
 assembles Defect
 
virtual void assemble_jacobian (matrix_type &J, const vector_type &u, const GridLevel &gl)
 assembles Jacobian (or Approximation of Jacobian)
 
virtual void assemble_jacobian (matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
 assembles Jacobian (or Approximation of Jacobian)
 
virtual void assemble_jacobian (matrix_type &J, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const number s_a, const GridLevel &gl)
 assembles Jacobian (or Approximation of Jacobian)
 
virtual void assemble_jacobian (matrix_type &J, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const number s_a0, ConstSmartPtr< DoFDistribution > dd)
 assembles Jacobian (or Approximation of Jacobian)
 
virtual void assemble_linear (matrix_type &A, vector_type &b, ConstSmartPtr< DoFDistribution > dd)
 Assembles Matrix and Right-Hand-Side for a linear problem.
 
virtual void assemble_linear (matrix_type &A, vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl)
 Assembles matrix_type and Right-Hand-Side for a linear problem.
 
virtual void assemble_linear (matrix_type &A, vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, ConstSmartPtr< DoFDistribution > dd)
 Assembles Matrix and Right-Hand-Side for a linear problem.
 
virtual void assemble_linear (matrix_type &mat, vector_type &rhs, const GridLevel &gl)
 Assembles Matrix and Right-Hand-Side for a linear problem.
 
virtual void assemble_mass_matrix (matrix_type &M, const vector_type &u, const GridLevel &gl)
 assembles the mass matrix
 
virtual void assemble_mass_matrix (matrix_type &M, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
 assembles the mass matrix
 
virtual void assemble_rhs (vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl)
 Assembles Right-Hand-Side for a linear problem.
 
virtual void assemble_rhs (vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, ConstSmartPtr< DoFDistribution > dd)
 assembles the rhs
 
virtual void assemble_rhs (vector_type &rhs, const GridLevel &gl)
 assembles the rhs
 
virtual void assemble_rhs (vector_type &rhs, const vector_type &u, const GridLevel &gl)
 assembles the rhs
 
virtual void assemble_rhs (vector_type &rhs, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
 assembles rhs
 
virtual void assemble_rhs (vector_type &rhs, ConstSmartPtr< DoFDistribution > dd)
 assembles rhs
 
virtual void assemble_stiffness_matrix (matrix_type &A, const vector_type &u, const GridLevel &gl)
 assembles the stiffness matrix
 
virtual void assemble_stiffness_matrix (matrix_type &A, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
 assembles the stiffness matrix
 
virtual void calc_error (const GridFunction< TDomain, TAlgebra > &u)
 
virtual void calc_error (const GridFunction< TDomain, TAlgebra > &u, error_vector_type *u_vtk)
 
virtual void calc_error (const vector_type &u, const GridLevel &gl, error_vector_type *u_vtk=NULL)
 
virtual void calc_error (const vector_type &u, ConstSmartPtr< DoFDistribution > dd, error_vector_type *u_vtk=NULL)
 
virtual void calc_error (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl, error_vector_type *u_vtk)
 
virtual void calc_error (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, error_vector_type *u_vtk)
 
virtual SmartPtr< IConstraint< TAlgebra > > constraint (size_t i)
 returns the i'th constraint
 
 DomainDiscretizationBase (SmartPtr< approx_space_type > pApproxSpace)
 default Constructor
 
virtual void finish_timestep (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const GridLevel &gl)
 
virtual void finish_timestep (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
 finishes time step
 
virtual void finish_timestep_elem (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const GridLevel &gl)
 finishes timestep
 
virtual void finish_timestep_elem (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
 finishes timestep
 
void init_all_exports (bool bAsTimeDependent)
 
virtual void init_all_exports (const GridLevel &gl, bool bAsTimeDependent)
 
virtual void init_all_exports (ConstSmartPtr< DoFDistribution > dd, bool bAsTimeDependent)
 
virtual void invalidate_error ()
 
virtual bool is_error_valid ()
 returns whether current error values are valid
 
virtual void mark_with_strategy (IRefiner &refiner, SmartPtr< IElementMarkingStrategy< TDomain > > strategy)
 
virtual size_t num_constraints () const
 returns number of registered constraints
 
virtual void prepare_timestep (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, const GridLevel &gl)
 
virtual void prepare_timestep (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, ConstSmartPtr< DoFDistribution > dd)
 prepares time step
 
virtual void prepare_timestep_elem (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const GridLevel &gl)
 
virtual void prepare_timestep_elem (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
 prepares time step element-wise
 
void remove (SmartPtr< IDomainConstraint< TDomain, TAlgebra > > pp)
 removes a constraint from the assembling process
 
void remove (SmartPtr< IElemDisc< TDomain > > elem)
 removes a element discretization from the assembling process
 
void remove_elem_error_indicator (SmartPtr< IElemError< TDomain > > elem)
 removes a element discretization from the assembling process
 
virtual ~DomainDiscretizationBase ()
 virtual destructor
 
void assemble_jacobian (matrix_type &J, GridFunction< TDomain, TAlgebra > &u)
 
void assemble_defect (vector_type &d, GridFunction< TDomain, TAlgebra > &u)
 
void assemble_linear (matrix_type &A, GridFunction< TDomain, TAlgebra > &rhs)
 
void assemble_rhs (vector_type &rhs, GridFunction< TDomain, TAlgebra > &u)
 
void assemble_rhs (GridFunction< TDomain, TAlgebra > &b)
 
void adjust_solution (GridFunction< TDomain, TAlgebra > &u)
 
virtual SmartPtr< AssemblingTuner< TAlgebra > > ass_tuner ()
 
virtual ConstSmartPtr< AssemblingTuner< TAlgebra > > ass_tuner () const
 
- Public Member Functions inherited from ug::IDomainDiscretization< TAlgebra >
void adjust_solution (vector_type &u, number time)
 adjust solution on surface level
 
void assemble_defect (vector_type &d, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff)
 assembles defect on surface level
 
void assemble_jacobian (matrix_type &J, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const number s_a)
 assembles jacobian on surface level
 
void assemble_linear (matrix_type &A, vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff)
 assembles linear on surface level
 
void assemble_rhs (vector_type &b, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff)
 assembles rhs on surface level
 
virtual void finish_timestep (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
 
void finish_timestep_elem (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
 finishes timestep on surface level
 
virtual void prepare_timestep (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time)
 
void prepare_timestep_elem (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
 prepares timestep on surface level
 
virtual ~IDomainDiscretization ()
 
- Public Member Functions inherited from ug::IAssemble< TAlgebra >
void adjust_solution (vector_type &u)
 
virtual void adjust_solution (vector_type &u, const GridLevel &gl)=0
 sets dirichlet values in solution vector
 
void assemble_defect (vector_type &d, const vector_type &u)
 
virtual void assemble_defect (vector_type &d, const vector_type &u, const GridLevel &gl)=0
 assembles Defect
 
void assemble_jacobian (matrix_type &J, const vector_type &u)
 
virtual void assemble_jacobian (matrix_type &J, const vector_type &u, const GridLevel &gl)=0
 assembles Jacobian (or Approximation of Jacobian)
 
void assemble_linear (matrix_type &A, vector_type &b)
 
virtual void assemble_linear (matrix_type &A, vector_type &b, const GridLevel &gl)=0
 Assembles Matrix and Right-Hand-Side for a linear problem.
 
void assemble_mass_matrix (matrix_type &M, const vector_type &u)
 
virtual void assemble_mass_matrix (matrix_type &M, const vector_type &u, const GridLevel &gl)
 assembles mass matrix
 
void assemble_rhs (vector_type &b)
 
virtual void assemble_rhs (vector_type &b, const GridLevel &gl)=0
 Assembles Right-Hand-Side for a linear problem.
 
virtual void assemble_rhs (vector_type &rhs, const vector_type &u)
 
virtual void assemble_rhs (vector_type &rhs, const vector_type &u, const GridLevel &gl)=0
 assembles rhs
 
void assemble_stiffness_matrix (matrix_type &A, const vector_type &u)
 
virtual void assemble_stiffness_matrix (matrix_type &A, const vector_type &u, const GridLevel &gl)
 assembles stiffness matrix
 
virtual ~IAssemble ()
 Virtual Destructor.
 
- Public Member Functions inherited from ug::IDomainErrorIndicator< TAlgebra >
virtual void calc_error (const vector_type &u, const GridLevel &gl, error_vector_type *u_vtk=NULL)=0
 
virtual void calc_error (const vector_type &u, ConstSmartPtr< DoFDistribution > dd, error_vector_type *u_vtk=NULL)=0
 
virtual void calc_error (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, const GridLevel &gl, error_vector_type *u_vtk)=0
 Transient version.
 
virtual void calc_error (ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff, error_vector_type *u_vtk)=0
 Transient version.
 
virtual ~IDomainErrorIndicator ()
 
- Public Member Functions inherited from ug::IDomainMarker< TDomain >
virtual ~IDomainMarker ()
 
- Public Member Functions inherited from ug::IInterfaceExtrapolation< TDomain, TAlgebra >
 IInterfaceExtrapolation ()
 Constructor.
 
virtual ~IInterfaceExtrapolation ()
 Destructor.
 

Static Public Attributes

static const int dim = TDomain::dim
 world dimension
 
- Static Public Attributes inherited from ug::DomainDiscretizationBase< TDomain, TAlgebra, LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > >
static const int dim
 world dimension
 
- Static Public Attributes inherited from ug::IInterfaceExtrapolation< TDomain, TAlgebra >
static const int dim = domain_type::dim
 dimensionality (the World dimension)
 

Protected Attributes

SmartPtr< ls_constraint_typem_spLSFGFConstraint
 the Level-Set Function constraint
 
- Protected Attributes inherited from ug::DomainDiscretizationBase< TDomain, TAlgebra, LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > >
bool m_bErrorCalculated
 
IMultigridElementIndicators< TDomain > m_mgElemErrors
 
SmartPtr< approx_space_typem_spApproxSpace
 current approximation space
 
SmartPtr< AssemblingTuner< TAlgebra > > m_spAssTuner
 this object provides tools to adapt the assemble routine
 
std::vector< SmartPtr< IDomainConstraint< TDomain, TAlgebra > > > m_vConstraint
 vector holding all registered constraints
 
std::vector< SmartPtr< IElemDisc< TDomain > > > m_vDomainElemDisc
 vector holding all registered elem discs
 
std::vector< SmartPtr< IElemError< TDomain > > > m_vDomainElemError
 vector holding all registered elem discs
 
std::vector< IElemDisc< TDomain > * > m_vElemDisc
 vector holding all registered elem discs
 
std::vector< IElemError< TDomain > * > m_vElemError
 vector holding all registered elem discs
 

Private Types

typedef DomainDiscretizationBase< TDomain, TAlgebra, gass_typebase_type
 Type of the base class.
 
typedef LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > gass_type
 Type of the global assembler.
 
typedef LSGFConstraint< TDomain, TAlgebra, TExtrapolation > ls_constraint_type
 Type of the constraint.
 

Additional Inherited Members

- Protected Types inherited from ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >
typedef TAlgebra algebra_type
 Algebra type.
 
typedef ApproximationSpace< domain_typeapprox_space_type
 type of approximation space
 
typedef TDomain domain_type
 Domain type.
 
typedef TExtrapolation extrapolation_type
 Extrapolation type.
 
typedef extrapolation_type::ls_grid_func_type ls_grid_func_type
 Grid function type for the LSF.
 
typedef algebra_type::matrix_type matrix_type
 Matrix type in the algebra.
 
typedef algebra_type::vector_type vector_type
 Vector type in the algebra.
 
- Protected Member Functions inherited from ug::DomainDiscretizationBase< TDomain, TAlgebra, LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation > >
ConstSmartPtr< DoFDistributiondd (const GridLevel &gl) const
 returns the level dof distribution
 
void update_constraints ()
 
void update_disc_items ()
 
void update_elem_discs ()
 set the approximation space in the elem discs and extract IElemDiscs
 
void update_elem_errors ()
 
void update_error_items ()
 
- Protected Member Functions inherited from ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >
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
 
virtual void clear_outer_values (vector_type &d, const DoFDistribution *dd) const
 sets the values at the outer vertices to 0
 
bool corner_inside (size_t co) const
 returns true if the corner is "inside" (use after check_elem_lsf)
 
void exclude_subsets (SmartPtr< approx_space_type > spApproxSpace, const char *subset_names)
 excludes a (boundary) subsets from the extrapolation
 
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)
 
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)
 
extrapolation_typeextrapolation ()
 returns the extrapolation
 
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)
 
template<typename TElem , typename TIterator >
void InitAllExports (const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, bool bAsTimeDependent)
 
number lsf_at (size_t co) const
 returns the effective value of the LSF at a corner (use after check_elem_lsf)
 
 LSGFGlobAssembler ()
 class constructor (may not have any arguments!)
 
void prepare_interface_bc (SmartPtr< approx_space_type > spApproxSpace)
 prepares the boundary conditions at the interface: sets all them to Dirichlet-0
 
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
 
void set_assemble_only_cut (bool b)
 set the "assemble only in cut elements" flag
 
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
 
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
 
void set_LSF (SmartPtr< ls_grid_func_type > spLSF)
 set the level-set function and check it
 
void set_Neumann0_on_if_for (SmartPtr< approx_space_type > spApproxSpace, const char *fct_name)
 adds a Neumann-0 with on the interface
 
virtual void set_outer_matrices (matrix_type &A, const DoFDistribution *dd) const
 sets the matrices at outer vertices to identity
 
virtual void set_outer_values (vector_type &u, const DoFDistribution *dd, number time)
 sets the values at the outer vertices to given values
 
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
 
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
 
virtual ~LSGFGlobAssembler ()
 virtual destructor
 
- Static Protected Member Functions inherited from ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >
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 Protected Attributes inherited from ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >
static const int dim = TDomain::dim
 world dimension
 

Detailed Description

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

domain discretization for the Level-Set Ghost-Fluid method

This class template is an implementation of the IDomainDiscretization interface for the Level-Set Ghost-Fluid method.

Template Parameters
TDomaindomain type
TAlgebraalgebra type

Member Typedef Documentation

◆ algebra_type

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

Type of algebra.

◆ approx_space_type

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

Type of approximation space.

◆ base_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef DomainDiscretizationBase<TDomain, TAlgebra, gass_type> ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::base_type
private

Type of the base class.

◆ domain_type

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

Type of Domain.

◆ gass_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef LSGFGlobAssembler<TDomain, TAlgebra, TExtrapolation> ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::gass_type
private

Type of the global assembler.

◆ grid_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef TDomain::grid_type ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::grid_type

Type of the grid.

◆ ls_constraint_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef LSGFConstraint<TDomain, TAlgebra, TExtrapolation> ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::ls_constraint_type
private

Type of the constraint.

◆ ls_grid_func_type

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
typedef gass_type::ls_grid_func_type ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::ls_grid_func_type

Type of the LSF grid functions.

◆ matrix_type

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

Type of algebra matrix.

◆ vector_type

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

Type of algebra vector.

Constructor & Destructor Documentation

◆ LSGFDomainDiscretization()

◆ ~LSGFDomainDiscretization()

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

virtual destructor

Member Function Documentation

◆ check_elem_lsf() [1/2]

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

(slow version) 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
use_hangingif there can be hanging nodes
vCornerCoordscoordinates of the corners of the element
timethe phisical time

Reimplemented from ug::IInterfaceExtrapolation< TDomain, TAlgebra >.

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::check_elem_lsf(), and UG_ASSERT.

◆ check_elem_lsf() [2/2]

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual int ug::LSGFDomainDiscretization< 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 
)
inlinevirtual

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

Reimplemented from ug::IInterfaceExtrapolation< TDomain, TAlgebra >.

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::check_elem_lsf().

◆ corner_inside()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual bool ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::corner_inside ( size_t  co) const
inlinevirtual

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

Parameters
cothe corner

Reimplemented from ug::IInterfaceExtrapolation< TDomain, TAlgebra >.

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::corner_inside().

◆ exclude_subsets()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::exclude_subsets ( const char *  subset_names)
inline

excludes a (boundary) subsets from the extrapolation

Parameters
subset_namesnames of the subsets to exclude

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::exclude_subsets().

◆ extrapolate_by_lsf() [1/2]

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

extrapolates a component of 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)

Reimplemented from ug::IInterfaceExtrapolation< TDomain, TAlgebra >.

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::extrapolate_by_lsf().

◆ extrapolate_by_lsf() [2/2]

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

extrapolates a component of 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)

Reimplemented from ug::IInterfaceExtrapolation< TDomain, TAlgebra >.

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::extrapolate_by_lsf().

◆ lsf_at()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
virtual number ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::lsf_at ( size_t  co) const
inlinevirtual

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

Parameters
cothe corner

Reimplemented from ug::IInterfaceExtrapolation< TDomain, TAlgebra >.

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::lsf_at().

◆ project_LSF()

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

project the level-set function to the coarse levels

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::project_LSF().

◆ set_assemble_only_cut()

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

set the "assemble only in cut elements" flag

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

◆ set_Dirichlet_on_if_for() [1/2]

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

sets the Dirichlet boundary condition at the interface for a component of the solution

Parameters
fct_namefunction to impose the condition for
valuethe Dirichlet value

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_Dirichlet_on_if_for().

◆ set_Dirichlet_on_if_for() [2/2]

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

sets the Dirichlet boundary condition at the interface for a component of the solution

Parameters
fct_namefunction to impose the condition for
functhe Dirichlet value (as a function)

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

◆ set_LSF()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFDomainDiscretization< 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 >::set_LSF().

◆ set_Neumann0_on_if_for()

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
void ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::set_Neumann0_on_if_for ( const char *  fct_name)
inline

sets the Neumann-0 boundary condition at the interface for a component of the solution

Parameters
fct_namefunction to impose the condition for

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_Neumann0_on_if_for().

◆ set_plain_Dirichlet_on_if_for() [1/2]

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

sets the 'plain' Dirichlet boundary condition at the interface for a component of the solution

Parameters
fct_namefunction to impose the condition for
valuethe Dirichlet value

References ug::LSGFGlobAssembler< TDomain, TAlgebra, TExtrapolation >::set_plain_Dirichlet_on_if_for().

◆ set_plain_Dirichlet_on_if_for() [2/2]

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

sets the 'plain' Dirichlet boundary condition at the interface for a component of the solution

Parameters
fct_namefunction to impose the condition for
functhe Dirichlet value (as a function)

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

Member Data Documentation

◆ dim

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

world dimension

◆ m_spLSFGFConstraint

template<typename TDomain , typename TAlgebra , typename TExtrapolation >
SmartPtr<ls_constraint_type> ug::LSGFDomainDiscretization< TDomain, TAlgebra, TExtrapolation >::m_spLSFGFConstraint
protected

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