From 45607501ae60b576920a9f373efe10498ad2b798 Mon Sep 17 00:00:00 2001 From: Pietro Incardona <i-bird@private-incardon-3.mpi-cbg.de> Date: Wed, 11 May 2016 13:03:41 +0200 Subject: [PATCH] Adding missing file --- src/util/petsc_util.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/util/petsc_util.hpp diff --git a/src/util/petsc_util.hpp b/src/util/petsc_util.hpp new file mode 100644 index 00000000..5f1793bb --- /dev/null +++ b/src/util/petsc_util.hpp @@ -0,0 +1,23 @@ +/* + * PETSC_util.hpp + * + * Created on: Jul 7, 2015 + * Author: Pietro Incardona + */ + +#ifndef PETSC_UTIL_HPP_ +#define PETSC_UTIL_HPP_ + +#include <iostream> + +#define PETSC_SAFE_CALL(call) {\ + PetscErrorCode err = call;\ + if (err != 0) {\ + std::string msg("Petsc error: ");\ + msg += std::string(__FILE__) + std::string(" ") + std::to_string(__LINE__);\ + PetscError(MPI_COMM_WORLD,__LINE__,__FUNCT__,__FILE__,err,PETSC_ERROR_INITIAL,"Error petsc");\ + }\ +} + + +#endif /* MPI_UTIL_HPP_ */ -- GitLab