OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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
46namespace oofem {
51 #define PARMETISLB_END_DATA -1
52 #define SHARED_DOFMAN_PARTITIONS_TAG 9998
53
58{
59protected:
62 idx_t *elmdist;
65 real_t *tpwgts;
69 std :: vector< IntArray >dofManPartitions;
72
73public:
75 virtual ~ParmetisLoadBalancer();
76
77 void calculateLoadTransfer() override;
78
79 #if 1
80 DofManMode giveDofManState(int idofman) override;
81 IntArray *giveDofManPartitions(int idofman) override;
82 int giveElementPartition(int ielem) override;
83 #endif
84protected:
86
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 const char *giveClassName() const override { return "ParmetisLoadBalancer"; }
106};
107} // end namespace oofem
108
109#endif // parmetisloadbalancer_h
LoadBalancer(Domain *d)
int giveElementPartition(int ielem) override
Returns the new partition number assigned to local element after LB.
real_t * tpwgts
Partition weights (user input).
IntArray elementPart
Partition vector of the locally-stored elements.
IntArray gToLMap
Element numbering maps.
IntArray * giveDofManPartitions(int idofman) override
Returns the partition list of given dofmanager after load balancing.
IntArray dofManState
Array of DofManMode(s).
DofManMode giveDofManState(int idofman) override
Returns the label of dofmanager after load balancing.
std ::vector< IntArray > dofManPartitions
Array of dof man partitions.
const char * giveClassName() const override
Returns class name of the receiver.
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011