From 1a2b13aef792a2a00c7f064aa9e770f6ecfd8b32 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Tue, 13 Apr 2021 09:10:53 +0200 Subject: [PATCH] [NL/DOF] Test the component order before doing anything else. This avoids also multiple testing using same input data. --- NumLib/DOF/MeshComponentMap.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NumLib/DOF/MeshComponentMap.cpp b/NumLib/DOF/MeshComponentMap.cpp index dbbe2889ac1..d0af0279334 100644 --- a/NumLib/DOF/MeshComponentMap.cpp +++ b/NumLib/DOF/MeshComponentMap.cpp @@ -325,6 +325,16 @@ void MeshComponentMap::createSerialMeshComponentMap( void MeshComponentMap::createParallelMeshComponentMap( std::vector<MeshLib::MeshSubset> const& components, ComponentOrder order) { + if (order != ComponentOrder::BY_LOCATION) + { + // Not allowed in parallel case since this is not suitable to + // arrange non ghost entries of a partition within + // a rank in the parallel computing. + OGS_FATAL( + "Global index in the system of equations can only be numbered by " + "the order type of ComponentOrder::BY_LOCATION"); + } + // Use PETSc with multi-thread // get number of unknowns GlobalIndexType num_unknowns = 0; @@ -352,16 +362,6 @@ void MeshComponentMap::createParallelMeshComponentMap( for (std::size_t j = 0; j < c.getNumberOfNodes(); j++) { GlobalIndexType global_id = 0; - if (order != ComponentOrder::BY_LOCATION) - { - // Deactivated since this case is not suitable to - // arrange non ghost entries of a partition within - // a rank in the parallel computing. - OGS_FATAL( - "Global index in the system of equations" - " can only be numbered by the order type of " - "ComponentOrder::BY_LOCATION"); - } global_id = static_cast<GlobalIndexType>( components.size() * p_mesh.getGlobalNodeID(j) + comp_id); const bool is_ghost = -- GitLab