1#ifndef DUNE_FEM_LOCALOPERATORS_HH 
    2#define DUNE_FEM_LOCALOPERATORS_HH 
    6#include "objpointer.hh" 
   29    template <
class FstPType, 
class SecPType, 
class SType ,
 
   30        class LocalOperatorImp>
 
   31    class LocalOperatorInterface
 
   35      typedef FstPType FirstParamType;
 
   36      typedef SecPType SecondParamType;
 
   37      typedef SType ScalarType;
 
   44      void prepareGlobal(
const FirstParamType &pa, SecondParamType &pb)
 
   46        asImp().prepareGlobal(pa,pb);
 
   52        asImp().prepareGlobal();
 
   58        asImp().finalizeGlobal();
 
   62      template<
class EntityType>
 
   63      void prepareLocal (EntityType & en)
 
   65        asImp().prepareLocal(en);
 
   69      template<
class EntityType>
 
   70      void finalizeLocal(EntityType & en)
 
   72        asImp().finalizeLocal(en);
 
   76      template<
class EntityType>
 
   77      void prepareLocal (EntityType & en1, EntityType &en2)
 
   79        asImp().prepareLocal(en1,en2);
 
   83      template<
class EntityType>
 
   84      void finalizeLocal(EntityType & en1, EntityType &en2)
 
   86        asImp().finalizeLocal(en1,en2);
 
   90      template<
class EntityType>
 
   91      void applyLocal(EntityType & en)
 
   93        asImp().applyLocal(en);
 
   97      template<
class EntityType>
 
   98      void applyLocal(EntityType & en1, EntityType &en2)
 
  100        asImp().applyLocal(en1,en2);
 
  104      LocalOperatorImp & asImp()
 
  106        return static_cast<LocalOperatorImp &
> (*this);
 
  118    template <
class FstPType, 
class SecPType, 
class SType ,
 
  119        class LocalOperatorImp>
 
  121    : 
public LocalOperatorInterface <FstPType,SecPType,
 
  122                          SType,LocalOperatorImp>
 
  127      typedef SecPType SecondParamType;
 
  128      typedef SType ScalarType;
 
  147      void finalizeGlobal() {}
 
  150      template<
class EntityType>
 
  151      void prepareLocal (EntityType & en) {}
 
  154      template<
class EntityType>
 
  158      template<
class EntityType>
 
  159      void prepareLocal (EntityType & en1, EntityType &en2){}
 
  162      template<
class EntityType>
 
  186    template <
class A, 
class B >
 
  193      typedef B SecondOperatorType;
 
  197        : _a ( a ) , _b ( b ) , printMSG_ ( printMsg )
 
  200          std::cout << 
"Create CombinedLocalOperator " << 
this << std::endl;
 
  207          std::cout << 
"Delete CombinedLocalOperator " << 
this << std::endl;
 
  211      template <
class ScalarType>
 
  212      void scaleIt( 
const ScalarType scalar);
 
  219      template <
class FirstParamType, 
class SecondParamType>
 
  220      void prepareGlobal(
const FirstParamType &pa, SecondParamType &pb);
 
  233      template<
class EntityType>
 
  237      template<
class EntityType>
 
  241      template<
class EntityType>
 
  245      template<
class EntityType>
 
  257      template<
class EntityType>
 
  261      template<
class EntityType>
 
  262      void applyLocal(EntityType & en1, EntityType &en2);
 
  283    template <
class A, 
class B >
 
  284    template <
class ScalarType>
 
  286    scaleIt(
const ScalarType scalar)
 
  291    template <
class A, 
class B >
 
  292    template <
class FirstParamType, 
class SecondParamType>
 
  298      _b.prepareGlobal(pa,pb);
 
  299      _a.prepareGlobal(pa,pb);
 
  302    template <
class A, 
class B >
 
  310    template <
class A, 
class B >
 
  311    template <
class EntityType>
 
  318    template <
class A, 
class B >
 
  319    template <
class EntityType>
 
  322      _b.finalizeLocal(en);
 
  323      _a.finalizeLocal(en);
 
  326    template <
class A, 
class B >
 
  327    template <
class EntityType>
 
  335    template <
class A, 
class B >
 
  336    template <
class EntityType>
 
  339      _b.prepareLocal(en1,en2);
 
  340      _a.prepareLocal(en1,en2);
 
  343    template <
class A, 
class B >
 
  344    template <
class EntityType>
 
  347      _b.applyLocal(en1,en2);
 
  348      _a.applyLocal(en1,en2);
 
  351    template <
class A, 
class B >
 
  352    template <
class EntityType>
 
  355      _b.finalizeLocal(en1,en2);
 
  356      _a.finalizeLocal(en1,en2);
 
  369    template <
class A,
class ScalarType>
 
  376            bool printMsg = 
