XC Open source finite element analysis program
ShadowPetscSOE.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.1.1.1 $
48 // $Date: 2000/09/15 08:23:29 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/petsc/ShadowPetscSOE.h,v $
50 
51 
52 // File: ~/system_of_eqn/linearSOE/petsc/ShadowPetscSOE.h
53 //
54 // Written: fmk & om
55 // Created: 7/98
56 // Revision: A
57 //
58 // Description: This file contains the class definition for ShadowPetscSOE
59 // ShadowPetscSOE is a subclass of LinearSOE.
60 
61 // What: "@(#) ShadowPetscSOE.h, revA"
62 
63 #ifndef ShadowPetscSOE_h
64 #define ShadowPetscSOE_h
65 
66 #include <solution/system_of_eqn/linearSOE/LinearSOE.h>
67 #include <solution/system_of_eqn/linearSOE/petsc/PetscSOE.h>
68 
69 // extern "C" {
70 #include <solution/system_of_eqn/linearSOE/petsc/petsc.h>
71 // }
72 
73 namespace XC {
74 class PetscSolver;
75 
77 //
80  {
81  private:
82  MPI_Comm theComm; // a comm for communicating to the ActorPetscSOE's
83  // without using PETSC_COMM_WORLD
84  PetscSOE theSOE; // the local portion of the SOE
85  PetscSolver *theSolver; // created by the user
86  int myRank;
87  int numProcessors;
88  int sendData[3];
89  void *sendBuffer;
90  int blockSize;
91 
92  friend class SoluMethod;
93  ShadowPetscSOE(SoluMethod *,PetscSolver &theSolver, int blockSize);
94  SystemOfEqn *getCopy(void) const;
95  public:
96  ~ShadowPetscSOE(void);
97 
98  int solve(void);
99 
100  int getNumEqn(void) const;
101  int setSize(Graph &theGraph);
102 
103  int addA(const Matrix &, const ID &, double fact = 1.0);
104  int addB(const Vector &, const ID &,const double &fact= 1.0);
105  int setB(const Vector &, const double &fact= 1.0);
106 
107  void zeroA(void);
108  void zeroB(void);
109 
110  const Vector &getX(void);
111  const Vector &getB(void);
112  double normRHS(void);
113 
114  void setX(int loc, double value);
115 
116  int setSolver(PetscSolver &);
117 
118  int sendSelf(CommParameters &);
119  int recvSelf(const CommParameters &);
120  };
121 inline SystemOfEqn *ShadowPetscSOE::getCopy(void) const
122  { return new ShadowPetscSOE(*this); }
123 } // end of XC namespace
124 
125 
126 #endif
127 
128 
129 
130 
131 
132 
??.
Definition: ShadowPetscSOE.h:79
Definition: Vector.h:82
Solution procedure for the finite element problem. The solution procedure is definde by specifiying: ...
Definition: SoluMethod.h:76
PETSC library based SOE solver.
Definition: PetscSolver.h:74
int solve(void)
Resuelve el system of equations.
Definition: ShadowPetscSOE.cpp:167
System of equations base class.
Definition: SystemOfEqn.h:84
Definition: ID.h:77
PETSC based system of equations.
Definition: PetscSOE.h:84
Definition: Matrix.h:82
Linea system of equations. This is the class definition for LinearSOE. LinearSOE is an abstract base ...
Definition: LinearSOE.h:86
The Graph class provides the abstraction of a graph, a collection of vertices and edges...
Definition: Graph.h:84
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34