ug4
|
Nested iteration solver (e.g. for full multigrid) More...
#include <nested_iteration.h>
Public Types | |
typedef TAlgebra | algebra_type |
Algebra type. More... | |
typedef GridFunction< TDomain, CPUAlgebra > | error_function_type |
Error function type. More... | |
typedef GridFunction< TDomain, TAlgebra > | grid_function_type |
GridFunction type. More... | |
typedef TAlgebra::matrix_type | matrix_type |
Matrix 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 std::string | config_string () const |
returns information about configuration parameters More... | |
NestedIterationSolver () | |
default constructor More... | |
NestedIterationSolver (SmartPtr< IAssemble< TAlgebra > > spAss) | |
constructor using assembling More... | |
NestedIterationSolver (SmartPtr< IAssemble< TAlgebra > > spAss, SmartPtr< IAssemble< TAlgebra > > spDomErr) | |
constructor using assembling More... | |
NestedIterationSolver (SmartPtr< ILinearOperatorInverse< vector_type > > LinearSolver) | |
constructor More... | |
NestedIterationSolver (SmartPtr< IOperator< vector_type > > N) | |
constructor setting operator More... | |
void | set_debug_elem_error (SmartPtr< error_function_type > spErrEta) |
void | set_linear_solver (SmartPtr< ILinearOperatorInverse< vector_type > > LinearSolver) |
sets the linear solver (this should be a fixed number of multi-grid cycles ) More... | |
IOperatorInverse interface | |
virtual bool | init (SmartPtr< IOperator< vector_type > > N) |
virtual bool | prepare (vector_type &u) |
prepare Operator More... | |
virtual bool | apply (vector_type &u) |
apply Operator, i.e. N^{-1}(0) = u More... | |
Adaptive refinement | |
for adaptive nested iteration | |
int | top_level () const |
getter/setter for top level More... | |
void | set_top_level (int lev) |
getter/setter for top level More... | |
int | base_level () const |
getter/setter for base level More... | |
void | set_base_level (int lev) |
getter/setter for top level More... | |
void | set_refiner (SmartPtr< IRefiner > r) |
set grid refiner More... | |
void | set_refinement_marking (SmartPtr< IElementMarkingStrategy< TDomain > > m) |
set marking strategy More... | |
void | set_coarsening_marking (SmartPtr< IElementMarkingStrategy< TDomain > > m) |
getter/setter for top level More... | |
void | set_tolerance (number tol) |
getter/setter for top level More... | |
bool | use_adaptive_refinement () const |
indicates, if grids should be refined further (if desired accuracy has not been achieved) More... | |
void | disable_adaptive_refinement () |
disable grid refinement More... | |
void | enable_adaptive_refinement () |
enable grid refinement More... | |
void | set_max_steps (int steps) |
getter/setter for top level More... | |
number | last_error () const |
getter/setter for top level More... | |
void | set_associated_space (SmartPtr< IGridFunctionSpace< grid_function_type > > spSpace) |
getter/setter for top level More... | |
void | set_absolute_tolerance (number atol) |
getter/setter for top level More... | |
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 Member Functions | |
number | coarsen_domain (const grid_function_type &u) |
Coarsen all elements. More... | |
void | estimate_and_mark_domain (const grid_function_type &u, SmartPtr< IElementMarkingStrategy< TDomain > > spMarking, bool bClearMarks=true) |
Refines domain and provides error estimate. More... | |
number | refine_domain (const grid_function_type &u) |
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... | |
Additional Inherited Members | |
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... | |
Nested iteration solver (e.g. for full multigrid)
If error estimators are available and the convergence rate of the FE/FV method is known, these methods allow to construct an optimal order method.
typedef TAlgebra ug::NestedIterationSolver< TDomain, TAlgebra >::algebra_type |
Algebra type.
typedef GridFunction<TDomain, CPUAlgebra> ug::NestedIterationSolver< TDomain, TAlgebra >::error_function_type |
Error function type.
typedef GridFunction<TDomain, TAlgebra> ug::NestedIterationSolver< TDomain, TAlgebra >::grid_function_type |
GridFunction type.
typedef TAlgebra::matrix_type ug::NestedIterationSolver< TDomain, TAlgebra >::matrix_type |
Matrix type.
typedef TAlgebra::vector_type ug::NestedIterationSolver< TDomain, TAlgebra >::vector_type |
Vector type.
ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver |
default constructor
ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver | ( | SmartPtr< IOperator< vector_type > > | N | ) |
constructor setting operator
References ug::NestedIterationSolver< TDomain, TAlgebra >::init().
ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver | ( | SmartPtr< IAssemble< TAlgebra > > | spAss | ) |
constructor using assembling
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_N, and ug::NestedIterationSolver< TDomain, TAlgebra >::m_spAss.
ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver | ( | SmartPtr< IAssemble< TAlgebra > > | spAss, |
SmartPtr< IAssemble< TAlgebra > > | spDomErr | ||
) |
constructor using assembling
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_N, and ug::NestedIterationSolver< TDomain, TAlgebra >::m_spAss.
ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver | ( | SmartPtr< ILinearOperatorInverse< vector_type > > | LinearSolver | ) |
constructor
|
virtual |
apply Operator, i.e. N^{-1}(0) = u
Apply solver for top level grid function.
returns: approximation by nested iteration. Input values are ignored.
Implements ug::IOperatorInverse< TAlgebra::vector_type >.
References ug::GetStringPrintf(), ug::GridFunction< TDomain, TAlgebra >::grid_level(), ug::GridLevel::is_surface(), ug::GridLevel::level(), make_sp(), name, NESTED_ITER_PROFILE_BEGIN, NESTED_ITER_PROFILE_END, ug::VTKOutput< TDim >::print(), ug::GridLevel::top(), UG_ASSERT, UG_CATCH_THROW, UG_LOG, and UG_THROW.
|
inline |
getter/setter for base level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_baseLevel.
|
protected |
Coarsen all elements.
|
virtual |
returns information about configuration parameters
this should return necessary information about parameters and possibly calling config_string of subcomponents.
Implements ug::IOperatorInverse< TAlgebra::vector_type >.
References ug::ConfigShift().
|
inline |
disable grid refinement
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_bUseAdaptiveRefinement.
|
inline |
enable grid refinement
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_bUseAdaptiveRefinement.
|
protected |
Refines domain and provides error estimate.
Values depend on m_spDomErr
References ug::GridFunction< TDomain, TAlgebra >::dd(), UG_ASSERT, UG_LOG, and SmartPtr< T, FreePolicy >::valid().
|
virtual |
This operator inverts the Operator N: Y -> X
Requires an AssembledOperator
References NESTED_ITER_PROFILE_BEGIN, and UG_THROW.
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver().
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_lastError.
|
virtual |
prepare Operator
todo: remove from interface
Implements ug::IOperatorInverse< TAlgebra::vector_type >.
|
protected |
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_absTOL, and UG_LOG.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_spAssociatedSpace.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_baseLevel.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_spCoarseningMarking.
|
inline |
|
inline |
sets the linear solver (this should be a fixed number of multi-grid cycles )
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_spLinearSolver.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_maxSteps.
|
inline |
set marking strategy
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_spRefinementMarking.
|
inline |
set grid refiner
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_spRefiner.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_TOL, and UG_LOG.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_topLevel.
|
inline |
getter/setter for top level
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_topLevel.
|
inline |
indicates, if grids should be refined further (if desired accuracy has not been achieved)
References ug::NestedIterationSolver< TDomain, TAlgebra >::m_bUseAdaptiveRefinement.
|
private |
absolute tolerance (for relative error)
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::set_absolute_tolerance().
|
private |
|
private |
|
private |
call counter
|
private |
jacobi operator
|
private |
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::last_error().
|
private |
|
private |
|
private |
assembling routine
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver().
|
private |
assembling
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::NestedIterationSolver().
|
private |
associated norm (for relative error)
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::set_associated_space().
|
private |
|
private |
|
private |
(optional) debug info for adaptive refinement
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::set_debug_elem_error().
|
private |
linear solver
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::set_linear_solver().
|
private |
|
private |
(adaptive) refinement
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::set_refiner().
|
private |
tolerance
Referenced by ug::NestedIterationSolver< TDomain, TAlgebra >::set_tolerance().
|
private |