PartitionedModelBuilder.cpp

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.2 $
00022 // $Date: 2003/02/14 23:01:47 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/modelbuilder/PartitionedModelBuilder.cpp,v $
00024                                                                         
00025                                                                         
00026 // File: ~/model/PartitionedModelBuilder.C
00027 //
00028 // Written: fmk 
00029 // Created: 03/98
00030 // Revision: A
00031 //
00032 
00033 #include <PartitionedModelBuilder.h>
00034 #include <PartitionedDomain.h>
00035 #include <Subdomain.h>
00036 #include <SubdomainIter.h>
00037 
00038 //  PartitionedModelBuilderModel(Domain &theDomain, int theClassTag);
00039 //      constructor
00040 PartitionedModelBuilder::PartitionedModelBuilder(PartitionedDomain &aPartitionedDomain,
00041                                                  int theClassTag)
00042 :ModelBuilder(aPartitionedDomain), MovableObject(theClassTag),
00043 thePartitionedDomain(&aPartitionedDomain)
00044 {
00045 
00046 }
00047 
00048 PartitionedModelBuilder::PartitionedModelBuilder(Subdomain &aSubdomain,
00049                                                  int theClassTag)
00050 :ModelBuilder(aSubdomain), MovableObject(theClassTag),
00051 thePartitionedDomain(0)
00052 {
00053 
00054 }
00055 
00056 PartitionedModelBuilder::~PartitionedModelBuilder()
00057 {
00058     
00059 }
00060 
00061 int
00062 PartitionedModelBuilder::buildFE_Model(void)
00063 {
00064   int result;
00065 
00066   if (thePartitionedDomain == 0) {
00067     opserr << "PartitionedModelBuilder::buildFE_Model(void) -";
00068     opserr << "No PartitionedDomain associated with this object\n";
00069     return -1;
00070   }
00071 
00072   // we build the interface, i.e. nodes on boundaries and any constraints and loads
00073   int numSubdomains = thePartitionedDomain->getNumSubdomains();
00074   result = this->buildInterface(numSubdomains);
00075   if (result != 0) {
00076     opserr << "PartitionedModelBuilder::buildFE_Model(void) -";
00077     opserr << "buildInterface failed\n";
00078     return result;
00079   }
00080 
00081   // now build the subdomains, stopping if an error in building any subdomain
00082   SubdomainIter &theSubs = thePartitionedDomain->getSubdomains();
00083   Subdomain *theSubdomain;
00084   while ((theSubdomain = theSubs()) != 0) {
00085     result = theSubdomain->buildSubdomain(numSubdomains, *this);
00086     if (result != 0) {
00087         opserr << "PartitionedModelBuilder::buildFE_Model(void) -";
00088         opserr << "buildSubdomain failed for Subdomain " << theSubdomain->getTag();
00089         opserr << endln;
00090         return result;
00091     }
00092 
00093   }
00094 
00095   // if got here a PartitiondDomain has been populated
00096   return 0;
00097 }
00098 
00099 PartitionedDomain *
00100 PartitionedModelBuilder::getPartitionedDomainPtr(void) const 
00101 {
00102     return thePartitionedDomain;
00103 }
00104     
00105 

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