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

Nonlinear GaussSeidel-method. More...

#include <nl_gauss_seidel.h>

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

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 domain_traits< TDomain::dim >::grid_base_object grid_base_object
 Type of geometric base object. More...
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type. More...
 
typedef vector_type::value_type value_type
 Value type. More...
 
typedef TAlgebra::vector_type vector_type
 Vector type. More...
 
- Public Types inherited from ug::IOperatorInverse< TAlgebra::vector_type >
typedef TAlgebra::vector_type codomain_function_type
 Range space. More...
 
typedef TAlgebra::vector_type domain_function_type
 Domain space. More...
 
- Public Types inherited from ug::DebugWritingObject< TAlgebra >
typedef TAlgebra algebra_type
 type of algebra More...
 
typedef TAlgebra::matrix_type matrix_type
 type of matrix More...
 
typedef TAlgebra::vector_type vector_type
 type of vector More...
 
- Public Types inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
typedef TAlgebra::vector_type vector_type
 type of vector More...
 

Public Member Functions

virtual bool apply (vector_type &u)
 apply Operator, i.e. op^{-1}(0) = u More...
 
virtual std::string config_string () const
 returns information about configuration parameters More...
 
virtual bool init (SmartPtr< IOperator< vector_type > > op)
 This operator inverts the Operator op: Y -> X. More...
 
 NLGaussSeidelSolver ()
 constructor More...
 
 NLGaussSeidelSolver (SmartPtr< approx_space_type > spApproxSpace, SmartPtr< IConvergenceCheck< vector_type > > spConvCheck)
 constructor More...
 
virtual bool prepare (vector_type &u)
 prepare Operator More...
 
void set_approximation_space (SmartPtr< approx_space_type > spApproxSpace)
 
void set_constraint (const vector_type &cons)
 
void set_convergence_check (SmartPtr< IConvergenceCheck< vector_type > > spConvCheck)
 
void set_damp (const number damp)
 
- Public Member Functions inherited from ug::IOperatorInverse< TAlgebra::vector_type >
virtual bool init (SmartPtr< IOperator< TAlgebra::vector_type, TAlgebra::vector_type > > N)=0
 initializes the operator for the inversion of the operator N: Y -> X More...
 
virtual ~IOperatorInverse ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::DebugWritingObject< TAlgebra >
SmartPtr< IDebugWriter< algebra_type > > debug_writer ()
 returns the debug writer More...
 
ConstSmartPtr< IDebugWriter< algebra_type > > debug_writer () const
 
