XC Open source finite element analysis program
ShadowSubdomain.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.5 $
48 // $Date: 2005/11/30 23:47:00 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/subdomain/ShadowSubdomain.h,v $
50 
51 
52 #ifndef ShadowSubdomain_h
53 #define ShadowSubdomain_h
54 
55 // Written: fmk
56 // Revision: A
57 //
58 // Description: This file contains the class definition for ShadowSubdomain.
59 // ShadowSubdomain is a container class. The class is responsible for holding
60 // and providing access to the Elements, Nodes, LoadCases, SFreedom_Constraints
61 // and MFreedom_Constraints that have been added to the ShadowSubdomain.
62 //
63 // What: "@(#) ShadowSubdomain.h, revA"
64 
65 #include "Subdomain.h"
66 #include <utility/actor/shadow/Shadow.h>
67 #include "utility/matrix/ID.h"
68 
69 namespace XC {
70 class ShadowSubdomain: public Shadow, public Subdomain
71  {
72  private:
73  mutable ID msgData;
74  ID theElements;
75  ID theNodes;
76  ID theExternalNodes;
77  ID theLoadCases;
78 
79  TaggedObjectStorage *theShadowSPs;
80  TaggedObjectStorage *theShadowMPs;
81  TaggedObjectStorage *theShadowLPs;
82 
83  int numDOF;
84  int numElements;
85  int numNodes;
86  int numExternalNodes;
87  int numSPs;
88  int numMPs;
89  int numLoadPatterns;
90 
91  bool buildRemote;
92  bool gotRemoteData;
93 
94  FE_Element *theFEele;
95 
96  mutable Vector *theVector; // for storing residual info
97  mutable Matrix *theMatrix; // for storing tangent info
98 
99  static char *shadowSubdomainProgram;
100 
101  static int count; // MHS
102  static int numShadowSubdomains;
103  static std::deque<ShadowSubdomain *> theShadowSubdomains;
104 
105  void libera_vectors(void) const;
106  void alloc_vectors(const size_t &) const;
107  void resize_vectors(const size_t &) const;
108  void libera_arrays(void);
109  void alloc_arrays(const size_t &,const size_t &);
110  protected:
111  virtual int buildMap(void) const;
112  virtual int buildEleGraph(Graph &theEleGraph);
113  virtual int buildNodeGraph(Graph &theNodeGraph);
114 
115  public:
116  ShadowSubdomain(int tag, MachineBroker &theMachineBroker, FEM_ObjectBroker &theObjectBroker,DataOutputHandler::map_output_handlers *oh,EntCmd *owr);
117  ShadowSubdomain(int tag, Channel &, FEM_ObjectBroker &,DataOutputHandler::map_output_handlers *,EntCmd *);
118  virtual ~ShadowSubdomain(void);
119 
120  // method added for parallel domain generation
121  virtual int buildSubdomain(int numSubdomains,
122  PartitionedModelBuilder &theBuilder);
123  virtual int getRemoteData(void);
124 
125  // Methods inherited from Domain, Subdomain and Element
126  // which must be rewritten
127 
128  virtual bool addElement(Element *);
129  virtual bool addNode(Node *);
130  virtual bool addExternalNode(Node *);
133  virtual bool addLoadPattern(LoadPattern *);
134  virtual bool addNodalLoad(NodalLoad *, int loadPattern);
135  virtual bool addElementalLoad(ElementalLoad *, int loadPattern);
136  virtual bool addSFreedom_Constraint(SFreedom_Constraint *, int loadPattern);
137 
138 
139  virtual bool hasNode(int tag);
140  virtual bool hasElement(int tag);
141 
142  virtual void clearAll(void);
143  virtual bool removeElement(int tag);
144  virtual bool removeNode(int tag);
145  virtual bool removeSFreedom_Constraint(int tag);
146  virtual bool removeMFreedom_Constraint(int tag);
147  virtual bool removeLoadPattern(int tag);
148  virtual bool removeNodalLoad(int tag, int loadPattern);
149  virtual bool removeElementalLoad(int tag, int loadPattern);
150  virtual bool removeSFreedom_Constraint(int tag, int loadPattern);
151 
152  virtual ElementIter &getElements();
153  virtual NodeIter &getNodes();
154  virtual NodeIter &getInternalNodeIter(void);
155  virtual NodeIter &getExternalNodeIter(void);
156 
157  virtual Element *getElementPtr(int tag);
158  virtual Node *getNodePtr(int tag);
159 
160  virtual int getNumElements(void) const;
161  virtual int getNumNodes(void) const;
162  virtual int getNumSPs(void) const;
163  virtual int getNumMPs(void) const;
164  virtual int getNumLoadPatterns(void) const;
165 
166  virtual Graph &getElementGraph(void);
167  virtual Graph &getNodeGraph(void);
168 
169  // methods to update the domain
170  virtual void setCommitTag(int newTag);
171  virtual void setCurrentTime(double newTime);
172  virtual void setCommittedTime(double newTime);
173  virtual void applyLoad(double pseudoTime);
174  virtual void setLoadConstant(void);
175 
176  virtual int update(void);
177  virtual int update(double newTime, double dT);
178  virtual int commit(void);
179  virtual int revertToLastCommit(void);
180  virtual int revertToStart(void);
181  virtual int barrierCheckIN(void);
182  virtual int barrierCheckOUT(int);
183 
184  virtual int setRayleighDampingFactors(const RayleighDampingFactors &rF);
185 
186  virtual int addRecorder(Recorder &theRecorder);
187  virtual int removeRecorders(void);
188 
189  virtual void wipeAnalysis(void);
190  virtual void setDomainDecompAnalysis(DomainDecompositionAnalysis &theAnalysis);
191  virtual int setAnalysisAlgorithm(EquiSolnAlgo &theAlgorithm);
192  virtual int setAnalysisIntegrator(IncrementalIntegrator &theIntegrator);
193  virtual int setAnalysisLinearSOE(LinearSOE &theSOE);
194  virtual int setAnalysisConvergenceTest(ConvergenceTest &theTest);
195  virtual void clearAnalysis(void);
196  virtual void domainChange(void);
197 
198  virtual int getNumExternalNodes(void) const;
199  virtual const ID &getExternalNodes(void) const;
200  virtual int getNumDOF(void) const;
201 
202  virtual const Matrix &getTang(void);
203  virtual const Vector &getResistingForce(void) const;
204 
205  virtual int computeTang(void);
206  virtual int computeResidual(void);
207 
208  const Vector &getLastExternalSysResponse(void);
209  virtual int computeNodalResponse(void);
210  virtual int newStep(double deltaT);
211 
212  virtual int sendSelf(CommParameters &);
213  virtual int recvSelf(const CommParameters &);
214 
215  virtual double getCost(void);
216 
217  virtual void Print(std::ostream &s, int flag =0);
218 
219  // nodal methods required in domain interface for parallel interprter
220  virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag);
221  virtual int setMass(const Matrix &mass, int nodeTag);
222  };
223 } // end of XC namespace
224 
225 #endif
A LoadPattern object is used to to store reference loads and single point constraints and a TimeSerie...
Definition: LoadPattern.h:87
virtual bool removeLoadPattern(int tag)
Elimina del domain el load pattern cuyo tag being passed as parameter.
Definition: ShadowSubdomain.cpp:586
virtual int revertToStart(void)
Returns the domain to its initial state and triggers the "restart" method for all the recorders...
Definition: ShadowSubdomain.cpp:943
virtual bool addElementalLoad(ElementalLoad *, int loadPattern)
Adds to the caso being passed as parameter una load over elements.
Definition: ShadowSubdomain.cpp:451
virtual void Print(std::ostream &s, int flag=0)
Imprime el domain.
Definition: ShadowSubdomain.cpp:1226
IncrementalIntegrator is an algorithmic class for setting up the finite element equations in an incre...
Definition: IncrementalIntegrator.h:87
EquiSolnAlgo is an abstract base class, i.e. no objects of it&#39;s type can be created. Its subclasses deifine the sequence of operations to be performed in the analysis by static equilibrium of a finite element model.
Definition: EquiSolnAlgo.h:85
virtual int revertToLastCommit(void)
Returns the domain to its last commited state.
Definition: ShadowSubdomain.cpp:932
Definition: Vector.h:82
virtual bool removeNode(int tag)
Elimina the node identified by the tag being passed as parameter.
Definition: ShadowSubdomain.cpp:524
A MachineBroker is responsible for getting an actor process running on the parallel machine...
Definition: MachineBroker.h:75
Iterator over an element container.
Definition: ElementIter.h:73
virtual int setMass(const Matrix &mass, int nodeTag)
Asigna la matriz de masas al nudo cuyo tag being passed as parameter.
Definition: ShadowSubdomain.cpp:1273
Definition: PartitionedModelBuilder.h:76
virtual ElementIter & getElements()
Returns an iterator to the element container.
Definition: ShadowSubdomain.cpp:665
Mesh node.
Definition: Node.h:99
Finite element as seen by analysis.
Definition: FE_Element.h:84
virtual bool addSFreedom_Constraint(SFreedom_Constraint *)
Adds to the domain una constraint monopunto.
Definition: ShadowSubdomain.cpp:342
FEM_ObjectBroker is is an object broker class for the finite element method. All methods are virtual ...
Definition: FEM_ObjectBroker.h:138
virtual bool removeNodalLoad(int tag, int loadPattern)
Elimina the load nodal del contenedor.
Definition: ShadowSubdomain.cpp:600
convergence test.
Definition: ConvergenceTest.h:75
virtual int removeRecorders(void)
Elimina los recorders.
Definition: ShadowSubdomain.cpp:914
Base calass for the finite elements.
Definition: Element.h:104
Base class for loads over elements.
Definition: ElementalLoad.h:73
virtual bool addElement(Element *)
Adds to the domain the element being passed as parameter.
Definition: ShadowSubdomain.cpp:267
virtual bool removeSFreedom_Constraint(int tag)
Elimina del domain la constraint monopunto cuyo tag being passed as parameter.
Definition: ShadowSubdomain.cpp:560
Iterador sobre el conteedor de nodos.
Definition: NodeIter.h:73
virtual bool addLoadPattern(LoadPattern *)
Adds al modelo la hipótesis simple being passed as parameter.
Definition: ShadowSubdomain.cpp:379
Definition: ID.h:77
virtual int commit(void)
Commits domain state and triggers "record" method for all defined recorders.
Definition: ShadowSubdomain.cpp:921
virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag)
Returns the value of dof component of displacement for the node with the tag being passed as paramete...
Definition: ShadowSubdomain.cpp:1257
Definition: ShadowSubdomain.h:70
An Recorder object is used in the program to store/restore information at each commit().
Definition: Recorder.h:79
Definition: Subdomain.h:87
virtual bool removeElement(int tag)
Clears the element identified by the tag being passed as parameter.
Definition: ShadowSubdomain.cpp:493
virtual bool addNodalLoad(NodalLoad *, int loadPattern)
Appends a nodal load to the pattern being passed as parameter.
Definition: ShadowSubdomain.cpp:426
Used when performing a domain decomposition analysis. It provides methods which can be invoked by a s...
Definition: DomainDecompositionAnalysis.h:81
Definition: Matrix.h:82
virtual Graph & getNodeGraph(void)
Builds (if necessary) the domain nodes graph and returns a reference to it.
Definition: ShadowSubdomain.cpp:774
TaggedObjectStorage. A TaggedObjectStorage object a container object used to hold objects of type Tag...
Definition: TaggedObjectStorage.h:76
virtual int buildEleGraph(Graph &theEleGraph)
Builds the element graph.
Definition: ShadowSubdomain.cpp:1235
Channel is an abstract base class which defines the channel interface. A channel is a point of commun...
Definition: Channel.h:85
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: ShadowSubdomain.cpp:1218
Rayleigh damping factors.
Definition: RayleighDampingFactors.h:45
Linea system of equations. This is the class definition for LinearSOE. LinearSOE is an abstract base ...
Definition: LinearSOE.h:86
virtual int getNumNodes(void) const
Returns the número de nodos.
Definition: ShadowSubdomain.cpp:753
virtual void domainChange(void)
Establece que the model ha cambiado.
Definition: ShadowSubdomain.cpp:1018
Definition: Shadow.h:80
The Graph class provides the abstraction of a graph, a collection of vertices and edges...
Definition: Graph.h:84
virtual int buildNodeGraph(Graph &theNodeGraph)
Builds the node graph.
Definition: ShadowSubdomain.cpp:1242
virtual void clearAll(void)
Removes all components from domain (nodes, elements, loads & constraints). GENERAL NOTE ON REMOVAL OF...
Definition: ShadowSubdomain.cpp:897
Multi-freedom constraint. Objectt of this class store the information for a multifreedom constraint...
Definition: MFreedom_Constraint.h:84
virtual int addRecorder(Recorder &theRecorder)
Adds a recorder to the model.
Definition: ShadowSubdomain.cpp:905
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
virtual void setLoadConstant(void)
Set all the loads as constant.
Definition: ShadowSubdomain.cpp:831
Communication parameters between processes.
Definition: CommParameters.h:65
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: ShadowSubdomain.cpp:1211
virtual NodeIter & getNodes()
Returns an iterator a los nodos del domain.
Definition: ShadowSubdomain.cpp:675
virtual int update(void)
Updates the state of the mesh.
Definition: ShadowSubdomain.cpp:839
Load over a node.
Definition: NodalLoad.h:76
================================================================================
Definition: ContinuaReprComponent.h:34
virtual int setRayleighDampingFactors(const RayleighDampingFactors &rF)
Asigna valores a los coeficientes de amortiguamiento de Rayleigh.
Definition: ShadowSubdomain.cpp:881
virtual bool addNode(Node *)
Method to add a Node to the model.
Definition: ShadowSubdomain.cpp:299
virtual int getNumElements(void) const
Returns the number of elements.
Definition: ShadowSubdomain.cpp:747
virtual bool removeElementalLoad(int tag, int loadPattern)
Elimina del contenedor the load over element.
Definition: ShadowSubdomain.cpp:620
virtual Graph & getElementGraph(void)
Builds (if necessary) the domain elements graph and returns a reference to it.
Definition: ShadowSubdomain.cpp:764
virtual bool removeMFreedom_Constraint(int tag)
Elimina del domain la constraint multipunto cuyo tag being passed as parameter.
Definition: ShadowSubdomain.cpp:573
virtual bool addMFreedom_Constraint(MFreedom_Constraint *)
Adds to the domain una constraint multipunto.
Definition: ShadowSubdomain.cpp:361