From a75e7e0a6316b6cd995ce1207e19f695fe70095e Mon Sep 17 00:00:00 2001 From: andrewgorgi Date: Mon, 16 Dec 2024 15:20:39 +0100 Subject: [PATCH] =?UTF-8?q?Rub=C3=A9n=20suggestions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nurbs_curve_on_surface_geometry.h | 20 +++++++++++++------ kratos/includes/variables.h | 2 ++ kratos/sources/variables.cpp | 7 ++++++- .../test_nurbs_curve_on_surface_geometry.cpp | 10 +++++----- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/kratos/geometries/nurbs_curve_on_surface_geometry.h b/kratos/geometries/nurbs_curve_on_surface_geometry.h index b4a4409c8f0e..443966d631b0 100644 --- a/kratos/geometries/nurbs_curve_on_surface_geometry.h +++ b/kratos/geometries/nurbs_curve_on_surface_geometry.h @@ -243,7 +243,9 @@ class NurbsCurveOnSurfaceGeometry : public Geometry& rSpans, IndexType DirectionIndex = 0) const override + void SpansLocalSpace( + std::vector& rSpans, + IndexType DirectionIndex = 0) const override { auto interval = mpNurbsCurve->DomainInterval(); this->SpansLocalSpace(rSpans, interval.GetT0(), interval.GetT1()); @@ -254,7 +256,9 @@ class NurbsCurveOnSurfaceGeometry : public Geometry& rSpans, IndexType DirectionIndex = 0) const + void SpansLocalSpaceSBM( + std::vector& rSpans, + IndexType DirectionIndex = 0) const { auto interval = mpNurbsCurve->DomainInterval(); this->SpansLocalSpaceSBM(rSpans, interval.GetT0(), interval.GetT1()); @@ -263,8 +267,10 @@ class NurbsCurveOnSurfaceGeometry : public Geometry& rSpans, - double Start, double End) const + void SpansLocalSpace( + std::vector& rSpans, + double Start, + double End) const { std::vector surface_spans_u; std::vector surface_spans_v; @@ -282,8 +288,10 @@ class NurbsCurveOnSurfaceGeometry : public Geometry& rSpans, - double Start, double End) const + void SpansLocalSpaceSBM( + std::vector& rSpans, + double Start, + double End) const { std::vector surface_spans_u; std::vector surface_spans_v; diff --git a/kratos/includes/variables.h b/kratos/includes/variables.h index d601268fafd6..fd9981490a20 100644 --- a/kratos/includes/variables.h +++ b/kratos/includes/variables.h @@ -485,6 +485,8 @@ namespace Kratos KRATOS_DEFINE_VARIABLE(double, VARIATIONAL_REDISTANCE_COEFFICIENT_FIRST) KRATOS_DEFINE_VARIABLE(double, VARIATIONAL_REDISTANCE_COEFFICIENT_SECOND) + // SBM variables + KRATOS_DEFINE_VARIABLE(bool, IS_SBM) } // namespace Kratos. #undef KRATOS_EXPORT_MACRO diff --git a/kratos/sources/variables.cpp b/kratos/sources/variables.cpp index fc28ab6ab8e3..74dc59edd22a 100644 --- a/kratos/sources/variables.cpp +++ b/kratos/sources/variables.cpp @@ -477,6 +477,9 @@ KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS(PARAMETER_2D_COORDINATES) KRATOS_CREATE_VARIABLE(double, VARIATIONAL_REDISTANCE_COEFFICIENT_FIRST) KRATOS_CREATE_VARIABLE(double, VARIATIONAL_REDISTANCE_COEFFICIENT_SECOND) +// SBM variables +KRATOS_CREATE_VARIABLE(bool, IS_SBM) + //------------------------------------------------------------------------------// //------------------------------------------------------------------------------// //------------------------------------------------------------------------------// @@ -954,6 +957,8 @@ void KratosApplication::RegisterVariables() { // Variational redistance KRATOS_REGISTER_VARIABLE(VARIATIONAL_REDISTANCE_COEFFICIENT_FIRST) KRATOS_REGISTER_VARIABLE(VARIATIONAL_REDISTANCE_COEFFICIENT_SECOND) - + + // SBM variables + KRATOS_REGISTER_VARIABLE(IS_SBM) } } // namespace Kratos. diff --git a/kratos/tests/cpp_tests/geometries/test_nurbs_curve_on_surface_geometry.cpp b/kratos/tests/cpp_tests/geometries/test_nurbs_curve_on_surface_geometry.cpp index f53a36033217..5cab39d80b5d 100644 --- a/kratos/tests/cpp_tests/geometries/test_nurbs_curve_on_surface_geometry.cpp +++ b/kratos/tests/cpp_tests/geometries/test_nurbs_curve_on_surface_geometry.cpp @@ -600,7 +600,7 @@ typedef Node NodeType; brep_coordinates[1][0] = 0.0; brep_coordinates[1][1] = 3.0; - NurbsCurveOnSurfaceGeometry<3, PointerVector, PointerVector> curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); + auto curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); auto p_surface = curve_on_surface.pGetGeometryPart(GeometryType::BACKGROUND_GEOMETRY_INDEX); @@ -636,7 +636,7 @@ typedef Node NodeType; brep_coordinates[1][0] = 2.0; brep_coordinates[1][1] = 0.0; - NurbsCurveOnSurfaceGeometry<3, PointerVector, PointerVector> curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); + auto curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); auto p_surface = curve_on_surface.pGetGeometryPart(GeometryType::BACKGROUND_GEOMETRY_INDEX); @@ -670,7 +670,7 @@ typedef Node NodeType; brep_coordinates[1][0] = 2.0; brep_coordinates[1][1] = 1.0; - NurbsCurveOnSurfaceGeometry<3, PointerVector, PointerVector> curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); + auto curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); auto p_surface = curve_on_surface.pGetGeometryPart(GeometryType::BACKGROUND_GEOMETRY_INDEX); std::vector spans; @@ -703,7 +703,7 @@ typedef Node NodeType; brep_coordinates[1][0] = 2.0; brep_coordinates[1][1] = 1.0; - NurbsCurveOnSurfaceGeometry<3, PointerVector, PointerVector> curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); + auto curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); auto p_surface = curve_on_surface.pGetGeometryPart(GeometryType::BACKGROUND_GEOMETRY_INDEX); // Check general information, input to ouput @@ -766,7 +766,7 @@ typedef Node NodeType; brep_coordinates[1][0] = 2.0; brep_coordinates[1][1] = 0.0; - NurbsCurveOnSurfaceGeometry<3, PointerVector, PointerVector> curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); + auto curve_on_surface = GenerateReferenceNurbs2dforKnotIntersections(brep_coordinates); auto p_surface = curve_on_surface.pGetGeometryPart(GeometryType::BACKGROUND_GEOMETRY_INDEX); // Check general information, input to ouput