ShadowSubdomain.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.5 $
00022 // $Date: 2005/11/30 23:47:00 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/subdomain/ShadowSubdomain.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef ShadowSubdomain_h
00027 #define ShadowSubdomain_h
00028 
00029 // Written: fmk 
00030 // Revision: A
00031 //
00032 // Description: This file contains the class definition for ShadowSubdomain.
00033 // ShadowSubdomain is a container class. The class is responsible for holding
00034 // and providing access to the Elements, Nodes, LoadCases, SP_Constraints 
00035 // and MP_Constraints that have been added to the ShadowSubdomain.
00036 //
00037 // What: "@(#) ShadowSubdomain.h, revA"
00038 
00039 #include <Subdomain.h>
00040 #include <Shadow.h>
00041 #include <remote.h>
00042 
00043 class ShadowSubdomain: public Shadow, public Subdomain
00044 {
00045   public:
00046     ShadowSubdomain(int tag,
00047                     MachineBroker &theMachineBroker,
00048                     FEM_ObjectBroker &theObjectBroker);
00049 
00050     ShadowSubdomain(int tag, 
00051                     Channel &theChannel, 
00052                     FEM_ObjectBroker &theObjectBroker);
00053 
00054     virtual  ~ShadowSubdomain();    
00055 
00056     // method added for parallel domain generation
00057     virtual int buildSubdomain(int numSubdomains, 
00058                                PartitionedModelBuilder &theBuilder);
00059     virtual int getRemoteData(void);
00060 
00061     // Methods inherited from Domain, Subdomain and Element
00062     // which must be rewritten
00063 
00064     virtual  bool addElement(Element *);
00065     virtual  bool addNode(Node *);
00066     virtual  bool addExternalNode(Node *);
00067     virtual  bool addSP_Constraint(SP_Constraint *);
00068     virtual  bool addMP_Constraint(MP_Constraint *);    
00069     virtual  bool addLoadPattern(LoadPattern *);            
00070     virtual  bool addNodalLoad(NodalLoad *, int loadPattern);
00071     virtual  bool addElementalLoad(ElementalLoad *, int loadPattern);
00072     virtual  bool addSP_Constraint(SP_Constraint *, int loadPattern);    
00073 
00074 
00075     virtual bool hasNode(int tag);
00076     virtual bool hasElement(int tag);
00077 
00078     virtual void clearAll(void);        
00079     virtual Element       *removeElement(int tag);
00080     virtual Node          *removeNode(int tag);    
00081     virtual SP_Constraint *removeSP_Constraint(int tag);
00082     virtual MP_Constraint *removeMP_Constraint(int tag);
00083     virtual LoadPattern   *removeLoadPattern(int tag);
00084     virtual NodalLoad     *removeNodalLoad(int tag, int loadPattern);
00085     virtual ElementalLoad *removeElementalLoad(int tag, int loadPattern);
00086     virtual SP_Constraint *removeSP_Constraint(int tag, int loadPattern);
00087     
00088     virtual  ElementIter       &getElements();
00089     virtual  NodeIter          &getNodes();
00090     virtual  NodeIter          &getInternalNodeIter(void);
00091     virtual  NodeIter          &getExternalNodeIter(void);    
00092     
00093     virtual  Element       *getElementPtr(int tag);
00094     virtual  Node          *getNodePtr(int tag);
00095 
00096     virtual int getNumElements(void) const;
00097     virtual int getNumNodes(void) const;
00098     virtual int getNumSPs(void) const;
00099     virtual int getNumMPs(void) const;
00100     virtual int getNumLoadPatterns(void) const;
00101     
00102     virtual  Graph &getElementGraph(void);
00103     virtual  Graph &getNodeGraph(void);
00104 
00105     // methods to update the domain
00106     virtual  void setCommitTag(int newTag);     
00107     virtual  void setCurrentTime(double newTime);    
00108     virtual  void setCommittedTime(double newTime);        
00109     virtual  void applyLoad(double pseudoTime);
00110     virtual  void setLoadConstant(void);    
00111 
00112     virtual  int update(void);    
00113     virtual  int update(double newTime, double dT);    
00114     virtual  int commit(void);
00115     virtual  int revertToLastCommit(void);    
00116     virtual  int revertToStart(void);    
00117     virtual  int barrierCheckIN(void);    
00118     virtual  int barrierCheckOUT(int);    
00119 
00120     virtual int setRayleighDampingFactors(double alphaM, double betaK, double betaK0, double betaKc);
00121 
00122     virtual int  addRecorder(Recorder &theRecorder);            
00123     virtual int  removeRecorders(void);
00124 
00125     virtual void wipeAnalysis(void);
00126     virtual void setDomainDecompAnalysis(DomainDecompositionAnalysis &theAnalysis);
00127     virtual int setAnalysisAlgorithm(EquiSolnAlgo &theAlgorithm);
00128     virtual int setAnalysisIntegrator(IncrementalIntegrator &theIntegrator);
00129     virtual int setAnalysisLinearSOE(LinearSOE &theSOE);
00130     virtual int setAnalysisConvergenceTest(ConvergenceTest &theTest);
00131     virtual void clearAnalysis(void);
00132     virtual void domainChange(void);
00133     
00134     virtual int         getNumExternalNodes(void) const;    
00135     virtual const ID   &getExternalNodes(void);
00136     virtual int         getNumDOF(void);
00137 
00138     virtual const Matrix &getTang(void);    
00139     virtual const Vector &getResistingForce(void);    
00140 
00141     virtual int  computeTang(void);
00142     virtual int  computeResidual(void);
00143 
00144     const Vector &getLastExternalSysResponse(void);
00145     virtual int computeNodalResponse(void);    
00146     virtual int newStep(double deltaT);
00147 
00148     virtual int sendSelf(int commitTag, Channel &theChannel);
00149     virtual int recvSelf(int commitTag, Channel &theChannel, 
00150                          FEM_ObjectBroker &theBroker);    
00151 
00152     virtual double getCost(void);
00153     
00154     virtual  void Print(OPS_Stream &s, int flag =0);
00155 
00156     // nodal methods required in domain interface for parallel interprter
00157     virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag);
00158     virtual int setMass(const Matrix &mass, int nodeTag);
00159     
00160   protected:    
00161     virtual int buildMap(void);
00162     virtual int buildEleGraph(Graph *theEleGraph);
00163     virtual int buildNodeGraph(Graph *theNodeGraph);    
00164     
00165   private:
00166     ID msgData;
00167     ID theElements;
00168     ID theNodes;
00169     ID theExternalNodes;    
00170     ID theLoadCases;
00171 
00172     TaggedObjectStorage  *theShadowSPs;    
00173     TaggedObjectStorage  *theShadowMPs;    
00174     TaggedObjectStorage  *theShadowLPs;        
00175     
00176     int numDOF;
00177     int numElements;
00178     int numNodes;
00179     int numExternalNodes;
00180     int numSPs;
00181     int numMPs;
00182     int numLoadPatterns;
00183 
00184     bool buildRemote;
00185     bool gotRemoteData;
00186     
00187     FE_Element *theFEele;
00188 
00189     Vector *theVector; // for storing residual info
00190     Matrix *theMatrix; // for storing tangent info
00191     
00192     static char *shadowSubdomainProgram;
00193 
00194     static int count;  // MHS
00195     static int numShadowSubdomains;
00196     static ShadowSubdomain **theShadowSubdomains;
00197 };
00198 
00199 #endif

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