Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
InterfaceBalancer.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2014 Sandia Corporation. */
3 /* This software is released under the license detailed */
4 /* in the file, LICENSE, which is located in the top-level Nalu */
5 /* directory structure */
6 /*------------------------------------------------------------------------*/
7 
8 #ifndef INTERFACEBALANCER_H_
9 #define INTERFACEBALANCER_H_
10 
11 #include <set>
12 #include <map>
13 #include <vector>
14 
15 #include "stk_mesh/base/Types.hpp"
16 
17 namespace sierra {
18 namespace nalu {
19 
21 
22 public:
23  InterfaceBalancer(const stk::mesh::MetaData& meta,
24  stk::mesh::BulkData& bulk);
25 
26  void balance_node_entities(const double targetLoadBalance,
27  const int maxIterations);
28 
29 private:
30 
31  void getInterfaceDescription (std::set<int>& neighborProcessors,
32  std::map<stk::mesh::Entity, std::vector<int> >& interfaceNodesAndProcessors);
33 
34  void getGlobalLoadImbalance (double &loadFactor, int& numLocallyOwnedNodes);
35 
36  void exchangeLocalSizes (const std::set<int>& neighborProcessors,
37  int& numLocallyOwnedNodes, std::map<int, int>& numLocallyOwnedByRank);
38  void
39  changeOwnersOfNodes (const std::map<stk::mesh::Entity, std::vector<int> >& interfaceNodesAndProcessors,
40  std::map<int, int>& numLocallyOwnedByRank,
41  int numLocallyOwnedNodes);
42 
43  const stk::mesh::MetaData & metaData_;
44  stk::mesh::BulkData & bulkData_;
45  const double tolerance_;
46 
47 };
48 }
49 }
50 
51 #endif /* INTERFACEBALANCER_H_ */
Definition: ABLForcingAlgorithm.C:26
const double tolerance_
Definition: InterfaceBalancer.h:45
Definition: InterfaceBalancer.h:20
void changeOwnersOfNodes(const std::map< stk::mesh::Entity, std::vector< int > > &interfaceNodesAndProcessors, std::map< int, int > &numLocallyOwnedByRank, int numLocallyOwnedNodes)
Definition: InterfaceBalancer.C:164
InterfaceBalancer(const stk::mesh::MetaData &meta, stk::mesh::BulkData &bulk)
Definition: InterfaceBalancer.C:25
void balance_node_entities(const double targetLoadBalance, const int maxIterations)
Definition: InterfaceBalancer.C:30
void getInterfaceDescription(std::set< int > &neighborProcessors, std::map< stk::mesh::Entity, std::vector< int > > &interfaceNodesAndProcessors)
Definition: InterfaceBalancer.C:68
stk::mesh::BulkData & bulkData_
Definition: InterfaceBalancer.h:44
void exchangeLocalSizes(const std::set< int > &neighborProcessors, int &numLocallyOwnedNodes, std::map< int, int > &numLocallyOwnedByRank)
Definition: InterfaceBalancer.C:129
const stk::mesh::MetaData & metaData_
Definition: InterfaceBalancer.h:43
void getGlobalLoadImbalance(double &loadFactor, int &numLocallyOwnedNodes)
Definition: InterfaceBalancer.C:97