This avoids irritating warnings of wmake about it not finding certain headers (e.g. system headers). Similar things were necessary in some headers of the LIGGGHTS code. While these did not cause compilation errors, they messed up the compilation output with hundrets of false alarms. Not very helpful if you're trying to find out what went wrong. One special case is the change from RASModel.H to turbulenceModel.H in cfdemCloud.H. Between major OpenFOAM versions there was a change of how turbulence models were implemented. While the CFDEMcoupling code uses preprocessors to allow compatibility, the wmkdepend utility is too simple to understand this. It does not evaluate #ifdef constructs and just looks for #include lines. Therefore it tries to access RASModel.H in newer versions of OpenFOAM, which no longer exists. To circumvent this issue, both includes were changed from "" to <> syntax. This suppresses the warning and compiles, since the OpenFOAM header is in the include path anyway.
43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
#include <mpi.h>
|
|
#include "stdlib.h"
|
|
#include <stdio.h>
|
|
#include "error.h"
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
|
|
Error::Error(MPI_Comm caller)
|
|
{
|
|
comm = caller;
|
|
MPI_Comm_rank(comm,&me);
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------
|
|
called by all procs
|
|
------------------------------------------------------------------------- */
|
|
|
|
void Error::all(const char *str)
|
|
{
|
|
if (me == 0) printf("ERROR: %s\n",str);
|
|
MPI_Finalize();
|
|
exit(1);
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------
|
|
called by one proc
|
|
------------------------------------------------------------------------- */
|
|
|
|
void Error::one(const char *str)
|
|
{
|
|
printf("ERROR on proc %d: %s\n",me,str);
|
|
MPI_Abort(comm,1);
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------
|
|
called by one proc
|
|
------------------------------------------------------------------------- */
|
|
|
|
void Error::warning(const char *str)
|
|
{
|
|
printf("WARNING: %s\n",str);
|
|
}
|