XC Open source finite element analysis program
Subdomain.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.6 $
48 // $Date: 2005/11/30 23:47:00 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/subdomain/Subdomain.h,v $
50 
51 
52 #ifndef Subdomain_h
53 #define Subdomain_h
54 
55 // File: ~/domain/subdomain/Subdomain.h
56 //
57 // Written: fmk
58 // Created: 11/96
59 // Revision: A
60 // Revision: B 03/98 - revised to allow parallel model generation
61 //
62 // Description: This file contains the class definition for Subdomain.
63 // Subdomain is a container class. The class is responsible for holding
64 // and providing access to the Elements, Nodes, LoadCases, SFreedom_Constraints
65 // and MFreedom_Constraints that have been added to the subdomain.
66 //
67 // What: "@(#) Subdomain.h, revA"
68 
69 #include "domain/domain/Domain.h"
70 #include "domain/mesh/element/Element.h"
71 #include "utility/Timer.h"
72 #include "SubdomainNodIter.h"
73 
74 namespace XC {
75 class Node;
76 class ID;
77 class TaggedObjectStorage;
78 class DomainDecompositionAnalysis;
79 class PartitionedModelBuilder;
80 class EquiSolnAlgo;
81 class IncrementalIntegrator;
82 class LinearSOE;
83 class ConvergenceTest;
84 class FE_Element;
85 
86 
87 class Subdomain: public Element, public Domain
88  {
89  private:
90  double realCost;
91  double cpuCost;
92  int pageCost;
93  Timer theTimer;
94  DomainDecompositionAnalysis *theAnalysis;
95  mutable ID *extNodes;
96  FE_Element *theFEele;
97 
98  // TaggedObjectStorage *realExternalNodes;
99 
100  SingleDomNodIter *internalNodeIter;
101  SingleDomNodIter *externalNodeIter;
102  SubdomainNodIter *theNodIter;
103 
104  PartitionedModelBuilder *thePartitionedModelBuilder;
105  static Matrix badResult;
106  protected:
107  virtual int buildMap(void) const;
108  mutable bool mapBuilt;
109  mutable ID *map;
110  mutable Vector *mappedVect;
111  mutable Matrix *mappedMatrix;
112 
113 
114  FE_Element *getFE_ElementPtr(void);
115  TaggedObjectStorage *internalNodes;
116  TaggedObjectStorage *externalNodes;
117 
118  DomainDecompositionAnalysis *getDDAnalysis(void);
119  public:
120  Subdomain(int tag,DataOutputHandler::map_output_handlers *oh,EntCmd *owr);
121 
122  virtual ~Subdomain(void);
123 
124  // method added for parallel domain generation
125  virtual int buildSubdomain(int numSubdomains,PartitionedModelBuilder &theBuilder);
126 
127  // Domain methods which must be rewritten
128  virtual void clearAll(void);
129  virtual bool addNode(Node *);
130  virtual bool removeNode(int tag);
131  virtual NodeIter &getNodes(void);
132  virtual const Node *getNode(int tag) const;
133  virtual Node *getNode(int tag);
134  virtual NodePtrsWithIDs &getNodePtrs(void);
135  virtual const NodePtrsWithIDs &getNodePtrs(void) const;
136 
137  virtual bool hasNode(int tag);
138  virtual bool hasElement(int tag);
139 
140  virtual int getNumNodes(void) const;
141  virtual int commit(void);
142  virtual int revertToLastCommit(void);
143  virtual int revertToStart(void);
144  virtual int update(void);
145  virtual int update(double newTime, double dT);
146 
147 #ifdef _PARALLEL_PROCESSING
148  virtual int barrierCheckIN(void) {return 0;};
149  virtual int barrierCheckOUT(int) {return 0;};
150 #endif
151 
152  virtual void Print(std::ostream &s, int flag =0);
153 
154  // Domain type methods unique to a Subdomain
155  virtual NodeIter &getInternalNodeIter(void);
156  virtual NodeIter &getExternalNodeIter(void) const;
157  virtual bool addExternalNode(Node *);
158 
159  virtual void wipeAnalysis(void);
160  virtual void setDomainDecompAnalysis(DomainDecompositionAnalysis &theAnalysis);
161  virtual int setAnalysisAlgorithm(EquiSolnAlgo &theAlgorithm);
162  virtual int setAnalysisIntegrator(IncrementalIntegrator &theIntegrator);
163  virtual int setAnalysisLinearSOE(LinearSOE &theSOE);
164  virtual int setAnalysisConvergenceTest(ConvergenceTest &theTest);
165  virtual int invokeChangeOnAnalysis(void);
166 
167  // Element methods which must be written
168  virtual int getNumExternalNodes(void) const;
169  virtual const ID &getExternalNodes(void) const;
170  virtual int getNumDOF(void) const;
171 
172  virtual int commitState(void);
173 
174  virtual const Matrix &getTangentStiff(void);
175  virtual const Matrix &getInitialStiff(void);
176  virtual const Matrix &getDamp(void);
177  virtual const Matrix &getMass(void);
178 
179  virtual void zeroLoad(void);
180  virtual int addLoad(ElementalLoad *theLoad, double loadFactor);
181  virtual int addInertiaLoadToUnbalance(const Vector &accel);
182 
183  virtual const Vector &getResistingForce(void) const;
184  virtual const Vector &getResistingForceIncInertia(void) const;
185  virtual bool isSubdomain(void);
186  virtual int setRayleighDampingFactors(const RayleighDampingFactors &rF);
187 
188  // Element type methods unique to a subdomain
189  virtual int computeTang(void);
190  virtual int computeResidual(void);
191  virtual const Matrix &getTang(void);
192 
193  void setFE_ElementPtr(FE_Element *theFE_Ele);
194  virtual const Vector &getLastExternalSysResponse(void);
195  virtual int computeNodalResponse(void);
196  virtual int newStep(double deltaT);
197  virtual bool doesIndependentAnalysis(void);
198 
199  virtual int sendSelf(CommParameters &);
200  virtual int recvSelf(const CommParameters &);
201 
202  virtual double getCost(void);
203  };
204 } // end of XC namespace
205 
206 #endif
207 
208 
virtual bool removeNode(int tag)
Elimina the node identified by the tag being passed as parameter.
Definition: Subdomain.cpp:207
virtual NodeIter & getNodes(void)
Returns an iterator a los nodos del domain.
Definition: Subdomain.cpp:221
IncrementalIntegrator is an algorithmic class for setting up the finite element equations in an incre...
Definition: IncrementalIntegrator.h:87
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
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 update(void)
Updates the state of the mesh.
Definition: Subdomain.cpp:334
virtual int setRayleighDampingFactors(const RayleighDampingFactors &rF)
Asigna valores a los coeficientes de amortiguamiento de Rayleigh.
Definition: Subdomain.cpp:573
Definition: Vector.h:82
Definition: PartitionedModelBuilder.h:76
virtual void zeroLoad(void)
Anula el load vector aplicadas of the element.
Definition: Subdomain.cpp:521
Mesh node.
Definition: Node.h:99
Finite element as seen by analysis.
Definition: FE_Element.h:84
virtual const Node * getNode(int tag) const
Returns a pointer to the nodo cuyo tag being passed as parameter.
Definition: Subdomain.cpp:241
convergence test.
Definition: ConvergenceTest.h:75
Base calass for the finite elements.
Definition: Element.h:104
Base class for loads over elements.
Definition: ElementalLoad.h:73
Definition: SubdomainNodIter.h:76
Iterador sobre el conteedor de nodos.
Definition: NodeIter.h:73
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: Subdomain.cpp:708
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: Subdomain.cpp:725
virtual void clearAll(void)
Removes all components from domain (nodes, elements, loads & constraints). GENERAL NOTE ON REMOVAL OF...
Definition: Subdomain.cpp:133
Node pointer container for elements.
Definition: NodePtrsWithIDs.h:45
Definition: ID.h:77
Definition: Subdomain.h:87
virtual void Print(std::ostream &s, int flag=0)
Imprime el domain.
Definition: Subdomain.cpp:340
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
TaggedObjectStorage. A TaggedObjectStorage object a container object used to hold objects of type Tag...
Definition: TaggedObjectStorage.h:76
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 const Vector & getResistingForceIncInertia(void) const
Returns the action of the element over its attached nodes. Computes damping matrix.
Definition: Subdomain.cpp:559
Definition: SingleDomNodIter.h:70
virtual int revertToLastCommit(void)
Returns the domain to its last commited state.
Definition: Subdomain.cpp:312
virtual int revertToStart(void)
Returns the domain to its initial state and triggers the "restart" method for all the recorders...
Definition: Subdomain.cpp:323
virtual int commit(void)
Commits domain state and triggers "record" method for all defined recorders.
Definition: Subdomain.cpp:301
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
virtual int commitState(void)
Consuma el estado of the element.
Definition: Subdomain.cpp:487
Definition: Timer.h:88
virtual bool addNode(Node *)
Method to add a Node to the model.
Definition: Subdomain.cpp:155
virtual int getNumNodes(void) const
Returns the número de nodos.
Definition: Subdomain.cpp:298