XC Open source finite element analysis program
SuperLU.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.3 $
48 // $Date: 2005/03/17 20:47:09 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/sparseGEN/SuperLU.h,v $
50 
51 
52 #ifndef SuperLU_h
53 #define SuperLU_h
54 
55 // File: ~/system_of_eqn/linearSOE/sparseGEN/SuperLU.h
56 //
57 // Written: fmk
58 // Created: 11/96
59 //
60 // Description: This file contains the class definition for SuperLU.
61 // A SuperLU object can be constructed to solve a SparseGenColLinSOE
62 // object. It obtains the solution by making calls on the
63 // the SuperLU library developed at UC Berkeley by Prof. James Demmel,
64 // Xiaoye S. Li and John R. Gilbert.
65 // The SuperLU library contains a set of subroutines to solve a sparse
66 // linear system $AX=B$. It uses Gaussian elimination with partial
67 // pivoting (GEPP). The columns of A may be preordered before
68 // factorization; the preordering for sparsity is completely separate
69 // from the factorization and a number of ordering schemes are provided.
70 //
71 // What: "@(#) SuperLU.h, revA"
72 
73 #include <solution/system_of_eqn/linearSOE/sparseGEN/SparseGenColLinSolver.h>
74 //#include "superlu/slu_cdefs.h"
75 #include "superlu/slu_ddefs.h"
76 #include "superlu/supermatrix.h"
77 
78 namespace XC {
79 
81 //
84  {
85  private:
86  SuperMatrix A,B,AC;
87  SuperMatrix L,U;
88  ID perm_r;
89  ID perm_c;
90  ID etree;
91  int relax, permSpec, panelSize;
92  double drop_tol;
93  char symmetric;
94  superlu_options_t options;
95  void libera_matricesLU(void);
96  void libera_matricesABAC(void);
97  void libera_matrices(void);
98  void libera(void);
99  void inic_permutation_vectors(const size_t &n);
100  void alloc_matrices(const size_t &n);
101  void alloc(const size_t &n);
102  int factoriza(void);
103 
104  friend class LinearSOE;
105  friend class FEM_ObjectBroker;
106  SuperLU(int permSpec = 0, double drop_tol = 0.0, int panelSize = 6, int relax = 6,char symmetric = 'N');
107  SuperLU(const SuperLU &otro);
108  SuperLU &operator=(const SuperLU &otro);
109  virtual LinearSOESolver *getCopy(void) const;
110  public:
111  ~SuperLU(void);
112 
113  int solve(void);
114  int setSize(void);
115 
116  int sendSelf(CommParameters &);
117  int recvSelf(const CommParameters &);
118 
119  void Print(std::ostream &os) const;
120  };
121 inline LinearSOESolver *SuperLU::getCopy(void) const
122  { return new SuperLU(*this); }
123 } // end of XC namespace
124 
125 #endif
126 
Solution of the linear system of equations.
Definition: LinearSOESolver.h:82
FEM_ObjectBroker is is an object broker class for the finite element method. All methods are virtual ...
Definition: FEM_ObjectBroker.h:138
~SuperLU(void)
Destructor.
Definition: SuperLU.cpp:202
Base class for sparse general matrix linear SOE solver.
Definition: SparseGenColLinSolver.h:76
Definition: ID.h:77
Linea system of equations. This is the class definition for LinearSOE. LinearSOE is an abstract base ...
Definition: LinearSOE.h:86
SuperLU based sparse general matrix linear SOE solver.
Definition: SuperLU.h:83
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34