XC Open source finite element analysis program
PartitionedDomain.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: 2006/01/10 00:33:09 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/domain/partitioned/PartitionedDomain.h,v $
50 
51 
52 // Written: fmk
53 // Created: Wed Sep 25 15:27:47: 1996
54 // Revision: A
55 //
56 // Description: This file contains the class definition for PartitionedDomain.
57 // PartitionedDomain is an abstract class. The class is responsible for holding
58 // and providing access to the Elements, Nodes, SFreedom_Constraints
59 // and MFreedom_Constraints just like a normal domain. In addition the domain provides
60 // a method to partition the domain into Subdomains.
61 //
62 // ModelBuilder. There are no partitions in a PartitionedDomain.
63 //
64 // What: "@(#) PartitionedDomain.h, revA"
65 
66 #ifndef PartitionedDomain_h
67 #define PartitionedDomain_h
68 
69 #include <domain/domain/Domain.h>
70 #include "solution/graph/graph/Graph.h"
71 
72 namespace XC {
73 class DomainPartitioner;
74 class Subdomain;
75 class SubdomainIter;
76 class ArrayOfTaggedObjects;
77 class PartitionedDomainSubIter;
78 class PartitionedDomainEleIter;
79 class SingleDomEleIter;
80 
83  {
84  private:
85  TaggedObjectStorage *elements;
86  ArrayOfTaggedObjects *theSubdomains;
87  DomainPartitioner *theDomainPartitioner;
88 
89  SingleDomEleIter *mainEleIter; // for ele that belong to elements
90  PartitionedDomainSubIter *theSubdomainIter;
91  PartitionedDomainEleIter *theEleIter;
92 
93  Graph mySubdomainGraph;
94  void alloc(void);
95  void libera(void);
96  protected:
97  int barrierCheck(int result);
98  DomainPartitioner *getPartitioner(void) const;
99  virtual int buildEleGraph(Graph &theEleGraph);
100  public:
101  PartitionedDomain(EntCmd *owr,DataOutputHandler::map_output_handlers *oh);
102  PartitionedDomain(EntCmd *owr,DomainPartitioner &thePartitioner,DataOutputHandler::map_output_handlers *oh);
103 
104  PartitionedDomain(EntCmd *owr,int numNods, int numElems,
105  int numSPs, int numMPs, int numLPatterns, int numNLockers,
106  int numSubdom,
107  DomainPartitioner &thePartitioner,DataOutputHandler::map_output_handlers *oh);
108 
109  virtual ~PartitionedDomain(void);
110 
111  // public methods to populate a domain
112  virtual bool addElement(Element *elePtr);
113  virtual bool addNode(Node *nodePtr);
114 
115  virtual bool addLoadPattern(LoadPattern *);
117  virtual bool addSFreedom_Constraint(SFreedom_Constraint *, int loadPatternTag);
118  virtual bool addNodalLoad(NodalLoad *, int loadPatternTag);
119  virtual bool addElementalLoad(ElementalLoad *, int loadPatternTag);
120 
121  // methods to remove the components
122  virtual void clearAll(void);
123  virtual bool removeElement(int tag);
124  virtual bool removeNode(int tag);
125  virtual bool removeSFreedom_Constraint(int tag);
126  virtual bool removeMFreedom_Constraint(int tag);
127  virtual bool removeLoadPattern(int loadTag);
128 
129  // methods to access the elements
130  virtual ElementIter &getElements();
131  virtual Element *getElement(int tag);
132 
133  virtual int getNumElements(void) const;
134 
135  // public methods to update the domain
136  virtual void setCommitTag(int newTag);
137  virtual void setCurrentTime(double newTime);
138  virtual void setCommittedTime(double newTime);
139  virtual void applyLoad(double pseudoTime);
140  virtual void setLoadConstant(void);
141 
142  virtual int commit(void);
143  virtual int revertToLastCommit(void);
144  virtual int revertToStart(void);
145  virtual int update(void);
146  virtual int update(double newTime, double dT);
147  virtual int newStep(double dT);
148 
149  virtual int addRecorder(Recorder &theRecorder);
150  virtual int removeRecorders(void);
151 
152  virtual void Print(std::ostream &s, int flag =0);
153 
154  // public member functions in addition to the standard domain
155  virtual int setPartitioner(DomainPartitioner *thePartitioner);
156  virtual int partition(int numPartitions, bool usingMain = false, int mainPartitionID = 0);
157 
158  virtual bool addSubdomain(Subdomain *theSubdomain);
159  virtual int getNumSubdomains(void);
160  virtual Subdomain *getSubdomainPtr(int tag);
161  virtual SubdomainIter &getSubdomains(void);
162  virtual bool removeExternalNode(int tag);
163  virtual Graph &getSubdomainGraph(void);
164 
165  // nodal methods required in domain interface for parallel interprter
166  virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag);
167  virtual int setMass(const Matrix &mass, int nodeTag);
168 
169  // friend classes
170  friend class PartitionedDomainEleIter;
171  };
172 } // end of XC namespace
173 
174 #endif
175 
176 
A LoadPattern object is used to to store reference loads and single point constraints and a TimeSerie...
Definition: LoadPattern.h:87
virtual bool removeSFreedom_Constraint(int tag)
Elimina del domain la constraint monopunto cuyo tag being passed as parameter.
Definition: PartitionedDomain.cpp:400
virtual int addRecorder(Recorder &theRecorder)
Adds a recorder to the model.
Definition: PartitionedDomain.cpp:791
virtual int getNumElements(void) const
Returns the number of elements.
Definition: PartitionedDomain.cpp:508
ArrayOfTaggedObjects is a storage class. The class is responsible for holding and providing access to...
Definition: ArrayOfTaggedObjects.h:81
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
virtual bool removeNode(int tag)
Elimina el nodo cuyo tag being passed as parameter.
Definition: PartitionedDomain.cpp:378
Definition: PartitionedDomainEleIter.h:79
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: PartitionedDomain.cpp:1212
virtual bool removeMFreedom_Constraint(int tag)
Elimina del domain la constraint multipunto cuyo tag being passed as parameter.
Definition: PartitionedDomain.cpp:422
virtual bool addSFreedom_Constraint(SFreedom_Constraint *)
Adds to the domain una constraint monopunto.
Definition: PartitionedDomain.cpp:231
virtual int update(void)
Updates the state of the mesh.
Definition: PartitionedDomain.cpp:598
Mesh node.
Definition: Node.h:99
virtual int revertToStart(void)
Returns the domain to its initial state and triggers the "restart" method for all the recorders...
Definition: PartitionedDomain.cpp:764
virtual ElementIter & getElements()
Returns an iterator to the element container.
Definition: PartitionedDomain.cpp:474
Partitioned domain.
Definition: PartitionedDomain.h:82
virtual Element * getElement(int tag)
Returns a pointer to the element identified by the tag being passed as parameter. ...
Definition: PartitionedDomain.cpp:481
virtual bool removeLoadPattern(int loadTag)
Elimina del domain el load pattern cuyo tag being passed as parameter.
Definition: PartitionedDomain.cpp:449
Base calass for the finite elements.
Definition: Element.h:104
Base class for loads over elements.
Definition: ElementalLoad.h:73
Definition: PartitionedDomainSubIter.h:72
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: PartitionedDomain.cpp:1189
virtual int commit(void)
Commits domain state and triggers "record" method for all defined recorders.
Definition: PartitionedDomain.cpp:702
virtual bool addElementalLoad(ElementalLoad *, int loadPatternTag)
Adds to the caso being passed as parameter una load over elements.
Definition: PartitionedDomain.cpp:346
An Recorder object is used in the program to store/restore information at each commit().
Definition: Recorder.h:79
Definition: Subdomain.h:87
Definition: SingleDomEleIter.h:71
Definition: Matrix.h:82
virtual bool addElement(Element *elePtr)
Adds to the domain the element being passed as parameter.
Definition: PartitionedDomain.cpp:164
TaggedObjectStorage. A TaggedObjectStorage object a container object used to hold objects of type Tag...
Definition: TaggedObjectStorage.h:76
Definition: SubdomainIter.h:70
virtual bool addNode(Node *nodePtr)
Adds to the domain el nodo being passed as parameter.
Definition: PartitionedDomain.cpp:216
The Graph class provides the abstraction of a graph, a collection of vertices and edges...
Definition: Graph.h:84
Definition: DomainPartitioner.h:73
virtual bool addNodalLoad(NodalLoad *, int loadPatternTag)
Appends a nodal load to the pattern being passed as parameter.
Definition: PartitionedDomain.cpp:315
virtual bool removeElement(int tag)
Clears the element identified by the tag being passed as parameter.
Definition: PartitionedDomain.cpp:352
virtual void setLoadConstant(void)
Set all the loads as constant.
Definition: PartitionedDomain.cpp:582
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
virtual void clearAll(void)
Removes all components from domain (nodes, elements, loads & constraints). GENERAL NOTE ON REMOVAL OF...
Definition: PartitionedDomain.cpp:150
Load over a node.
Definition: NodalLoad.h:76
virtual int removeRecorders(void)
Elimina los recorders.
Definition: PartitionedDomain.cpp:816
virtual void Print(std::ostream &s, int flag=0)
Imprime el domain.
Definition: PartitionedDomain.cpp:838
================================================================================
Definition: ContinuaReprComponent.h:34
virtual bool addLoadPattern(LoadPattern *)
Adds al modelo la hipótesis simple being passed as parameter.
Definition: PartitionedDomain.cpp:286
virtual ~PartitionedDomain(void)
Destructor.
Definition: PartitionedDomain.cpp:144
virtual int buildEleGraph(Graph &theEleGraph)
Builds the element graph.
Definition: PartitionedDomain.cpp:958
virtual int revertToLastCommit(void)
Returns the domain to its last commited state.
Definition: PartitionedDomain.cpp:737