make communicator protected and use accessor instead. simplify

This commit is contained in:
Axel Kohlmeyer
2023-04-15 21:54:13 -04:00
parent baeed85468
commit 8086228976
5 changed files with 17 additions and 18 deletions

View File

@ -22,21 +22,23 @@ namespace LAMMPS_NS {
class LAMMPSException : public std::exception {
public:
std::string message;
LAMMPSException(const std::string &msg) : message(msg) {}
const char *what() const noexcept override { return message.c_str(); }
protected:
std::string message;
};
class LAMMPSAbortException : public LAMMPSException {
public:
MPI_Comm universe;
LAMMPSAbortException(const std::string &msg, MPI_Comm _universe) :
LAMMPSException(msg), universe(_universe)
{
}
MPI_Comm get_universe() const { return universe; }
protected:
MPI_Comm universe;
};
enum ErrorType { ERROR_NONE = 0, ERROR_NORMAL = 1, ERROR_ABORT = 2 };