DUNE-ACFEM (2.5.1)

timestepparameter.hh
Go to the documentation of this file.
1
5#ifndef __DUNE_ACFEM_TIMESTEP_PARAMETER_HH__
6#define __DUNE_ACFEM_TIMESTEP_PARAMETER_HH__
7
8#include <dune/fem/solver/timeprovider.hh>
9#include "../expressions/parameterinterface.hh"
10#include "timeview.hh"
11
12namespace Dune {
13
14 namespace ACFem {
15
27 template<class TimeProvider>
29 : public DefaultParameter<TimeStepParameter<TimeProvider> >
30 {
32 public:
35 enum { dimension = ParameterSpaceType::dimension };
36 typedef typename ParameterSpaceType::FieldType FieldType;
37 typedef typename ParameterSpaceType::ValueType ValueType;
38 typedef TimeProvider TimeProviderType;
39
40 TimeStepParameter(const TimeProviderType& tp) : timeProvider_(tp) {}
41
43 ValueType value() const { return timeProvider_.deltaT(); }
44
45 protected:
46 const TimeProviderType& timeProvider_;
47 };
48
49 template<class TimeProvider>
50 struct ParameterTraits<TimeStepParameter<TimeProvider> >
51 {
52 typedef typename ParameterSpaceTraits<double>::ParameterSpaceType ParameterSpaceType;
53 };
54
59 template<class TimeProvider>
61 : public DefaultParameter<InverseTimeStepParameter<TimeProvider> >
62 {
64 public:
67 enum { dimension = ParameterSpaceType::dimension };
68 typedef typename ParameterSpaceType::FieldType FieldType;
69 typedef typename ParameterSpaceType::ValueType ValueType;
70 typedef TimeProvider TimeProviderType;
71
72 InverseTimeStepParameter(const TimeProviderType& tp) : timeProvider_(tp) {}
73
75 ValueType value() const {
76 return timeProvider_.inverseDeltaT();
77 }
78
79 protected:
80 const TimeProviderType& timeProvider_;
81 };
82
83 template<class TimeProvider>
84 struct ParameterTraits<InverseTimeStepParameter<TimeProvider> >
85 {
86 typedef typename ParameterSpaceTraits<double>::ParameterSpaceType ParameterSpaceType;
87 };
88
92 template<class TimeProvider>
94 : public DefaultParameter<TimeViewParameter<TimeProvider> >
95 {
97 public:
100 enum { dimension = ParameterSpaceType::dimension };
101 typedef typename ParameterSpaceType::FieldType FieldType;
102 typedef typename ParameterSpaceType::ValueType ValueType;
103 typedef TimeProvider TimeProviderType;
105
113 TimeViewParameter(const TimeProviderType& tp, double theta = 0.0)
114 : timeView_(tp, theta)
115 {}
116
120 ValueType value() const {
121 return timeView().time();
122 }
123
126 {
127 return timeView_;
128 }
129
131 const TimeViewType& timeView() const
132 {
133 return timeView_;
134 }
135 protected:
136 TimeViewType timeView_;
137 };
138
139 template<class TimeProvider>
140 struct ParameterTraits<TimeViewParameter<TimeProvider> >
141 {
142 typedef typename ParameterSpaceTraits<double>::ParameterSpaceType ParameterSpaceType;
143 };
144
146
148
149 }
150
151}
152
153#endif // __DUNE_ACFEM_TIMESTEP_PARAMETER_HH__
Just for completeness, there is no default implementation.
Definition: parameterinterface.hh:109
A Parameter-class which gives access to the inverse of the current time-step size of an underlying Du...
Definition: timestepparameter.hh:62
ValueType value() const
Return the inverse of the current time step size.
Definition: timestepparameter.hh:75
A Parameter-class which gives access to the current time-step size of an underlying Dune::Fem::TimePr...
Definition: timestepparameter.hh:30
ValueType value() const
Return the current time step size.
Definition: timestepparameter.hh:43
A Parameter-class which returns the absolute time corresponding to a fixed fraction of the current ti...
Definition: timestepparameter.hh:95
ValueType value() const
Return the current global time corresponding to the fraction into the current time-step defined by th...
Definition: timestepparameter.hh:120
TimeViewType & timeView()
Non interface method, but convenient.
Definition: timestepparameter.hh:125
TimeViewParameter(const TimeProviderType &tp, double theta=0.0)
Constructor.
Definition: timestepparameter.hh:113
const TimeViewType & timeView() const
Non interface method, but convenient.
Definition: timestepparameter.hh:131
double time() const
Return the absolute point in time.
Definition: timeview.hh:41
A model for the vector space a parameter value lives in.
Definition: parameterinterface.hh:50
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)