From 6e95af8efdf723ee1f527ae6290f7855b3ad215e Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Tue, 20 Aug 2024 14:54:20 +0200 Subject: [PATCH 1/5] [MeL] Shrink return vector size --- MeshLib/Elements/Utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/MeshLib/Elements/Utils.h b/MeshLib/Elements/Utils.h index e78c4190ced..5174dcff86b 100644 --- a/MeshLib/Elements/Utils.h +++ b/MeshLib/Elements/Utils.h @@ -36,6 +36,7 @@ inline std::vector getBaseNodes(std::vector const& elements) BaseLib::makeVectorUnique(base_nodes, MeshLib::idsComparator); + base_nodes.shrink_to_fit(); return base_nodes; } From 46a4492d95b72d470503e341358736f4c16565a4 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Tue, 27 Aug 2024 16:17:22 +0200 Subject: [PATCH 2/5] [MeL] Assert local index is valid in isBaseNode --- MeshLib/Mesh.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index 1cf62c20b42..e598fa31ef5 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -357,6 +357,7 @@ bool isBaseNode(Node const& node, auto const n_base_nodes = e->getNumberOfBaseNodes(); auto const local_index = getNodeIDinElement(*e, &node); + assert(local_index <= e->getNumberOfNodes()); return local_index < n_base_nodes; } From e69af34d1bba1a02e6c5fa7a3b0c1c96f2f273b1 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Thu, 10 Oct 2024 17:36:30 +0200 Subject: [PATCH 3/5] [NL/DOF] Use views::ids --- NumLib/DOF/MeshComponentMap.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/NumLib/DOF/MeshComponentMap.cpp b/NumLib/DOF/MeshComponentMap.cpp index 3897bdc61d0..9f0b9e33f4c 100644 --- a/NumLib/DOF/MeshComponentMap.cpp +++ b/NumLib/DOF/MeshComponentMap.cpp @@ -301,11 +301,9 @@ void MeshComponentMap::createSerialMeshComponentMap( for (auto const& c : components) { std::size_t const mesh_id = c.getMeshID(); - auto const& mesh_subset_nodes = c.getNodes(); // mesh items are ordered first by node, cell, .... - for (std::size_t j = 0; j < mesh_subset_nodes.size(); j++) + for (auto const node_id : c.getNodes() | MeshLib::views::ids) { - auto const node_id = mesh_subset_nodes[j]->getID(); _dict.insert( Line(Location(mesh_id, MeshLib::MeshItemType::Node, node_id), comp_id, global_index++)); From b823237c93aea3113a14f3d0ecdf936ca817bc5f Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Wed, 13 Nov 2024 21:46:16 +0100 Subject: [PATCH 4/5] [PL/RM] Fix comment --- .../RichardsMechanics/ConstitutiveRelations/ConstitutiveData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProcessLib/RichardsMechanics/ConstitutiveRelations/ConstitutiveData.h b/ProcessLib/RichardsMechanics/ConstitutiveRelations/ConstitutiveData.h index 2641de6abc8..833f8e91c8d 100644 --- a/ProcessLib/RichardsMechanics/ConstitutiveRelations/ConstitutiveData.h +++ b/ProcessLib/RichardsMechanics/ConstitutiveRelations/ConstitutiveData.h @@ -30,7 +30,7 @@ namespace ProcessLib::RichardsMechanics { -/// Data whose state must be tracked by the TRM process. +/// Data whose state must be tracked by the process. template using StatefulData = std::tuple< StrainData, From ae5e09029d9422d05b2e85740afcf37c84c6dc59 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Thu, 14 Nov 2024 13:49:16 +0100 Subject: [PATCH 5/5] [NL/TS] Fix delta_t computation for n steps --- NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp b/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp index 73d5203b017..d34ab9e5109 100644 --- a/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp +++ b/NumLib/TimeStepping/Algorithms/CreateFixedTimeStepping.cpp @@ -52,8 +52,8 @@ FixedTimeSteppingParameters parseFixedTimeStepping( *n_steps); } // Create the RepeatDtPair - std::size_t const t_step = static_cast( - (t_end - t_initial) / static_cast(*n_steps)); + double const t_step = + (t_end - t_initial) / static_cast(*n_steps); std::vector const repeat_pairs = { RepeatDtPair{static_cast(*n_steps), t_step}}; return {t_initial, t_end, repeat_pairs};