33 #ifndef __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__STD_TRANSFER__
34 #define __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__STD_TRANSFER__
56 template <
typename TDomain,
typename TAlgebra>
129 GF* pFine =
dynamic_cast<GF*
>(&uFine);
130 const GF* pCoarse =
dynamic_cast<const GF*
>(&uCoarse);
131 if(!pFine || !pCoarse)
132 UG_THROW(
"StdTransfer: fine and coarse vectors expected to be "
139 const GF* pFine =
dynamic_cast<const GF*
>(&uFine);
140 GF* pCoarse =
dynamic_cast<GF*
>(&uCoarse);
141 if(!pFine || !pCoarse)
142 UG_THROW(
"StdTransfer: fine and coarse vectors expected to be "
169 template <
typename TChild>
179 template <
typename TChild>
209 typedef std::map<TransferKey, SmartPtr<matrix_type> >
TransferMap;
214 typedef typename TransferMap::iterator iterator;
215 for(iterator iter = map.begin(); iter != map.end();)
218 if((cnt.
obj() == revCnt.
obj()) && (cnt != revCnt)){
location name
Definition: checkpoint_util.lua:128
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
base class for approximation spaces without type of algebra or dof distribution
Definition: approximation_space.h:279
Definition: dof_distribution.h:51
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
Definition: grid_level.h:42
base class for all debug writer
Definition: debug_writer.h:244
interface for transfer routines
Definition: transfer_interface.h:50
std::vector< SmartPtr< IConstraint< TAlgebra > > > m_vConstraint
list of post processes
Definition: transfer_interface.h:117
Wrapper for sequential matrices to handle them in parallel.
Definition: parallel_matrix.h:65
Class used to identify a state of adaption of a grid, approx-space, ...
Definition: revision_counter.h:56
const void * obj() const
returns the associated object
Definition: revision_counter.h:123
Standard Prolongation Operator.
Definition: std_transfer.h:59
void assemble_restriction(matrix_type &mat, const DoFDistribution &coarseDD, const DoFDistribution &fineDD, ConstSmartPtr< TDomain > spDomain)
Definition: std_transfer_impl.h:410
void assemble_prolongation_p1(matrix_type &mat, const DoFDistribution &fineDD, const DoFDistribution &coarseDD)
Definition: std_transfer_impl.h:47
virtual SmartPtr< matrix_type > restriction(const GridLevel &coarseGL, const GridLevel &fineGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace)
returns restriction as a matrix
Definition: std_transfer_impl.h:668
TransferMap m_mRestriction
Definition: std_transfer.h:210
TAlgebra::matrix_type matrix_type
Type of Matrix.
Definition: std_transfer.h:71
void remove_outdated(TransferMap &map, const RevisionCounter &revCnt)
Definition: std_transfer.h:213
TAlgebra::vector_type vector_type
Type of Vector.
Definition: std_transfer.h:68
GridFunction< TDomain, TAlgebra > GF
Type of GridFunction.
Definition: std_transfer.h:77
StdTransfer()
Default constructor.
Definition: std_transfer.h:81
virtual void do_restrict(vector_type &uCoarse, const vector_type &uFine)
apply transposed Operator, restrict function
Definition: std_transfer.h:138
virtual SmartPtr< matrix_type > prolongation(const GridLevel &fineGL, const GridLevel &coarseGL, ConstSmartPtr< ApproximationSpace< TDomain > > spApproxSpace)
returns prolongation as a matrix
Definition: std_transfer_impl.h:605
ITransferOperator< TDomain, TAlgebra > base_type
Type of base class.
Definition: std_transfer.h:62
bool m_bUseTransposed
flag if transposed is used
Definition: std_transfer.h:241
SmartPtr< IDebugWriter< TAlgebra > > m_spDebugWriter
debug writer
Definition: std_transfer.h:244
virtual void set_levels(GridLevel coarseLevel, GridLevel fineLevel)
Set levels.
Definition: std_transfer.h:119
virtual void init()
initialize the operator
Definition: std_transfer.h:122
void set_restriction_damping(number damp)
set restriction damping (only applied on vector operation, not (!!) in assembled matrices)
Definition: std_transfer.h:92
std::map< TransferKey, SmartPtr< matrix_type > > TransferMap
Definition: std_transfer.h:209
TDomain domain_type
Type of Domain.
Definition: std_transfer.h:74
void enable_p1_lagrange_optimization(bool enable)
enables/disables an assembling optimization for p1-lagrange elements
Definition: std_transfer.h:111
number m_dampProl
Definition: std_transfer.h:235
void set_use_transposed(bool bTransposed)
sets if restriction and prolongation are transposed
Definition: std_transfer.h:115
virtual void prolongate(vector_type &uFine, const vector_type &uCoarse)
apply Operator, interpolate function
Definition: std_transfer.h:128
bool p1_lagrange_optimization_enabled() const
Definition: std_transfer.h:112
number m_dampRes
damping parameter
Definition: std_transfer.h:234
TAlgebra algebra_type
Type of Algebra.
Definition: std_transfer.h:65
TransferMap m_mProlongation
Definition: std_transfer.h:211
bool m_p1LagrangeOptimizationEnabled
flag for p1-lagrange-optimization
Definition: std_transfer.h:231
void set_prolongation_damping(number damp)
set prolongation damping (only applied on vector operation, not (!!) in assembled matrices)
Definition: std_transfer.h:95
virtual SmartPtr< ITransferOperator< TDomain, TAlgebra > > clone()
returns new instance with same setting
Definition: std_transfer_impl.h:810
void set_debug(SmartPtr< IDebugWriter< TAlgebra > > spDebugWriter)
set debug writer
Definition: std_transfer.h:98
void write_debug(const matrix_type &mat, std::string name, const GridLevel &glTo, const GridLevel &glFrom)
debug writing of matrix
Definition: std_transfer_impl.h:825
void assemble_prolongation(matrix_type &mat, const DoFDistribution &fineDD, const DoFDistribution &coarseDD, ConstSmartPtr< TDomain > spDomain)
Definition: std_transfer_impl.h:217
virtual ~StdTransfer()
virtual destructor
Definition: std_transfer.h:89
bool bCached
flag if cached (matrix) transfer used
Definition: std_transfer.h:238
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
struct to distinguish already assembled operators
Definition: std_transfer.h:195
GridLevel toGL
Definition: std_transfer.h:199
bool operator<(const TransferKey &other) const
Definition: std_transfer.h:202
TransferKey(const GridLevel &toGL_, const GridLevel &fromGL_, const RevisionCounter &revCnt_)
Definition: std_transfer.h:196
RevisionCounter revCnt
Definition: std_transfer.h:200
GridLevel fromGL
Definition: std_transfer.h:199