bool debug_writer_valid () const
 returns true if the debug writer is set More...
 
 DebugWritingObject ()
 
 DebugWritingObject (const DebugWritingObject< algebra_type > &parent)
 clone constructor More...
 
 DebugWritingObject (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
 
virtual void set_debug (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
 set debug writer More...
 
virtual ~DebugWritingObject ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
virtual void set_debug (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter)
 set debug writer More...
 
SmartPtr< IVectorDebugWriter< vector_type > > vector_debug_writer ()
 returns the debug writer More...
 
ConstSmartPtr< IVectorDebugWriter< vector_type > > vector_debug_writer () const
 
bool vector_debug_writer_valid () const
 returns true if the debug writer is set More...
 
 VectorDebugWritingObject ()
 
 VectorDebugWritingObject (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter)
 
void write_debug (const vector_type &vec, const char *filename)
 writing debug output for a vector (if debug writer set) More...
 
virtual ~VectorDebugWritingObject ()
 virtual destructor More...
 

Protected Types

typedef DebugWritingObject< TAlgebra > base_writer_type
 

Private Types

typedef std::vector< grid_base_object * > elemList
 
typedef NLGaussSeidelSolver< TDomain, TAlgebra > this_type
 own type More...
 

Private Member Functions

void write_debug (const vector_type &vec, const char *filename)
 
void write_debug (const matrix_type &mat, const char *filename)
 

Private Attributes

bool m_bProjectedGS
 
vector_type m_ConsVec
 vector describing a constraint More...
 
number m_damp
 damping factor More...
 
int m_dgbCall
 call counter More...
 
GridLevel m_gridLevel
 DoF Distribution used. More...
 
LocalToGlobalMapperNLGS< TAlgebra > m_map
 LocalToGlobal-Mapper which accounts for index-wise assembling. More...
 
Selector m_sel
 selector of elements with contributions to a specific DoF More...
 
SmartPtr< approx_space_typem_spApproxSpace
 Approximation Space. More...
 
SmartPtr< IAssemble< TAlgebra > > m_spAss
 
SmartPtr< AssembledOperator< algebra_type > > m_spAssOp
 
SmartPtr< IConvergenceCheck< vector_type > > m_spConvCheck
 
SmartPtr< AssembledLinearOperator< algebra_type > > m_spJBlock
 
ConstSmartPtr< DoFDistributionm_spLevDD
 DoF distribution pointer. More...
 
ConstSmartPtr< DoFDistributionm_spSurfDD
 
std::vector< elemListm_vElemList
 

Additional Inherited Members

- Protected Member Functions inherited from ug::DebugWritingObject< TAlgebra >
void enter_debug_writer_section (const char *secDir)
 enters a debugging section More...
 
void enter_debug_writer_section (std::string secDir)
 enters a debugging section More...
 
void leave_debug_writer_section ()
 leaves a debugging section More...
 
void write_debug (const matrix_type &mat, const char *filename)
 write debug output for a matrix (if debug writer set) More...
 
void write_debug (const matrix_type &mat, std::string name)
 write debug output for a matrix (if debug writer set) More...
 
- Protected Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
void enter_vector_debug_writer_section (const char *secDir)
 enters a debugging section More...
 
void enter_vector_debug_writer_section (std::string secDir)
 enters a debugging section More...
 
void leave_vector_debug_writer_section ()
 leaves a debugging section More...
 
void print_debugger_message (const char *msg)
 prints a debugger message (listing all the sections) More...
 
void print_debugger_message (std::string msg)
 prints a debugger message (listing all the sections) More...
 
virtual void write_debug (const vector_type &vec, std::string name)
 writing debug output for a vector (if debug writer set) More...
 
- Protected Attributes inherited from ug::DebugWritingObject< TAlgebra >
SmartPtr< IDebugWriter< algebra_type > > m_spDebugWriter
 Debug Writer. More...
 
- Protected Attributes inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
SmartPtr< IVectorDebugWriter< vector_type > > m_spVectorDebugWriter
 Debug Writer. More...
 

Detailed Description

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

Nonlinear GaussSeidel-method.

Let L(u) denote a nonlinear functional of n components (l_1,...,l_n). Then the basic step of the nonlinear GaussSeidel method is to solve the i-th equation

l_i(u_1^{k+1},...,u_{i-1}^{k+1},u_i,u_{i+1}^{k},...,u_{n}^{k}) = 0

for u_i and to set u_i^{k+1} = u_i. Here k denotes the iteration-index. Note, that the already computed, updated values (.)^{k+1} are used in this method. Thus, in order to obtain u^{k+1} from u^k, we solve successively the n dimensional nonlinear equations for i = 1,...,n. Here this is done by a scalar newton step for every i. But every other scalar nonlinear method could be applied as well.

Using a damped version of the nonlinear GaussSeidel method (= nonlinear SOR-method) results in the following update of the variables

u_i^{k+1} = u_i^k + damp * (u_i -u_i^k).

References:

  • J. M. Ortega and W. C. Rheinbolt. Iterative Solution of nonlinear equations in several variables.(1970)
Template Parameters
TDomainDomain type
TAlgebraAlgebra type

Member Typedef Documentation

◆ algebra_type

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

Algebra type.

◆ approx_space_type

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

Type of approximation space.

◆ base_writer_type

template<typename TDomain , typename TAlgebra >
typedef DebugWritingObject<TAlgebra> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::base_writer_type
protected

◆ domain_type

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

Domain type.

◆ elemList

template<typename TDomain , typename TAlgebra >
typedef std::vector<grid_base_object*> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::elemList
private

◆ grid_base_object

template<typename TDomain , typename TAlgebra >
typedef domain_traits<TDomain::dim>::grid_base_object ug::NLGaussSeidelSolver< TDomain, TAlgebra >::grid_base_object

Type of geometric base object.

◆ matrix_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra::matrix_type ug::NLGaussSeidelSolver< TDomain, TAlgebra >::matrix_type

Matrix type.

◆ this_type

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

own type

◆ value_type

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

Value type.

◆ vector_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra::vector_type ug::NLGaussSeidelSolver< TDomain, TAlgebra >::vector_type

Vector type.

Constructor & Destructor Documentation

◆ NLGaussSeidelSolver() [1/2]

template<typename TDomain , typename TAlgebra >
ug::NLGaussSeidelSolver< TDomain, TAlgebra >::NLGaussSeidelSolver

constructor

References new().

◆ NLGaussSeidelSolver() [2/2]

template<typename TDomain , typename TAlgebra >
ug::NLGaussSeidelSolver< TDomain, TAlgebra >::NLGaussSeidelSolver ( SmartPtr< approx_space_type spApproxSpace,
SmartPtr< IConvergenceCheck< vector_type > >  spConvCheck 
)

constructor

Member Function Documentation

◆ apply()

template<typename TDomain , typename TAlgebra >
bool ug::NLGaussSeidelSolver< TDomain, TAlgebra >::apply ( vector_type u)
virtual

◆ config_string()

template<typename TDomain , typename TAlgebra >
virtual std::string ug::NLGaussSeidelSolver< TDomain, TAlgebra >::config_string ( ) const
inlinevirtual

◆ init()

template<typename TDomain , typename TAlgebra >
bool ug::NLGaussSeidelSolver< TDomain, TAlgebra >::init ( SmartPtr< IOperator< vector_type > >  op)
virtual

This operator inverts the Operator op: Y -> X.

References ug::GridLevel::LEVEL, NL_GAUSSSEIDEL_PROFILE_BEGIN, ug::GridLevel::SURFACE, and UG_THROW.

◆ prepare()

template<typename TDomain , typename TAlgebra >
bool ug::NLGaussSeidelSolver< TDomain, TAlgebra >::prepare ( vector_type u)
virtual

◆ set_approximation_space()

template<typename TDomain , typename TAlgebra >
void ug::NLGaussSeidelSolver< TDomain, TAlgebra >::set_approximation_space ( SmartPtr< approx_space_type spApproxSpace)
inline

◆ set_constraint()

template<typename TDomain , typename TAlgebra >
void ug::NLGaussSeidelSolver< TDomain, TAlgebra >::set_constraint ( const vector_type cons)
inline

◆ set_convergence_check()

template<typename TDomain , typename TAlgebra >
void ug::NLGaussSeidelSolver< TDomain, TAlgebra >::set_convergence_check ( SmartPtr< IConvergenceCheck< vector_type > >  spConvCheck)

◆ set_damp()

template<typename TDomain , typename TAlgebra >
void ug::NLGaussSeidelSolver< TDomain, TAlgebra >::set_damp ( const number  damp)
inline

◆ write_debug() [1/2]

template<typename TDomain , typename TAlgebra >
void ug::NLGaussSeidelSolver< TDomain, TAlgebra >::write_debug ( const matrix_type mat,
const char *  filename 
)
private

help functions for debug output

References name.

◆ write_debug() [2/2]

template<typename TDomain , typename TAlgebra >
void ug::NLGaussSeidelSolver< TDomain, TAlgebra >::write_debug ( const vector_type vec,
const char *  filename 
)
private

help functions for debug output

References name.

Member Data Documentation

◆ m_bProjectedGS

template<typename TDomain , typename TAlgebra >
bool ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_bProjectedGS
private

◆ m_ConsVec

template<typename TDomain , typename TAlgebra >
vector_type ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_ConsVec
private

vector describing a constraint

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

◆ m_damp

template<typename TDomain , typename TAlgebra >
number ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_damp
private

◆ m_dgbCall

template<typename TDomain , typename TAlgebra >
int ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_dgbCall
private

call counter

◆ m_gridLevel

template<typename TDomain , typename TAlgebra >
GridLevel ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_gridLevel
private

DoF Distribution used.

◆ m_map

template<typename TDomain , typename TAlgebra >
LocalToGlobalMapperNLGS<TAlgebra> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_map
private

LocalToGlobal-Mapper which accounts for index-wise assembling.

◆ m_sel

template<typename TDomain , typename TAlgebra >
Selector ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_sel
private

selector of elements with contributions to a specific DoF

◆ m_spApproxSpace

template<typename TDomain , typename TAlgebra >
SmartPtr<approx_space_type> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spApproxSpace
private

◆ m_spAss

template<typename TDomain , typename TAlgebra >
SmartPtr<IAssemble<TAlgebra> > ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spAss
private

◆ m_spAssOp

template<typename TDomain , typename TAlgebra >
SmartPtr<AssembledOperator<algebra_type> > ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spAssOp
private

◆ m_spConvCheck

template<typename TDomain , typename TAlgebra >
SmartPtr<IConvergenceCheck<vector_type> > ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spConvCheck
private

◆ m_spJBlock

template<typename TDomain , typename TAlgebra >
SmartPtr<AssembledLinearOperator<algebra_type> > ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spJBlock
private

◆ m_spLevDD

template<typename TDomain , typename TAlgebra >
ConstSmartPtr<DoFDistribution> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spLevDD
private

DoF distribution pointer.

◆ m_spSurfDD

template<typename TDomain , typename TAlgebra >
ConstSmartPtr<DoFDistribution> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_spSurfDD
private

◆ m_vElemList

template<typename TDomain , typename TAlgebra >
std::vector<elemList> ug::NLGaussSeidelSolver< TDomain, TAlgebra >::m_vElemList
private

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