7 #include <amdis/ContextGeometry.hpp> 8 #include <amdis/Output.hpp> 9 #include <amdis/common/TypeTraits.hpp> 10 #include <amdis/functions/Order.hpp> 11 #include <amdis/typetree/FiniteElementType.hpp> 27 template <
class Derived,
class LC>
30 using ContextType = Impl::ContextTypes<LC>;
37 using Element =
typename ContextType::Entity;
43 template <
class Gr
idView>
44 void init(GridView
const& gridView)
46 derived().init_impl(gridView);
60 isSimplex_ = geometry.type().isSimplex();
61 isAffine_ = geometry.affine();
65 derived().bind_impl(element, geometry);
71 derived().unbind_impl();
82 template <
class CG,
class RN,
class CN,
class Mat>
86 derived().getElementMatrix(contextGeo, rowNode, colNode, elementMatrix);
95 template <
class CG,
class Node,
class Vec>
99 derived().getElementVector(contextGeo, node, elementVector);
103 Derived & derived() {
return static_cast<Derived&
>(*this); }
104 Derived
const& derived()
const {
return static_cast<Derived const&
>(*this); }
110 template <
class Gr
idView>
111 void init_impl(GridView
const& ) {}
114 template <
class Element,
class Geometry>
118 void unbind_impl() {}
129 template <
class RN,
class CN>
130 int getDegree(
int derivOrder,
int coeffDegree, RN
const& rowNode, CN
const& colNode)
const 134 "polynomial order of coefficient function not determined. Use order 4 by default.");
136 int psiDegree =
order(rowNode);
137 int phiDegree =
order(colNode);
139 int degree = psiDegree + phiDegree + (coeffDegree >= 0 ? coeffDegree : 4);
141 degree -= derivOrder;
154 template <
class Node>
155 int getDegree(
int derivOrder,
int coeffDegree, Node
const& node)
const 159 "polynomial order of coefficient function not determined. Use order 4 by default.");
161 int psiDegree =
order(node);
163 int degree = psiDegree + (coeffDegree >= 0 ? coeffDegree : 4);
165 degree -= derivOrder;
174 bool isSimplex_ =
false;
175 bool isAffine_ =
false;
186 template <
class Derived,
class LC,
class GV>
189 return localOp.derived();
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
void calculateElementMatrix(CG const &contextGeo, RN const &rowNode, CN const &colNode, Mat &elementMatrix)
Assemble a local element matrix on the element that is bound.
Definition: LocalOperator.hpp:83
int getDegree(int derivOrder, int coeffDegree, RN const &rowNode, CN const &colNode) const
Return the quadrature degree for a matrix operator.
Definition: LocalOperator.hpp:130
LC LocalContext
The element or intersection the operator is assembled on.
Definition: LocalOperator.hpp:34
auto order(F const &f) -> decltype(&F::operator(), f.order())
polynomial order of functions
Definition: Order.hpp:11
void init(GridView const &gridView)
Initialize the local operator on the current gridView.
Definition: LocalOperator.hpp:44
auto makeLocalOperator(PreGridFunctionOperator< Args... > op, GridView const &gridView)
Definition: GridFunctionOperator.hpp:258
The main implementation of an operator to be used in a Assembler.
Definition: LocalOperator.hpp:28
typename ContextType::Entity Element
The codim=0 grid entity.
Definition: LocalOperator.hpp:37
void calculateElementVector(CG const &contextGeo, Node const &node, Vec &elementVector)
Assemble a local element vector on the element that is bound.
Definition: LocalOperator.hpp:96
int getDegree(int derivOrder, int coeffDegree, Node const &node) const
Return the quadrature degree for a vector operator.
Definition: LocalOperator.hpp:155
void bind(Element const &element, Geometry const &geometry)
Binds operator to element and geometry.
Definition: LocalOperator.hpp:57
void test_warning(bool condition, std::string const &str, Args &&... args)
test for condition and in case of failure print message
Definition: Output.hpp:183
void unbind()
Unbinds operator from element.
Definition: LocalOperator.hpp:69
typename Element::Geometry Geometry
The geometry of the Element.
Definition: LocalOperator.hpp:40