ug4
ug::ObstacleInNormalDir< TDomain, TAlgebra > Class Template Reference

Obstacle Class for Obstacle in normal direction. More...

#include <obstacle_in_normal_dir.h>

+ Inheritance diagram for ug::ObstacleInNormalDir< TDomain, TAlgebra >:

Classes

struct  obsDoFData
 struct to store data for a specific obstacle DoF More...
 

Public Types

typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef IObstacleConstraint< TDomain, TAlgebra > base_type
 Base class type. More...
 
typedef TDomain domain_type
 Domain type. More...
 
typedef GridFunction< TDomain, TAlgebra > function_type
 Type of grid function. More...
 
typedef algebra_type::matrix_type matrix_type
 Matrix type. More...
 
typedef domain_type::position_type position_type
 Type of position coordinates (e.g. position_type) More...
 
typedef vector_type::value_type value_type
 Value type. More...
 
typedef algebra_type::vector_type vector_type
 Vector type. More...
 
- Public Types inherited from ug::IObstacleConstraint< TDomain, TAlgebra >
typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef IDomainConstraint< TDomain, TAlgebra > base_type
 Base Type. More...
 
typedef TDomain domain_type
 Type of domain. More...
 
typedef algebra_type::matrix_type matrix_type
 Matrix type. More...
 
typedef domain_type::position_type position_type
 Type of position coordinates (e.g. position_type) More...
 
typedef vector_type::value_type value_type
 Value type. More...
 
typedef algebra_type::vector_type vector_type
 Vector type. More...
 
- Public Types inherited from ug::IDomainConstraint< TDomain, TAlgebra >
typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef TDomain domain_type
 Domain Type. More...
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix. More...
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector. More...
 
- Public Types inherited from ug::IConstraint< TAlgebra >
typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix. More...
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector. More...
 

Public Member Functions

void adjust_defect_to_constraint (vector_type &d)
 the defect needs to be adjusted for the active indices (those indices, which are in contact) More...
 
void adjust_sol_and_cor (value_type &sol_i, value_type &c_i, bool &dofIsActive, const DoFIndex &dof)
 projects the i-th index of the solution onto the admissible set and adjusts the correction More...
 
 ObstacleInNormalDir ()
 constructor More...
 
 ObstacleInNormalDir (const function_type &u)
 
void preprocess ()
 preprocess is useful to attach the normals for every obstacle DoF More...
 
void restrict_obs_values ()
 restricts the obstacle values to a coarser grid in a multigrid hierarchy More...
 
 ~ObstacleInNormalDir ()
 Destructor. More...
 
- Public Member Functions inherited from ug::IObstacleConstraint< TDomain, TAlgebra >
void active_dofs (vector< DoFIndex > &vActiveDoFs)
 returns the vector storing the active dofs More...
 
void add (number value, const char *function)
 adds a constant value as dirichlet condition for a function on subsets and on whole domain More...
 
void add (number value, const char *function, const char *subsets)
 
void add (SmartPtr< UserData< MathVector< dim >, dim > > func, const char *functions)
 adds a user-defined vector as dirichlet condition for a vector-function on subsets and on whole domain More...
 
void add (SmartPtr< UserData< MathVector< dim >, dim > > func, const char *functions, const char *subsets)
 
void add (SmartPtr< UserData< number, dim > > func, const char *function)
 adds a user-defined value as dirichlet condition for a function on subsets and on whole domain More...
 
void add (SmartPtr< UserData< number, dim > > func, const char *function, const char *subsets)
 
void add (SmartPtr< UserData< number, dim, bool > > func, const char *function)
 adds a lua callback (cond and non-cond) More...
 
void add (SmartPtr< UserData< number, dim, bool > > func, const char *function, const char *subsets)
 
