C++ main module for emicrom Package  1.0
EMM_Test.h
Go to the documentation of this file.
1 #ifndef EMM_Test_H
2 #define EMM_Test_H
3 
4 #include "CORE_Test.h"
5 #include "EMM_RealField.h"
6 #include "EMM_Grid3D.h"
7 #include "EMM_MatterField.h"
9 
10 class CORE_Run;
11 
25 class EMM_Test : public CORE_Test {
26 
28  // ATTRIBUTES
29 
30 
31 public:
32  static const tFlag PRIMARY_TESTS;
33  static const tFlag ELEMENTARY_TESTS;
34  static const tFlag CASE_TESTS;
35  static const tFlag CASE_TEST;
36  static const tFlag ALL_TESTS;
37 
38 protected:
39  // METHODS
40 
41  // CONSTRUCTORS
42 
45  EMM_Test(void);
46 
47 
48 
49  // DESTRUCTORS
50 
51 
54  virtual ~EMM_Test(void);
55 
56 
57 
58 public:
61  inline static SP::EMM_Test New() {
62  SP::EMM_Test p(new EMM_Test(),EMM_Test::Delete());
63  p->setThis(p);
64  return p;
65  };
66 
67 
68 
69 
70 
76  virtual tBoolean test(const CORE_Run& runner,
77  const map<tString,tString>& options) const;
78 
84  virtual tBoolean performanceTest(const CORE_Run& runner,
85  const map<tString,tString>& options) const;
86 
87 
92  tString searchPath(const tString& fileName) const;
93 
97  void getSearchingPaths(vector<tString>& vpaths) const;
98 
99 
106  static tReal compareField(const EMM_RealField& F,
107  const EMM_RealField& G,
108  tUIndex& indexMax);
109 
110 
111 private:
112 
118  tBoolean primaryTests(const CORE_Run& runner,const map<tString,tString>& options) const;
119 
120 
126  tBoolean elementaryTests(const CORE_Run& runner,const map<tString,tString>& options) const;
127 
128 
134  tBoolean caseTests(const CORE_Run& runner,const map<tString,tString>& options) const;
141  tBoolean caseTest(const CORE_Run& runner,const map<tString,tString>& options,
142  const tString& caseName) const;
143 
144  //Data creation for tests
145  //=======================
146 public:
152  static tBoolean isInBox(const tReal dim[3],const tReal x[3]);
153 
159  static SP::EMM_Grid3D createCube(const tReal dim[3],
160  const tUInteger N[3]);
166  static SP::EMM_Grid3D createBox(const tReal dim[3],
167  const tUInteger N[3]);
173  SP::EMM_Grid3D createDomain(const tBoolean periodicity[3],
174  const tReal L[3],
175  const tUInteger N[3]) const;
176 
185  void createMatters(EMM_MatterField& matters,
186  const tUIndex& nMatters,
187  const tFlag& anisotropy,
188  const tUIndex& nCells,
189  const tReal& Lmin,const tReal& Lmax) const;
190 
207  void computeMField(const tString& path,EMM_RealField& M,const tReal& initSeed) const;
208 
224  inline void computeMField(EMM_RealField& M,const tReal& initSeed) const {
225  computeMField("",M,initSeed);
226  }
227 
236  SP::EMM_LandauLifschitzSystem createSystem(const CORE_Run& runner,
237  const map<tString,tString>& options) const;
238 
239 
240 };
241 
242 #endif
virtual ~EMM_Test(void)
destroy
Definition: EMM_Test.cpp:23
This class is a Run class for Common package.
Definition: CORE_Run.h:38
virtual tBoolean performanceTest(const CORE_Run &runner, const map< tString, tString > &options) const
make the perfomance tests
Definition: EMM_Test.cpp:123
#define tUInteger
Definition: types.h:91
SP::EMM_LandauLifschitzSystem createSystem(const CORE_Run &runner, const map< tString, tString > &options) const
create the system
Definition: EMM_Test.cpp:648
tBoolean caseTest(const CORE_Run &runner, const map< tString, tString > &options, const tString &caseName) const
execute the case tests
Definition: EMM_Test.cpp:258
static const tFlag PRIMARY_TESTS
Definition: EMM_Test.h:32
static const tFlag CASE_TESTS
Definition: EMM_Test.h:34
EMM_Test(void)
create
Definition: EMM_Test.cpp:20
#define tBoolean
Definition: types.h:139
static const tFlag ELEMENTARY_TESTS
Definition: EMM_Test.h:33
SP::EMM_Grid3D createDomain(const tBoolean periodicity[3], const tReal L[3], const tUInteger N[3]) const
create a cubic mesh
Definition: EMM_Test.cpp:465
void computeMField(const tString &path, EMM_RealField &M, const tReal &initSeed) const
compute normalized magnetization field
Definition: EMM_Test.cpp:565
This class is a test class for E-MicromM package.
Definition: EMM_Test.h:25
static tBoolean isInBox(const tReal dim[3], const tReal x[3])
return true if x[k] is in the [0,dim[k]] for all k in [0,3[
Definition: EMM_Test.cpp:286
static tReal compareField(const EMM_RealField &F, const EMM_RealField &G, tUIndex &indexMax)
compare 2 fields
Definition: EMM_Test.cpp:89
tBoolean caseTests(const CORE_Run &runner, const map< tString, tString > &options) const
execute the case tests
Definition: EMM_Test.cpp:240
tBoolean elementaryTests(const CORE_Run &runner, const map< tString, tString > &options) const
execute the elementary tests
Definition: EMM_Test.cpp:223
DEFINE_SPTR(EMM_Test)
static const tFlag CASE_TEST
Definition: EMM_Test.h:35
void getSearchingPaths(vector< tString > &vpaths) const
get the path fro seaching the files
Definition: EMM_Test.cpp:38
This class describes the field of matters.
Definition: EMM_MatterField.h:34
static SP::EMM_Grid3D createBox(const tReal dim[3], const tUInteger N[3])
create a box
Definition: EMM_Test.cpp:387
tString searchPath(const tString &fileName) const
set the path to find the file with name fileName
Definition: EMM_Test.cpp:26
#define tUIndex
Definition: types.h:126
static SP::EMM_Test New()
create a test class
Definition: EMM_Test.h:61
#define tString
Definition: types.h:135
void createMatters(EMM_MatterField &matters, const tUIndex &nMatters, const tFlag &anisotropy, const tUIndex &nCells, const tReal &Lmin, const tReal &Lmax) const
create matters & distribution on matters
Definition: EMM_Test.cpp:483
static SP::EMM_Grid3D createCube(const tReal dim[3], const tUInteger N[3])
create a cube
Definition: EMM_Test.cpp:294
This class is a test class for common package.
Definition: CORE_Test.h:18
static const tFlag ALL_TESTS
Definition: EMM_Test.h:36
void computeMField(EMM_RealField &M, const tReal &initSeed) const
compute normalized magnetization field
Definition: EMM_Test.h:224
SP_OBJECT(EMM_Test)
This class describes a real field.
Definition: EMM_RealField.h:21
tBoolean primaryTests(const CORE_Run &runner, const map< tString, tString > &options) const
execute the primary tests
Definition: EMM_Test.cpp:205
#define tReal
Definition: types.h:118
virtual tBoolean test(const CORE_Run &runner, const map< tString, tString > &options) const
make the tests
Definition: EMM_Test.cpp:144
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141
#define tFlag
Definition: types.h:74