1 #ifndef DUNE_FEM_CREATEPASS_HH 2 #define DUNE_FEM_CREATEPASS_HH 34 template<
class Model ,
template <
class,
class,
int>
class PassType ,
int pId = -1 >
50 const DiscreteFunctionSpaceType&
space_;
57 CreatePass(Model& model,
const DiscreteFunctionSpaceType& space)
58 : model_(model) , space_(space) , passPointer_(0)
65 CreatePass(
const Model& model,
const DiscreteFunctionSpaceType& space)
66 : model_(const_cast<Model&> (model)) , space_(space) , passPointer_(0)
74 passPointer_( org.passPointer_ )
79 template <
class PreviousPass>
83 typedef PassType< Model , PreviousPass , passId > RealPassType;
86 RealPassType*
pass =
new RealPassType(model_,prevObj->
pass(),
space_);
89 ObjPtrType* obj =
new ObjPtrType(pass);
95 obj->saveObjPointer(prevObj);
100 template <
class PreviousPass>
104 typedef PassType< Model , PreviousPass , passId > RealPassType;
107 RealPassType*
pass =
new RealPassType(model_,prevObj->
pass(),
space_);
110 ObjPtrType* obj =
new ObjPtrType(pass);
116 obj->saveObjPointer(prevObj);
123 assert( passPointer_ );
130 assert( passPointer_ );
137 template <
class DiscreteModelImp,
class SelectorImp>
140 public DiscreteModelImp
143 typedef DiscreteModelImp BaseType;
159 template <
class Model,
class SelectorImp,
template <
class,
class>
class PassType>
184 : model_(new DiscreteModelType(model))
193 : model_(new DiscreteModelType(org.model_)),
195 passPointer_( org.passPointer_ ),
203 if( owner_ )
delete model_;
208 template <
class PreviousPass>
212 typedef PassType<DiscreteModelType,PreviousPass> RealPassType;
215 RealPassType*
pass =
new RealPassType(*model_,prevObj->
pass(),
space_);
218 ObjPtrType* obj =
new ObjPtrType(pass, model_ );
227 obj->saveObjPointer(prevObj);
232 template <
class PreviousPass>
236 typedef PassType<DiscreteModelType,PreviousPass> RealPassType;
239 RealPassType*
pass =
new RealPassType(*model_,prevObj->
pass(),
space_);
242 ObjPtrType* obj =
new ObjPtrType(pass, model_);
251 obj->saveObjPointer(prevObj);
258 assert( passPointer_ );
265 assert( passPointer_ );
275 template <
class Model,
template <
class,
class,
int>
class PassType,
306 paramFile_(paramfile),
313 : model_(org.model_) , space_(org.space_),
314 paramFile_(org.paramFile_),
315 passPointer_(org.passPointer_)
320 template <
class PreviousPass>
324 typedef PassType<Model,PreviousPass,passId> RealPassType;
327 RealPassType*
pass =
new RealPassType(model_,prevObj->
pass(),
space_,paramFile_);
330 ObjPtrType* obj =
new ObjPtrType(pass);
336 obj->saveObjPointer(prevObj);
341 template <
class PreviousPass>
345 typedef PassType<Model,PreviousPass,passId> RealPassType;
348 RealPassType*
pass =
new RealPassType(model_,prevObj->
pass(),
space_,paramFile_);
351 ObjPtrType* obj =
new ObjPtrType(pass);
357 obj->saveObjPointer(prevObj);
364 assert( passPointer_ );
373 template <
int startPassId = -1>
378 template <
class DestinationType>
385 StartPassType* startPass =
new StartPassType ();
388 ObjPtrType* obj =
new ObjPtrType(startPass);
396 template <
class LastModel>
400 return ml.createLast( createStartPass<typename LastModel :: DestinationType> () );
404 template <
class FirstModel,
410 return ml.createLast( mf.create( createStartPass<typename LastModel :: DestinationType>() ) );
414 template <
class Mod0,
422 return mlast.createLast(
424 m0.create( createStartPass<typename LastModel :: DestinationType> () )
430 template <
class Mod0,
440 return mlast.createLast( m2.create( m1.create(
441 m0.create( createStartPass<typename LastModel :: DestinationType> () )
446 template <
class Mod0,
463 m0.create( createStartPass<typename LastModel :: DestinationType> () )
468 template <
class Mod0,
488 m0.create( createStartPass<typename LastModel :: DestinationType> () )
492 template <
class Mod0,
515 m0.create( createStartPass<typename LastModel :: DestinationType> () )
520 template <
class Mod0,
546 m0.create( createStartPass<typename LastModel :: DestinationType> () )
550 template <
class Mod0,
579 m0.create( createStartPass<typename LastModel :: DestinationType> () )
587 #endif // #ifndef DUNE_FEM_CREATEPASS_HH DiscreteModelWrapper(const DiscreteModelWrapper &other)
copy constructor
Definition: createpass.hh:153
DiscreteFunctionSpaceType & space_
Definition: createpass.hh:294
Model & model_
Definition: createpass.hh:49
Model::Traits::DiscreteFunctionType DestinationType
destination type
Definition: createpass.hh:44
Definition: createpass.hh:39
const std::string paramFile_
Definition: createpass.hh:295
SpaceOperatorWrapper< PassType< Model, PreviousPass, passId > > * createLast(SpaceOperatorStorage< PreviousPass > *prevObj)
last creation method
Definition: createpass.hh:102
const DiscreteFunctionSpaceType & space_
Definition: createpass.hh:175
create pass tree from given list of discrete models the passId is deliviered to the start pass and st...
Definition: createpass.hh:374
apply wrapper
Definition: spaceoperatorif.hh:317
Model::Traits::DiscreteFunctionType DestinationType
destination type
Definition: createpass.hh:166
only for keeping the pointer
Definition: spaceoperatorif.hh:254
SpaceOperatorPtr< PassType< DiscreteModelType, PreviousPass > > * create(SpaceOperatorStorage< PreviousPass > *prevObj)
creation method
Definition: createpass.hh:210
const DestinationType * destination() const
return pointer to destination
Definition: createpass.hh:263
const DestinationType * destination() const
return pointer to destination
Definition: createpass.hh:362
virtual const DestinationType * destination() const
return reference to pass's local memory
Definition: spaceoperatorif.hh:207
CreatePass takes a discrete model and a PassType (like LocalDGPass) and creates with the parameter Pr...
Definition: createpass.hh:35
CreateSelectedPass(const CreateSelectedPass &org)
copy constructor
Definition: createpass.hh:192
DiscreteModelWrapper to combine DiscreteModel and Selector.
Definition: createpass.hh:138
bool owner_
Definition: createpass.hh:177
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, Mod2 &m2, Mod3 &m3, Mod4 &m4, Mod5 &m5, Mod6 &m6, Mod7 &m7, LastModel &mlast)
create 9 passes
Definition: createpass.hh:560
SpaceOperatorInterface< DestinationType > SpaceOperatorIFType
type of space operator
Definition: createpass.hh:47
CreateSelectedPass(Model &model, const DiscreteFunctionSpaceType &space)
Definition: createpass.hh:183
CreateFeaturedPass(const CreateFeaturedPass &org)
copy constructor
Definition: createpass.hh:312
DiscreteModelType * model_
Definition: createpass.hh:174
SpaceOperatorIFType * pass()
return pointer to space operator if
Definition: createpass.hh:256
OperatorType & pass() const
return reference to pass
Definition: spaceoperatorif.hh:245
CreatePass(const CreatePass &org)
copy constructor
Definition: createpass.hh:71
SpaceType DiscreteFunctionSpaceType
type of discrete functions space
Definition: createpass.hh:286
SpaceOperatorIFType * passPointer_
Definition: createpass.hh:51
CreatePass(const Model &model, const DiscreteFunctionSpaceType &space)
Definition: createpass.hh:65
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, Mod2 &m2, Mod3 &m3, Mod4 &m4, Mod5 &m5, LastModel &mlast)
create 7 passes
Definition: createpass.hh:500
Definition: objpointer.hh:37
SpaceOperatorWrapper< PassType< DiscreteModelType, PreviousPass > > * createLast(SpaceOperatorStorage< PreviousPass > *prevObj)
last creation method
Definition: createpass.hh:234
Model & model_
Definition: createpass.hh:293
Model::Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of discrete function space
Definition: createpass.hh:164
interface for time evolution operators
Definition: spaceoperatorif.hh:101
SpaceOperatorIFType * passPointer_
Definition: createpass.hh:176
CreateFeaturedPass(Model &model, DiscreteFunctionSpaceType &space, std::string paramfile="")
Definition: createpass.hh:303
SpaceOperatorInterface< DestinationType > SpaceOperatorIFType
type of space operator
Definition: createpass.hh:169
Definition: coordinate.hh:4
Model::Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of discrete function space
Definition: createpass.hh:42
Model::Traits::DiscreteFunctionType DestinationType
destination type
Definition: createpass.hh:288
static SpaceOperatorStorage< StartPass< DestinationType, startPassId > > * createStartPass()
method that creates first pass
Definition: createpass.hh:379
const DestinationType * destination() const
return pointer to destination
Definition: createpass.hh:128
CreateFeaturedPass takes a discrete model and a PassType (like LocalDGEllliptPass) and creates with t...
Definition: createpass.hh:279
const DiscreteFunctionSpaceType & space_
Definition: createpass.hh:50
SpaceOperatorPtr< PassType< Model, PreviousPass, passId > > * create(SpaceOperatorStorage< PreviousPass > *prevObj)
creation method
Definition: createpass.hh:322
create pass with previous unknown selector
Definition: createpass.hh:160
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(FirstModel &mf, LastModel &ml)
create 2 passes
Definition: createpass.hh:407
SpaceOperatorIFType * passPointer_
Definition: createpass.hh:296
DiscreteModelWrapper(const BaseType &base)
constructor calling the copy constructor of the base type
Definition: createpass.hh:148
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, LastModel &mlast)
create 3 passes
Definition: createpass.hh:418
SpaceOperatorIFType * pass()
return pointer to space operator if
Definition: createpass.hh:121
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(LastModel &ml)
create 1 pass
Definition: createpass.hh:398
DiscreteModelWrapper< Model, SelectorImp > DiscreteModelType
type of discrete model
Definition: createpass.hh:172
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, Mod2 &m2, LastModel &mlast)
create 4 passes
Definition: createpass.hh:435
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, Mod2 &m2, Mod3 &m3, Mod4 &m4, Mod5 &m5, Mod6 &m6, LastModel &mlast)
create 8 passes
Definition: createpass.hh:529
only for keeping the pointer
Definition: spaceoperatorif.hh:212
~CreateSelectedPass()
destructor deleting model if still owner
Definition: createpass.hh:201
SelectorImp SelectorType
exporting given type of selector
Definition: createpass.hh:146
End marker for a compile-time list of passes.
Definition: common/pass.hh:47
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, Mod2 &m2, Mod3 &m3, Mod4 &m4, LastModel &mlast)
create 6 passes
Definition: createpass.hh:475
SpaceOperatorWrapper< PassType< Model, PreviousPass, passId > > * createLast(SpaceOperatorStorage< PreviousPass > *prevObj)
last creation method
Definition: createpass.hh:343
SpaceOperatorInterface< DestinationType > SpaceOperatorIFType
type of space operator
Definition: createpass.hh:291
CreatePass(Model &model, const DiscreteFunctionSpaceType &space)
Definition: createpass.hh:57
SpaceOperatorPtr< PassType< Model, PreviousPass, passId > > * create(SpaceOperatorStorage< PreviousPass > *prevObj)
creation method
Definition: createpass.hh:81
static SpaceOperatorInterface< typename LastModel::DestinationType > * create(Mod0 &m0, Mod1 &m1, Mod2 &m2, Mod3 &m3, LastModel &mlast)
create 5 passes
Definition: createpass.hh:452