|
OOFEM
2.1
|
00001 /* 00002 * 00003 * ##### ##### ###### ###### ### ### 00004 * ## ## ## ## ## ## ## ### ## 00005 * ## ## ## ## #### #### ## # ## 00006 * ## ## ## ## ## ## ## ## 00007 * ## ## ## ## ## ## ## ## 00008 * ##### ##### ## ###### ## ## 00009 * 00010 * 00011 * OOFEM : Object Oriented Finite Element Code 00012 * 00013 * Copyright (C) 1993 - 2013 Borek Patzak 00014 * 00015 * 00016 * 00017 * Czech Technical University, Faculty of Civil Engineering, 00018 * Department of Structural Mechanics, 166 29 Prague, Czech Republic 00019 * 00020 * This program is free software; you can redistribute it and/or modify 00021 * it under the terms of the GNU General Public License as published by 00022 * the Free Software Foundation; either version 2 of the License, or 00023 * (at your option) any later version. 00024 * 00025 * This program is distributed in the hope that it will be useful, 00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00028 * GNU General Public License for more details. 00029 * 00030 * You should have received a copy of the GNU General Public License 00031 * along with this program; if not, write to the Free Software 00032 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00033 */ 00034 00035 #ifndef domain_h 00036 #define domain_h 00037 00038 #include "alist.h" 00039 #include "domaintype.h" 00040 #include "statecountertype.h" 00041 #include "intarray.h" 00042 00043 #include <map> 00044 #ifdef __PARALLEL_MODE 00045 #include <list> 00046 #include "entityrenumberingscheme.h" 00047 #endif 00048 00049 #ifdef __OOFEG 00050 #include "oofeggraphiccontext.h" 00051 #endif 00052 00053 namespace oofem { 00054 class Element; 00055 class Node; 00056 class Material; 00057 class GeneralBoundaryCondition; 00058 class InitialCondition; 00059 class Load; 00060 class LoadTimeFunction; 00061 class CrossSection; 00062 class ElementSide; 00063 class DofManager; 00064 class OutputManager; 00065 class EngngModel; 00066 class ConnectivityTable; 00067 class ErrorEstimator; 00068 class SpatialLocalizer; 00069 class NodalRecoveryModel; 00070 class NonlocalBarrier; 00071 class DomainTransactionManager; 00072 class RandomFieldGenerator; 00073 class XfemManager; 00074 class TopologyDescription; 00075 class DataReader; 00076 00077 #ifdef __PARALLEL_MODE 00078 class ProcessCommunicator; 00079 class LoadBalancer; 00080 #endif 00081 00095 class Domain 00096 { 00097 private: 00099 AList< Element > *elementList; 00101 AList< DofManager > *dofManagerList; 00103 AList< Material > *materialList; 00105 AList< CrossSection > *crossSectionList; 00107 AList< GeneralBoundaryCondition > *bcList; 00109 AList< InitialCondition > *icList; 00111 AList< LoadTimeFunction > *loadTimeFunctionList; 00113 AList< NonlocalBarrier > *nonlocalBarierList; 00115 AList< RandomFieldGenerator > *randomFieldGeneratorList; 00116 00118 IntArray defaultNodeDofIDArry; 00119 00127 domainType dType; 00128 00132 EngngModel *engineeringModel; 00133 00138 ConnectivityTable *connectivityTable; 00143 SpatialLocalizer *spatialLocalizer; 00145 OutputManager *outputManager; 00147 int number; 00149 int serialNumber; 00151 NodalRecoveryModel *smoother; 00162 StateCounterType nonlocalUpdateStateCounter; 00164 XfemManager *xfemManager; 00166 TopologyDescription *topology; 00167 00169 int freeDofID; 00170 00171 #ifdef __PARALLEL_MODE 00172 00176 DomainTransactionManager *transactionManager; 00178 std :: map< int, DofManager * >dmanMap; 00180 bool dmanMapInitialized; 00182 std :: map< int, Element * >elementMap; 00184 bool elementMapInitialized; 00185 00186 00189 00190 std :: list< Element * >recvElemList; 00192 #endif 00193 00194 public: 00202 Domain(int n, int serNum, EngngModel *e); 00204 ~Domain(); 00205 00207 int giveNumber() { return this->number; } 00209 void setNumber(int nn) { this->number = nn; } 00211 int giveSerialNumber() { return this->serialNumber; } 00212 00213 // management of the mesh components 00219 Element *giveElement(int n); 00223 EngngModel *giveEngngModel(); 00229 Load *giveLoad(int n); 00235 GeneralBoundaryCondition *giveBc(int n); 00241 InitialCondition *giveIc(int n); 00242 00248 LoadTimeFunction *giveLoadTimeFunction(int n); 00254 Material *giveMaterial(int n); 00260 CrossSection *giveCrossSection(int n); 00266 NonlocalBarrier *giveNonlocalBarrier(int n); 00272 RandomFieldGenerator *giveRandomFieldGenerator(int n); 00273 00280 Node *giveNode(int n); 00287 ElementSide *giveSide(int n); 00294 DofManager *giveDofManager(int n); 00307 int instanciateYourself(DataReader *dr); 00312 void postInitialize(); 00313 //int giveNumberOfNodes () {return nodeList->giveSize();} 00314 //int giveNumberOfSides () {return elementSideList->giveSize();} 00316 int giveNumberOfDofManagers() { return dofManagerList->giveSize(); } 00318 int giveNumberOfElements() { return elementList->giveSize(); } 00320 int giveNumberOfMaterialModels() { return materialList->giveSize(); } 00322 int giveNumberOfCrossSectionModels() { return crossSectionList->giveSize(); } 00324 int giveNumberOfBoundaryConditions() { return bcList->giveSize(); } 00326 int giveNumberOfInitialConditions() { return icList->giveSize(); } 00328 int giveNumberOfLoadTimeFunctions() { return loadTimeFunctionList->giveSize(); } 00330 int giveNumberOfRegions() { return this->giveNumberOfCrossSectionModels(); } 00332 int giveNumberOfNonlocalBarriers() { return nonlocalBarierList->giveSize(); } 00334 int giveNumberOfRandomFieldGenerators() { return randomFieldGeneratorList->giveSize(); } 00335 00336 int giveCorrespondingCoordinateIndex(int); 00338 int giveNumberOfSpatialDimensions(); 00343 00344 void resizeDofManagers(int _newSize); 00346 void resizeElements(int _newSize); 00348 void resizeCrossSectionModels(int _newSize); 00350 void resizeMaterials(int _newSize); 00352 void resizeNonlocalBarriers(int _newSize); 00354 void resizeBoundaryConditions(int _newSize); 00356 void resizeInitialConditions(int _newSize); 00358 void resizeLoadTimeFunctions(int _newSize); 00360 void resizeRandomFieldGenerators(int _newSize); 00361 00363 void setDofManager(int i, DofManager *obj); 00365 void setElement(int i, Element *obj); 00367 void setCrossSection(int i, CrossSection *obj); 00369 void setMaterial(int i, Material *obj); 00371 void setNonlocalBarrier(int i, NonlocalBarrier *obj); 00373 void setBoundaryCondition(int i, GeneralBoundaryCondition *obj); 00375 void setInitialCondition(int i, InitialCondition *obj); 00377 void setLoadTimeFunction(int i, LoadTimeFunction *obj); 00379 void setRandomFieldGenerator(int i, RandomFieldGenerator *obj); 00380 00382 void setXfemManager(XfemManager *xfemManager); 00388 void setTopology(TopologyDescription *topo, bool destroyOld = true); 00390 void clearBoundaryConditions(); 00392 void clear(); 00394 00410 contextIOResultType saveContext(DataStream *stream, ContextMode mode, void *obj = NULL); 00426 contextIOResultType restoreContext(DataStream *stream, ContextMode mode, void *obj = NULL); 00431 const IntArray &giveDefaultNodeDofIDArry(); 00433 domainType giveDomainType() { return dType; } 00435 void setDomainType(domainType _dType) { this->dType = _dType; } 00442 int checkConsistency(); 00443 00448 double giveArea(); 00453 double giveVolume(); 00454 00460 int giveNextFreeDofID(); 00464 void resetFreeDofID(); 00468 int giveMaxDofID() { return this->freeDofID - 1; } 00469 00473 ConnectivityTable *giveConnectivityTable(); 00477 SpatialLocalizer *giveSpatialLocalizer(); 00481 OutputManager *giveOutputManager() { return outputManager; } 00486 ErrorEstimator *giveErrorEstimator(); 00491 NodalRecoveryModel *giveSmoother(); 00495 TopologyDescription *giveTopology() { return topology; } 00501 void setSmoother(NodalRecoveryModel *smoother, bool destroyOld = true); 00502 00503 #ifdef __PARALLEL_MODE 00504 00514 DomainTransactionManager *giveTransactionManager(); 00524 int commitTransactions(DomainTransactionManager *tm); 00525 00529 void initGlobalDofManMap(bool forceinit = false); 00530 void initGlobalElementMap(bool forceinit = false); 00535 void renumberDofManagers(); 00536 void renumberDofManData(DomainTransactionManager *tm); 00537 void renumberElements(); 00538 void renumberElementData(DomainTransactionManager *tm); 00540 int LB_giveUpdatedLocalNumber(int oldnum, EntityRenumberingScheme scheme); 00542 int LB_giveUpdatedGlobalNumber(int oldnum, EntityRenumberingScheme scheme); 00544 00545 00548 int dofmanGlobal2Local(int _globnum); 00549 int elementGlobal2Local(int _globnum); 00551 #endif 00552 00553 #ifdef __OOFEG 00554 void drawYourself(oofegGraphicContext &context); 00555 void drawElements(oofegGraphicContext &context); 00556 void drawNodes(oofegGraphicContext &context); 00557 #endif 00558 00559 const char *giveClassName() const { return "Domain"; } 00560 00562 StateCounterType giveNonlocalUpdateStateCounter() { return this->nonlocalUpdateStateCounter; } 00564 void setNonlocalUpdateStateCounter(StateCounterType val) { this->nonlocalUpdateStateCounter = val; } 00565 00566 private: 00567 void resolveDomainDofsDefaults(const char *); 00568 00569 void error(const char *file, int line, const char *format, ...); 00570 void warning(const char *file, int line, const char *format, ...); 00571 }; 00572 } // end namespace oofem 00573 #endif // domain_h 00574