00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef Subdomain_h
00027 #define Subdomain_h
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
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
00076 virtual int buildSubdomain(int numSubdomains,
00077 PartitionedModelBuilder &theBuilder);
00078
00079
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
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
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
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
00180
00181 SingleDomNodIter *internalNodeIter;
00182 SingleDomNodIter *externalNodeIter;
00183 SubdomainNodIter *theNodIter;
00184
00185 PartitionedModelBuilder *thePartitionedModelBuilder;
00186 static Matrix badResult;
00187 };
00188
00189 #endif
00190
00191