28 bool scalarAdvectionTestResult =
true;
30 const std::string testFunctionName(
"TestPlasCom2_ScalarAdvection2DX");
31 const std::string testSuiteName(
"ScalarTest/Advection");
32 const std::string testCaseName(
"xPeriodic");
33 const std::string testDirectory(testSuiteName+
"/"+testCaseName);
35 std::ostringstream compareStream;
36 double errorTolerance = 5e-3;
38 int myRank = testComm.
Rank();
41 std::cout <<
"Executing " << testFunctionName << std::endl;
46 const char *argv[] = {
"plascom2x",
"-c",
"scalar2d.config",NULL};
53 scalarAdvectionTestResult =
false;
55 std::cout << testFunctionName <<
": testing directory (" 56 << testDirectory <<
") did not exist. Aborting test." 83 std::cout <<
"Running dimensional PlasCom2..." << std::endl;
88 std::cout <<
"Done running dimensional PlasCom2." << std::endl;
91 std::cout << testFunctionName <<
": PlasCom2 returned error code (" 92 << returnValue <<
"). Test failed." << std::endl;
93 scalarAdvectionTestResult =
false;
98 std::cout << testFunctionName <<
": PlasCom2 failed to produce expected" 100 <<
"output file (PlasCom2_000000202.h5). Test failed." << std::endl;
101 scalarAdvectionTestResult =
false;
108 std::cout <<
"Comparing results to expected result...";
110 "PlasCom2_000000000.h5",
111 errorTolerance,compareStream);
113 std::cout <<
"passed." << std::endl;
115 std::cout <<
"failed." << std::endl;
116 scalarAdvectionTestResult =
false;
117 std::cout << testFunctionName <<
": Resulting state " 118 <<
"comparison yielded negative result:" 120 << compareStream.str()
126 scalarAdvectionTestResult =
CheckResult(scalarAdvectionTestResult,testComm);
132 parallelUnitResults.
UpdateResult(
"PlasCom2:Scalar:Advection2DX",scalarAdvectionTestResult);
145 myGlobal.
Init(
"AdvectionDiffusion2DX",testComm);
149 bool scalarAdvectionTestResult =
true;
151 const std::string testFunctionName(
"TestPlasCom2_ScalarAdvectionDiffusion2DX");
152 const std::string testSuiteName(
"ScalarTest/AdvectionDiffusion");
153 const std::string testCaseName(
"xPeriodic");
154 const std::string testDirectory(testSuiteName+
"/"+testCaseName);
156 std::ostringstream compareStream;
158 double errorTolerance = 1.0e-8;
160 int myRank = testComm.
Rank();
163 std::cout <<
"Executing " << testFunctionName << std::endl;
168 const char *argv[] = {
"plascom2x",
"-c",
"scalar2d.config",NULL};
174 scalarAdvectionTestResult =
false;
176 std::cout << testFunctionName <<
": testing directory (" 177 << testDirectory <<
") did not exist. Aborting test." 192 std::cout <<
"Running PlasCom2..." << std::endl;
200 std::cout <<
"Done running dimensional PlasCom2." << std::endl;
203 std::cout << testFunctionName <<
": PlasCom2 returned error code (" 204 << returnValue <<
"). Test failed." << std::endl;
205 scalarAdvectionTestResult =
false;
213 std::cout << testFunctionName <<
": PlasCom2 failed to produce expected" 215 <<
"output file (PlasCom2_000001001.h5). Test failed." << std::endl;
216 scalarAdvectionTestResult =
false;
224 std::cout <<
"Comparing results to expected result...";
226 "accepted/PlasCom2_000001001.h5",
227 errorTolerance,compareStream);
229 std::cout <<
"passed." << std::endl;
231 std::cout <<
"failed." << std::endl;
232 scalarAdvectionTestResult =
false;
233 std::cout << testFunctionName <<
": Resulting state " 234 <<
"comparison yielded negative result:" 236 << compareStream.str()
241 scalarAdvectionTestResult =
CheckResult(scalarAdvectionTestResult,testComm);
247 parallelUnitResults.
UpdateResult(
"PlasCom2:Scalar:AdvectionDiffusion2DX",scalarAdvectionTestResult);
260 myGlobal.
Init(
"AdvectionDiffusion2DY",testComm);
264 bool scalarAdvectionTestResult =
true;
266 const std::string testFunctionName(
"TestPlasCom2_ScalarAdvectionDiffusion2DY");
267 const std::string testSuiteName(
"ScalarTest/AdvectionDiffusion");
268 const std::string testCaseName(
"yPeriodic");
269 const std::string testDirectory(testSuiteName+
"/"+testCaseName);
271 std::ostringstream compareStream;
273 double errorTolerance = 1.0e-8;
275 int myRank = testComm.
Rank();
278 std::cout <<
"Executing " << testFunctionName << std::endl;
283 const char *argv[] = {
"plascom2x",
"-c",
"scalar2d.config",NULL};
289 scalarAdvectionTestResult =
false;
291 std::cout << testFunctionName <<
": testing directory (" 292 << testDirectory <<
") did not exist. Aborting test." 307 std::cout <<
"Running PlasCom2..." << std::endl;
315 std::cout <<
"Done running dimensional PlasCom2." << std::endl;
318 std::cout << testFunctionName <<
": PlasCom2 returned error code (" 319 << returnValue <<
"). Test failed." << std::endl;
320 scalarAdvectionTestResult =
false;
328 std::cout << testFunctionName <<
": PlasCom2 failed to produce expected" 330 <<
"output file (PlasCom2_000001001.h5). Test failed." << std::endl;
331 scalarAdvectionTestResult =
false;
339 std::cout <<
"Comparing results to expected result...";
341 "accepted/PlasCom2_000001001.h5",
342 errorTolerance,compareStream);
344 std::cout <<
"passed." << std::endl;
346 std::cout <<
"failed." << std::endl;
347 scalarAdvectionTestResult =
false;
348 std::cout << testFunctionName <<
": Resulting state " 349 <<
"comparison yielded negative result:" 351 << compareStream.str()
356 scalarAdvectionTestResult =
CheckResult(scalarAdvectionTestResult,testComm);
362 parallelUnitResults.
UpdateResult(
"PlasCom2:Scalar:AdvectionDiffusion2DY",scalarAdvectionTestResult);
373 bool scalarAdvectionTestResult =
true;
375 const std::string testFunctionName(
"TestPlasCom2_ScalarAdvection2DY");
376 const std::string testSuiteName(
"ScalarTest/Advection");
377 const std::string testCaseName(
"ySlipWalls");
378 const std::string testDirectory(testSuiteName+
"/"+testCaseName);
380 std::ostringstream compareStream;
381 double errorTolerance = 0.005;
383 int myRank = testComm.
Rank();
386 std::cout <<
"Executing " << testFunctionName << std::endl;
391 const char *argv[] = {
"plascom2x",
"-c",
"scalar2d.config",NULL};
398 scalarAdvectionTestResult =
false;
400 std::cout << testFunctionName <<
": testing directory (" 401 << testDirectory <<
") did not exist. Aborting test." 416 std::cout <<
"Running dimensional PlasCom2..." << std::endl;
421 std::cout <<
"Done running dimensional PlasCom2." << std::endl;
424 std::cout << testFunctionName <<
": PlasCom2 returned error code (" 425 << returnValue <<
"). Test failed." << std::endl;
426 scalarAdvectionTestResult =
false;
431 std::cout << testFunctionName <<
": PlasCom2 failed to produce expected" 433 <<
"output file (PlasCom2_000001010.h5). Test failed." << std::endl;
434 scalarAdvectionTestResult =
false;
439 std::cout <<
"Comparing results to expected result...";
441 "PlasCom2_000000000.h5",
442 errorTolerance,compareStream);
444 std::cout <<
"passed." << std::endl;
446 std::cout <<
"failed." << std::endl;
447 scalarAdvectionTestResult =
false;
448 std::cout << testFunctionName <<
": Resulting state " 449 <<
"comparison yielded negative result:" 451 << compareStream.str()
456 scalarAdvectionTestResult =
CheckResult(scalarAdvectionTestResult,testComm);
462 parallelUnitResults.
UpdateResult(
"PlasCom2:Scalar:Advection2DY",scalarAdvectionTestResult);
473 bool scalarAdvectionTestResult =
true;
475 const std::string testFunctionName(
"TestPlasCom2_ScalarAdvection3DZ");
476 const std::string testSuiteName(
"ScalarTest/Advection");
477 const std::string testCaseName(
"zPeriodicCube");
478 const std::string testDirectory(testSuiteName+
"/"+testCaseName);
480 std::ostringstream compareStream;
481 double errorTolerance = 0.15;
483 int myRank = testComm.
Rank();
486 std::cout <<
"Executing " << testFunctionName << std::endl;
491 const char *argv[] = {
"plascom2x",
"-c",
"scalar3d.config",NULL};
498 scalarAdvectionTestResult =
false;
500 std::cout << testFunctionName <<
": testing directory (" 501 << testDirectory <<
") did not exist. Aborting test." 516 std::cout <<
"Running dimensional PlasCom2..." << std::endl;
521 std::cout <<
"Done running dimensional PlasCom2." << std::endl;
524 std::cout << testFunctionName <<
": PlasCom2 returned error code (" 525 << returnValue <<
"). Test failed." << std::endl;
526 scalarAdvectionTestResult =
false;
531 std::cout << testFunctionName <<
": PlasCom2 failed to produce expected" 533 <<
"output file (PlasCom2_000000500.h5). Test failed." << std::endl;
534 scalarAdvectionTestResult =
false;
539 std::cout <<
"Comparing results to expected result...";
541 "PlasCom2_000000000.h5",
542 errorTolerance,compareStream);
544 std::cout <<
"passed." << std::endl;
546 std::cout <<
"failed." << std::endl;
547 scalarAdvectionTestResult =
false;
548 std::cout << testFunctionName <<
": Resulting state " 549 <<
"comparison yielded negative result:" 551 << compareStream.str()
556 scalarAdvectionTestResult =
CheckResult(scalarAdvectionTestResult,testComm);
562 parallelUnitResults.
UpdateResult(
"Integrated:Scalar:Advection3DZ",scalarAdvectionTestResult);
pcpp::ParallelGlobalType global_t
void TestPlasCom2_Scalar_Advection2DX(ix::test::results ¶llelUnitResults, pcpp::CommunicatorType &testComm)
int ApplicationDriver(ApplicationType &simulationApplication)
void TestPlasCom2_Scalar_Advection2DY(ix::test::results ¶llelUnitResults, pcpp::CommunicatorType &testComm)
int Remove(const std::string &fname)
std::vector< DomainBaseType > domainvector
virtual bool Profiling()
Get profiling state.
int PC2Compare(const std::string &redFileName, const std::string &blueFileName, double errTolerance, std::ostream &outStream)
Read two HDF5 files and compare the state data therein.
bool CheckResult(bool &localResult, pcpp::CommunicatorType &testComm)
int ChDir(const std::string &path)
virtual int Init(const std::string &name, CommunicatorType &incomm)
void TestPlasCom2_Scalar_AdvectionDiffusion2DX(ix::test::results ¶llelUnitResults, pcpp::CommunicatorType &testComm)
Encapsulating class for collections of test results.
void TestPlasCom2_Scalar_AdvectionDiffusion2DY(ix::test::results ¶llelUnitResults, pcpp::CommunicatorType &testComm)
simulation::grid::parallel_blockstructured pbsgrid_t
int Check(comm::Ops op=comm::MAXOP)
bool FILEEXISTS(const std::string &fname)
Main encapsulation of MPI.
Testing constructs for unit testing.
void TestIntegrated_Scalar_Advection3DZ(ix::test::results ¶llelUnitResults, pcpp::CommunicatorType &testComm)
plascom2::application::domainvector DomainVector
void UpdateResult(const std::string &name, const ValueType &result)
Updates an existing test result.
void SetVerbLevel(unsigned char l)
simulation::state::base state_t