DOLFIN
DOLFIN C++ interface
PETScObject.h
1 // Copyright (C) 2008 Garth N. Wells
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef __PETSC_OBJECT_H
19 #define __PETSC_OBJECT_H
20 
21 #ifdef HAS_PETSC
22 
23 #include <string>
24 #include <dolfin/common/SubSystemsManager.h>
25 
26 namespace dolfin
27 {
28 
32 
34  {
35  public:
36 
39 
41  virtual ~PETScObject() {}
42 
44  static void petsc_error(int error_code,
45  std::string filename,
46  std::string petsc_function);
47 
48  };
49 }
50 
51 #endif
52 #endif
PETScObject()
Constructor. Ensures that PETSc has been initialised.
Definition: PETScObject.h:38
Definition: adapt.h:29
static void init_petsc()
Initialize PETSc without command-line arguments.
Definition: SubSystemsManager.cpp:125
static void petsc_error(int error_code, std::string filename, std::string petsc_function)
Print error message for PETSc calls that return an error.
Definition: PETScObject.cpp:29
virtual ~PETScObject()
Destructor.
Definition: PETScObject.h:41
Definition: PETScObject.h:33