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. More... | |
typedef ITransferOperator< TDomain, TAlgebra > | base_type |
Type of base class. More... | |
typedef TDomain | domain_type |
Type of Domain. More... | |
typedef GridFunction< TDomain, TAlgebra > | GF |
Type of GridFunction. 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::ITransferOperator< TDomain, TAlgebra > | |
typedef TDomain | domain_type |
Domain type. More... | |
typedef TAlgebra::matrix_type | matrix_type |
Matrix type. More... | |
typedef TAlgebra::vector_type | vector_type |
Vector type. More... | |
Public Member Functions | |
virtual SmartPtr< ITransferOperator< TDomain, TAlgebra > > | clone () |
returns new instance with same setting More... | |
void | do_restrict (GF &uCoarse, const GF &uFine) |
apply operator to a grid function More... | |
virtual void | do_restrict (vector_type &uCoarse, const vector_type &uFine) |
apply transposed Operator, restrict function More... | |
void | enable_p1_lagrange_optimization (bool enable) |
enables/disables an assembling optimization for p1-lagrange elements More... | |
virtual void | init () |
initialize the operator More... | |
bool | p1_lagrange_optimization_enabled () const |
void | prolongate (GF &uFine, const GF &uCoarse) |
apply operator to a grid function More... | |
virtual void | prolongate (vector_type &uFine, const vector_type &uCoarse) |
apply Operator, interpolate function More... | |
virtual SmartPtr< matrix_type > | prolongation (const GridLevel &fineGL, const GridLevel &coarseGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace) |
returns prolongation as a matrix More... | |
virtual SmartPtr< matrix_type > | restriction (const GridLevel &coarseGL, const GridLevel &fineGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace) |
returns restriction as a matrix More... | |
void | set_debug (SmartPtr< IDebugWriter< TAlgebra > > spDebugWriter) |
set debug writer More... | |
virtual void | set_levels (GridLevel coarseLevel, GridLevel fineLevel) |
Set levels. More... | |
void | set_prolongation_damping (number damp) |
set prolongation damping (only applied on vector operation, not (!!) in assembled matrices) More... | |
void | set_restriction_damping (number damp) |
set restriction damping (only applied on vector operation, not (!!) in assembled matrices) More... | |
void | set_use_transposed (bool bTransposed) |
sets if restriction and prolongation are transposed More... | |
StdTransfer () | |
Default constructor. More... | |
virtual | ~StdTransfer () |
virtual destructor More... | |
Public Member Functions inherited from ug::ITransferOperator< TDomain, TAlgebra > | |
virtual void | add_constraint (SmartPtr< IConstraint< TAlgebra > > pp) |
adds a dirichlet post process (not added if already registered) More... | |
virtual void | clear_constraints () |
clears dirichlet post processes More... | |
ITransferOperator () | |
constructor More... | |
virtual void | remove_constraint (SmartPtr< IConstraint< TAlgebra > > pp) |
removes a post process More... | |
virtual | ~ITransferOperator () |
virtual destructor More... | |
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 More... | |
Protected Attributes | |
bool | bCached |
flag if cached (matrix) transfer used More... | |
bool | m_bUseTransposed |
flag if transposed is used More... | |
number | m_dampProl |
number | m_dampRes |
damping parameter More... | |
TransferMap | m_mProlongation |
TransferMap | m_mRestriction |
bool | m_p1LagrangeOptimizationEnabled |
flag for p1-lagrange-optimization More... | |
SmartPtr< IDebugWriter< TAlgebra > > | m_spDebugWriter |
debug writer More... | |
std::vector< SmartPtr< IConstraint< TAlgebra > > > | m_vConstraint |
list of post processes More... | |
Protected Attributes inherited from ug::ITransferOperator< TDomain, TAlgebra > | |
std::vector< SmartPtr< IConstraint< TAlgebra > > > | m_vConstraint |
list of post processes More... | |
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, dim, 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, dim, 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_THROW.
|
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_THROW.
|
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::ParallelMatrix< TMatrix >::set_storage_type(), 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::ParallelMatrix< TMatrix >::set_storage_type(), 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