42 int 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."
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)