XC Open source finite element analysis program
DomainPartitioner.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.3 $
48 // $Date: 2006/01/10 00:31:52 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/partitioner/DomainPartitioner.h,v $
50 
51 // Written: fmk
52 // Created: Fri Sep 20 15:27:47: 1996
53 // Revision: A
54 //
55 // Description: This file contains the class definition for DomainPartitioner.
56 // A DomainPartitioner is an object used to partition a PartitionedDomain.
57 //
58 // What: "@(#) DomainPartitioner.h, revA"
59 
60 #ifndef DomainPartitioner_h
61 #define DomainPartitioner_h
62 
63 #include <utility/matrix/ID.h>
64 
65 namespace XC {
66 class GraphPartitioner;
67 class LoadBalancer;
68 class PartitionedDomain;
69 class Vector;
70 class Graph;
71 class TaggedObjectStorage;
72 
74  {
75  private:
76  PartitionedDomain *myDomain;
77  GraphPartitioner &thePartitioner;
78  LoadBalancer *theBalancer;
79 
80  Graph *theElementGraph;
81  std::vector<Graph> theBoundaryElements;
82 
83  TaggedObjectStorage *theNodeLocations;
84  ID *elementPlace;
85  int numPartitions;
86  ID primes;
87  bool partitionFlag;
88 
89  bool usingMainDomain;
90  int mainPartition;
91 
92  int inic(const size_t &);
93  public:
94  DomainPartitioner(GraphPartitioner &theGraphPartitioner,
95  LoadBalancer &theLoadBalancer);
96 
97  DomainPartitioner(GraphPartitioner &theGraphPartitioner);
98 
99  virtual void setPartitionedDomain(PartitionedDomain &theDomain);
100  virtual int partition(int numParts, bool useMainDomain = false, int mainPartition = 0);
101 
102  virtual int balance(Graph &theWeightedSubdomainGraph);
103 
104  // public member functions needed by the load balancer
105  virtual int getNumPartitions(void) const;
106  virtual Graph &getPartitionGraph(void);
107  virtual Graph &getColoredGraph(void);
108 
109  virtual int swapVertex(int from,
110  int to,
111  int vertexTag,
112  bool adjacentVertexNotInOther = true);
113 
114  virtual int swapBoundary(int from,
115  int to,
116  bool adjacentVertexNotInOther = true);
117 
118  virtual int releaseVertex(int from,
119  int vertexTag,
120  Graph &theWeightedPartitionGraph,
121  bool mustReleaseToLighter = true,
122  double factorGreater = 1.0,
123  bool adjacentVertexNotInOther = true);
124 
125  virtual int releaseBoundary(int from,
126  Graph &theWeightedPartitionGraph,
127  bool mustReleaseToLighter = true,
128  double factorGreater = 1.0,
129  bool adjacentVertexNotInOther = true);
130  };
131 } // end of XC namespace
132 
133 #endif
134 
135 
GraphPartitioner is an abstract base class. Its subtypes are responsible for partioning the vertices ...
Definition: GraphPartitioner.h:80
Partitioned domain.
Definition: PartitionedDomain.h:82
Definition: ID.h:77
TaggedObjectStorage. A TaggedObjectStorage object a container object used to hold objects of type Tag...
Definition: TaggedObjectStorage.h:76
The Graph class provides the abstraction of a graph, a collection of vertices and edges...
Definition: Graph.h:84
Definition: DomainPartitioner.h:73
Definition: LoadBalancer.h:71
================================================================================
Definition: ContinuaReprComponent.h:34