CGSelectRegionSelfTest.cpp File Reference

Classes

class  Chain
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

A simple DPM problem is coarse-grained in a select region to show selective CG works

Returns
86 {
87  logger(INFO,"\nRun a simple DPM problem\n");
88  Chain chain;
89  chain.solve();
90 
91  logger(INFO,"\nCoarse-grain a select region (1<z<2)\n");
92  std::string cmd = "./MercuryCG Chain -tMin 1 -timeAverage -z 1 2 -averageBeyondDomain 0";
93  if (system(cmd.c_str())==-1) {
94  logger(WARN,"system call failed");
95  }
96 
97  logger(INFO,"\nRead in CG\n");
98  std::ifstream statFile("Chain.stat");
99  //ignore 2 header lines and coordinate
100  statFile.ignore(2000,'\n');
101  statFile.ignore(2000,'\n');
102  statFile.ignore(2000,' ');
103  statFile.ignore(2000,' ');
104  //read in volume fraction
105  Mdouble density = 0;
106  statFile >> density;
107  logger(INFO,"Density % (should be 1)",density);
108 }
double Mdouble
Definition: GeneralDefine.h:34
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.
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
Definition: CGSelectRegionSelfTest.cpp:34
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270

References INFO, logger, DPMBase::solve(), and WARN.