From 4fa86d9a800229e28f987ccc37670a11d218349b Mon Sep 17 00:00:00 2001 From: philbucher Date: Tue, 1 Sep 2020 11:23:50 +0200 Subject: [PATCH 01/15] removing projection --- kratos/geometries/line_2d_2.h | 16 +--------------- kratos/geometries/triangle_3d_3.h | 24 +----------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/kratos/geometries/line_2d_2.h b/kratos/geometries/line_2d_2.h index fbeee3f0e15d..8dca61bf9b6b 100644 --- a/kratos/geometries/line_2d_2.h +++ b/kratos/geometries/line_2d_2.h @@ -26,7 +26,6 @@ #include "geometries/geometry.h" #include "integration/line_gauss_legendre_integration_points.h" #include "integration/line_collocation_integration_points.h" -#include "utilities/geometrical_projection_utilities.h" namespace Kratos { @@ -909,20 +908,7 @@ class Line2D2 : public Geometry const double Tolerance = std::numeric_limits::epsilon() ) const override { - // We compute the distance, if it is not in the pane we - const Point point_to_project(rPoint); - Point point_projected; - const double distance = GeometricalProjectionUtilities::FastProjectOnLine2D(*this, point_to_project, point_projected); - - // We check if we are on the plane - if (std::abs(distance) > std::numeric_limits::epsilon()) { - if (std::abs(distance) > 1.0e-6 * Length()) { - KRATOS_WARNING_FIRST_N("Line2D2", 10) << "The point of coordinates X: " << rPoint[0] << "\tY: " << rPoint[1] << " it is in a distance: " << std::abs(distance) << std::endl; - return false; - } - } - - PointLocalCoordinates( rResult, point_projected ); + PointLocalCoordinates( rResult, rPoint ); if ( std::abs( rResult[0] ) <= (1.0 + Tolerance) ) { return true; diff --git a/kratos/geometries/triangle_3d_3.h b/kratos/geometries/triangle_3d_3.h index 9a1fc1c0c3e8..0ab8df29b5c6 100644 --- a/kratos/geometries/triangle_3d_3.h +++ b/kratos/geometries/triangle_3d_3.h @@ -28,7 +28,6 @@ #include "geometries/line_3d_2.h" #include "integration/triangle_gauss_legendre_integration_points.h" #include "integration/triangle_collocation_integration_points.h" -#include "utilities/geometrical_projection_utilities.h" namespace Kratos { @@ -887,28 +886,7 @@ template class Triangle3D3 const double Tolerance = std::numeric_limits::epsilon() ) const override { - // We compute the normal to check the normal distances between the point and the triangles, so we can discard that is on the triangle - const auto center = this->Center(); - const array_1d normal = this->UnitNormal(center); - - // We compute the distance, if it is not in the plane we project - const Point point_to_project(rPoint); - double distance; - CoordinatesArrayType point_projected; - point_projected = GeometricalProjectionUtilities::FastProject( center, point_to_project, normal, distance); - - // We check if we are on the plane - if (std::abs(distance) > std::numeric_limits::epsilon()) { - if (std::abs(distance) > 1.0e-6 * Length()) { - KRATOS_WARNING_FIRST_N("Triangle3D3", 10) << "The " << rPoint << " is in a distance: " << std::abs(distance) << std::endl; - return false; - } - - // Not in the plane, but allowing certain distance, projecting - noalias(point_projected) = rPoint - normal * distance; - } - - PointLocalCoordinates( rResult, point_projected ); + PointLocalCoordinates( rResult, rPoint ); if ( (rResult[0] >= (0.0-Tolerance)) && (rResult[0] <= (1.0+Tolerance)) ) { if ( (rResult[1] >= (0.0-Tolerance)) && (rResult[1] <= (1.0+Tolerance)) ) { From 80d289304dc816ce78ea49b6979f52b86655d3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Mon, 2 Nov 2020 17:14:27 +0100 Subject: [PATCH 02/15] Fix compilation without cotire --- .../cpp_tests/geometries/test_quadrature_point_geometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos/tests/cpp_tests/geometries/test_quadrature_point_geometry.cpp b/kratos/tests/cpp_tests/geometries/test_quadrature_point_geometry.cpp index 83cc3396a76e..e82bb45ab6a3 100644 --- a/kratos/tests/cpp_tests/geometries/test_quadrature_point_geometry.cpp +++ b/kratos/tests/cpp_tests/geometries/test_quadrature_point_geometry.cpp @@ -18,7 +18,7 @@ #include "includes/stream_serializer.h" #include "utilities/quadrature_points_utility.h" - +#include "utilities/geometrical_projection_utilities.h" #include "geometries/point.h" #include "geometries/triangle_2d_3.h" From 85ad251b2b8a3853000cb9c04fc06e42554e9718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Mon, 2 Nov 2020 21:04:34 +0100 Subject: [PATCH 03/15] Missing include --- .../custom_utilities/mortar_explicit_contribution_utilities.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/ContactStructuralMechanicsApplication/custom_utilities/mortar_explicit_contribution_utilities.cpp b/applications/ContactStructuralMechanicsApplication/custom_utilities/mortar_explicit_contribution_utilities.cpp index 78ea79f4a9da..04719524f248 100644 --- a/applications/ContactStructuralMechanicsApplication/custom_utilities/mortar_explicit_contribution_utilities.cpp +++ b/applications/ContactStructuralMechanicsApplication/custom_utilities/mortar_explicit_contribution_utilities.cpp @@ -14,6 +14,7 @@ // External includes // Project includes +#include "utilities/geometrical_projection_utilities.h" #include "custom_utilities/mortar_explicit_contribution_utilities.h" namespace Kratos From 10b41515679c53273f8f3144346c607b4f92e945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 17:42:51 +0100 Subject: [PATCH 04/15] Adding ProjectedIsInside --- kratos/utilities/geometry_utilities.cpp | 34 ++++++++++++++++++++++++- kratos/utilities/geometry_utilities.h | 15 +++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/kratos/utilities/geometry_utilities.cpp b/kratos/utilities/geometry_utilities.cpp index 950a1a53d42a..7decb78c752d 100644 --- a/kratos/utilities/geometry_utilities.cpp +++ b/kratos/utilities/geometry_utilities.cpp @@ -18,7 +18,8 @@ // Project includes // Include base h -#include "geometry_utilities.h" +#include "utilities/geometry_utilities.h" +#include "utilities/geometrical_projection_utilities.h" namespace Kratos { @@ -114,6 +115,37 @@ void GeometryUtils::EvaluateHistoricalVariableGradientAtGaussPoint( } } +bool GeometryUtils::ProjectedIsInside( + const GeometryType& rGeometry, + const GeometryType::CoordinatesArrayType& rPointGlobalCoordinates, + GeometryType::CoordinatesArrayType& rResult, + const double Tolerance + ) +{ + // We compute the distance, if it is not in the pane we + const Point point_to_project(rPointGlobalCoordinates); + Point point_projected; + double distance = 0.0; + if (rGeometry.GetGeometryType() == GeometryData::KratosGeometryType::Kratos_Line2D2) { + GeometricalProjectionUtilities::FastProjectOnLine2D(rGeometry, point_to_project, point_projected); + } else if (rGeometry.GetGeometryType() == GeometryData::KratosGeometryType::Kratos_Triangle3D3) { + // We compute the normal to check the normal distances between the point and the triangles, so we can discard that is on the triangle + const auto center = rGeometry.Center(); + const array_1d normal = rGeometry.UnitNormal(center); + + point_projected = GeometricalProjectionUtilities::FastProject(center, point_to_project, normal, distance); + } + + // We check if we are on the plane + if (std::abs(distance) > Tolerance) { + if (std::abs(distance) > 1.0e-6 * rGeometry.Length()) { + return false; + } + } + + return rGeometry.IsInside(rPointGlobalCoordinates, rResult, Tolerance); +} + // template instantiations template void KRATOS_API(KRATOS_CORE) GeometryUtils::EvaluateHistoricalVariableValueAtGaussPoint>( diff --git a/kratos/utilities/geometry_utilities.h b/kratos/utilities/geometry_utilities.h index b9d394ac7233..adee0dc3c27d 100644 --- a/kratos/utilities/geometry_utilities.h +++ b/kratos/utilities/geometry_utilities.h @@ -848,6 +848,21 @@ class GeometryUtils const Variable>& rVariable, const Matrix& rGaussPointShapeFunctionDerivativeValues, const int Step = 0); + + /** + * @brief Checks if given point in global space coordinates is inside the geometry boundaries. + * @details This function computes the local coordinates and checks then if this point lays within the boundaries after projecting the points. + * @param rPointGlobalCoordinates the global coordinates of the external point. + * @param rResult the local coordinates of the point. + * @param Tolerance the tolerance to the boundary. + * @return true if the point is inside, false otherwise + */ + static bool KRATOS_API(KRATOS_CORE) ProjectedIsInside( + const GeometryType& rGeometry, + const GeometryType::CoordinatesArrayType& rPointGlobalCoordinates, + GeometryType::CoordinatesArrayType& rResult, + const double Tolerance = std::numeric_limits::epsilon() + ); }; } // namespace Kratos. From 1f7f3ca6318ae6369719b8b2fad96772d5b1a357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 17:43:08 +0100 Subject: [PATCH 05/15] Minor --- kratos/utilities/binbased_fast_point_locator.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kratos/utilities/binbased_fast_point_locator.h b/kratos/utilities/binbased_fast_point_locator.h index 902a59214088..cf53f135a17b 100644 --- a/kratos/utilities/binbased_fast_point_locator.h +++ b/kratos/utilities/binbased_fast_point_locator.h @@ -190,13 +190,13 @@ class BinBasedFastPointLocator if (results_found > 0) { // Loop over the candidate entities and check if the particle falls within for (IndexType i = 0; i < results_found; i++) { - GeometryType& geom = (*(ItResultBegin + i))->GetGeometry(); + GeometryType& r_geom = (*(ItResultBegin + i))->GetGeometry(); // Find local position array_1d point_local_coordinates; Vector shape_function; - const bool is_found = geom.IsInside(rCoordinates, point_local_coordinates, Tolerance); - geom.ShapeFunctionsValues(shape_function, point_local_coordinates); + const bool is_found = LocalIsInside(r_geom, rCoordinates, point_local_coordinates, Tolerance); + r_geom.ShapeFunctionsValues(shape_function, point_local_coordinates); noalias(rNShapeFunction) = shape_function; if (is_found) { @@ -240,12 +240,12 @@ class BinBasedFastPointLocator // Loop over the candidate entities and check if the particle falls within for (IndexType i = 0; i < static_cast(results_found); i++) { - GeometryType& geom = (*(ItResultBegin + i))->GetGeometry(); + GeometryType& r_geom = (*(ItResultBegin + i))->GetGeometry(); // Find local position array_1d point_local_coordinates; - const bool is_found = geom.IsInside(rCoordinates, point_local_coordinates, Tolerance); - geom.ShapeFunctionsValues(rNShapeFunction, point_local_coordinates); + const bool is_found = LocalIsInside(r_geom, rCoordinates, point_local_coordinates, Tolerance); + r_geom.ShapeFunctionsValues(rNShapeFunction, point_local_coordinates); if (is_found) { pEntity = (*(ItResultBegin + i)); From f68038d8b11884bc29bae0405cb04f35b75e4e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 17:43:20 +0100 Subject: [PATCH 06/15] LocalIsInside --- .../utilities/binbased_fast_point_locator.h | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kratos/utilities/binbased_fast_point_locator.h b/kratos/utilities/binbased_fast_point_locator.h index cf53f135a17b..25c972845322 100644 --- a/kratos/utilities/binbased_fast_point_locator.h +++ b/kratos/utilities/binbased_fast_point_locator.h @@ -313,6 +313,27 @@ class BinBasedFastPointLocator ///@name Protected Operations ///@{ + /** + * @brief Checks if given point in global space coordinates + * is inside the geometry boundaries. This function + * computes the local coordinates and checks then if + * this point lays within the boundaries. + * @param rPointGlobalCoordinates the global coordinates of the + * external point. + * @param rResult the local coordinates of the point. + * @param Tolerance the tolerance to the boundary. + * @return true if the point is inside, false otherwise + */ + virtual bool LocalIsInside( + const GeometryType& rGeometry, + const GeometryType::CoordinatesArrayType& rPointGlobalCoordinates, + GeometryType::CoordinatesArrayType& rResult, + const double Tolerance = std::numeric_limits::epsilon() + ) const + { + return rGeometry.IsInside(rPointGlobalCoordinates, rResult, Tolerance); + } + ///@} ///@name Protected Access ///@{ From a58f4cb5f1088373280a5c2c383e8ae8fe5e4b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 17:43:34 +0100 Subject: [PATCH 07/15] Update --- .../nodal_values_interpolation_process.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h index 83d644e08a30..89b635fef410 100755 --- a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h +++ b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h @@ -562,19 +562,19 @@ class KRATOS_API(MESHING_APPLICATION) NodalValuesInterpolationProcess /****************************** INPUT STREAM FUNCTION ******************************/ /***********************************************************************************/ -// template -// inline std::istream& operator >> (std::istream& rIStream, -// NodalValuesInterpolationProcess& rThis); +template +inline std::istream& operator >> (std::istream& rIStream, + NodalValuesInterpolationProcess& rThis); /***************************** OUTPUT STREAM FUNCTION ******************************/ /***********************************************************************************/ -// template -// inline std::ostream& operator << (std::ostream& rOStream, -// const NodalValuesInterpolationProcess& rThis) -// { -// return rOStream; -// } +template +inline std::ostream& operator << (std::ostream& rOStream, + const NodalValuesInterpolationProcess& rThis) +{ + return rOStream; +} ///@} From 236d9f35a87ebc6f86e83e99e8f554e68ba5c90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 17:43:59 +0100 Subject: [PATCH 08/15] Creating ProjectedBinBasedFastPointLocator --- .../nodal_values_interpolation_process.cpp | 2 +- .../nodal_values_interpolation_process.h | 68 +++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp index 8d5a028aea59..81b6c424afe8 100755 --- a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp +++ b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp @@ -45,7 +45,7 @@ template void NodalValuesInterpolationProcess::Execute() { // We create the locator - BinBasedFastPointLocator point_locator = BinBasedFastPointLocator(mrOriginMainModelPart); + ProjectedBinBasedFastPointLocator point_locator = ProjectedBinBasedFastPointLocator(mrOriginMainModelPart); point_locator.UpdateSearchDatabase(); // Iterate in the nodes diff --git a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h index 89b635fef410..3d3b94a4222a 100755 --- a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h +++ b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h @@ -28,6 +28,7 @@ #include "includes/kratos_parameters.h" /* Utilities */ +#include "utilities/geometry_utilities.h" #include "utilities/binbased_fast_point_locator.h" #include "utilities/openmp_utils.h" @@ -60,6 +61,73 @@ namespace Kratos ///@name Kratos Classes ///@{ +/** + * @ingroup MeshingApplication + * @class PointBoundary + * @brief Custom Point container to be used to look in the boundary skin + * @details The main difference with this point and the base one is that it contains the pointer to condition where the center of the points belongs + * @author Vicente Mataix Ferrandiz + */ +template< SizeType TDim, class TConfigureType = SpatialContainersConfigure > +class ProjectedBinBasedFastPointLocator + : public BinBasedFastPointLocator +{ +public: + ///@name Type Definitions + ///@{ + + /// The base type + typedef BinBasedFastPointLocator BaseType; + + /// Geometry definitions + typedef Node<3> NodeType; + typedef Geometry GeometryType; + + /// Pointer definition of ProjectedBinBasedFastPointLocator + KRATOS_CLASS_POINTER_DEFINITION(ProjectedBinBasedFastPointLocator); + + ///@} + ///@name Life Cycle + ///@{ + + /** + * @brief This is the default constructor + * @param rModelPart The model part of the mesh used in the search + */ + explicit ProjectedBinBasedFastPointLocator(ModelPart& rModelPart) + : BinBasedFastPointLocator(rModelPart) + { + } + + /// Destructor. + virtual ~ProjectedBinBasedFastPointLocator() = default; + + ///@} +protected: + ///@name Protected Operations + ///@{ + + /** + * @brief Checks if given point in global space coordinates is inside the geometry boundaries. + * @details This function computes the local coordinates and checks then if this point lays within the boundaries. + * @param rPointGlobalCoordinates the global coordinates of the external point. + * @param rResult the local coordinates of the point. + * @param Tolerance the tolerance to the boundary. + * @return true if the point is inside, false otherwise + */ + bool LocalIsInside( + const GeometryType& rGeometry, + const GeometryType::CoordinatesArrayType& rPointGlobalCoordinates, + GeometryType::CoordinatesArrayType& rResult, + const double Tolerance = std::numeric_limits::epsilon() + ) const override + { + GeometryUtils::ProjectedIsInside(rGeometry, rPointGlobalCoordinates, rResult, Tolerance); + } + + ///@} +}; + /** * @ingroup MeshingApplication * @class PointBoundary From 55ab889d6bad116d58f723e03e3ab3a6c4fe4d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 19:18:12 +0100 Subject: [PATCH 09/15] Missing --- .../custom_processes/nodal_values_interpolation_process.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h index 3d3b94a4222a..6fe2104e57f2 100755 --- a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h +++ b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.h @@ -122,7 +122,7 @@ class ProjectedBinBasedFastPointLocator const double Tolerance = std::numeric_limits::epsilon() ) const override { - GeometryUtils::ProjectedIsInside(rGeometry, rPointGlobalCoordinates, rResult, Tolerance); + return GeometryUtils::ProjectedIsInside(rGeometry, rPointGlobalCoordinates, rResult, Tolerance); } ///@} From 0fa3b7a4237d930ee156bc43990acf95fcfaab1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 21:47:02 +0100 Subject: [PATCH 10/15] Missing --- kratos/utilities/geometry_utilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos/utilities/geometry_utilities.cpp b/kratos/utilities/geometry_utilities.cpp index 7decb78c752d..6f0a29d312a1 100644 --- a/kratos/utilities/geometry_utilities.cpp +++ b/kratos/utilities/geometry_utilities.cpp @@ -127,7 +127,7 @@ bool GeometryUtils::ProjectedIsInside( Point point_projected; double distance = 0.0; if (rGeometry.GetGeometryType() == GeometryData::KratosGeometryType::Kratos_Line2D2) { - GeometricalProjectionUtilities::FastProjectOnLine2D(rGeometry, point_to_project, point_projected); + distance = GeometricalProjectionUtilities::FastProjectOnLine2D(rGeometry, point_to_project, point_projected); } else if (rGeometry.GetGeometryType() == GeometryData::KratosGeometryType::Kratos_Triangle3D3) { // We compute the normal to check the normal distances between the point and the triangles, so we can discard that is on the triangle const auto center = rGeometry.Center(); From 601b7dd4eedf14aee2ebfc4a53d92cb52f2a5ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 21:47:34 +0100 Subject: [PATCH 11/15] Adding test --- .../utilities/test_geometry_utils.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/kratos/tests/cpp_tests/utilities/test_geometry_utils.cpp b/kratos/tests/cpp_tests/utilities/test_geometry_utils.cpp index d7becd6025dd..84639bda11ef 100644 --- a/kratos/tests/cpp_tests/utilities/test_geometry_utils.cpp +++ b/kratos/tests/cpp_tests/utilities/test_geometry_utils.cpp @@ -564,5 +564,27 @@ namespace Testing { GeometryUtils::EvaluateHistoricalVariableGradientAtGaussPoint(old_velocity_gradient, tetrahedra, VELOCITY, DN_DX, 1); KRATOS_CHECK_MATRIX_NEAR(check_old_velocity_gradient, old_velocity_gradient, 1e-15); } + + KRATOS_TEST_CASE_IN_SUITE(ProjectedIsInside, KratosCoreFastSuite) + { + Geometry>::CoordinatesArrayType aux; + + auto line = GenerateExampleLine(); + + auto p_node_1 = Kratos::make_intrusive>(1, 0.5, 1.0e-6, 0.0); + + auto p_node_2 = Kratos::make_intrusive>(2, 0.5, 1.0e-1, 0.0); + + KRATOS_CHECK_EQUAL(GeometryUtils::ProjectedIsInside(line, *p_node_1, aux), true); + KRATOS_CHECK_EQUAL(GeometryUtils::ProjectedIsInside(line, *p_node_2, aux), false); + + auto triangle = GenerateExampleTriangle3D(); + + auto p_node_3 = Kratos::make_intrusive>(3, 1.0/3.0, 1.0/3.0, 1.0e-7); + auto p_node_4 = Kratos::make_intrusive>(4, 1.0/3.0, 1.0/3.0, 1.0e-1); + + KRATOS_CHECK_EQUAL(GeometryUtils::ProjectedIsInside(triangle, *p_node_3, aux), true); + KRATOS_CHECK_EQUAL(GeometryUtils::ProjectedIsInside(triangle, *p_node_4, aux), false); + } } // namespace Testing. } // namespace Kratos. From b94f90bf6f44307acb7680d37930d16bd529a243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Tue, 3 Nov 2020 22:35:21 +0100 Subject: [PATCH 12/15] Update --- .../custom_processes/nodal_values_interpolation_process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp index 81b6c424afe8..77216ac4794e 100755 --- a/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp +++ b/applications/MeshingApplication/custom_processes/nodal_values_interpolation_process.cpp @@ -312,7 +312,7 @@ void NodalValuesInterpolationProcess::ExtrapolateValues( GeometryType::CoordinatesArrayType projected_point_local; - const bool is_inside = r_geom.IsInside(projected_point_global.Coordinates( ), projected_point_local); + const bool is_inside = GeometryUtils::ProjectedIsInside(r_geom, projected_point_global.Coordinates( ), projected_point_local); if (is_inside) { // SHAPE FUNCTIONS From 0238b9df3c0d1b7e7818f6453b3d142181316b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Thu, 5 Nov 2020 12:13:55 +0100 Subject: [PATCH 13/15] Update --- kratos/utilities/geometry_utilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos/utilities/geometry_utilities.cpp b/kratos/utilities/geometry_utilities.cpp index 6f0a29d312a1..47d7011f726d 100644 --- a/kratos/utilities/geometry_utilities.cpp +++ b/kratos/utilities/geometry_utilities.cpp @@ -137,7 +137,7 @@ bool GeometryUtils::ProjectedIsInside( } // We check if we are on the plane - if (std::abs(distance) > Tolerance) { + if (std::abs(distance) > std::numeric_limits::epsilon()) { if (std::abs(distance) > 1.0e-6 * rGeometry.Length()) { return false; } From d1241916869189934c6c61435bafd9427d0c2171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Wed, 11 Jan 2023 16:07:27 +0100 Subject: [PATCH 14/15] Fix compilation --- .../test_shifted_boundary_meshless_interface_utility.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp b/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp index d192dc46dd86..33815e5f69fa 100644 --- a/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp +++ b/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp @@ -22,6 +22,7 @@ #include "processes/generic_find_elements_neighbours_process.h" #include "processes/structured_mesh_generator_process.h" #include "utilities/shifted_boundary_meshless_interface_utility.h" +#include "utilities/geometrical_projection_utilities.h" namespace Kratos::Testing { From 03e70daeeb3223e91fcae9615b2909361be86234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Thu, 12 Jan 2023 10:09:28 +0100 Subject: [PATCH 15/15] Partial revert --- kratos/geometries/line_2d_2.h | 1 + .../test_shifted_boundary_meshless_interface_utility.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/kratos/geometries/line_2d_2.h b/kratos/geometries/line_2d_2.h index 16efa7ee24e2..16aec5ebac48 100644 --- a/kratos/geometries/line_2d_2.h +++ b/kratos/geometries/line_2d_2.h @@ -25,6 +25,7 @@ #include "geometries/geometry.h" #include "integration/line_gauss_legendre_integration_points.h" #include "integration/line_collocation_integration_points.h" +#include "utilities/geometrical_projection_utilities.h" namespace Kratos { diff --git a/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp b/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp index 33815e5f69fa..d192dc46dd86 100644 --- a/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp +++ b/kratos/tests/cpp_tests/utilities/test_shifted_boundary_meshless_interface_utility.cpp @@ -22,7 +22,6 @@ #include "processes/generic_find_elements_neighbours_process.h" #include "processes/structured_mesh_generator_process.h" #include "utilities/shifted_boundary_meshless_interface_utility.h" -#include "utilities/geometrical_projection_utilities.h" namespace Kratos::Testing {