ug4
|
Standard Prolongation Operator. More...
#include <std_transfer.h>
Classes | |
struct | TransferKey |
struct to distinguish already assembled operators More... | |
Public Types | |
typedef TAlgebra | algebra_type |
Type of Algebra. | |
typedef ITransferOperator< TDomain, TAlgebra > | base_type |
Type of base class. | |
typedef TDomain | domain_type |
Type of Domain. | |
typedef GridFunction< TDomain, TAlgebra > | GF |
Type of GridFunction. | |
typedef TAlgebra::matrix_type | matrix_type |
Type of Matrix. | |
typedef TAlgebra::vector_type | vector_type |
Type of Vector. | |
![]() | |
typedef TDomain | domain_type |
Domain type. | |
typedef TAlgebra::matrix_type | matrix_type |
Matrix type. | |
typedef TAlgebra::vector_type | vector_type |
Vector type. | |
Public Member Functions | |
virtual SmartPtr< ITransferOperator< TDomain, TAlgebra > > | clone () |
returns new instance with same setting | |
void | do_restrict (GF &uCoarse, const GF &uFine) |
apply operator to a grid function | |
virtual void | do_restrict (vector_type &uCoarse, const vector_type &uFine) |
apply transposed Operator, restrict function | |
void | enable_p1_lagrange_optimization (bool enable) |
enables/disables an assembling optimization for p1-lagrange elements | |
virtual void | init () |
initialize the operator | |
bool | p1_lagrange_optimization_enabled () const |
void | prolongate (GF &uFine, const GF &uCoarse) |
apply operator to a grid function | |
virtual void | prolongate (vector_type &uFine, const vector_type &uCoarse) |
apply Operator, interpolate function | |
virtual SmartPtr< matrix_type > | prolongation (const GridLevel &fineGL, const GridLevel &coarseGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace) |
returns prolongation as a matrix | |
virtual SmartPtr< matrix_type > | restriction (const GridLevel &coarseGL, const GridLevel &fineGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace) |
returns restriction as a matrix | |
void | set_debug (SmartPtr< IDebugWriter< TAlgebra > > spDebugWriter) |
set debug writer | |
virtual void | set_levels (GridLevel coarseLevel, GridLevel fineLevel) |
Set levels. | |
void | set_prolongation_damping (number damp) |
set prolongation damping (only applied on vector operation, not (!!) in assembled matrices) | |
void | set_restriction_damping (number damp) |
set restriction damping (only applied on vector operation, not (!!) in assembled matrices) | |
void | set_use_transposed (bool bTransposed) |
sets if restriction and prolongation are transposed | |
StdTransfer () | |
Default constructor. | |
virtual | ~StdTransfer () |
virtual destructor | |
![]() | |
virtual void | add_constraint (SmartPtr< IConstraint< TAlgebra > > pp) |
adds a dirichlet post process (not added if already registered) | |
virtual void | clear_constraints () |
clears dirichlet post processes | |
ITransferOperator () | |
constructor | |
virtual void | remove_constraint (SmartPtr< IConstraint< TAlgebra > > pp) |
removes a post process | |
virtual | ~ITransferOperator () |
virtual destructor | |
Protected Types | |
typedef std::map< TransferKey, SmartPtr< matrix_type > > | TransferMap |
Protected Member Functions | |
template<typename TChild > | |
void | assemble_prolongation (matrix_type &mat, const DoFDistribution &fineDD, const DoFDistribution &coarseDD, ConstSmartPtr< TDomain > spDomain) |
void | assemble_prolongation (matrix_type &mat, const DoFDistribution &fineDD, const DoFDistribution &coarseDD, ConstSmartPtr< TDomain > spDomain) |
void | assemble_prolongation_p1 (matrix_type &mat, const DoFDistribution &fineDD, const DoFDistribution &coarseDD) |
template<typename TChild > | |
void | assemble_restriction (matrix_type &mat, const DoFDistribution &coarseDD, const DoFDistribution &fineDD, ConstSmartPtr< TDomain > spDomain) |
void | assemble_restriction (matrix_type &mat, const DoFDistribution &coarseDD, const DoFDistribution &fineDD, ConstSmartPtr< TDomain > spDomain) |
void | remove_outdated (TransferMap &map, const RevisionCounter &revCnt) |
void | write_debug (const matrix_type &mat, std::string name, const GridLevel &glTo, const GridLevel &glFrom) |
debug writing of matrix | |
Protected Attributes | |
bool | bCached |
flag if cached (matrix) transfer used | |
bool | m_bUseTransposed |
flag if transposed is used | |
number | m_dampProl |
number | m_dampRes |
damping parameter | |
TransferMap | m_mProlongation |
TransferMap | m_mRestriction |
bool | m_p1LagrangeOptimizationEnabled |
flag for p1-lagrange-optimization | |
SmartPtr< IDebugWriter< TAlgebra > > | m_spDebugWriter |
debug writer | |
std::vector< SmartPtr< IConstraint< TAlgebra > > > | m_vConstraint |
list of post processes | |
![]() | |
std::vector< SmartPtr< IConstraint< TAlgebra > > > | m_vConstraint |
list of post processes | |
Standard Prolongation Operator.
By default a special optimization is performed for p1-lagrange-elements. This optimization is only valid if all elements have been refined with standard refinement rules. If closure elements are generated, this optimization has to be deactivated (use StdTransfer::enable_p1_lagrange_optimization(false)).
typedef TAlgebra ug::StdTransfer< TDomain, TAlgebra >::algebra_type |
Type of Algebra.
typedef ITransferOperator<TDomain, TAlgebra> ug::StdTransfer< TDomain, TAlgebra >::base_type |
Type of base class.
typedef TDomain ug::StdTransfer< TDomain, TAlgebra >::domain_type |
Type of Domain.
typedef GridFunction<TDomain, TAlgebra> ug::StdTransfer< TDomain, TAlgebra >::GF |
Type of GridFunction.
typedef TAlgebra::matrix_type ug::StdTransfer< TDomain, TAlgebra >::matrix_type |
Type of Matrix.
|
protected |
typedef TAlgebra::vector_type ug::StdTransfer< TDomain, TAlgebra >::vector_type |
Type of Vector.
|
inline |
Default constructor.
|
inlinevirtual |
virtual destructor
|
protected |
References ug::GridObject::base_object_id(), ug::DoFDistribution::collect_associated(), ug::LFEID::CROUZEIX_RAVIART, ug::LFEID::dim(), ug::DoFDistribution::dof_indices(), ug::DoFRef(), SmartPtr< T, FreePolicy >::get(), ug::MultiGrid::get_parent(), ug::DoFDistribution::inner_algebra_indices(), ug::DoFDistribution::inner_dof_indices(), ug::InnerDoFPosition(), ug::DoFDistribution::is_contained(), ug::LFEID::LAGRANGE, ug::DoFDistributionInfoProvider::lfeid(), ug::DoFDistributionInfoProvider::max_fct_dofs(), ug::DoFDistribution::multi_grid(), ug::DoFDistributionInfoProvider::num_fct(), ug::DoFDistributionInfoProvider::num_subsets(), p, ug::LFEID::PIECEWISE_CONSTANT, PROFILE_FUNC_GROUP, ug::ShapesAtGlobalPosition(), ug::LFEID::type(), UG_ASSERT, and UG_THROW.
|
protected |
|
protected |
References ug::DoFRef(), ug::ElementDebugInfo(), ug::MultiGrid::get_parent(), ug::DoFDistribution::inner_algebra_indices(), ug::DoFDistribution::inner_dof_indices(), ug::DoFDistribution::is_contained(), ug::DoFDistributionInfoProvider::is_def_in_subset(), ug::LFEID::LAGRANGE, ug::DoFDistributionInfoProvider::lfeid(), ug::DoFDistribution::multi_grid(), ug::DoFDistributionInfoProvider::num_fct(), ug::DoFDistribution::num_indices(), ug::DoFDistributionInfoProvider::num_subsets(), ug::LFEID::order(), PROFILE_FUNC_GROUP, ug::GridObject::reference_object_id(), ug::ROID_EDGE, ug::ROID_HEXAHEDRON, ug::ROID_QUADRILATERAL, ug::ROID_VERTEX, ug::LFEID::type(), UG_ASSERT, UG_THROW, ug::EdgeVertices::vertex(), ug::FaceVertices::vertex(), and ug::VolumeVertices::vertex().
|
protected |
References ug::GridObject::base_object_id(), ug::DoFDistribution::collect_associated(), ug::LFEID::CROUZEIX_RAVIART, ug::LFEID::dim(), ug::DoFDistribution::dof_indices(), ug::DoFRef(), SmartPtr< T, FreePolicy >::get(), ug::MultiGrid::get_parent(), ug::DoFDistribution::inner_algebra_indices(), ug::DoFDistribution::inner_dof_indices(), ug::InnerDoFPosition(), ug::DoFDistribution::is_contained(), ug::LFEID::LAGRANGE, ug::DoFDistributionInfoProvider::lfeid(), ug::DoFDistributionInfoProvider::max_fct_dofs(), ug::DoFDistribution::multi_grid(), ug::MultiGrid::num_children(), ug::DoFDistributionInfoProvider::num_fct(), ug::DoFDistributionInfoProvider::num_subsets(), p, ug::LFEID::PIECEWISE_CONSTANT, PROFILE_FUNC_GROUP, ug::ShapesAtGlobalPosition(), ug::LFEID::type(), UG_ASSERT, and UG_THROW.
|
protected |
|
virtual |
returns new instance with same setting
Implements ug::ITransferOperator< TDomain, TAlgebra >.
Reimplemented in ug::TruncatedMonotoneTransfer< TDomain, TAlgebra >.
void ug::StdTransfer< TDomain, TAlgebra >::do_restrict | ( | GF & | uCoarse, |
const GF & | uFine | ||
) |
apply operator to a grid function
References ug::GridFunction< TDomain, TAlgebra >::approx_space(), ug::CT_ALL, ug::GridFunction< TDomain, TAlgebra >::grid_level(), PROFILE_FUNC_GROUP, UG_CATCH_THROW, and UG_THROW.
|
inlinevirtual |
apply transposed Operator, restrict function
Implements ug::ITransferOperator< TDomain, TAlgebra >.
References ug::StdTransfer< TDomain, TAlgebra >::do_restrict(), and UG_THROW.
Referenced by ug::StdTransfer< TDomain, TAlgebra >::do_restrict().
|
inline |
enables/disables an assembling optimization for p1-lagrange elements
The optimization is enabled by default. It can however only be used, if all elements are refined with their standard refinement rule. If one uses anisotropic refinement or refinement with closure, the optimization should be disabled.
References ug::StdTransfer< TDomain, TAlgebra >::m_p1LagrangeOptimizationEnabled.
|
inlinevirtual |
initialize the operator
Implements ug::ITransferOperator< TDomain, TAlgebra >.
Reimplemented in ug::TruncatedMonotoneTransfer< TDomain, TAlgebra >.
|
inline |
void ug::StdTransfer< TDomain, TAlgebra >::prolongate | ( | GF & | uFine, |
const GF & | uCoarse | ||
) |
apply operator to a grid function
References ug::AdditiveToConsistent(), ug::GridFunction< TDomain, TAlgebra >::approx_space(), ug::LFEID::CROUZEIX_RAVIART, ug::CT_ALL, ug::GridFunction< TDomain, TAlgebra >::grid_level(), ug::MatMultDirect(), ug::LFEID::PIECEWISE_CONSTANT, PROFILE_FUNC_GROUP, ug::ScaleLayoutValues(), UG_CATCH_THROW, and UG_THROW.
|
inlinevirtual |
apply Operator, interpolate function
Implements ug::ITransferOperator< TDomain, TAlgebra >.
References ug::StdTransfer< TDomain, TAlgebra >::prolongate(), and UG_THROW.
Referenced by ug::StdTransfer< TDomain, TAlgebra >::prolongate().
|
virtual |
returns prolongation as a matrix
Reimplemented from ug::ITransferOperator< TDomain, TAlgebra >.
Reimplemented in ug::TruncatedMonotoneTransfer< TDomain, TAlgebra >.
References ug::CT_ALL, ug::LFEID::LAGRANGE, ug::GridLevel::level(), ug::PST_CONSISTENT, ug::GridLevel::type(), and UG_THROW.
|
inlineprotected |
References ug::RevisionCounter::obj().
|
virtual |
returns restriction as a matrix
Reimplemented from ug::ITransferOperator< TDomain, TAlgebra >.
Reimplemented in ug::TruncatedMonotoneTransfer< TDomain, TAlgebra >.
References ug::CT_ALL, ug::GridLevel::level(), ug::PST_CONSISTENT, ug::GridLevel::type(), and UG_THROW.
|
inline |
set debug writer
References ug::StdTransfer< TDomain, TAlgebra >::m_spDebugWriter.
|
inlinevirtual |
Set levels.
Implements ug::ITransferOperator< TDomain, TAlgebra >.
Reimplemented in ug::TruncatedMonotoneTransfer< TDomain, TAlgebra >.
|
inline |
set prolongation damping (only applied on vector operation, not (!!) in assembled matrices)
References ug::StdTransfer< TDomain, TAlgebra >::m_dampProl.
|
inline |
set restriction damping (only applied on vector operation, not (!!) in assembled matrices)
References ug::StdTransfer< TDomain, TAlgebra >::m_dampRes.
|
inline |
sets if restriction and prolongation are transposed
References ug::StdTransfer< TDomain, TAlgebra >::m_bUseTransposed.
|
protected |
debug writing of matrix
References SmartPtr< T, FreePolicy >::invalid(), ug::GridLevel::level(), name, PROFILE_FUNC_GROUP, and ug::ToString().
|
protected |
flag if cached (matrix) transfer used
|
protected |
flag if transposed is used
Referenced by ug::StdTransfer< TDomain, TAlgebra >::set_use_transposed().
|
protected |
|
protected |
damping parameter
Referenced by ug::StdTransfer< TDomain, TAlgebra >::set_restriction_damping().
|
protected |
|
protected |
|
protected |
flag for p1-lagrange-optimization
Referenced by ug::StdTransfer< TDomain, TAlgebra >::enable_p1_lagrange_optimization(), and ug::StdTransfer< TDomain, TAlgebra >::p1_lagrange_optimization_enabled().
|
protected |
debug writer
Referenced by ug::StdTransfer< TDomain, TAlgebra >::set_debug().
|
protected |
list of post processes