Skip to content

Commit 23ef12d

Browse files
committed
PABLO: rename some variables
1 parent 1208925 commit 23ef12d

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/PABLO/LocalTree.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,12 +1920,12 @@ namespace bitpit {
19201920

19211921
/*! 2:1 balancing on level a local tree (refinement wins!)
19221922
* \param[in] doNew Set to true the balance is enforced also on new octants.
1923-
* \param[in] doInterior Set to false if the interior octants are already balanced.
1924-
* \param[in] doGhost Set to true if the ghost octants will be processed.
1923+
* \param[in] checkInterior Set to true if interior octants should be checked.
1924+
* \param[in] checkGhost Set to true if ghost octants should be checked.
19251925
* \return True if balanced done with some markers modification.
19261926
*/
19271927
bool
1928-
LocalTree::localBalance(bool doNew, bool doInterior, bool doGhost){
1928+
LocalTree::localBalance(bool doNew, bool checkInterior, bool checkGhost){
19291929

19301930
bool balanceEdges = ((m_balanceCodim>1) && (m_dim==3));
19311931
bool balanceNodes = (m_balanceCodim==m_dim);
@@ -1934,7 +1934,7 @@ namespace bitpit {
19341934
std::vector<bool> processGhostFlags;
19351935

19361936
// Identify internal octants that will be processed
1937-
if(doInterior){
1937+
if(checkInterior){
19381938
for (Octant &octant : m_octants){
19391939
// Skip octants that doesn't need balancing
19401940
bool balanceOctant = octant.getBalance();
@@ -1964,7 +1964,7 @@ namespace bitpit {
19641964
// because it's faster to process all the ghost octants that may affect balacning
19651965
// of internal octants, rather than find the ones that actually affect balacing of
19661966
// internal octants.
1967-
if (doGhost) {
1967+
if (checkGhost) {
19681968
for (Octant &octant : m_ghosts){
19691969
// Only ghosts of the first layer can affect load balance
19701970
if (octant.getGhostLayer() > 0) {
@@ -2854,7 +2854,7 @@ namespace bitpit {
28542854
*/
28552855
void
28562856
LocalTree::computeConnectivity(){
2857-
vector<uint64_t> mortonList;
2857+
vector<uint64_t> nodeKeys;
28582858
unordered_map<uint64_t, array<uint32_t, 3> > nodeCoords;
28592859
unordered_map<uint64_t, vector<uint64_t> > nodeOctants;
28602860
uint32_t noctants = getNumOctants();
@@ -2863,7 +2863,7 @@ namespace bitpit {
28632863

28642864

28652865
// Gather node information
2866-
mortonList.reserve(noctants);
2866+
nodeKeys.reserve(noctants);
28672867
nodeCoords.reserve(noctants);
28682868
nodeOctants.reserve(noctants);
28692869

@@ -2881,31 +2881,31 @@ namespace bitpit {
28812881
u32array3 node;
28822882
octant->getLogicalNode(node, i);
28832883

2884-
uint64_t morton = octant->computeNodePersistentKey(node);
2885-
if (nodeCoords.count(morton) == 0) {
2886-
mortonList.push_back(morton);
2887-
nodeCoords.insert({{morton, std::move(node)}});
2888-
nodeOctants[morton].reserve(m_treeConstants->nNodes);
2884+
uint64_t nodeKey = octant->computeNodePersistentKey(node);
2885+
if (nodeCoords.count(nodeKey) == 0) {
2886+
nodeKeys.push_back(nodeKey);
2887+
nodeCoords.insert({{nodeKey, std::move(node)}});
2888+
nodeOctants[nodeKey].reserve(m_treeConstants->nNodes);
28892889
}
28902890

2891-
nodeOctants[morton].push_back(n);
2891+
nodeOctants[nodeKey].push_back(n);
28922892
}
28932893
}
2894-
std::sort(mortonList.begin(), mortonList.end());
2894+
std::sort(nodeKeys.begin(), nodeKeys.end());
28952895

28962896
// Build node list and connectivity
28972897
m_nodes.clear();
28982898
m_connectivity.clear();
28992899
m_ghostsConnectivity.clear();
29002900

2901-
m_nodes.reserve(mortonList.size());
2901+
m_nodes.reserve(nodeKeys.size());
29022902
m_connectivity.resize(noctants);
29032903
m_ghostsConnectivity.resize(nghosts);
29042904

29052905
uint32_t nodeId = 0;
2906-
for (uint64_t morton : mortonList) {
2907-
m_nodes.emplace_back(std::move(nodeCoords.at(morton)));
2908-
for (uint64_t n : nodeOctants.at(morton)) {
2906+
for (uint64_t nodeKey : nodeKeys) {
2907+
m_nodes.emplace_back(std::move(nodeCoords.at(nodeKey)));
2908+
for (uint64_t n : nodeOctants.at(nodeKey)) {
29092909
std::vector<uint32_t> *octantConnect;
29102910
if (n < noctants) {
29112911
uint32_t octantId = n;

src/PABLO/LocalTree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class LocalTree{
227227

228228
void computeNeighSearchBegin(uint64_t sameSizeVirtualNeighMorton, const octvector &octants, uint32_t *searchBeginIdx, uint64_t *searchBeginMorton) const;
229229

230-
bool localBalance(bool doNew, bool doInterior, bool doGhost);
230+
bool localBalance(bool doNew, bool checkInterior, bool checkGhost);
231231

232232
bool fixBrokenFamiliesMarkers(std::vector<Octant *> *updatedOctants = nullptr, std::vector<bool> *updatedGhostFlags = nullptr);
233233

0 commit comments

Comments
 (0)