From a009f6b5962d53c383368aafacb3cd3334550de1 Mon Sep 17 00:00:00 2001 From: Andrea Iob Date: Sat, 7 Jan 2023 21:17:09 +0100 Subject: [PATCH] voloctree: rename some variables --- src/voloctree/voloctree_mapper.cpp | 50 ++++++++++++++-------------- src/voloctree/voloctree_mapper.hpp | 10 +++--- src/voloctree/voloctree_parallel.cpp | 14 ++++---- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/voloctree/voloctree_mapper.cpp b/src/voloctree/voloctree_mapper.cpp index 117fdd9347..2912f19085 100644 --- a/src/voloctree/voloctree_mapper.cpp +++ b/src/voloctree/voloctree_mapper.cpp @@ -98,12 +98,12 @@ void VolOctreeMapper::clearPartitionMappingLists() * The adaptation of only one mesh at time is allowed. Calling this method * is mandatory to perform an update of the mapper after an adaptation. * - * \param[in] adaptionInfo are the adaptation info that describe the changes + * \param[in] adaptionData are the adaptation info that describe the changes * of the patch * \param[in] reference if set to true the reference mesh will be adapted, * is set to false the mapped one will be adapted */ -void VolOctreeMapper::adaptionPrepare(const std::vector &adaptionInfo, bool reference) +void VolOctreeMapper::adaptionPrepare(const std::vector &adaptionData, bool reference) { m_previousMapping.clear(); PiercedStorage *pmapper; @@ -118,7 +118,7 @@ void VolOctreeMapper::adaptionPrepare(const std::vector &adaptio #if BITPIT_ENABLE_MPI m_partitionIR.map_rank_previousMapping.clear(); #endif - for (const adaption::Info &info : adaptionInfo) { + for (const adaption::Info &info : adaptionData) { if (info.type == adaption::Type::TYPE_PARTITION_SEND || info.type == adaption::Type::TYPE_PARTITION_RECV || info.type == adaption::Type::TYPE_PARTITION_NOTICE) { @@ -139,7 +139,7 @@ void VolOctreeMapper::adaptionPrepare(const std::vector &adaptio * The adaptationPrepare method of the mapper has to called before the * adaptation of the mesh. * - * \param[in] adaptionInfo are the adaptation info that describe the changes of + * \param[in] adaptionData are the adaptation info that describe the changes of * the patch * \param[in] reference if set to true the reference mesh will be adapted, * is set to false the mapped one will be adapted @@ -148,12 +148,12 @@ void VolOctreeMapper::adaptionPrepare(const std::vector &adaptio * the inverse mapper has to be necessarily filled during the first computation * in initialization) */ -void VolOctreeMapper::adaptionAlter(const std::vector &adaptionInfo, bool reference, bool inverseFilled) +void VolOctreeMapper::adaptionAlter(const std::vector &adaptionData, bool reference, bool inverseFilled) { if (reference) { - _mappingAdaptionReferenceUpdate(adaptionInfo, inverseFilled); + _mappingAdaptionReferenceUpdate(adaptionData, inverseFilled); } else { - _mappingAdaptionMappedUpdate(adaptionInfo); + _mappingAdaptionMappedUpdate(adaptionData); } } @@ -168,14 +168,14 @@ void VolOctreeMapper::adaptionCleanup() /** * Update the mapper after an adaption of the reference mesh. * - * \param[in] adaptionInfo are the adaptation info that describe the changes of + * \param[in] adaptionData are the adaptation info that describe the changes of * the patch * \param[in] inverseFilled if set to true the inverse mapped was filled * during the mesh mapper computing. If the adapted mesh is the mapped one, * the inverse mapper has to be necessarily filled during the first computation * in initialization) */ -void VolOctreeMapper::_mappingAdaptionReferenceUpdate(const std::vector &adaptionInfo, bool inverseFilled) +void VolOctreeMapper::_mappingAdaptionReferenceUpdate(const std::vector &adaptionData, bool inverseFilled) { const VolOctree *adaptedPatch = static_cast(m_referencePatch); const VolOctree *mappedPatch = static_cast(m_mappedPatch); @@ -193,7 +193,7 @@ void VolOctreeMapper::_mappingAdaptionReferenceUpdate(const std::vector &adaptionInfo) +void VolOctreeMapper::_mappingAdaptionMappedUpdate(const std::vector &adaptionData) { const VolOctree *adaptedPatch = static_cast(m_mappedPatch); const VolOctree *referencePatch = static_cast(m_referencePatch); @@ -481,18 +481,18 @@ void VolOctreeMapper::_mappingAdaptionMappedUpdate(const std::vector adaptionInfoRef; + std::vector adaptionDataRef; #if BITPIT_ENABLE_MPI if (!checkPart) { - _communicateMappedAdaptionInfo(adaptionInfo, &adaptionInfoRef); + _communicateMappedAdaptionInfo(adaptionData, &adaptionDataRef); } else { - adaptionInfoRef = adaptionInfo; + adaptionDataRef = adaptionData; } #else - adaptionInfoRef = adaptionInfo; + adaptionDataRef = adaptionData; #endif - for (const adaption::Info &info : adaptionInfoRef) { + for (const adaption::Info &info : adaptionDataRef) { if (info.type == adaption::Type::TYPE_PARTITION_SEND || info.type == adaption::Type::TYPE_PARTITION_RECV || info.type == adaption::Type::TYPE_PARTITION_NOTICE) { @@ -1596,12 +1596,12 @@ void VolOctreeMapper::_communicateInverseMapperBack() * Communicate adaption info of overlapped partitions of the mapped mesh to * the processes of reference partitions. * - * \param[in] adaptionInfoMap are the adaptation info that describe the changes + * \param[in] adaptionDataMap are the adaptation info that describe the changes * of the local mapped partitions - * \param[out] adaptionInfoRef are the adaptation info that describe the + * \param[out] adaptionDataRef are the adaptation info that describe the * changes of the local reference partitions */ -void VolOctreeMapper::_communicateMappedAdaptionInfo(const std::vector &adaptionInfoMap, std::vector *adaptionInfoRef) +void VolOctreeMapper::_communicateMappedAdaptionInfo(const std::vector &adaptionDataMap, std::vector *adaptionDataRef) { // Recover mapping elements to send (to partitions of mapped mesh) std::set toRanks; @@ -1609,7 +1609,7 @@ void VolOctreeMapper::_communicateMappedAdaptionInfo(const std::vector> toRankId; std::size_t n = 0; - for (auto &info : adaptionInfoMap) { + for (auto &info : adaptionDataMap) { for (long id : info.previous) { auto itPreviousMapping = m_previousMapping.find(id); if (itPreviousMapping == m_previousMapping.end()){ @@ -1639,7 +1639,7 @@ void VolOctreeMapper::_communicateMappedAdaptionInfo(const std::vector> entity; - adaptionInfoRef->emplace_back(); - adaption::Info &info = adaptionInfoRef->back(); + adaptionDataRef->emplace_back(); + adaption::Info &info = adaptionDataRef->back(); info.type = adaption::Type(type); info.entity = adaption::Entity(entity); int ncurrent; diff --git a/src/voloctree/voloctree_mapper.hpp b/src/voloctree/voloctree_mapper.hpp index d4aa693f36..6356242bac 100644 --- a/src/voloctree/voloctree_mapper.hpp +++ b/src/voloctree/voloctree_mapper.hpp @@ -47,8 +47,8 @@ class VolOctreeMapper: public VolumeMapper { VolOctreeMapper(const VolOctree *referencePatch, const VolOctree *mappedPatch); #endif - void adaptionPrepare(const std::vector &adaptionInfo, bool reference = true) override; - void adaptionAlter(const std::vector &adaptionInfo, bool reference = true, bool inverseFilled = false) override; + void adaptionPrepare(const std::vector &adaptionData, bool reference = true) override; + void adaptionAlter(const std::vector &adaptionData, bool reference = true, bool inverseFilled = false) override; void adaptionCleanup() override; #if BITPIT_ENABLE_MPI @@ -161,8 +161,8 @@ class VolOctreeMapper: public VolumeMapper { void _mapMeshesSamePartition(const std::vector * octantsReference, const std::vector * octantsMapped, bool fillInverse, long *indRef); - void _mappingAdaptionReferenceUpdate(const std::vector &adaptionInfo, bool fillInverse = false); - void _mappingAdaptionMappedUpdate(const std::vector &adaptionInfo); + void _mappingAdaptionReferenceUpdate(const std::vector &adaptionData, bool fillInverse = false); + void _mappingAdaptionMappedUpdate(const std::vector &adaptionData); #if BITPIT_ENABLE_MPI void clearPartitionMappingLists(); @@ -177,7 +177,7 @@ class VolOctreeMapper: public VolumeMapper { void _communicateInverseMapperBack(); - void _communicateMappedAdaptionInfo(const std::vector &adaptionInfoMap, std::vector *adaptionInfoRef); + void _communicateMappedAdaptionInfo(const std::vector &adaptionDataMap, std::vector *adaptionDataRef); #endif }; diff --git a/src/voloctree/voloctree_parallel.cpp b/src/voloctree/voloctree_parallel.cpp index 96ffc1b72a..6c7b7a14ed 100644 --- a/src/voloctree/voloctree_parallel.cpp +++ b/src/voloctree/voloctree_parallel.cpp @@ -147,19 +147,19 @@ std::vector VolOctree::_partitioningPrepare(const std::unordered } partitioningData.emplace_back(); - adaption::Info &partitioningInfo = partitioningData.back(); - partitioningInfo.entity = adaption::ENTITY_CELL; - partitioningInfo.type = adaptionType; - partitioningInfo.rank = receiver; + adaption::Info &partitioningCellInfo = partitioningData.back(); + partitioningCellInfo.entity = adaption::ENTITY_CELL; + partitioningCellInfo.type = adaptionType; + partitioningCellInfo.rank = receiver; const std::array &sendRange = entry.second; uint32_t beginTreeId = sendRange[0]; uint32_t endTreeId = sendRange[1]; - partitioningInfo.previous.reserve(endTreeId - beginTreeId); + partitioningCellInfo.previous.reserve(endTreeId - beginTreeId); for (uint32_t treeId = beginTreeId; treeId < endTreeId; ++treeId) { OctantInfo octantInfo(treeId, true); - partitioningInfo.previous.emplace_back(); - long &cellId = partitioningInfo.previous.back(); + partitioningCellInfo.previous.emplace_back(); + long &cellId = partitioningCellInfo.previous.back(); cellId = getOctantId(octantInfo); } }