DUNE PDELab (git)

maxwellparameter.hh
1// -*- tab-width: 4; indent-tabs-mode: nil -*-
2#ifndef DUNE_PDELAB_LOCALOPERATOR_MAXWELLPARAMETER_HH
3#define DUNE_PDELAB_LOCALOPERATOR_MAXWELLPARAMETER_HH
4
5#include<vector>
6
9
11#include<dune/geometry/referenceelements.hh>
13
14#include<dune/pdelab/common/function.hh>
15#include<dune/pdelab/common/functionutilities.hh>
16#include<dune/pdelab/common/geometrywrapper.hh>
17
18namespace Dune {
19 namespace PDELab {
20
27 template<typename GV, typename RF>
29 {
31 typedef GV GridViewType;
32
34 enum {
36 dimDomain = GV::dimension
37 };
38
40 typedef typename GV::Grid::ctype DomainFieldType;
41
44
47
49 typedef RF RangeFieldType;
50
53
56
58 typedef typename GV::Traits::template Codim<0>::Entity ElementType;
59 typedef typename GV::Intersection IntersectionType;
60 };
61
62 template<typename T>
63 class MaxwellInitialValueAdapter
64 : public Dune::PDELab::GridFunctionBase<Dune::PDELab::GridFunctionTraits<typename T::Traits::GridViewType,
65 typename T::Traits::RangeFieldType,
66 T::Traits::dimDomain*2,Dune::FieldVector<typename T::Traits::RangeFieldType,T::Traits::dimDomain*2> >
67 ,MaxwellInitialValueAdapter<T> >
68 {
69 public:
70 typedef Dune::PDELab::GridFunctionTraits<typename T::Traits::GridViewType,
71 typename T::Traits::RangeFieldType,
73
75 MaxwellInitialValueAdapter (const typename Traits::GridViewType& g_, const T& t_) : g(g_), t(t_) {}
76
78 inline void evaluate (const typename Traits::ElementType& e,
79 const typename Traits::DomainType& x,
80 typename Traits::RangeType& y) const
81 {
82 y = t.u0(e,x);
83 }
84
85 inline const typename Traits::GridViewType& getGridView () const
86 {
87 return g;
88 }
89
90 private:
91 typename Traits::GridViewType g;
92 const T& t;
93 };
94
95 template<typename GV, typename RF>
96 class MaxwellModelProblem
97 {
98 public:
99 typedef MaxwellParameterTraits<GV,RF> Traits;
100
101 MaxwellModelProblem ()
102 : pi(3.141592653589793238462643), time(0.0)
103 {
104 }
105
108 eps (const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
109 {
110 return 1.0;
111 }
112
115 mu (const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
116 {
117 return 1.0;
118 }
119
122 sigma (const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
123 {
124 return 1.0;
125 }
126
128 typename Traits::StateType
129 g (const typename Traits::IntersectionType& is, const typename Traits::IntersectionDomainType& x, const typename Traits::StateType& s) const
130 {
131 typename Traits::DomainType xglobal = is.geometry().global(x);
132 typename Traits::StateType u(0.0);
133 return u;
134 }
135
137 typename Traits::StateType
138 j (const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
139 {
140 typename Traits::StateType rhs(0.0);
141 return rhs;
142 }
143
145 typename Traits::StateType
146 u0 (const typename Traits::ElementType& e, const typename Traits::DomainType& x) const
147 {
148 typename Traits::StateType u(0.0);
149 return u;
150 }
151
153 void setTime (RF t)
154 {
155 time = t;
156 }
157
158 private:
159 double pi;
160 RF time;
161 };
162 }
163}
164#endif // DUNE_PDELAB_LOCALOPERATOR_MAXWELLPARAMETER_HH
vector space out of a tensor product of fields.
Definition: fvector.hh:91
leaf of a function tree
Definition: function.hh:302
A few common exception classes.
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Dune::FieldVector< GV::Grid::ctype, GV::dimension > DomainType
domain type in dim-size coordinates
Definition: function.hh:50
traits class holding the function signature, same as in local function
Definition: function.hh:183
Traits class for convection diffusion parameters.
Definition: maxwellparameter.hh:29
RF RangeFieldType
Export type for range field.
Definition: maxwellparameter.hh:49
@ dimDomain
dimension of the domain
Definition: maxwellparameter.hh:36
GV::Traits::template Codim< 0 >::Entity ElementType
grid types
Definition: maxwellparameter.hh:58
Dune::FieldVector< DomainFieldType, dimDomain > DomainType
domain type
Definition: maxwellparameter.hh:43
GV GridViewType
the grid view
Definition: maxwellparameter.hh:31
Dune::FieldVector< RF, GV::dimension > RangeType
range type
Definition: maxwellparameter.hh:52
Dune::FieldVector< DomainFieldType, dimDomain-1 > IntersectionDomainType
domain type
Definition: maxwellparameter.hh:46
GV::Grid::ctype DomainFieldType
Export type for domain field.
Definition: maxwellparameter.hh:40
Dune::FieldVector< RF, 2 *GV::dimension > StateType
range type
Definition: maxwellparameter.hh:55
GV::Traits::template Codim< 0 >::Entity ElementType
codim 0 entity
Definition: function.hh:119
GV GridViewType
The type of the grid view the function lives on.
Definition: function.hh:116
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)