DUNE-ACFEM (2.5.1)

simplemodel.hh
1#ifndef SIMPLE_MODEL_HH
2#define SIMPLE_MODEL_HH
3
4#include <cassert>
5#include <cmath>
6
7#include <dune/acfem/models/modelinterface.hh>
8
9namespace Dune {
10
11namespace ACFem {
12
13
14template<class FunctionSpace, class GridPart>
15class FluxModel
16 : public DefaultModel<FluxModel<FunctionSpace, GridPart> >
17{
18 typedef DefaultModel<FluxModel<FunctionSpace, GridPart> > BaseType;
19 typedef ModelInterface<FluxModel<FunctionSpace, GridPart> > InterfaceType;
20 typedef FluxModel ThisType;
21 public:
22 typedef typename BaseType::FunctionSpaceType FunctionSpaceType;
23 typedef typename BaseType::GridPartType GridPartType;
24 typedef typename BaseType::EntityType EntityType;
25
26 typedef typename BaseType::DomainType DomainType;
27 typedef typename BaseType::RangeType RangeType;
28 typedef typename BaseType::JacobianRangeType JacobianRangeType;
29 typedef typename BaseType::HessianRangeType HessianRangeType;
30
31 typedef typename BaseType::DomainFieldType DomainFieldType;
32 typedef typename BaseType::RangeFieldType RangeFieldType;
33
34 FluxModel(const RangeFieldType a = RangeFieldType(0.)):a_(a)
35 {}
36
37 template<class Point>
38 void flux(const EntityType &entity,
39 const Point &x,
40 const RangeType &value,
41 const JacobianRangeType &gradient,
42 JacobianRangeType &flux ) const
43 {
44 //Default is 0
45 flux = JacobianRangeType(a_) ;
46 }
47
48 private:
49 RangeFieldType a_;
50};
51
52template<class FunctionSpace, class GridPart>
53struct ModelTraits<FluxModel<FunctionSpace, GridPart> >
54 : public DefaultModelTraits<FunctionSpace, GridPart>
55{
56 private:
57 typedef DefaultModelTraits<FunctionSpace, GridPart> BaseType;
58 public:
59};
60
61} // namespace ACFem
62
63}//Namespace Dune
64
65#endif // #ifndef SIMPLE_MODEL_HH
LocalFunctionWrapper< LocalGradientAdapter< GridFunction >, typename GridFunction::GridPartType > gradient(const Fem::Function< typename GridFunction::FunctionSpaceType, GridFunction > &f_, const std::string &name="")
Take the gradient of a given function.
Definition: basicfunctions.hh:145
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Mar 12, 23:28, 2025)