PartitionedDomain.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: 2006/01/10 00:33:09 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/domain/partitioned/PartitionedDomain.h,v $
00024                                                                         
00025                                                                         
00026 // Written: fmk 
00027 // Created: Wed Sep 25 15:27:47: 1996
00028 // Revision: A
00029 //
00030 // Description: This file contains the class definition for PartitionedDomain.
00031 // PartitionedDomain is an abstract class. The class is responsible for holding
00032 // and providing access to the Elements, Nodes, SP_Constraints 
00033 // and MP_Constraints just like a normal domain. In addition the domain provides
00034 // a method to partition the domain into Subdomains.
00035 //
00036 // ModelBuilder. There are no partitions in a PartitionedDomain.
00037 //
00038 // What: "@(#) PartitionedDomain.h, revA"
00039 
00040 #ifndef PartitionedDomain_h
00041 #define PartitionedDomain_h
00042 
00043 #include <Domain.h>
00044 
00045 class DomainPartitioner;
00046 class Subdomain;
00047 class SubdomainIter; 
00048 class  ArrayOfTaggedObjects;
00049 class  PartitionedDomainSubIter;
00050 class  PartitionedDomainEleIter;
00051 class SingleDomEleIter;
00052 
00053 class PartitionedDomain: public Domain
00054 {
00055   public:
00056     PartitionedDomain();    
00057     PartitionedDomain(DomainPartitioner &thePartitioner);    
00058 
00059     PartitionedDomain(int numNodes, int numElements, 
00060                       int numSPs, int numMPs, int numLoadPatterns,
00061                       int numSubdomains,
00062                       DomainPartitioner &thePartitioner);
00063     
00064     virtual  ~PartitionedDomain();    
00065 
00066     // public methods to populate a domain      
00067     virtual  bool addElement(Element *elePtr);
00068     virtual  bool addNode(Node *nodePtr);
00069 
00070     virtual  bool addLoadPattern(LoadPattern *);            
00071     virtual  bool addSP_Constraint(SP_Constraint *); 
00072     virtual  bool addSP_Constraint(SP_Constraint *, int loadPatternTag); 
00073     virtual  bool addNodalLoad(NodalLoad *, int loadPatternTag);
00074     virtual  bool addElementalLoad(ElementalLoad *, int loadPatternTag);
00075 
00076     // methods to remove the components     
00077     virtual void clearAll(void);
00078     virtual Element *removeElement(int tag);
00079     virtual Node *removeNode(int tag);        
00080     virtual SP_Constraint *removeSP_Constraint(int tag);
00081     virtual MP_Constraint *removeMP_Constraint(int tag);
00082     virtual LoadPattern   *removeLoadPattern(int loadTag);
00083     
00084     // methods to access the elements
00085     virtual  ElementIter       &getElements();
00086     virtual  Element           *getElement(int tag);
00087     
00088     virtual  int                getNumElements(void) const;
00089 
00090     // public methods to update the domain
00091     virtual  void setCommitTag(int newTag);     
00092     virtual  void setCurrentTime(double newTime);    
00093     virtual  void setCommittedTime(double newTime);        
00094     virtual  void applyLoad(double pseudoTime);
00095     virtual  void setLoadConstant(void);    
00096 
00097     virtual  int commit(void);    
00098     virtual  int revertToLastCommit(void);        
00099     virtual  int revertToStart(void);    
00100     virtual  int update(void);        
00101     virtual  int update(double newTime, double dT);
00102     virtual  int newStep(double dT);
00103 
00104     virtual int  addRecorder(Recorder &theRecorder);            
00105     virtual int  removeRecorders(void);
00106     
00107     virtual  void Print(OPS_Stream &s, int flag =0);    
00108 
00109     // public member functions in addition to the standard domain
00110     virtual int setPartitioner(DomainPartitioner *thePartitioner);
00111     virtual int partition(int numPartitions, bool usingMain = false, int mainPartitionID = 0);
00112                         
00113     virtual bool addSubdomain(Subdomain *theSubdomain);
00114     virtual int getNumSubdomains(void);
00115     virtual Subdomain *getSubdomainPtr(int tag);
00116     virtual SubdomainIter &getSubdomains(void);
00117     virtual Node *removeExternalNode(int tag);        
00118     virtual Graph &getSubdomainGraph(void);
00119 
00120     // nodal methods required in domain interface for parallel interprter
00121     virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag);
00122     virtual int setMass(const Matrix &mass, int nodeTag);
00123     
00124     // friend classes
00125     friend class PartitionedDomainEleIter;
00126     
00127   protected:    
00128     int barrierCheck(int result);        
00129     DomainPartitioner *getPartitioner(void) const;
00130     virtual int buildEleGraph(Graph *theEleGraph);
00131     
00132   private:
00133     TaggedObjectStorage  *elements;    
00134     ArrayOfTaggedObjects *theSubdomains;
00135     DomainPartitioner    *theDomainPartitioner;
00136 
00137     SingleDomEleIter           *mainEleIter;  // for ele that belong to elements
00138     PartitionedDomainSubIter   *theSubdomainIter;
00139     PartitionedDomainEleIter   *theEleIter;
00140     
00141     Graph *mySubdomainGraph;    // a graph of subdomain connectivity
00142 };
00143 
00144 #endif
00145 
00146 

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