CGReadFilesUnitTest.cpp File Reference

Classes

class  CreateDataAndFStatFiles
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
61 {
62  logger(INFO,"Testing if data and fstat files are successfully read by the cgHandler.");
63 
65  problem.solve();
66 
67  //evaluate cg from data file
69  evaluate.setName("CGReadFiles2");
70  auto cg = evaluate.cgHandler.copyAndAddObject(CG<CGCoordinates::O>());
71  cg->statFile.setName("CGReadFiles2.stat");
72  evaluate.cgHandler.restartAndEvaluateDataFiles("CGReadFiles");
73 
74  //evaluate time-averaged cg from data file
75  DPMBase evaluate2;
76  evaluate2.setName("CGReadFiles3");
78  cg2->statFile.setName("CGReadFiles3.stat");
79  cg2->setTimeMin(0);
80  evaluate2.cgHandler.restartAndEvaluateDataFiles("CGReadFiles");
81 
82  helpers::check(cg->getPoint(0).getDensity(),1,1e-10, "Density");
83  helpers::check(cg->getPoint(0).getMomentum().X,2,1e-10, "Momentum");
84  helpers::check(cg2->getPoint(0).getDensity(),1,1e-10, "Time-averaged density");
85  helpers::check(cg2->getPoint(0).getMomentum().X,1.5,1e-10, "Time-averaged momentum");
86 
87  return 0;
88 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
void restartAndEvaluateDataFiles(const std::string &name, bool evaluateFStatFiles=true)
Definition: CGHandler.cc:188
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:76
Definition: CGReadFilesUnitTest.cpp:32
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:77
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Evaluates time-averaged continuum fields and writes the data into a stat file.
Definition: TimeAveragedCG.h:59
Vec3D evaluate(Mdouble u, Mdouble v, std::vector< Mdouble > knotsU, std::vector< Mdouble > knotsV, std::vector< std::vector< Vec3D >> controlPoints, std::vector< std::vector< Mdouble >> weights)
Evaluate point on a NURBS surface.
Definition: NurbsUtils.cc:376
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37

References DPMBase::cgHandler, helpers::check(), BaseHandler< T >::copyAndAddObject(), NurbsUtils::evaluate(), INFO, logger, CGHandler::restartAndEvaluateDataFiles(), DPMBase::setName(), and DPMBase::solve().