void adjust_defect (vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=NULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
 sets a zero value in the defect for all dirichlet indices More...
 
void adjust_jacobian (matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=NULL, const number s_a0=1.0)
 sets a unity row for all dirichlet indices More...
 
void adjust_linear (matrix_type &A, vector_type &b, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 sets unity rows in A and dirichlet values in right-hand side b More...
 
virtual void adjust_prolongation (matrix_type &P, ConstSmartPtr< DoFDistribution > ddFine, ConstSmartPtr< DoFDistribution > ddCoarse, int type, number time=0.0)
 sets constraints in prolongation More...
 
virtual void adjust_restriction (matrix_type &R, ConstSmartPtr< DoFDistribution > ddCoarse, ConstSmartPtr< DoFDistribution > ddFine, int type, number time=0.0)
 sets constraints in restriction More...
 
void adjust_rhs (vector_type &b, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 sets the dirichlet value in the right-hand side More...
 
void adjust_solution (vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 sets the dirichlet value in the solution for all dirichlet indices More...
 
void init ()
 
 IObstacleConstraint ()
 constructor More...
 
 IObstacleConstraint (const GridFunction< TDomain, TAlgebra > &u)
 constructor for an obstacle defined on some subset(s) More...
 
bool is_obs_dof (const DoFIndex &dof)
 checks if a given dof is in an obstacle subset More...
 
void reset_active_dofs ()
 resets the vector storing the active dofs More...
 
virtual int type () const
 returns the type of the constraints More...
 
virtual ~IObstacleConstraint ()
 Destructor. More...
 
- Public Member Functions inherited from ug::IDomainConstraint< TDomain, TAlgebra >
SmartPtr< ApproximationSpace< TDomain > > approximation_space ()
 returns approximation space More...
 
ConstSmartPtr< ApproximationSpace< TDomain > > approximation_space () const
 returns approximation space More...
 
virtual SmartPtr< IErrEstData< TDomain > > err_est_data ()
 returns the pointer to the error estimator data object (or NULL) More...
 
bool err_est_enabled () const
 find out whether or not a posteriori error estimation is to be performed for this disc More...
 
 IDomainConstraint ()
 constructor More...
 
virtual void set_approximation_space (SmartPtr< ApproximationSpace< TDomain > > approxSpace)
 sets the approximation space More...
 
void set_ass_tuner (ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssemblingTuner=NULL)
 sets the assemble adapter for the constraints More...
 
void set_error_estimator (SmartPtr< IErrEstData< TDomain > > ee)
 sets the pointer to an error estimator data object (or NULL) More...
 
- Public Member Functions inherited from ug::IConstraint< TAlgebra >
virtual void adjust_correction (vector_type &c, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 
virtual void adjust_error (const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=SPNULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
 adjusts the assembled error estimator values in the attachments according to the constraint More...
 
virtual void adjust_linear_residual (vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
 adjust linear residual More...
 
virtual void adjust_prolongation (vector_type &uFine, GridLevel fineLvl, const vector_type &uCoarse, GridLevel coarseLvl, int type)
 sets the constraints in a solution vector More...
 
virtual void adjust_restriction (vector_type &uCoarse, GridLevel coarseLvl, const vector_type &uFine, GridLevel fineLvl, int type)
 sets the constraints in a solution vector More...
 
virtual void modify_solution (SmartPtr< VectorTimeSeries< vector_type > > vSolMod, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd, int type)
 modify_solution for instationary case More...
 
virtual void modify_solution (vector_type &uMod, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type)
 modifies solution vector before calling the assembling routine More...
 
virtual ~IConstraint ()
 virtual destructor More...
 

Static Public Attributes

static const int dim = domain_type::dim
 World dimension. More...
 
- Static Public Attributes inherited from ug::IObstacleConstraint< TDomain, TAlgebra >
static const int dim = domain_type::dim
 world Dimension More...
 

Private Member Functions

template<typename TElem , typename TIterator >
void adjust_sol_and_cor_elem (TIterator iterBegin, TIterator iterEnd, value_type &sol_i, value_type &c_i, bool &dofIsAdmissible, const DoFIndex &dof)
 
void transform_eulerian_coord_sys (MathVector< dim > transformedONB[], const MathVector< dim > &firstTransformedBaseVec)
 

Private Attributes

ConstSmartPtr< DoFDistributionm_spDD
 pointer to the DofDistribution on the whole domain More...
 
ConstSmartPtr< TDomain > m_spDomain
 pointer to the domain More...
 

Additional Inherited Members

- Protected Member Functions inherited from ug::IDomainConstraint< TDomain, TAlgebra >
ConstSmartPtr< DoFDistributiondd (const GridLevel &gl) const
 returns the level dof distribution More...
 
- Protected Attributes inherited from ug::IObstacleConstraint< TDomain, TAlgebra >
map< DoFIndex, numberm_mObstacleValues
 map to store obstacle values with its corresponding DoFs More...
 
vector< DoFIndexm_vActiveDofs
 stores the dofs, which satisfy the constraints with equality More...
 
vector< int > m_vObsSubsets
 stores the subset-indices of the obstacle subsets More...
 
- Protected Attributes inherited from ug::IDomainConstraint< TDomain, TAlgebra >
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
 Approximation Space. More...
 
ConstSmartPtr< AssemblingTuner< TAlgebra > > m_spAssTuner
 Assemble adapter. More...
 
SmartPtr< IErrEstData< TDomain > > m_spErrEstData
 error estimation object associated to the element discretization More...
 

Detailed Description

template<typename TDomain, typename TAlgebra>
class ug::ObstacleInNormalDir< TDomain, TAlgebra >

Obstacle Class for Obstacle in normal direction.

Scalar obstacle are described by constraints of the form

u * n <= upObs    (cf. 'set_upper_obstacle' in 'IObstacleConstraint')

and

u * n >= lowObs   (cf. 'set_lower_obstacle' in 'IObstacleConstraint')

where u is the solution vector and n the normal vector to the boundary-face/side.

Here, 'upObs' and 'lowObs' are user-defined functions, which need to be of the same size as the function of unknowns u.

Those obstacle functions can be used in combination with projected preconditioners. They should be passed to the preconditioner by 'IProjPreconditioner::set_obstacle_constraint'.

Member Typedef Documentation

◆ algebra_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra ug::ObstacleInNormalDir< TDomain, TAlgebra >::algebra_type

Algebra type.

◆ base_type

template<typename TDomain , typename TAlgebra >
typedef IObstacleConstraint<TDomain,TAlgebra> ug::ObstacleInNormalDir< TDomain, TAlgebra >::base_type

Base class type.

◆ domain_type

template<typename TDomain , typename TAlgebra >
typedef TDomain ug::ObstacleInNormalDir< TDomain, TAlgebra >::domain_type

Domain type.

◆ function_type

template<typename TDomain , typename TAlgebra >
typedef GridFunction<TDomain, TAlgebra> ug::ObstacleInNormalDir< TDomain, TAlgebra >::function_type

Type of grid function.

◆ matrix_type

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

Matrix type.

◆ position_type

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

Type of position coordinates (e.g. position_type)

◆ value_type

template<typename TDomain , typename TAlgebra >
typedef vector_type::value_type ug::ObstacleInNormalDir< TDomain, TAlgebra >::value_type

Value type.

◆ vector_type

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

Vector type.

Constructor & Destructor Documentation

◆ ObstacleInNormalDir() [1/2]

template<typename TDomain , typename TAlgebra >
ug::ObstacleInNormalDir< TDomain, TAlgebra >::ObstacleInNormalDir ( const function_type u)
inline

◆ ObstacleInNormalDir() [2/2]

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

constructor

◆ ~ObstacleInNormalDir()

template<typename TDomain , typename TAlgebra >
ug::ObstacleInNormalDir< TDomain, TAlgebra >::~ObstacleInNormalDir ( )
inline

Destructor.

Member Function Documentation

◆ adjust_defect_to_constraint()

template<typename TDomain , typename TAlgebra >
void ug::ObstacleInNormalDir< TDomain, TAlgebra >::adjust_defect_to_constraint ( vector_type d)
virtual

the defect needs to be adjusted for the active indices (those indices, which are in contact)

Implements ug::IObstacleConstraint< TDomain, TAlgebra >.

References ug::BlockRef().

◆ adjust_sol_and_cor()

template<typename TDomain , typename TAlgebra >
void ug::ObstacleInNormalDir< TDomain, TAlgebra >::adjust_sol_and_cor ( value_type sol_i,
value_type c_i,
bool &  dofIsActive,
const DoFIndex dof 
)
virtual

projects the i-th index of the solution onto the admissible set and adjusts the correction

Implements ug::IObstacleConstraint< TDomain, TAlgebra >.

References ug::DimensionOfSubset(), UG_LOG, and UG_THROW.

◆ adjust_sol_and_cor_elem()

template<typename TDomain , typename TAlgebra >
template<typename TElem , typename TIterator >
void ug::ObstacleInNormalDir< TDomain, TAlgebra >::adjust_sol_and_cor_elem ( TIterator  iterBegin,
TIterator  iterEnd,
value_type sol_i,
value_type c_i,
bool &  dofIsAdmissible,
const DoFIndex dof 
)
private

◆ preprocess()

template<typename TDomain , typename TAlgebra >
void ug::ObstacleInNormalDir< TDomain, TAlgebra >::preprocess
virtual

preprocess is useful to attach the normals for every obstacle DoF

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

References dim.

◆ restrict_obs_values()

template<typename TDomain , typename TAlgebra >
void ug::ObstacleInNormalDir< TDomain, TAlgebra >::restrict_obs_values ( )
virtual

restricts the obstacle values to a coarser grid in a multigrid hierarchy

Implements ug::IObstacleConstraint< TDomain, TAlgebra >.

◆ transform_eulerian_coord_sys()

template<typename TDomain , typename TAlgebra >
void ug::ObstacleInNormalDir< TDomain, TAlgebra >::transform_eulerian_coord_sys ( MathVector< dim transformedONB[],
const MathVector< dim > &  firstTransformedBaseVec 
)
private

Member Data Documentation

◆ dim

template<typename TDomain , typename TAlgebra >
const int ug::ObstacleInNormalDir< TDomain, TAlgebra >::dim = domain_type::dim
static

World dimension.

◆ m_spDD

template<typename TDomain , typename TAlgebra >
ConstSmartPtr<DoFDistribution> ug::ObstacleInNormalDir< TDomain, TAlgebra >::m_spDD
private

pointer to the DofDistribution on the whole domain

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

◆ m_spDomain

template<typename TDomain , typename TAlgebra >
ConstSmartPtr<TDomain> ug::ObstacleInNormalDir< TDomain, TAlgebra >::m_spDomain
private

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