Domain.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.17 $
00022 // $Date: 2006/09/05 23:03:33 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/domain/Domain.h,v $
00024                                                                         
00025 // Written: fmk 
00026 // Created: Fri Sep 20 15:27:47: 1996
00027 // Revision: A
00028 //
00029 // Description: This file contains the class definition for Domain.
00030 // Domain is a container class. The class is responsible for holding
00031 // and providing access to the Elements, Nodes, SP_Constraints 
00032 // MP_Constraints, and LoadPatterns.
00033 //
00034 // What: "@(#) Domain.h, revA"
00035 
00036 #ifndef Domain_h
00037 #define Domain_h
00038 
00039 #include <OPS_Stream.h>
00040 #include <Vector.h>
00041 
00042 #ifndef _bool_h
00043 #include <bool.h>
00044 #endif
00045 
00046 class Element;
00047 class Node;
00048 class SP_Constraint;
00049 class MP_Constraint;
00050 class NodalLoad;
00051 class ElementalLoad;
00052 class LoadPattern;
00053 class Parameter;
00054 
00055 class ElementIter;
00056 class NodeIter;
00057 class SP_ConstraintIter;
00058 class MP_ConstraintIter;
00059 class LoadPatternIter;
00060 
00061 class SingleDomEleIter;
00062 class SingleDomNodIter;
00063 class SingleDomSP_Iter;
00064 class SingleDomMP_Iter;
00065 class SingleDomAllSP_Iter;
00066 
00067 class MeshRegion;
00068 class Recorder;
00069 class Graph;
00070 class NodeGraph;
00071 class ElementGraph;
00072 class Channel;
00073 class FEM_ObjectBroker;
00074 
00075 class TaggedObjectStorage;
00076 
00077 class Domain
00078 {
00079   public:
00080     Domain();
00081     Domain(int numNodes, int numElements, int numSPs, int numMPs,
00082            int numLoadPatterns);
00083     
00084     Domain(TaggedObjectStorage &theNodesStorage,
00085            TaggedObjectStorage &theElementsStorage,
00086            TaggedObjectStorage &theMPsStorage,
00087            TaggedObjectStorage &theSPsStorage,
00088            TaggedObjectStorage &theLoadPatternsStorage);
00089 
00090     Domain(TaggedObjectStorage &theStorageType);
00091     
00092     virtual ~Domain();    
00093 
00094     // methods to populate a domain
00095     virtual  bool addElement(Element *);
00096     virtual  bool addNode(Node *);
00097     virtual  bool addSP_Constraint(SP_Constraint *);
00098     virtual  bool addMP_Constraint(MP_Constraint *); 
00099     virtual  bool addLoadPattern(LoadPattern *);            
00100     virtual  bool addParameter(Parameter *);            
00101     
00102     // methods to add components to a LoadPattern object
00103     virtual  bool addSP_Constraint(SP_Constraint *, int loadPatternTag); 
00104     virtual  bool addNodalLoad(NodalLoad *, int loadPatternTag);
00105     virtual  bool addElementalLoad(ElementalLoad *, int loadPatternTag);
00106     
00107     // methods to remove the components 
00108     virtual void clearAll(void);        
00109     virtual Element       *removeElement(int tag);
00110     virtual Node          *removeNode(int tag);    
00111     virtual SP_Constraint *removeSP_Constraint(int tag);
00112     virtual MP_Constraint *removeMP_Constraint(int tag);    
00113     virtual LoadPattern   *removeLoadPattern(int tag);
00114     virtual Parameter     *removeParameter(int tag);
00115 
00116     virtual NodalLoad     *removeNodalLoad(int tag, int loadPattern);
00117     virtual ElementalLoad *removeElementalLoad(int tag, int loadPattern);
00118     virtual SP_Constraint *removeSP_Constraint(int tag, int loadPattern);
00119     
00120     // methods to access the components of a domain
00121     virtual  ElementIter       &getElements();
00122     virtual  NodeIter          &getNodes();
00123     virtual  SP_ConstraintIter &getSPs();
00124     virtual  MP_ConstraintIter &getMPs();
00125     virtual  LoadPatternIter   &getLoadPatterns();
00126     virtual  SP_ConstraintIter &getDomainAndLoadPatternSPs();
00127     
00128     virtual  Element       *getElement(int tag);
00129     virtual  Node          *getNode(int tag);
00130     virtual  SP_Constraint *getSP_Constraint(int tag);    
00131     virtual  MP_Constraint *getMP_Constraint(int tag);    
00132     virtual  LoadPattern   *getLoadPattern(int tag);        
00133     virtual  Parameter     *getParameter(int tag);        
00134 
00135     // methods to query the state of the domain
00136     virtual double  getCurrentTime(void) const;
00137     virtual int     getCommitTag(void) const;           
00138     virtual int getNumElements(void) const;
00139     virtual int getNumNodes(void) const;
00140     virtual int getNumSPs(void) const;
00141     virtual int getNumMPs(void) const;
00142     virtual int getNumLoadPatterns(void) const;            
00143     virtual int getNumParameters(void) const;            
00144     virtual const Vector &getPhysicalBounds(void); 
00145 
00146 
00147     // methods to get element and node graphs
00148     virtual  Graph  &getElementGraph(void);
00149     virtual  Graph  &getNodeGraph(void);
00150     
00151     // methods to update the domain
00152     virtual  void setCommitTag(int newTag);     
00153     virtual  void setCurrentTime(double newTime);    
00154     virtual  void setCommittedTime(double newTime);        
00155     virtual  void applyLoad(double pseudoTime);
00156     virtual  void setLoadConstant(void);    
00157     virtual  int  initialize(void);    
00158     virtual  int  setRayleighDampingFactors(double alphaM, double betaK, double betaK0, double betaKc);
00159     
00160     virtual  int  commit(void);
00161     virtual  int  revertToLastCommit(void);
00162     virtual  int  revertToStart(void);    
00163     virtual  int  update(void);
00164     virtual  int  update(double newTime, double dT);
00165     virtual  int  newStep(double dT);
00166 
00167     
00168     // methods for eigenvalue analysis
00169     virtual int setEigenvalues(const Vector &theEigenvalues);
00170     virtual const Vector &getEigenvalues(void);
00171     virtual double getTimeEigenvaluesSet(void);
00172     
00173     // methods for other objects to determine if model has changed
00174     virtual void domainChange(void);    
00175     virtual int hasDomainChanged(void);
00176     virtual void setDomainChangeStamp(int newStamp);
00177     
00178     // methods for output
00179     virtual int  addRecorder(Recorder &theRecorder);            
00180     virtual int  removeRecorders(void);
00181 
00182     virtual int  addRegion(MeshRegion &theRegion);      
00183     virtual MeshRegion *getRegion(int region);          
00184 
00185     virtual void Print(OPS_Stream &s, int flag =0);
00186     friend OPS_Stream &operator<<(OPS_Stream &s, Domain &M);    
00187 
00188     virtual int sendSelf(int commitTag, Channel &theChannel);  
00189     virtual int recvSelf(int commitTag, Channel &theChannel, 
00190                          FEM_ObjectBroker &theBroker);    
00191 
00192     // nodal methods required in domain interface for parallel interprter
00193     virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag);
00194     virtual int setMass(const Matrix &mass, int nodeTag);
00195 
00196     virtual int calculateNodalReactions(bool inclInertia);
00197 
00198   protected:    
00199     virtual int buildEleGraph(Graph *theEleGraph);
00200     virtual int buildNodeGraph(Graph *theNodeGraph);
00201 
00202     Recorder **theRecorders;
00203     int numRecorders;    
00204 
00205   private:
00206     double currentTime;               // current pseudo time
00207     double committedTime;             // the committed pseudo time
00208     double dT;                        // difference between committed and current time
00209     int    currentGeoTag;             // an integer used to mark if domain has changed
00210     bool   hasDomainChangedFlag;      // a bool flag used to indicate if GeoTag needs to be ++
00211     int    theDbTag;                   // the Domains unique database tag == 0
00212     int    lastGeoSendTag;            // the value of currentGeoTag when sendSelf was last invoked
00213     int dbEle, dbNod, dbSPs, dbMPs, dbLPs, dbParam; // database tags for storing info
00214 
00215     bool eleGraphBuiltFlag;
00216     bool nodeGraphBuiltFlag;
00217     
00218     Graph *theNodeGraph;
00219     Graph *theElementGraph;
00220 
00221     TaggedObjectStorage  *theElements;
00222     TaggedObjectStorage  *theNodes;
00223     TaggedObjectStorage  *theSPs;    
00224     TaggedObjectStorage  *theMPs;    
00225     TaggedObjectStorage  *theLoadPatterns;        
00226     TaggedObjectStorage  *theParameters;        
00227 
00228     SingleDomEleIter      *theEleIter;
00229     SingleDomNodIter      *theNodIter;
00230     SingleDomSP_Iter      *theSP_Iter;
00231     SingleDomMP_Iter      *theMP_Iter;
00232     LoadPatternIter       *theLoadPatternIter;        
00233     SingleDomAllSP_Iter   *allSP_Iter;
00234     
00235     MeshRegion **theRegions;
00236     int numRegions;    
00237 
00238     int commitTag;
00239     
00240     Vector theBounds;
00241     
00242     Vector *theEigenvalues;
00243     double theEigenvalueSetTime;
00244 
00245     int lastChannel;
00246 };
00247 
00248 #endif
00249 
00250 

Generated on Mon Oct 23 15:05:01 2006 for OpenSees by doxygen 1.5.0