C++ main module for emicrom Package  1.0
EMM_WaveFEMTest.h
Go to the documentation of this file.
1 #ifndef EMM_WaveFEMTest_H
2 #define EMM_WaveFEMTest_H
3 
4 #include "EMM_WaveTest.h"
5 #include "MATH_FullMatrix.h"
6 #include "MATH_ArrayVector.h"
8 
9 
31 
32 class EMM_WaveFEMTest : public EMM_WaveTest {
33 
35  // ATTRIBUTES
36 
37 
38 private:
39 
40  //insidcates if the mass matrix is diagonal
42 
43 protected:
44  // METHODS
45 
46  // CONSTRUCTORS
47 
50  EMM_WaveFEMTest(void);
51 
52 
53 
54  // DESTRUCTORS
55 
56 
59  virtual ~EMM_WaveFEMTest(void);
60 
61 
62 
63 public:
66  inline static SP::EMM_WaveFEMTest New() {
67  SP::EMM_WaveFEMTest p(new EMM_WaveFEMTest(),
69  p->setThis(p);
70  return p;
71  };
72 
73 
74 
75 public:
79  inline void setIsCondensedMassMatrix(const tBoolean& isCondensed) {
80  mIsMassMatrixCondensed=isCondensed;
81  }
82 
83 
84 
85 private:
86 
87  //matrix computations methods
88 
101  void computeMassMatrix(const tUIndex& nPts,
102  const tBoolean& isPeriodic,
103  const tBoolean dirichletLC[2],
104  MATH_FullMatrix& M) const;
105 
118  void computeCondensedMassMatrix(const tUIndex& nPts,
119  const tBoolean& isPeriodic,
120  const tBoolean dirichletLC[2],
121  MATH_ArrayVector& M) const;
122 
135  void computeStressMatrix(const tUIndex& nPts,
136  const tBoolean& isPeriodic,
137  const tBoolean dirichletLC[2],
138  MATH_FullMatrix& S) const;
139 
140  //signal propagation
141 
142 
178  const MATH_Matrix& X,
179  MATH_Solver& solver,
180  const tBoolean& isPeriodic,
181  const tBoolean dirichletLC[2],
182  tReal U0(const tReal& t),//U(0,t)
183  tReal UL(const tReal& t),//U(L,t)
184  EMM_RealArray& Ux_0,//U(x,0)
185  EMM_RealArray& dU_dt0,//dU_dt(x,0)
186  const tReal& s,//s=c^2*dt^2/dx^2
187  const tReal& dt,
188  EMM_RealArray& Ux_1) const;
189 
224  const MATH_Matrix& X,
225  const tBoolean& isPeriodic,
226  const tBoolean dirichletLC[2],
227  tReal U0(const tReal& t),//U(0,t)
228  tReal UL(const tReal& t),//U(L,t)
229  EMM_RealArray& Ux_0,//U(x,0)
230  EMM_RealArray& dU_dt0,//dU_dt(x,0)
231  const tReal& s,//s=c^2*dt^2/dx^2
232  const tReal& dt,
233  EMM_RealArray& Ux_1) const;
234 
235 protected:
236 
303  tBoolean waveTE2Propagation(const tBoolean& isForward,
304  const tBoolean& isTXTOutput,
305  const tString& prefix,
306  const tBoolean& isPeriodic,
307  const tBoolean dirichletLC[2],
308  tReal U_0(const tReal& t),//U(0,t)
309  tReal U_L(const tReal& t),//U(L,t)
310  const tReal& C,
311  const tReal &L,
312  const tReal& cfl,
313  const tUIndex nT,
314  EMM_RealArray& U,
315  EMM_RealArray& V) const;
316 
317 
318 
340  virtual tBoolean waveSystemP1Propagation(const tBoolean& isTXTOutput,
341  const tString& prefix,
342  const tBoolean dirichletLC[2],
343  tReal U_0(const tReal& t),//U(0,t)
344  tReal U_L(const tReal& t),//U(L,t)
345  const tReal& c,
346  const tReal& L,
347  const tReal& dt,
348  const tUIndex nT,
349  EMM_RealArray& U,
350  EMM_RealArray& V) const {
351  cout << "FEM P1 System not yet implemented \n";
352  return true;
353  }
374  virtual tBoolean waveSystemP2Propagation(const tBoolean& isTXTOutput,
375  const tString& prefix,
376  const tBoolean dirichletLC[2],
377  tReal U_0(const tReal& t),//U(0,t)
378  tReal U_L(const tReal& t),//U(L,t)
379  const tReal& c,
380  const tReal& L,
381  const tReal& cfl,
382  const tUIndex nT,
383  EMM_RealArray& U,
384  EMM_RealArray& V) const {
385  cout << "FEM P2 System not yet implemented \n";
386  return true;
387  };
388  protected:
389 
390  //wave examples
391  virtual tBoolean sinusoidalWave() const {
392  return mIsMassMatrixCondensed ? EMM_WaveTest::sinusoidalWave("C-FEM"):EMM_WaveTest::sinusoidalWave("FEM");
393  }
394  virtual tBoolean triangleWave() const {
395  return mIsMassMatrixCondensed ? EMM_WaveTest::triangleWave("C-FEM"):EMM_WaveTest::triangleWave("FEM");
396  }
398  return mIsMassMatrixCondensed ? EMM_WaveTest::trianglePeriodicalWave("C-FEM"):EMM_WaveTest::trianglePeriodicalWave("FEM");
399  }
400  virtual tBoolean sharkWave() const {
401 
402  return mIsMassMatrixCondensed ? EMM_WaveTest::sharkWave("C-FEM"):EMM_WaveTest::sharkWave("FEM");
403  }
404 
405  virtual tBoolean barWave() const {
406  return mIsMassMatrixCondensed ? EMM_WaveTest::barWave("C-FEM"):EMM_WaveTest::barWave("FEM");
407  }
408 
409 };
410 
411 
412 #endif
tBoolean computeWaveAtFirstTime(const MATH_Matrix &M, const MATH_Matrix &X, MATH_Solver &solver, const tBoolean &isPeriodic, const tBoolean dirichletLC[2], tReal U0(const tReal &t), tReal UL(const tReal &t), EMM_RealArray &Ux_0, EMM_RealArray &dU_dt0, const tReal &s, const tReal &dt, EMM_RealArray &Ux_1) const
compute the wave U(dt,.) with Dirichlet/Neumann limit conditions
Definition: EMM_WaveFEMTest.cpp:282
void computeMassMatrix(const tUIndex &nPts, const tBoolean &isPeriodic, const tBoolean dirichletLC[2], MATH_FullMatrix &M) const
compute the mass matrix
Definition: EMM_WaveFEMTest.cpp:19
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
compute the wave at any time from initial conditions U(0,.) and V(0,x) and from dirichlet limit condi...
Definition: EMM_WaveFEMTest.h:374
void computeStressMatrix(const tUIndex &nPts, const tBoolean &isPeriodic, const tBoolean dirichletLC[2], MATH_FullMatrix &S) const
compute the stress matrix
Definition: EMM_WaveFEMTest.cpp:179
This class describes a general matrix interface used in solver.
Definition: MATH_Matrix.h:20
static SP::EMM_WaveFEMTest New()
create a test class
Definition: EMM_WaveFEMTest.h:66
#define tBoolean
Definition: types.h:139
virtual tBoolean trianglePeriodicalWave() const
Definition: EMM_WaveFEMTest.h:397
virtual tBoolean triangleWave() const
Definition: EMM_WaveFEMTest.h:394
void computeCondensedMassMatrix(const tUIndex &nPts, const tBoolean &isPeriodic, const tBoolean dirichletLC[2], MATH_ArrayVector &M) const
compute the condensed mass matrix as diagonal
Definition: EMM_WaveFEMTest.cpp:132
virtual tBoolean sharkWave() const
Definition: EMM_WaveFEMTest.h:400
this class is a test class for testing wave equation using the Finite elements Method with two implem...
Definition: EMM_WaveFEMTest.h:32
This class is a test class for testing wave equation : .
Definition: EMM_WaveTest.h:28
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
compute the wave at any time from initial conditions U(0,.) and V(0,x) and from dirichlet limit condi...
Definition: EMM_WaveFEMTest.cpp:483
virtual tBoolean trianglePeriodicalWave() const =0
SP_OBJECT(EMM_WaveFEMTest)
This class impements the MATH_Vector class thanks to CORE_RealArray data.
Definition: MATH_ArrayVector.h:17
virtual tBoolean barWave() const
Definition: EMM_WaveFEMTest.h:405
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
This class describes a solver of Ax=b.
Definition: MATH_Solver.h:18
virtual tBoolean barWave() const =0
This class impements the MATH_Matrix class thanks to CORE_RealArray data.
Definition: MATH_FullMatrix.h:19
#define tString
Definition: types.h:135
virtual ~EMM_WaveFEMTest(void)
destroy the class
Definition: EMM_WaveFEMTest.cpp:14
virtual tBoolean sinusoidalWave() const =0
EMM_WaveFEMTest(void)
create the class
Definition: EMM_WaveFEMTest.cpp:10
virtual tBoolean sharkWave() const =0
DEFINE_SPTR(EMM_WaveFEMTest)
tBoolean mIsMassMatrixCondensed
Definition: EMM_WaveFEMTest.h:41
virtual tBoolean triangleWave() const =0
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
compute the wave at any time from initial conditions U(0,.) and V(0,x) and from dirichlet limit condi...
Definition: EMM_WaveFEMTest.h:340
#define tReal
Definition: types.h:118
void setIsCondensedMassMatrix(const tBoolean &isCondensed)
set true if the Mass Matrix is condensed or not
Definition: EMM_WaveFEMTest.h:79
virtual tBoolean sinusoidalWave() const
Definition: EMM_WaveFEMTest.h:391
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141