OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
parmetisloadbalancer.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef parmetisloadbalancer_h
36 #define parmetisloadbalancer_h
37 
38 #include "loadbalancer.h"
39 #include "intarray.h"
40 
41 #include <parmetis.h>
42 #include <vector>
43 
44 #define _IFT_ParmetisLoadBalancer_Name "parmetis"
45 
46 namespace oofem {
51  #define PARMETISLB_END_DATA -1
52  #define SHARED_DOFMAN_PARTITIONS_TAG 9998
53 
57 class OOFEM_EXPORT ParmetisLoadBalancer : public LoadBalancer
58 {
59 protected:
61  IntArray gToLMap, lToGMap;
62  idx_t *elmdist;
65  real_t *tpwgts;
69  std :: vector< IntArray >dofManPartitions;
72 
73 public:
75  virtual ~ParmetisLoadBalancer();
76 
77  virtual void calculateLoadTransfer();
78 
79  #if 1
80  virtual DofManMode giveDofManState(int idofman);
81  virtual IntArray *giveDofManPartitions(int idofman);
82  virtual int giveElementPartition(int ielem);
83  #endif
84 protected:
85  void handleMasterSlaveDofManLinks();
86 
87  void initGlobalParmetisElementNumbering();
88  int giveLocalElementNumber(int globnum) { return gToLMap.at(globnum - myGlobNumOffset); }
89  int giveGlobalElementNumber(int locnum) { return lToGMap.at(locnum); }
90 
98  void labelDofManagers();
99  int determineDofManState(int idofman, int myrank, int npart, IntArray *dofManPartitions);
100 
101  int packSharedDmanPartitions(ProcessCommunicator &pc);
102  int unpackSharedDmanPartitions(ProcessCommunicator &pc);
103  void addSharedDofmanPartitions(int _locnum, IntArray _partitions);
104 
105  virtual const char *giveClassName() const { return "ParmetisLoadBalancer"; }
106 };
107 } // end namespace oofem
108 
109 #endif // parmetisloadbalancer_h
DofManMode
Describes the state of dofmanager after load balancing on the local partition.
Definition: loadbalancer.h:115
Class and object Domain.
Definition: domain.h:115
real_t * tpwgts
Partition weights (user input).
std::vector< IntArray > dofManPartitions
Array of dof man partitions.
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
int giveLocalElementNumber(int globnum)
IntArray elementPart
Partition vector of the locally-stored elements.
IntArray dofManState
Array of DofManMode(s).
Class representing process communicator for engineering model.
Definition: processcomm.h:176
ParMetis load balancer.
Abstract base class representing general load balancer.
Definition: loadbalancer.h:108
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual const char * giveClassName() const
Returns class name of the receiver.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011