C++ main module for emicrom Package  1.0
EMM_WaveTest.h
Go to the documentation of this file.
1 #ifndef EMM_WaveTest_H
2 #define EMM_WaveTest_H
3 
4 #include "EMM_Test.h"
5 
6 
28 class EMM_WaveTest : public EMM_Test {
29 
31  // ATTRIBUTES
32 
33 
34 private:
35 
36 
37 protected:
38  // METHODS
39 
40  // CONSTRUCTORS
41 
44  EMM_WaveTest(void);
45 
46 
47 
48  // DESTRUCTORS
49 
50 
53  virtual ~EMM_WaveTest(void);
54 
55 
56 
57 public:
58 
59 
60 
61 
62 
66  virtual tBoolean test(const CORE_Run& runner,
67  const map<tString,tString>& options) const;
68 
69 
70 protected:
71 
82  tReal computeEnergy(const tUIndex& n,
83  const tReal& C,
84  const tReal& dx,
85  const tReal& dt,
86  const tReal* U,
87  const tReal* Ut) const;
88 
106  virtual tBoolean waveTE2Propagation(const tBoolean& isForward,
107  const tBoolean& isTXTOutput,
108  const tString& prefix,
109  const tBoolean& isPeriodic,
110  const tBoolean dirichletLC[2],
111  tReal U_0(const tReal& t),//U(0,t)
112  tReal U_L(const tReal& t),//U(L,t)
113  const tReal& C,
114  const tReal &L,
115  const tReal& cfl,
116  const tUIndex nT,
117  EMM_RealArray& U,
118  EMM_RealArray& V) const=0;
119 
136  virtual tBoolean waveSystemP1Propagation(const tBoolean& isTXTOutput,
137  const tString& prefix,
138  const tBoolean dirichletLC[2],
139  tReal U_0(const tReal& t),//U(0,t)
140  tReal U_L(const tReal& t),//U(L,t)
141  const tReal& c,
142  const tReal& L,
143  const tReal& dt,
144  const tUIndex nT,
145  EMM_RealArray& U,
146  EMM_RealArray& V) const=0;
166  virtual tBoolean waveSystemP2Propagation(const tBoolean& isTXTOutput,
167  const tString& prefix,
168  const tBoolean dirichletLC[2],
169  tReal U_0(const tReal& t),//U(0,t)
170  tReal U_L(const tReal& t),//U(L,t)
171  const tReal& c,
172  const tReal& L,
173  const tReal& cfl,
174  const tUIndex nT,
175  EMM_RealArray& U,
176  EMM_RealArray& V) const=0;
177 
178 
185  tBoolean save(const tString& fileName,
186  const tReal &dx,
187  const tReal *U,const tUIndex &nPts) const;
188 
196  tBoolean save(const tString& fileName,
197  const tReal &dx,
198  const tReal *U,const tReal * V,const tUIndex &nPts) const;
199 
225  tBoolean load(const tString& optionFile,
226  tString& path,
227  tBoolean& isTXTOutput,
228  tBoolean& isPeriodic,
229  tBoolean dirichletLC[2],
230  tReal& L,
231  tUIndex& nPoints,
232  tReal& Umax,
233  tReal& C,
234  tUIndex& nTimes,
235  tReal& cfl) const;
236 
237  //wave examples
238  tBoolean sinusoidalWave(const tString& method) const;
239  tBoolean triangleWave(const tString& method) const;
240  tBoolean trianglePeriodicalWave(const tString& method) const;
241  tBoolean sharkWave(const tString& method) const;
242  tBoolean barWave(const tString& method) const;
243 
244  //wave examples
245  virtual tBoolean sinusoidalWave() const=0;
246  virtual tBoolean triangleWave() const=0;
247  virtual tBoolean trianglePeriodicalWave() const=0;
248  virtual tBoolean sharkWave() const=0;
249  virtual tBoolean barWave() const=0;
250 
251  //function for x or t
252  static tReal null_function(const tReal& t);
253  static tReal shark_function(const tReal& t);
254  static tReal triangle_function(const tReal& L,const tReal& U,const tReal& x);
255  static tReal sinusoidal_function(const tReal& L,const tReal& U,const tReal& x);
256  static void linearPieceWise_function(const tUInteger& n,//number of points
257  const tReal *X,//X values
258  const tReal* Y,//Y values
259  const tUInteger& nEvals,//number of evaluations
260  const tReal *Xvalues,//values of evaluations of x
261  tReal *Yvalues);
262 };
263 
264 #endif
static tReal sinusoidal_function(const tReal &L, const tReal &U, const tReal &x)
Definition: EMM_WaveTest.cpp:151
tReal computeEnergy(const tUIndex &n, const tReal &C, const tReal &dx, const tReal &dt, const tReal *U, const tReal *Ut) const
compute the energy of the wave :
Definition: EMM_WaveTest.cpp:754
This class is a Run class for Common package.
Definition: CORE_Run.h:38
#define tUInteger
Definition: types.h:91
static tReal shark_function(const tReal &t)
Definition: EMM_WaveTest.cpp:162
virtual tBoolean test(const CORE_Run &runner, const map< tString, tString > &options) const
make the test
Definition: EMM_WaveTest.cpp:14
virtual tBoolean waveTE2Propagation(const tBoolean &isForward, const tBoolean &isTXTOutput, const tString &prefix, const tBoolean &isPeriodic, const tBoolean dirichletLC[2], tReal U_0(const tReal &t), tReal U_L(const tReal &t), const tReal &C, const tReal &L, const tReal &cfl, const tUIndex nT, EMM_RealArray &U, EMM_RealArray &V) const =0
compute the wave at any time from initial conditions U(0,.) and V(0,x) and from dirichlet limit condi...
#define tBoolean
Definition: types.h:139
This class is a test class for E-MicromM package.
Definition: EMM_Test.h:25
tBoolean save(const tString &fileName, const tReal &dx, const tReal *U, const tUIndex &nPts) const
save the displacement at time with space space of dx
Definition: EMM_WaveTest.cpp:173
static void linearPieceWise_function(const tUInteger &n, const tReal *X, const tReal *Y, const tUInteger &nEvals, const tReal *Xvalues, tReal *Yvalues)
Definition: EMM_WaveTest.cpp:86
virtual ~EMM_WaveTest(void)
destroy the class
Definition: EMM_WaveTest.cpp:11
This class is a test class for testing wave equation : .
Definition: EMM_WaveTest.h:28
virtual tBoolean trianglePeriodicalWave() const =0
static tReal null_function(const tReal &t)
Definition: EMM_WaveTest.cpp:82
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
EMM_WaveTest(void)
create the class
Definition: EMM_WaveTest.cpp:8
DEFINE_SPTR(EMM_WaveTest)
tBoolean load(const tString &optionFile, tString &path, tBoolean &isTXTOutput, tBoolean &isPeriodic, tBoolean dirichletLC[2], tReal &L, tUIndex &nPoints, tReal &Umax, tReal &C, tUIndex &nTimes, tReal &cfl) const
load the data from txt file
Definition: EMM_WaveTest.cpp:222
virtual tBoolean waveSystemP1Propagation(const tBoolean &isTXTOutput, const tString &prefix, const tBoolean dirichletLC[2], tReal U_0(const tReal &t), tReal U_L(const tReal &t), const tReal &c, const tReal &L, const tReal &dt, const tUIndex nT, EMM_RealArray &U, EMM_RealArray &V) const =0
compute the wave at any time from initial conditions U(0,.) and V(0,x) and from dirichlet limit condi...
virtual tBoolean barWave() const =0
virtual tBoolean waveSystemP2Propagation(const tBoolean &isTXTOutput, const tString &prefix, const tBoolean dirichletLC[2], tReal U_0(const tReal &t), tReal U_L(const tReal &t), const tReal &c, const tReal &L, const tReal &cfl, const tUIndex nT, EMM_RealArray &U, EMM_RealArray &V) const =0
compute the wave at any time from initial conditions U(0,.) and V(0,x) and from dirichlet limit condi...
#define tString
Definition: types.h:135
virtual tBoolean sinusoidalWave() const =0
virtual tBoolean sharkWave() const =0
virtual tBoolean triangleWave() const =0
static tReal triangle_function(const tReal &L, const tReal &U, const tReal &x)
Definition: EMM_WaveTest.cpp:142
#define tReal
Definition: types.h:118
SP_OBJECT(EMM_WaveTest)