false)
 
  377        : 
_a ( a ) , 
scalar_ (scalar), tmpScalar_ (scalar) ,
 
  378          printMSG_ ( printMsg )
 
  381          std::cout << 
"Create ScaledLocalOperator " << 
this << std::endl;
 
  387          std::cout << 
"Delete ScaledLocalOperator " << 
this << std::endl;
 
  390      void scaleIt ( 
const ScalarType & scalar);
 
  397      template <
class FirstParamType, 
class SecondParamType>
 
  398      void prepareGlobal(
const FirstParamType &pa, SecondParamType &pb);
 
  410      template<
class EntityType>
 
  414      template<
class EntityType>
 
  418      template<
class EntityType>
 
  422      template<
class EntityType>
 
  433      template<
class EntityType>
 
  437      template<
class EntityType>
 
  438      void applyLocal(EntityType & en1, EntityType &en2);
 
  445      ScalarType tmpScalar_;
 
  454    template <
class A, 
class ScalarType>
 
  456    scaleIt ( 
const ScalarType & scalar )
 
  458      tmpScalar_ = scalar_ * scalar;
 
  461    template <
class A, 
class ScalarType>
 
  462    template <
class FirstParamType, 
class SecondParamType>
 
  466      _a.scaleIt(tmpScalar_);
 
  467      _a.prepareGlobal(pa,pb);
 
  470    template <
class A, 
class ScalarType>
 
  476    template <
class A, 
class ScalarType>
 
  477    template <
class EntityType>
 
  483    template <
class A, 
class ScalarType>
 
  484    template <
class EntityType>
 
  487      _a.prepareLocal(en1,en2);
 
  490    template <
class A, 
class ScalarType>
 
  491    template <
class EntityType>
 
  494      _a.finalizeLocal(en);
 
  497    template <
class A, 
class ScalarType>
 
  498    template <
class EntityType>
 
  501      _a.finalizeLocal(en1,en2);
 
  504    template <
class A, 
class ScalarType>
 
  505    template <
class EntityType>
 
  511    template <
class A, 
class ScalarType>
 
  512    template <
class EntityType>
 
  515      _a.applyLocal(en1,en2);
 
Definition: localoperator.hh:189
 
~CombinedLocalOperator()
Destructor.
Definition: localoperator.hh:204
 
A FirstOperatorType
The type of the operators exported.
Definition: localoperator.hh:192
 
void scaleIt(const ScalarType scalar)
method to scale the belonging operators
Definition: localoperator.hh:286
 
void finalizeGlobal()
finalizeGlobal is called after the grid walktrough
Definition: localoperator.hh:303
 
void prepareGlobal(const FirstParamType &pa, SecondParamType &pb)
prepareGlobal is called before the grid walktrough
Definition: localoperator.hh:294
 
void applyLocal(EntityType &en)
Definition: localoperator.hh:328
 
void finalizeLocal(EntityType &en)
Definition: localoperator.hh:320
 
void prepareLocal(EntityType &en)
Definition: localoperator.hh:312
 
CombinedLocalOperator(A &a, B &b, bool printMsg=false)
Constructor for combinations storing the two operators.
Definition: localoperator.hh:196
 
Default implementation of a local operator A local operator works on entities only and is used by a D...
Definition: localoperator.hh:123
 
void prepareGlobal()
Definition: localoperator.hh:144
 
void scaleIt(const ScalarType scalar)
scale operator , for inheritance
Definition: localoperator.hh:134
 
LocalOperatorDefault()
no default implementation at the moement
Definition: localoperator.hh:131
 
void finalizeLocal(EntityType &en1, EntityType &en2)
Definition: localoperator.hh:163
 
FstPType FirstParamType
remember the parameter types
Definition: localoperator.hh:126
 
void finalizeLocal(EntityType &en)
Definition: localoperator.hh:155
 
Definition: objpointer.hh:42
 
Definition: localoperator.hh:372
 
void applyLocal(EntityType &en)
Definition: localoperator.hh:506
 
const ScalarType scalar_
scale factor for operator _a
Definition: localoperator.hh:444
 
void finalizeLocal(EntityType &en)
Definition: localoperator.hh:492
 
void prepareLocal(EntityType &en)
Definition: localoperator.hh:478
 
void prepareGlobal(const FirstParamType &pa, SecondParamType &pb)
prepareGlobal is called before the grid walktrough
Definition: localoperator.hh:464
 
A & _a
reference to local operator A
Definition: localoperator.hh:441
 
ScaledLocalOperator(A &a, const ScalarType scalar, bool printMsg=false)
Constructor for combinations with factors.
Definition: localoperator.hh:375
 
void finalizeGlobal()
finalizeGlobal is called after the grid walktrough
Definition: localoperator.hh:471
 
Dune namespace.
Definition: alignedallocator.hh:13