dune-pdelab 2.7-git
Loading...
Searching...
No Matches
maxwellparameter.hh
Go to the documentation of this file.
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
7#include<dune/common/exceptions.hh>
8#include<dune/common/fvector.hh>
9
10#include<dune/geometry/quadraturerules.hh>
11#include<dune/geometry/referenceelements.hh>
12#include<dune/geometry/type.hh>
13
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
43 typedef Dune::FieldVector<DomainFieldType,dimDomain> DomainType;
44
46 typedef Dune::FieldVector<DomainFieldType,dimDomain-1> IntersectionDomainType;
47
49 typedef RF RangeFieldType;
50
52 typedef Dune::FieldVector<RF,GV::dimension> RangeType;
53
55 typedef Dune::FieldVector<RF,2*GV::dimension> StateType;
56
58 typedef typename GV::Traits::template Codim<0>::Entity ElementType;
59 typedef typename GV::Intersection IntersectionType;
60 };
61
62 template<typename T>
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,
72 T::Traits::dimDomain*2,Dune::FieldVector<typename T::Traits::RangeFieldType,T::Traits::dimDomain*2> > Traits;
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>
97 {
98 public:
100
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
const std::string s
Definition: function.hh:843
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Dune::FieldVector< GV::Grid::ctype, GV::dimension > DomainType
domain type in dim-size coordinates
Definition: function.hh:50
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
traits class holding the function signature, same as in local function
Definition: function.hh:183
leaf of a function tree
Definition: function.hh:302
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
GV::Intersection IntersectionType
Definition: maxwellparameter.hh:59
Dune::FieldVector< RF, 2 *GV::dimension > StateType
range type
Definition: maxwellparameter.hh:55
Definition: maxwellparameter.hh:68
MaxwellInitialValueAdapter(const typename Traits::GridViewType &g_, const T &t_)
constructor
Definition: maxwellparameter.hh:75
const Traits::GridViewType & getGridView() const
Definition: maxwellparameter.hh:85
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Evaluate the GridFunction at given position.
Definition: maxwellparameter.hh:78
Dune::PDELab::GridFunctionTraits< typename T::Traits::GridViewType, typename T::Traits::RangeFieldType, T::Traits::dimDomain *2, Dune::FieldVector< typename T::Traits::RangeFieldType, T::Traits::dimDomain *2 > > Traits
Definition: maxwellparameter.hh:72
Definition: maxwellparameter.hh:97
Traits::RangeFieldType sigma(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
permeability
Definition: maxwellparameter.hh:122
Traits::StateType u0(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
initial value
Definition: maxwellparameter.hh:146
Traits::StateType j(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
right hand side
Definition: maxwellparameter.hh:138
Traits::RangeFieldType mu(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
permeability
Definition: maxwellparameter.hh:115
Traits::StateType g(const typename Traits::IntersectionType &is, const typename Traits::IntersectionDomainType &x, const typename Traits::StateType &s) const
boundary condition value
Definition: maxwellparameter.hh:129
MaxwellParameterTraits< GV, RF > Traits
Definition: maxwellparameter.hh:99
void setTime(RF t)
set time for subsequent evaluation
Definition: maxwellparameter.hh:153
MaxwellModelProblem()
Definition: maxwellparameter.hh:101
Traits::RangeFieldType eps(const typename Traits::ElementType &e, const typename Traits::DomainType &x) const
permittivity
Definition: maxwellparameter.hh:108