Subdomain.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.6 $
00022 // $Date: 2005/11/30 23:47:00 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/subdomain/Subdomain.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef Subdomain_h
00027 #define Subdomain_h
00028 
00029 // File: ~/domain/subdomain/Subdomain.h
00030 // 
00031 // Written: fmk 
00032 // Created:  11/96
00033 // Revision: A
00034 // Revision: B 03/98 - revised to allow parallel model generation
00035 //
00036 // Description: This file contains the class definition for Subdomain.
00037 // Subdomain is a container class. The class is responsible for holding
00038 // and providing access to the Elements, Nodes, LoadCases, SP_Constraints 
00039 // and MP_Constraints that have been added to the subdomain.
00040 //
00041 // What: "@(#) Subdomain.h, revA"
00042 
00043 #include <Domain.h>
00044 #include <Element.h>
00045 #include <Timer.h>
00046 
00047 class Node;
00048 class ID;
00049 class TaggedObjectStorage;
00050 class DomainDecompositionAnalysis;
00051 class PartitionedModelBuilder;
00052 class EquiSolnAlgo;
00053 class IncrementalIntegrator;
00054 class LinearSOE;
00055 class ConvergenceTest;
00056 class FE_Element;
00057 
00058 #include <SubdomainNodIter.h>
00059 
00060 class Subdomain: public Element, public Domain
00061 {
00062   public:
00063     Subdomain(int tag);
00064 
00065     Subdomain(int tag, 
00066               TaggedObjectStorage &theInternalNodeStorage,
00067               TaggedObjectStorage &theExternalNodeStorage,
00068               TaggedObjectStorage &theElementsStorage,
00069               TaggedObjectStorage &theLoadPatternsStorage,            
00070               TaggedObjectStorage &theMPsStorage,
00071               TaggedObjectStorage &theSPsStorage);
00072     
00073     virtual  ~Subdomain();    
00074 
00075     // method added for parallel domain generation
00076     virtual int buildSubdomain(int numSubdomains, 
00077                                PartitionedModelBuilder &theBuilder); 
00078 
00079     // Domain methods which must be rewritten
00080     virtual void clearAll(void);
00081     virtual bool addNode(Node *);       
00082     virtual Node *removeNode(int tag);        
00083     virtual NodeIter &getNodes(void);    
00084     virtual Node *getNode(int tag);            
00085     virtual Node **getNodePtrs(void);            
00086 
00087     virtual bool hasNode(int tag);
00088     virtual bool hasElement(int tag);
00089 
00090     virtual int getNumNodes(void) const;    
00091     virtual int commit(void);
00092     virtual int revertToLastCommit(void);    
00093     virtual int revertToStart(void);        
00094     virtual int update(void);
00095     virtual int update(double newTime, double dT);
00096 
00097 #ifdef _PARALLEL_PROCESSING
00098     virtual  int barrierCheckIN(void) {return 0;};
00099     virtual  int barrierCheckOUT(int) {return 0;};
00100 #endif
00101     
00102     virtual  void Print(OPS_Stream &s, int flag =0);
00103     
00104     // Domain type methods unique to a Subdomain
00105     virtual NodeIter &getInternalNodeIter(void);
00106     virtual NodeIter &getExternalNodeIter(void);
00107     virtual bool addExternalNode(Node *);
00108 
00109     virtual void wipeAnalysis(void);
00110     virtual void setDomainDecompAnalysis(DomainDecompositionAnalysis &theAnalysis);
00111     virtual int setAnalysisAlgorithm(EquiSolnAlgo &theAlgorithm);
00112     virtual int setAnalysisIntegrator(IncrementalIntegrator &theIntegrator);
00113     virtual int setAnalysisLinearSOE(LinearSOE &theSOE);
00114     virtual int setAnalysisConvergenceTest(ConvergenceTest &theTest);
00115     virtual int invokeChangeOnAnalysis(void);
00116     
00117     // Element methods which must be written
00118     virtual int getNumExternalNodes(void) const;    
00119     virtual const ID &getExternalNodes(void);
00120     virtual int getNumDOF(void);
00121 
00122     virtual int commitState(void);    
00123     
00124     virtual const Matrix &getTangentStiff(void);
00125     virtual const Matrix &getInitialStiff(void);    
00126     virtual const Matrix &getDamp(void);    
00127     virtual const Matrix &getMass(void);    
00128 
00129     virtual void  zeroLoad(void);
00130     virtual int addLoad(ElementalLoad *theLoad, double loadFactor);
00131     virtual int addInertiaLoadToUnbalance(const Vector &accel);
00132 
00133     virtual const Vector &getResistingForce(void);    
00134     virtual const Vector &getResistingForceIncInertia(void);        
00135     virtual bool isSubdomain(void);    
00136     virtual int setRayleighDampingFactors(double alphaM, double betaK, double betaK0, double betaKc);
00137 
00138     // Element type methods unique to a subdomain
00139     virtual int computeTang(void);
00140     virtual int computeResidual(void);
00141     virtual const Matrix &getTang(void);    
00142 
00143     void setFE_ElementPtr(FE_Element *theFE_Ele);
00144     virtual const Vector &getLastExternalSysResponse(void);
00145     virtual int computeNodalResponse(void);    
00146     virtual int newStep(double deltaT);
00147     virtual bool doesIndependentAnalysis(void);
00148 
00149     virtual int sendSelf(int commitTag, Channel &theChannel);
00150     virtual int recvSelf(int commitTag, Channel &theChannel, 
00151                          FEM_ObjectBroker &theBroker);
00152 
00153     virtual double getCost(void);
00154 
00155     
00156   protected:    
00157     virtual int buildMap(void);
00158     bool mapBuilt;
00159     ID *map;
00160     Vector *mappedVect;
00161     Matrix *mappedMatrix;
00162 
00163 
00164     FE_Element *getFE_ElementPtr(void);
00165     TaggedObjectStorage  *internalNodes;
00166     TaggedObjectStorage  *externalNodes;    
00167 
00168     DomainDecompositionAnalysis *getDDAnalysis(void);
00169 
00170   private:
00171     double realCost;
00172     double cpuCost;
00173     int pageCost;
00174     Timer theTimer;
00175     DomainDecompositionAnalysis *theAnalysis;
00176     ID *extNodes;
00177     FE_Element *theFEele;
00178     
00179     //    TaggedObjectStorage  *realExternalNodes;        
00180 
00181     SingleDomNodIter   *internalNodeIter;
00182     SingleDomNodIter   *externalNodeIter;    
00183     SubdomainNodIter   *theNodIter;
00184 
00185     PartitionedModelBuilder *thePartitionedModelBuilder;
00186     static Matrix badResult;
00187 };
00188 
00189 #endif
00190 
00191 

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