diff --git a/kratos/modeler/entity_generation/generate_conditions_with_face_color.cpp b/kratos/modeler/entity_generation/generate_conditions_with_face_color.cpp index d575ded9665e..c7fa63afba69 100644 --- a/kratos/modeler/entity_generation/generate_conditions_with_face_color.cpp +++ b/kratos/modeler/entity_generation/generate_conditions_with_face_color.cpp @@ -16,6 +16,7 @@ // Project includes #include "generate_conditions_with_face_color.h" +#include "includes/model_part.h" namespace Kratos { @@ -45,8 +46,8 @@ void GenerateConditionsWithFaceColor::Generate(ModelPart& rModelPart, Parameters array_1d number_of_cells = GetNumberOfCells(); - ModelPart::NodesContainerType new_nodes; - ModelPart::ConditionsContainerType new_conditions; + std::vector new_nodes; + std::vector new_conditions; auto& r_prototype_condition = KratosComponents::Get( parameters["generated_entity"].GetString()); @@ -71,8 +72,8 @@ void GenerateConditionsWithFaceColor::Generate(ModelPart& rModelPart, Parameters } } - AddNodesToModelPart(rModelPart, new_nodes); - rModelPart.AddConditions(new_conditions.begin(), new_conditions.end()); + rModelPart.AddNodes(std::move(new_nodes)); + rModelPart.AddConditions(std::move(new_conditions)); } } \ No newline at end of file diff --git a/kratos/modeler/entity_generation/generate_elements_with_cell_color.cpp b/kratos/modeler/entity_generation/generate_elements_with_cell_color.cpp index 19491c664902..63fefd716525 100644 --- a/kratos/modeler/entity_generation/generate_elements_with_cell_color.cpp +++ b/kratos/modeler/entity_generation/generate_elements_with_cell_color.cpp @@ -41,8 +41,8 @@ void GenerateElementsWithCellColor::Generate(ModelPart& rModelPart, Parameters p array_1d number_of_cells = GetNumberOfCells(); - ModelPart::NodesContainerType new_nodes; - ModelPart::ElementsContainerType new_elements; + std::vector new_nodes; + std::vector new_elements; auto& r_prototype_element = KratosComponents::Get( parameters["generated_entity"].GetString()); @@ -63,8 +63,8 @@ void GenerateElementsWithCellColor::Generate(ModelPart& rModelPart, Parameters p } } - AddNodesToModelPart(rModelPart, new_nodes); - rModelPart.AddElements(new_elements.begin(), new_elements.end()); + rModelPart.AddNodes(std::move(new_nodes)); + rModelPart.AddElements(std::move(new_elements)); } } \ No newline at end of file diff --git a/kratos/modeler/entity_generation/generate_quadratic_elements_with_cell_color.cpp b/kratos/modeler/entity_generation/generate_quadratic_elements_with_cell_color.cpp index cef1172f4f8d..dd2a297fddf8 100644 --- a/kratos/modeler/entity_generation/generate_quadratic_elements_with_cell_color.cpp +++ b/kratos/modeler/entity_generation/generate_quadratic_elements_with_cell_color.cpp @@ -43,8 +43,8 @@ void GenerateQuadraticElementsWithCellColor::Generate(ModelPart& rModelPart, Par array_1d number_of_cells = GetNumberOfCells(); - ModelPart::NodesContainerType new_nodes; - ModelPart::ElementsContainerType new_elements; + std::vector new_nodes; + std::vector new_elements; auto& r_prototype_element = KratosComponents::Get( parameters["generated_entity"].GetString()); @@ -65,8 +65,8 @@ void GenerateQuadraticElementsWithCellColor::Generate(ModelPart& rModelPart, Par } } - AddNodesToModelPart(rModelPart, new_nodes); - rModelPart.AddElements(new_elements.begin(), new_elements.end()); + rModelPart.AddNodes(std::move(new_nodes)); + rModelPart.AddElements(std::move(new_elements)); } } \ No newline at end of file diff --git a/kratos/modeler/entity_generation/generate_stl_intersection_with_cells.cpp b/kratos/modeler/entity_generation/generate_stl_intersection_with_cells.cpp index 4922644afbd4..a24313049733 100644 --- a/kratos/modeler/entity_generation/generate_stl_intersection_with_cells.cpp +++ b/kratos/modeler/entity_generation/generate_stl_intersection_with_cells.cpp @@ -16,6 +16,7 @@ // Project includes #include "generate_stl_intersection_with_cells.h" +#include namespace Kratos { @@ -54,8 +55,8 @@ void GenerateStlIntersectionWithCells::Generate(ModelPart& rModelPart, Parameter parameters["generated_entity"].GetString()); const SkinIntersection& r_intersections = GetIntersections(inside_color); - ModelPart::NodesContainerType new_nodes; - ModelPart::ElementsContainerType new_elements; + std::vector new_nodes; + std::vector new_elements; array_1d number_of_cells = GetNumberOfCells(); @@ -82,8 +83,8 @@ void GenerateStlIntersectionWithCells::Generate(ModelPart& rModelPart, Parameter } } - AddNodesToModelPart(rModelPart, new_nodes); - rModelPart.AddElements(new_elements.begin(), new_elements.end()); + rModelPart.AddNodes(std::move(new_nodes)); + rModelPart.AddElements(std::move(new_elements)); } PointerVector GenerateStlIntersectionWithCells::GenerateCutGeometryNodes( diff --git a/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.cpp b/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.cpp index f3cf3a68f242..ffe7daefec05 100644 --- a/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.cpp +++ b/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.cpp @@ -45,8 +45,8 @@ void GenerateTetrahedralElementsWithCellColor::Generate(ModelPart& rModelPart, P array_1d number_of_cells = GetNumberOfCells(); - ModelPart::NodesContainerType new_nodes; - ModelPart::ElementsContainerType new_elements; + std::vector new_nodes; + std::vector new_elements; Element::NodesArrayType cell_nodes(8); for (std::size_t k = 0; k < number_of_cells[2]; k++) { @@ -61,12 +61,12 @@ void GenerateTetrahedralElementsWithCellColor::Generate(ModelPart& rModelPart, P } } - AddNodesToModelPart(rModelPart, new_nodes); - rModelPart.AddElements(new_elements.begin(), new_elements.end()); + rModelPart.AddNodes(std::move(new_nodes)); + rModelPart.AddElements(std::move(new_elements)); } void GenerateTetrahedralElementsWithCellColor::CreateTetrahedraInCell( - ModelPart::ElementsContainerType& rElements, + std::vector& rElements, Element::NodesArrayType& rCellNodes, const std::size_t StartId, Properties::Pointer& pProperties, diff --git a/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.h b/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.h index 0abf8fff5b4a..d4ea68966fbd 100644 --- a/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.h +++ b/kratos/modeler/entity_generation/generate_tetrahedral_elements_with_cell_color.h @@ -36,7 +36,7 @@ class GenerateTetrahedralElementsWithCellColor: public VoxelMesherEntityGenerati private: void CreateTetrahedraInCell( - ModelPart::ElementsContainerType& rElements, + std::vector& rElements, Element::NodesArrayType& rCellNodes, const std::size_t StartId, Properties::Pointer& pProperties, diff --git a/kratos/modeler/entity_generation/generate_triangular_conditions_with_face_color.cpp b/kratos/modeler/entity_generation/generate_triangular_conditions_with_face_color.cpp index d91d323d7779..1de8c217020b 100644 --- a/kratos/modeler/entity_generation/generate_triangular_conditions_with_face_color.cpp +++ b/kratos/modeler/entity_generation/generate_triangular_conditions_with_face_color.cpp @@ -45,8 +45,8 @@ void GenerateTriangularConditionsWithFaceColor::Generate(ModelPart& rModelPart, array_1d number_of_cells = GetNumberOfCells(); - ModelPart::NodesContainerType new_nodes; - ModelPart::ConditionsContainerType new_conditions; + std::vector new_nodes; + std::vector new_conditions; auto& r_prototype_condition = KratosComponents::Get( parameters["generated_entity"].GetString()); @@ -77,8 +77,8 @@ void GenerateTriangularConditionsWithFaceColor::Generate(ModelPart& rModelPart, } } - AddNodesToModelPart(rModelPart, new_nodes); - rModelPart.AddConditions(new_conditions.begin(), new_conditions.end()); + rModelPart.AddNodes(std::move(new_nodes)); + rModelPart.AddConditions(std::move(new_conditions)); } } \ No newline at end of file diff --git a/kratos/modeler/entity_generation/voxel_mesher_entity_generation.cpp b/kratos/modeler/entity_generation/voxel_mesher_entity_generation.cpp index 19a0a409cf62..afd0c7ecc569 100644 --- a/kratos/modeler/entity_generation/voxel_mesher_entity_generation.cpp +++ b/kratos/modeler/entity_generation/voxel_mesher_entity_generation.cpp @@ -15,6 +15,7 @@ // External includes // Project includes +#include "includes/model_part.h" #include "utilities/model_part_utils.h" #include "voxel_mesher_entity_generation.h" @@ -108,13 +109,6 @@ bool VoxelMesherEntityGeneration::IntersectionsGenerated(int Color) const { } -void VoxelMesherEntityGeneration::AddNodesToModelPart(ModelPart& rModelPart, ModelPart::NodesContainerType& rNewNodes) const -{ - rNewNodes.Unique(); - ModelPartUtils::AddNodesFromOrderedContainer(rModelPart, rNewNodes.begin(), rNewNodes.end()); -} - - void VoxelMesherEntityGeneration::SetStartIds(ModelPart& rModelPart) { mrModeler.SetStartIds(rModelPart); @@ -144,7 +138,7 @@ array_1d VoxelMesherEntityGeneration::GetNumberOfCells() const Node::Pointer VoxelMesherEntityGeneration::GenerateOrRetrieveNode( ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K) @@ -155,7 +149,7 @@ Node::Pointer VoxelMesherEntityGeneration::GenerateOrRetrieveNode( Node::Pointer VoxelMesherEntityGeneration::GenerateOrRetrieveQuadraticNode( ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K) @@ -173,7 +167,7 @@ Node::Pointer VoxelMesherEntityGeneration::GenerateNode(ModelPart& rModelPart, c void VoxelMesherEntityGeneration::GetLinearCellNodes( Element::NodesArrayType& rCellNodes, ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K) @@ -192,7 +186,7 @@ void VoxelMesherEntityGeneration::GetLinearCellNodes( void VoxelMesherEntityGeneration::GetQuadraticCellNodes( Element::NodesArrayType& rCellNodes, ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K) diff --git a/kratos/modeler/entity_generation/voxel_mesher_entity_generation.h b/kratos/modeler/entity_generation/voxel_mesher_entity_generation.h index 1bd64f7657a8..0d48b562fabc 100644 --- a/kratos/modeler/entity_generation/voxel_mesher_entity_generation.h +++ b/kratos/modeler/entity_generation/voxel_mesher_entity_generation.h @@ -69,8 +69,6 @@ class KRATOS_API(KRATOS_CORE) VoxelMesherEntityGeneration { bool IntersectionsGenerated(int Color) const; - void AddNodesToModelPart(ModelPart& rModelPart, ModelPart::NodesContainerType& rNewNodes) const; - void SetStartIds(ModelPart& rModelPart); std::size_t GetStartElementId() const; @@ -81,14 +79,14 @@ class KRATOS_API(KRATOS_CORE) VoxelMesherEntityGeneration { Node::Pointer GenerateOrRetrieveNode( ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); Node::Pointer GenerateOrRetrieveQuadraticNode( ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); @@ -98,7 +96,7 @@ class KRATOS_API(KRATOS_CORE) VoxelMesherEntityGeneration { void GetLinearCellNodes( Element::NodesArrayType& rCellNodes, ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); @@ -106,7 +104,7 @@ class KRATOS_API(KRATOS_CORE) VoxelMesherEntityGeneration { void GetQuadraticCellNodes( Element::NodesArrayType& rCellNodes, ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); diff --git a/kratos/modeler/voxel_mesh_generator_modeler.cpp b/kratos/modeler/voxel_mesh_generator_modeler.cpp index 437691636fc2..4c9d15cebdd2 100644 --- a/kratos/modeler/voxel_mesh_generator_modeler.cpp +++ b/kratos/modeler/voxel_mesh_generator_modeler.cpp @@ -219,7 +219,7 @@ ModelPart& VoxelMeshGeneratorModeler::CreateAndGetModelPart(std::string const& F Node::Pointer VoxelMeshGeneratorModeler::GenerateOrRetrieveNode( ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K @@ -240,7 +240,7 @@ Node::Pointer VoxelMeshGeneratorModeler::GenerateOrRetrieveNode( Node::Pointer VoxelMeshGeneratorModeler::GenerateOrRetrieveQuadraticNode( ModelPart& rTheVolumeModelPart, - ModelPart::NodesContainerType& rThisNodes, + std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K diff --git a/kratos/modeler/voxel_mesh_generator_modeler.h b/kratos/modeler/voxel_mesh_generator_modeler.h index 3f7629c84742..766abd47f6ae 100644 --- a/kratos/modeler/voxel_mesh_generator_modeler.h +++ b/kratos/modeler/voxel_mesh_generator_modeler.h @@ -210,9 +210,9 @@ class KRATOS_API(KRATOS_CORE) VoxelMeshGeneratorModeler void GenerateEntities(ModelPart& rTheVolumeModelPart, Parameters EntityGeneratorParameters); - Node::Pointer GenerateOrRetrieveNode(ModelPart& rTheVolumeModelPart, ModelPart::NodesContainerType& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); + Node::Pointer GenerateOrRetrieveNode(ModelPart& rTheVolumeModelPart, std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); - Node::Pointer GenerateOrRetrieveQuadraticNode(ModelPart& rTheVolumeModelPart, ModelPart::NodesContainerType& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); + Node::Pointer GenerateOrRetrieveQuadraticNode(ModelPart& rTheVolumeModelPart, std::vector& rThisNodes, const std::size_t I, const std::size_t J, const std::size_t K); Node::Pointer GenerateNode(ModelPart& rTheVolumeModelPart, const Point& rCoordinates); diff --git a/kratos/tests/cpp_tests/utilities/test_model_part_utilities.cpp b/kratos/tests/cpp_tests/utilities/test_model_part_utilities.cpp deleted file mode 100644 index ff9a11eb6b90..000000000000 --- a/kratos/tests/cpp_tests/utilities/test_model_part_utilities.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// System includes - -// External includes - -// Project includes -#include "testing/testing.h" -#include "includes/kratos_parameters.h" -#include "containers/model.h" -#include "utilities/model_part_utils.h" - -namespace Kratos::Testing { - using PropertiesType = Properties; - using ElementType = Element; - using ConditionType = Condition; - using MeshType = Mesh; - using NodesContainerType = MeshType::NodesContainerType; - - KRATOS_TEST_CASE_IN_SUITE(AddNodesFromOrderedContainer, KratosCoreFastSuite) - { - Model model; - - auto& r_model_part = model.CreateModelPart("Main"); - - auto& r_smp = r_model_part.CreateSubModelPart("Inlet1"); - auto& r_ssmp = r_model_part.CreateSubModelPart("Inlet1.sub_inlet"); - auto& r_smp2 = r_model_part.CreateSubModelPart("Inlet2"); - auto& r_ssmp2 = r_model_part.CreateSubModelPart("Inlet2.sub_inlet"); - NodesContainerType aux, aux2, aux3; //auxiliary containers - - // Now we create some nodes and store some of them in a container - for(std::size_t id=1; id<25; id++) { - auto p_node = r_model_part.CreateNewNode(id, 0.00,0.00,0.00); - if (id%2!=0) { - aux.insert(aux.end(), p_node); - } - if (id<15) { - aux2.insert(aux2.end(), p_node); - } - aux3.insert(aux3.end(), p_node); - } - // We check the first one - r_ssmp.AddNodes(aux.begin(), aux.end()); - KRATOS_EXPECT_EQ(r_ssmp.NumberOfNodes(), 12); - KRATOS_EXPECT_EQ(r_smp.NumberOfNodes(), 12); - - ModelPartUtils::AddNodesFromOrderedContainer(r_ssmp2, aux.begin(), aux.end()); - KRATOS_EXPECT_EQ(r_ssmp2.NumberOfNodes(), 12); - KRATOS_EXPECT_EQ(r_smp2.NumberOfNodes(), 12); - - // We check the second one - r_ssmp.AddNodes(aux2.begin(), aux2.end()); - KRATOS_EXPECT_EQ(r_ssmp.NumberOfNodes(), 19); - KRATOS_EXPECT_EQ(r_smp.NumberOfNodes(), 19); - - ModelPartUtils::AddNodesFromOrderedContainer(r_ssmp2, aux2.begin(), aux2.end()); - KRATOS_EXPECT_EQ(r_ssmp2.NumberOfNodes(), 19); - KRATOS_EXPECT_EQ(r_smp2.NumberOfNodes(), 19); - - // Now with aux3, we start with ordered because it needs to be unique - ModelPartUtils::AddNodesFromOrderedContainer(r_ssmp2, aux3.begin(), aux3.end()); - KRATOS_EXPECT_EQ(r_ssmp2.NumberOfNodes(), 24); - KRATOS_EXPECT_EQ(r_smp2.NumberOfNodes(), 24); - - // Here we can go a bit further. No need to be Unique - for(auto it=aux.begin();it!=aux.end(); it++){ - aux3.insert(aux3.end(), *(it.base())); - } - r_ssmp.AddNodes(aux3.begin(), aux3.end()); - KRATOS_EXPECT_EQ(r_ssmp.NumberOfNodes(), 24); - KRATOS_EXPECT_EQ(r_smp.NumberOfNodes(), 24); - } - - } // namespace Testing - diff --git a/kratos/utilities/model_part_utils.h b/kratos/utilities/model_part_utils.h index bf3d296cd5a1..7cb81a1ac246 100644 --- a/kratos/utilities/model_part_utils.h +++ b/kratos/utilities/model_part_utils.h @@ -98,37 +98,6 @@ class ModelPartUtils } } - /** - * @brief Add nodes to ModelPart from an ordered container. - * @details By assuming that the input is ordered (by increasing Id), the nodes can be added more efficiently. Note that the function makes no check of the ordering, it is the responsability of the caller to ensure that it is correct. - * @tparam TIteratorType Iterator type for the nodes to add. - * @param rTargetModelPart ModelPart the nodes will be added to. - * @param iNodesBegin First element of the container of nodes to be added to rTargetModelPart. - * @param iNodesEnd End position for the container of nodes to be added to rTargetModelPart. - */ - template - static void AddNodesFromOrderedContainer(ModelPart& rTargetModelPart, TIteratorType iNodesBegin, TIteratorType iNodesEnd) - { - KRATOS_TRY - ModelPart::NodesContainerType aux; - ModelPart* root_model_part = &rTargetModelPart.GetRootModelPart(); - - for(TIteratorType it = iNodesBegin; it!=iNodesEnd; it++) { - aux.push_back( *(it.base()) ); - } - // Add the nodes to the root modelpart - root_model_part->Nodes() = JoinOrderedNodesContainerType(root_model_part->Nodes().begin(), root_model_part->Nodes().end(), aux.begin(), aux.end()); - - // Add to all of the leaves - ModelPart* current_part = &rTargetModelPart; - while(current_part->IsSubModelPart()) { - current_part->Nodes() = JoinOrderedNodesContainerType(current_part->Nodes().begin(), current_part->Nodes().end(), aux.begin(), aux.end()); - current_part = &(current_part->GetParentModelPart()); - } - - KRATOS_CATCH("") - } - /** * @brief Generates entities (e.g., Elements or Conditions) based on provided connectivities and adds them to a specified container, with an option to use default properties. * @details This function is designed to create entities of a specific type (denoted by TEntity) based on their node connectivities. It facilitates the construction of these entities by looking up nodes in the provided nodes container and either using a specified Properties object or defaulting to a provided one if not explicitly specified for each entity. The generated entities are then added to the specified container. The function ensures that the entity type is registered in Kratos and that all specified nodes are available. It allows specifying a common Properties object to be used for all entities, which can be particularly useful when all entities share the same physical properties. @@ -302,73 +271,13 @@ class ModelPartUtils private: - /** - * @brief Helper function for AddNodesFromOrderedContainer. Joins two ranges of nodes in a sorted order based on their IDs. - * @details This function takes two ranges of nodes (defined by iterators), and merges them into a single container of nodes in sorted order of their IDs. If one range is empty, the other is returned as is. If both ranges are empty, an empty container is returned. - * @tparam TIteratorType The type of the iterator. Must support operations like increment and dereference. - * @param iC1Begin Iterator pointing to the beginning of the first range of nodes. - * @param iC1End Iterator pointing to the end of the first range of nodes. - * @param iC2Begin Iterator pointing to the beginning of the second range of nodes. - * @param iC2End Iterator pointing to the end of the second range of nodes. - * @return ModelPart::NodesContainerType A container filled with nodes from both ranges in sorted order. - * @note This function assumes that each range is already sorted by node ID. The function performs a merge operation and ensures that nodes with the same ID are not duplicated in the output. - */ - template - static typename ModelPart::NodesContainerType JoinOrderedNodesContainerType( - TIteratorType iC1Begin, - TIteratorType iC1End, - TIteratorType iC2Begin, - TIteratorType iC2End - ) - { - std::size_t c1length = std::distance(iC1Begin,iC1End); - std::size_t c2length = std::distance(iC2Begin,iC2End); - TIteratorType blong, elong, bshort, eshort; - ModelPart::NodesContainerType aux; - aux.reserve(c1length + c2length); - - // We order c1 and c2 to long and short - if(c1length>c2length){ - blong = iC1Begin; elong = iC1End; - bshort = iC2Begin; eshort = iC2End; - } else { - blong = iC2Begin; elong = iC2End; - bshort = iC1Begin; eshort = iC1End; - } - - // If short is empty we return long. If both empty it returns empty aux - if(c2length == 0 || c1length == 0){ - for(TIteratorType it1=blong; it1!=elong; it1++){ - aux.push_back(*(it1.base()) ); - } - return aux; - } - TIteratorType it2 = blong; - for(TIteratorType it1=bshort; it1!=eshort; it1++) { - while(it2!=elong && it2->Id()Id()) { - aux.push_back(*(it2.base())); - it2++; - } - aux.push_back(*(it1.base()) ); - if(it2!=elong && (it1->Id() == it2->Id())) { //If both are the same, then we need to skip - it2++; - } - } - while(it2 != elong) { - aux.push_back(*(it2.base())); - it2++; - } - - return aux; - } - /** * @brief Checks if an entity is registered in Kratos and returns a reference to it. * @details This function checks if a given entity (either an Element or a Condition) is registered in Kratos. If the entity is registered, it returns a constant reference to it. If the entity is not registered, it throws an error with a descriptive message. Template parameter `TEntity` can be either `Element` or `Condition`. The function utilizes compile-time checks to generate appropriate error messages based on the entity type. * @tparam TEntity The type of the entity to check. Must be either `Element` or `Condition`. * @param rEntityName The name of the entity to check. * @return const TEntity& A constant reference to the entity. - * @throw Kratos::Exception If the entity is not registered in Kratos. The exception message will specify + * @throw Kratos::Exception If the entity is not registered in Kratos. The exception message will specify * whether the missing entity is an Element or a Condition and remind to check the spelling and registration of the application. */ template