Skip to content

Commit

Permalink
Merge pull request #12688 from KratosMultiphysics/meshing/minor-clean…
Browse files Browse the repository at this point in the history
…-up-mmg-utilities

[MeshingApplication] Minor clean up in `MMGUtilities`
  • Loading branch information
loumalouomega authored Sep 19, 2024
2 parents d19d5f1 + 810b877 commit e678d21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// | | | | |___ ___) | _ || || |\ | |_| |
// |_| |_|_____|____/|_| |_|___|_| \_|\____| APPLICATION
//
// License: BSD License
// license: MeshingApplication/license.txt
// License: BSD License
// license: MeshingApplication/license.txt
//
// Main authors: Vicente Mataix Ferrandiz
//
Expand Down Expand Up @@ -3563,20 +3563,23 @@ void MmgUtilities<TMMGLibrary>::ReorderAllIds(ModelPart& rModelPart)
// Iterate over nodes
auto& r_nodes_array = rModelPart.Nodes();
const auto it_node_begin = r_nodes_array.begin();
for(IndexType i = 0; i < r_nodes_array.size(); ++i)
IndexPartition<std::size_t>(r_nodes_array.size()).for_each([&](std::size_t i) {
(it_node_begin + i)->SetId(i + 1);
});

// Iterate over conditions
auto& r_conditions_array = rModelPart.Conditions();
const auto it_cond_begin = r_conditions_array.begin();
for(IndexType i = 0; i < r_conditions_array.size(); ++i)
IndexPartition<std::size_t>(r_conditions_array.size()).for_each([&](std::size_t i) {
(it_cond_begin + i)->SetId(i + 1);
});

// Iterate over elements
auto& r_elements_array = rModelPart.Elements();
const auto it_elem_begin = r_elements_array.begin();
for(IndexType i = 0; i < r_elements_array.size(); ++i)
IndexPartition<std::size_t>(r_elements_array.size()).for_each([&](std::size_t i) {
(it_elem_begin + i)->SetId(i + 1);
});

r_nodes_array.Unique();
r_conditions_array.Unique();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
// | | | | |___ ___) | _ || || |\ | |_| |
// |_| |_|_____|____/|_| |_|___|_| \_|\____| APPLICATION
//
// License: BSD License
// license: MeshingApplication/license.txt
// License: BSD License
// license: MeshingApplication/license.txt
//
// Main authors: Vicente Mataix Ferrandiz
//

#if !defined(KRATOS_MMG_UTILITIES)
#define KRATOS_MMG_UTILITIES
#pragma once

// System includes

Expand Down Expand Up @@ -908,4 +907,3 @@ inline std::ostream& operator << (std::ostream& rOStream,
}

}// namespace Kratos.
#endif /* KRATOS_MMG_UTILITIES defined */

0 comments on commit e678d21

Please sign in to comment.