xc
MumpsSolverBase.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 
29 #ifndef MumpsSolverBase_h
30 #define MumpsSolverBase_h
31 
32 #include <solution/system_of_eqn/linearSOE/LinearSOESolver.h>
33 extern "C" {
34 #include <dmumps_c.h>
35 }
36 
37 namespace XC {
38 
40  {
41  private:
42  static bool MPIInitialized(void);
43  static int initializeMPI(void);
44  static int finalizeMPI(void);
45  protected:
46  DMUMPS_STRUC_C id;
47  bool mumps_init;
48  int icntl14;
49  int icntl7;
50  bool needsSetSize;
51 
52  int terminateMumps(void);
53  virtual int initializeMumps(void)= 0;
54  virtual int solveAfterInitialization(void)= 0;
55 
56  int sendData(Communicator &);
57  int recvData(const Communicator &);
58  std::string getMUMPSErrorMessage(void);
59  public:
60  MumpsSolverBase(int classTag, int ICNTL7=7, int ICNTL14=20);
61  virtual ~MumpsSolverBase(void);
62 
63  int solve(void);
64  int setSize(void);
65 
66  virtual int sendSelf(Communicator &);
67  virtual int recvSelf(const Communicator &);
68  };
69 } // end of XC namespace
70 
71 #endif
72 
Communication parameters between processes.
Definition: Communicator.h:66
int terminateMumps(void)
Terminate MUMPS.
Definition: MumpsSolverBase.cc:50
int recvData(const Communicator &)
Receives object members through the communicator argument.
Definition: MumpsSolverBase.cc:170
std::string getMUMPSErrorMessage(void)
Return a message explaining the mumps error (if any).
Definition: MumpsSolverBase.cc:103
int solve(void)
Causes the solver to compute the solution of the system of equations.
Definition: MumpsSolverBase.cc:145
virtual int sendSelf(Communicator &)
Send the object.
Definition: MumpsSolverBase.cc:176
Definition: MumpsSolverBase.h:39
virtual int recvSelf(const Communicator &)
Receive the object.
Definition: MumpsSolverBase.cc:189
int setSize(void)
Sets the number of equations.
Definition: MumpsSolverBase.cc:156
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class of the solvers for linear system of equations.
Definition: LinearSOESolver.h:87
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: MumpsSolverBase.cc:163