DomainPartitioner.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.3 $
00022 // $Date: 2006/01/10 00:31:52 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/partitioner/DomainPartitioner.h,v $
00024                                                                         
00025 // Written: fmk 
00026 // Created: Fri Sep 20 15:27:47: 1996
00027 // Revision: A
00028 //
00029 // Description: This file contains the class definition for DomainPartitioner.
00030 // A DomainPartitioner is an object used to partition a PartitionedDomain.
00031 //
00032 // What: "@(#) DomainPartitioner.h, revA"
00033 
00034 #ifndef DomainPartitioner_h
00035 #define DomainPartitioner_h
00036 
00037 #ifndef _bool_h
00038 #include <bool.h>
00039 #endif
00040 
00041 #include <ID.h>
00042 
00043 class GraphPartitioner;
00044 class LoadBalancer;
00045 class PartitionedDomain;
00046 class Vector;
00047 class Graph;
00048 class TaggedObjectStorage;
00049 
00050 class DomainPartitioner
00051 {
00052   public:
00053     
00054     DomainPartitioner(GraphPartitioner &theGraphPartitioner,
00055                       LoadBalancer &theLoadBalancer);
00056     
00057     DomainPartitioner(GraphPartitioner &theGraphPartitioner);
00058     virtual  ~DomainPartitioner();    
00059 
00060     virtual void setPartitionedDomain(PartitionedDomain &theDomain);
00061     virtual int partition(int numParts, bool useMainDomain = false, int mainPartition = 0);
00062 
00063     virtual int balance(Graph &theWeightedSubdomainGraph);
00064 
00065     // public member functions needed by the load balancer
00066     virtual int getNumPartitions(void) const;
00067     virtual Graph &getPartitionGraph(void);
00068     virtual Graph &getColoredGraph(void);
00069     
00070     virtual int  swapVertex(int from, 
00071                             int to, 
00072                             int vertexTag,
00073                             bool adjacentVertexNotInOther = true);
00074 
00075     virtual int  swapBoundary(int from, 
00076                               int to,
00077                               bool adjacentVertexNotInOther = true);
00078 
00079     virtual int  releaseVertex(int from, 
00080                                int vertexTag, 
00081                                Graph &theWeightedPartitionGraph, 
00082                                bool mustReleaseToLighter = true,
00083                                double factorGreater = 1.0,
00084                                bool adjacentVertexNotInOther = true);
00085 
00086     virtual int releaseBoundary(int from, 
00087                                Graph &theWeightedPartitionGraph, 
00088                                bool mustReleaseToLighter = true,
00089                                double factorGreater = 1.0,
00090                                bool adjacentVertexNotInOther = true);
00091                                  
00092   protected:    
00093     
00094   private:
00095     PartitionedDomain *myDomain; 
00096     GraphPartitioner  &thePartitioner;
00097     LoadBalancer      *theBalancer;    
00098 
00099     Graph *theElementGraph;
00100     Graph **theBoundaryElements; 
00101     
00102     TaggedObjectStorage *theNodeLocations;
00103     ID *elementPlace;
00104     int numPartitions;
00105     ID primes;
00106     bool partitionFlag;
00107     
00108     bool usingMainDomain;
00109     int mainPartition;
00110 };
00111 
00112 #endif
00113 
00114 

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