42int main(
int argc,
char *argv[])
46 "Initialises fields for a molecular dynamics (MD) simulation"
52 IOdictionary mdInitialiseDict
59 IOobject::MUST_READ_IF_MODIFIED,
65 IOdictionary idListDict
70 mesh.time().constant(),
77 potential pot(
mesh, mdInitialiseDict, idListDict);
79 moleculeCloud molecules(
mesh, pot, mdInitialiseDict);
81 label totalMolecules = molecules.size();
83 if (Pstream::parRun())
85 reduce(totalMolecules, sumOp<label>());
88 Info<<
nl <<
"Total number of molecules added: " << totalMolecules
91 IOstream::defaultPrecision(15);
96 <<
"Failed writing moleculeCloud."
101 runTime.printExecutionTime(Info);
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).