1#ifndef __DUNE_ACFEM_OPERATORPARTSOPERATIONS_HH__
2#define __DUNE_ACFEM_OPERATORPARTSOPERATIONS_HH__
4#include "../../expressions/expressionoperations.hh"
12 template<
class Operation>
13 struct OperatorPartsExpressionOperation
16 template<
class Operation>
17 struct UnaryOperatorPartsExpressionOperation
18 :
public OperatorPartsExpressionOperation<Operation>
21 template<
class Operation>
22 struct BinaryOperatorPartsExpressionOperation
23 :
public OperatorPartsExpressionOperation<Operation>
31 struct BinaryOperatorPartsExpressionOperation<PlusOperation>
32 :
public OperatorPartsExpressionOperation<PlusOperation>
35 template<
class LeftOperand,
class RightOperand,
36 class PointType,
class RangeType,
class JacobianRangeType,
38 static void flux(
const LeftOperand& f,
const RightOperand& g,
39 const Entity &entity,
const PointType& x,
40 const RangeType &value,
const JacobianRangeType& jacobian,
41 JacobianRangeType& ret)
43 JacobianRangeType tmp;
45 f.flux(entity, x, value, jacobian, ret);
46 if (RightOperand::hasFlux) {
47 g.flux(entity, x, value, jacobian, tmp);
53 template<
class LeftOperand,
class RightOperand,
54 class PointType,
class RangeType,
class JacobianRangeType,
56 static void linearizedFlux (
const LeftOperand& f,
const RightOperand& g,
57 const RangeType& uBar,
const JacobianRangeType& DuBar,
58 const Entity &entity,
const PointType& x,
59 const RangeType &value,
const JacobianRangeType& jacobian,
60 JacobianRangeType& ret)
62 JacobianRangeType tmp;
64 f.linearizedFlux(uBar, DuBar, entity, x, value, jacobian, ret);
65 if (RightOperand::hasFlux) {
66 g.linearizedFlux(uBar, DuBar, entity, x, value, jacobian, tmp);
72 template<
class LeftOperand,
class RightOperand,
73 class PointType,
class RangeType,
class JacobianRangeType,
class Entity>
74 static void source(
const LeftOperand& f,
const RightOperand& g,
75 const Entity &entity,
const PointType& x,
76 const RangeType& value,
const JacobianRangeType& jacobian,
81 f.source(entity, x, value, jacobian, ret);
82 if (RightOperand::hasSources) {
83 g.source(entity, x, value, jacobian, tmp);
89 template<
class LeftOperand,
class RightOperand,
90 class PointType,
class RangeType,
class JacobianRangeType,
92 static void linearizedSource(
const LeftOperand& f,
const RightOperand& g,
93 const RangeType& uBar,
const JacobianRangeType& DuBar,
94 const Entity &entity,
const PointType& x,
95 const RangeType& value,
const JacobianRangeType& jacobian,
100 f.linearizedSource(uBar, DuBar, entity, x, value, jacobian, ret);
101 if (RightOperand::hasSources) {
102 g.linearizedSource(uBar, DuBar, entity, x, value, jacobian, tmp);
108 template<
class LeftOperand,
class RightOperand,
109 class PointType,
class RangeType,
class JacobianRangeType,
class HessianRangeType,
111 static void fluxDivergence(
const LeftOperand& f,
const RightOperand& g,
112 const Entity &entity,
const PointType& x,
113 const RangeType& value,
const JacobianRangeType& jacobian,
114 const HessianRangeType& hessian,
119 f.fluxDivergence(entity, x, value, jacobian, hessian, ret);
120 if (RightOperand::hasFlux) {
121 g.fluxDivergence(entity, x, value, jacobian, hessian, tmp);
127 template<
class LeftOperand,
class RightOperand,
128 class Intersection,
class Point,
129 class DomainType,
class RangeType>
130 static void robinFlux(
const LeftOperand& left,
const RightOperand& right,
131 const Intersection& intersection,
133 const DomainType& unitOuterNormal,
134 const RangeType& value,
139 left.robinFlux(intersection, x, unitOuterNormal, value, result);
140 if (RightOperand::hasRobinFlux) {
141 right.robinFlux(intersection, x, unitOuterNormal, value, tmp);
147 template<
class LeftOperand,
class RightOperand,
148 class Intersection,
class Point,
149 class DomainType,
class RangeType>
150 static void linearizedRobinFlux(
const LeftOperand& left,
151 const RightOperand& right,
152 const RangeType& uBar,
153 const Intersection& intersection,
155 const DomainType& unitOuterNormal,
156 const RangeType& value,
161 left.linearizedRobinFlux(uBar, intersection, x, unitOuterNormal, value, result);
162 if (RightOperand::hasRobinFlux) {
163 right.linearizedRobinFlux(uBar, intersection, x, unitOuterNormal, value, tmp);
175 struct BinaryOperatorPartsExpressionOperation<MinusOperation>
176 :
public OperatorPartsExpressionOperation<MinusOperation>
179 template<
class LeftOperand,
class RightOperand,
180 class PointType,
class RangeType,
class JacobianRangeType,
182 static void flux(
const LeftOperand& f,
const RightOperand& g,
183 const Entity &entity,
const PointType& x,
184 const RangeType& value,
const JacobianRangeType& jacobian,
185 JacobianRangeType& ret)
187 JacobianRangeType tmp;
189 f.flux(entity, x, value, jacobian, ret);
190 if (RightOperand::hasFlux) {
191 g.flux(entity, x, value, jacobian, tmp);
197 template<
class LeftOperand,
class RightOperand,
198 class PointType,
class RangeType,
class JacobianRangeType,
200 static void linearizedFlux(
const LeftOperand& f,
const RightOperand& g,
201 const RangeType& uBar,
const JacobianRangeType& DuBar,
202 const Entity &entity,
const PointType& x,
203 const RangeType &value,
const JacobianRangeType& jacobian,
204 JacobianRangeType& ret)
206 JacobianRangeType tmp;
208 f.linearizedFlux(uBar, DuBar, entity, x, value, jacobian, ret);
209 if (RightOperand::hasFlux) {
210 g.linearizedFlux(uBar, DuBar, entity, x, value, jacobian, tmp);
216 template<
class LeftOperand,
class RightOperand,
217 class PointType,
class RangeType,
class JacobianRangeType,
219 static void source(
const LeftOperand& f,
const RightOperand& g,
220 const Entity &entity,
const PointType& x,
221 const RangeType& value,
const JacobianRangeType& jacobian,
226 f.source(entity, x, value, jacobian, ret);
227 if (RightOperand::hasSources) {
228 g.source(entity, x, value, jacobian, tmp);
234 template<
class LeftOperand,
class RightOperand,
235 class PointType,
class RangeType,
class JacobianRangeType,
237 static void linearizedSource(
const LeftOperand& f,
const RightOperand& g,
238 const RangeType uBar,
const JacobianRangeType DuBar,
239 const Entity &entity,
const PointType& x,
240 const RangeType &value,
const JacobianRangeType& jacobian,
245 f.linearizedSource(uBar, DuBar, entity, x, value, jacobian, ret);
246 if (RightOperand::hasSources) {
247 g.linearizedSource(uBar, DuBar, entity, x, value, jacobian, tmp);
253 template<
class LeftOperand,
class RightOperand,
254 class PointType,
class RangeType,
class JacobianRangeType,
class HessianRangeType,
256 static void fluxDivergence(
const LeftOperand& f,
const RightOperand& g,
257 const Entity &entity,
const PointType& x,
258 const RangeType &value,
const JacobianRangeType& jacobian,
259 const HessianRangeType& hessian,
264 f.fluxDivergence(entity, x, value, jacobian, hessian, ret);
265 if (RightOperand::hasFlux) {
266 g.fluxDivergence(entity, x, value, jacobian, hessian, tmp);
272 template<
class LeftOperand,
class RightOperand,
273 class Intersection,
class Point,
274 class DomainType,
class RangeType>
275 static void robinFlux(
const LeftOperand& left,
const RightOperand& right,
276 const Intersection& intersection,
278 const DomainType& unitOuterNormal,
279 const RangeType& value,
284 left.robinFlux(intersection, x, unitOuterNormal, value, result);
285 if (RightOperand::hasRobinFlux) {
287 right.robinFlux(intersection, x, unitOuterNormal, value, tmp);
293 template<
class LeftOperand,
class RightOperand,
294 class Intersection,
class Point,
295 class DomainType,
class RangeType>
296 static void linearizedRobinFlux(
const LeftOperand& left,
297 const RightOperand& right,
298 const RangeType& uBar,
299 const Intersection& intersection,
301 const DomainType& unitOuterNormal,
302 const RangeType& value,
307 left.linearizedRobinFlux(uBar, intersection, x, unitOuterNormal, value, result);
308 if (RightOperand::hasRobinFlux) {
309 right.linearizedRobinFlux(uBar, intersection, x, unitOuterNormal, value, tmp);