xc
DistributedSuperLU.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 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.1 $
49 // $Date: 2005/12/06 22:21:03 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/sparseGEN/DistributedSuperLU.h,v $
51 
52 
53 #ifndef DistributedSuperLU_h
54 #define DistributedSuperLU_h
55 
56 // Written: fmk
57 //
58 // Description: This file contains the class definition for DistributedSuperLU.
59 // A DistributedSuperLU object can be constructed to solve a SparseGenColLinSOE
60 // object. It obtains the solution by making calls on the
61 // the SuperLU library developed at UC Berkeley by Prof. James Demmel,
62 // Xiaoye S. Li and John R. Gilbert.
63 // The SuperLU library contains a set of subroutines to solve a sparse
64 // linear system $AX=B$. It uses Gaussian elimination with partial
65 // pivoting (GEPP). The columns of A may be preordered before
66 // factorization; the preordering for sparsity is completely separate
67 // from the factorization and a number of ordering schemes are provided.
68 //
69 // What: "@(#) DistributedSuperLU.h, revA"
70 
71 #include "solution/system_of_eqn/linearSOE/DistributedLinSOE.h"
72 #include <superlu-dist/superlu_ddefs.h>
73 #include <solution/system_of_eqn/linearSOE/sparseGEN/SparseGenColLinSolver.h>
74 
75 
76 namespace XC {
77 #if SUPERLU_DIST_MAJOR_VERSION > 6 || \
78  (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
79 #define ScalePermstruct_t dScalePermstruct_t
80 #define LUstruct_t dLUstruct_t
81 #define SOLVEstruct_t dSOLVEstruct_t
82 #define ScalePermstructFree dScalePermstructFree
83 #define ScalePermstructInit dScalePermstructInit
84 #define Destroy_LU dDestroy_LU
85 #define LUstructFree dLUstructFree
86 #define LUstructInit dLUstructInit
87 #endif
88 //
95  {
96  private:
97  superlu_dist_options_t options;
98  SuperLUStat_t stat;
99  SuperMatrix A;
100  ScalePermstruct_t ScalePermstruct;
101  LUstruct_t LUstruct;
102  gridinfo_t grid;
103 
104  bool gridInit;
105  int npRow, npCol;
106 
107  MPI_Comm comm_SuperLU;
108  Vector b;
109  ID rowA;
110 
111  DbTagData &getDbTagData(void) const;
112  public:
113  DistributedSuperLU(int npRow, int npCol);
114  DistributedSuperLU(void);
115  ~DistributedSuperLU(void);
116 
117  int solve(void);
118  int setSize(void);
119 
120  int sendSelf(Communicator &);
121  int recvSelf(const Communicator &);
122  };
123 } // end of XC namespace
124 
125 #endif
126 
Float vector abstraction.
Definition: Vector.h:94
int recvSelf(const Communicator &)
Receive the object.
Definition: DistributedSuperLU.cpp:313
Communication parameters between processes.
Definition: Communicator.h:66
int setSize(void)
Sets the number of equations.
Definition: DistributedSuperLU.cpp:191
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Vector of integers.
Definition: ID.h:95
Base class for distributed systems of equations.
Definition: DistributedLinSOE.h:47
DistributedSuperLU(void)
Default constructor.
Definition: DistributedSuperLU.cpp:70
int solve(void)
Causes the solver to compute the solution of the system of equations.
Definition: DistributedSuperLU.cpp:86
Base class for sparse general matrix linear SOE solver.
Definition: SparseGenColLinSolver.h:77
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int sendSelf(Communicator &)
Send the object.
Definition: DistributedSuperLU.cpp:262
SuperLU based solver for distributed sparse matrix linear systems of equations.
Definition: DistributedSuperLU.h:94