diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c501c2b63d6..c04a33960ee5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -392,6 +392,8 @@ jobs: cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \ -DUSE_MPI=ON \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DBOOST_ROOT="/workspace/boost/boost_1_87_0" \ + -DBoost_NO_SYSTEM_PATHS=ON \ -DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ -DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ -DTRILINOS_LIBRARY_PREFIX="trilinos_" \ @@ -518,7 +520,7 @@ jobs: -DBOOST_ROOT="%TEMP%\boost" ^ -DCMAKE_CXX_FLAGS="/Od /we4661 /we4804 /WX /wd4996" ^ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^ - -DKRATOS_USE_PCH=ON ^ + -DKRATOS_USE_PCH=OFF ^ -DFORCE_LOCAL_ZLIB_COMPILATION=ON || goto :error cmake --build "%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%" --target all_build -- /property:configuration=%KRATOS_BUILD_TYPE% /p:Platform=x64 || goto :error diff --git a/.github/workflows/intel_configure.sh b/.github/workflows/intel_configure.sh index f5aa5867a2d8..949d8057ed33 100644 --- a/.github/workflows/intel_configure.sh +++ b/.github/workflows/intel_configure.sh @@ -60,6 +60,8 @@ cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \ ${KRATOS_CMAKE_OPTIONS_FLAGS} \ -DUSE_MPI=ON \ -DPYTHON_EXECUTABLE="/usr/bin/python3.10" \ +-DBOOST_ROOT="/workspace/boost/boost_1_87_0" \ +-DBoost_NO_SYSTEM_PATHS=ON \ -DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O3 -Wall -Werror-all -diag-disable 1478 -diag-disable 1786" \ -DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \ -DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \ diff --git a/CMakeLists.txt b/CMakeLists.txt index ec703ee2b583..43c963dabced 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.15.0) project (KratosMultiphysics) -set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD 20) set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_EXTENSIONS OFF) @@ -170,6 +170,11 @@ ELSE(CMAKE_VERSION VERSION_LESS "3.16.0") ENDIF(CMAKE_UNITY_BUILD MATCHES ON) ENDIF(CMAKE_VERSION VERSION_LESS "3.16.0") +# Add /utf-8 as a source file encoding flag for MSVC +if(MSVC) + add_compile_options("/utf-8") +endif() + # Get subversion data. This is done automagically by the cmakes include (GenerateExportHeader) diff --git a/README.md b/README.md index cd0336abe190..a5a9d71cb449 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ [license-image]: https://img.shields.io/badge/license-BSD-green.svg?style=flat [license]: https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/license.txt -[c++-image]: https://img.shields.io/badge/C++-17-blue.svg?style=flat&logo=c%2B%2B +[c++-image]: https://img.shields.io/badge/C++-20-blue.svg?style=flat&logo=c%2B%2B [c++standard]: https://isocpp.org/std/the-standard [Nightly-Build]: https://github.com/KratosMultiphysics/Kratos/workflows/Nightly%20Build/badge.svg diff --git a/applications/CoSimulationApplication/custom_external_libraries/CoSimIO/co_sim_io/sources/communication/base_socket_communication.cpp b/applications/CoSimulationApplication/custom_external_libraries/CoSimIO/co_sim_io/sources/communication/base_socket_communication.cpp index a5fb6806d4d4..8f71c4c1e85a 100644 --- a/applications/CoSimulationApplication/custom_external_libraries/CoSimIO/co_sim_io/sources/communication/base_socket_communication.cpp +++ b/applications/CoSimulationApplication/custom_external_libraries/CoSimIO/co_sim_io/sources/communication/base_socket_communication.cpp @@ -19,7 +19,7 @@ namespace CoSimIO { namespace Internals { template -BaseSocketCommunication::~BaseSocketCommunication() +BaseSocketCommunication::~BaseSocketCommunication() { CO_SIM_IO_TRY diff --git a/applications/ConvectionDiffusionApplication/custom_utilities/move_particle_utility.h b/applications/ConvectionDiffusionApplication/custom_utilities/move_particle_utility.h index e58826cef65d..f78e6b5d0d83 100644 --- a/applications/ConvectionDiffusionApplication/custom_utilities/move_particle_utility.h +++ b/applications/ConvectionDiffusionApplication/custom_utilities/move_particle_utility.h @@ -205,7 +205,6 @@ namespace Kratos mvector_of_particle_pointers_vectors.resize(mnelems); //int artz; //std::cin >> artz; - int i_int=0; //careful! it's not the id, but the position inside the array! std::cout << "about to create particles" << std::endl; //now we seed: LOOP IN ELEMENTS //using loop index, DO NOT parallelize this! change lines : mparticles_in_elems_pointers((ii*mmaximum_number_of_particles)+mparticles_in_elems_integers(ii)) = pparticle; and the next one @@ -230,7 +229,6 @@ namespace Kratos Geometry< Node >& geom = ielem->GetGeometry(); //unsigned int elem_id = ielem->Id(); - //mareas_vector[i_int]=CalculateArea(geom); UNUSED SO COMMENTED ComputeGaussPointPositions_initial(geom, pos, N); //we also have the standard (4), and 45 //now we seed the particles in the current element for (unsigned int j = 0; j < pos.size1(); j++) @@ -257,7 +255,6 @@ namespace Kratos number_of_particles++ ; } - ++i_int; } m_nparticles=particle_id; //we save the last particle created as the total number of particles we have. For the moment this is true. @@ -1173,8 +1170,6 @@ namespace Kratos #pragma omp parallel firstprivate(elem_partition) // firstprivate(results)//we will add the nodes in different parts of aux and later assemble everything together, remaming particles ids to get consecutive ids { - unsigned int reused_particles=0; - unsigned int freeparticle = 0; //we start by the first position; int k = OpenMPUtils::ThisThread(); @@ -1273,10 +1268,6 @@ namespace Kratos { KRATOS_THROW_ERROR(std::logic_error, "FINISHED THE LIST AND COULDN'T FIND A FREE CELL FOR THE NEW PARTICLE!", ""); } - else - { - reused_particles++; - } } } diff --git a/applications/FluidDynamicsApplication/custom_elements/dpg_vms.h b/applications/FluidDynamicsApplication/custom_elements/dpg_vms.h index 1c9d6d75e048..16ed7728a9cc 100644 --- a/applications/FluidDynamicsApplication/custom_elements/dpg_vms.h +++ b/applications/FluidDynamicsApplication/custom_elements/dpg_vms.h @@ -450,16 +450,17 @@ class DPGVMS : public VMS ElementBaseType::CalculateLocalVelocityContribution(rDampingMatrix, rRightHandSideVector, rCurrentProcessInfo); //compute boundary term - int boundary_nodes = 0; + // int boundary_nodes = 0; //unsigned int inside_index = -1; - for (unsigned int i = 0; i < TNumNodes; i++) - { - double nd_flag = this->GetGeometry()[i].FastGetSolutionStepValue(FLAG_VARIABLE); - if (nd_flag == 5.0) - boundary_nodes++; - //else - //inside_index = i; - } + + // for (unsigned int i = 0; i < TNumNodes; i++) + // { + // double nd_flag = this->GetGeometry()[i].FastGetSolutionStepValue(FLAG_VARIABLE); + // if (nd_flag == 5.0) + // boundary_nodes++; + // //else + // //inside_index = i; + // } /* if(boundary_nodes == TDim) diff --git a/external_libraries/delaunator-cpp/include/delaunator.hpp b/external_libraries/delaunator-cpp/include/delaunator.hpp index 89d6e54d5ec8..6972878afae3 100644 --- a/external_libraries/delaunator-cpp/include/delaunator.hpp +++ b/external_libraries/delaunator-cpp/include/delaunator.hpp @@ -318,7 +318,7 @@ Delaunator::Delaunator(std::vector const& in_coords) hull_start = i0; - size_t hull_size = 3; + // size_t hull_size = 3; hull_next[i0] = hull_prev[i2] = i1; hull_next[i1] = hull_prev[i0] = i2; @@ -388,7 +388,7 @@ Delaunator::Delaunator(std::vector const& in_coords) hull_tri[i] = legalize(t + 2); hull_tri[e] = t; - hull_size++; + // hull_size++; // walk forward through the hull, adding more triangles and flipping recursively std::size_t next = hull_next[e]; @@ -398,7 +398,7 @@ Delaunator::Delaunator(std::vector const& in_coords) t = add_triangle(next, i, q, hull_tri[i], INVALID_INDEX, hull_tri[next]); hull_tri[i] = legalize(t + 2); hull_next[next] = next; // mark as removed - hull_size--; + // hull_size--; next = q; } @@ -411,7 +411,7 @@ Delaunator::Delaunator(std::vector const& in_coords) legalize(t + 2); hull_tri[q] = t; hull_next[e] = e; // mark as removed - hull_size--; + // hull_size--; e = q; } } diff --git a/kratos/processes/calculate_signed_distance_to_3d_skin_process.h b/kratos/processes/calculate_signed_distance_to_3d_skin_process.h index ad530528ab4c..fbc75426efe0 100644 --- a/kratos/processes/calculate_signed_distance_to_3d_skin_process.h +++ b/kratos/processes/calculate_signed_distance_to_3d_skin_process.h @@ -534,11 +534,6 @@ class CalculateSignedDistanceTo3DSkinProcess array_1d& Npos, array_1d& Nneg) { - //count positives - int n_positives = 0; - for(unsigned int i=0; i0) n_positives++; - //generate the points on the edges at the zero of the distance function //generate "father nodes", defined as the end nodes of the edge on which the local point is located std::vector< Point > edge_points; diff --git a/kratos/processes/flux_corrected_transport_convection_process.h b/kratos/processes/flux_corrected_transport_convection_process.h index ca815908b6a7..00a79ecb561e 100644 --- a/kratos/processes/flux_corrected_transport_convection_process.h +++ b/kratos/processes/flux_corrected_transport_convection_process.h @@ -23,7 +23,6 @@ // Project includes #include "containers/edge_based_data_structure.h" -#include "includes/define.h" #include "processes/process.h" #include "solving_strategies/strategies/butcher_tableau.h" #include "utilities/atomic_utilities.h" @@ -180,12 +179,12 @@ class FluxCorrectedTransportConvectionProcess : public Process const double max_dt = std::min(cfl_dt, mMaxAllowedDt); // Check if the user defined delta time is more restrictive than the CFL one const SizeType n_steps = std::ceil(target_dt / max_dt); // Required number of substeps (rounded up) const double dt = target_dt / n_steps; // Time increment to be used in the substep loop - KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 0) << u8"Solving FCT convection with \u0394t = " << dt << u8" (max allowed \u0394t = " << max_dt << ")" << std::endl; + KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 0) << "Solving FCT convection with \u0394t = " << dt << " (max allowed \u0394t = " << max_dt << ")" << std::endl; // Substepping time loop for (IndexType step = 1; step <= n_steps; ++step) { // Solve current substep - KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 1) << "Substep = " << step << " - Time = " << prev_time << u8" - \u0394t = " << dt << std::endl; + KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 1) << "Substep = " << step << " - Time = " << prev_time << " - \u0394t = " << dt << std::endl; this->SolveSubStep(dt); // Advance in time @@ -962,4 +961,4 @@ inline std::ostream& operator << ( } ///@} -} // namespace Kratos. +} // namespace Kratos. \ No newline at end of file diff --git a/kratos/spatial_containers/bins_dynamic.h b/kratos/spatial_containers/bins_dynamic.h index 1484a1d22ae0..2a9670f740ab 100644 --- a/kratos/spatial_containers/bins_dynamic.h +++ b/kratos/spatial_containers/bins_dynamic.h @@ -73,7 +73,7 @@ class BinsDynamic /// Pointer definition of BinsDynamic KRATOS_CLASS_POINTER_DEFINITION(BinsDynamic); - enum { Dimension = TDimension }; + constexpr static std::size_t Dimension = TDimension; using PointType = TPointType; using BoundingBoxType = BoundingBox; @@ -345,20 +345,20 @@ class BinsDynamic std::array lengths; double average_length = 0.0; - for (int i = 0; i < Dimension; i++) { + for (std::size_t i = 0; i < Dimension; i++) { lengths[i] = GetMaxPoint()[i] - GetMinPoint()[i]; average_length += lengths[i]; } average_length *= 1.0 / 3.0; if (average_length < std::numeric_limits::epsilon()) { - for(int i = 0; i < Dimension; i++) { + for(std::size_t i = 0; i < Dimension; i++) { mN[i] = 1; } return; } - for (int i = 0; i < Dimension; i++) { + for (std::size_t i = 0; i < Dimension; i++) { mN[i] = static_cast(lengths[i] / average_length * (double)average_number_of_cells) + 1; if (mN[i] > 1) { diff --git a/kratos/spatial_containers/bins_dynamic_objects.h b/kratos/spatial_containers/bins_dynamic_objects.h index 68303064fce7..a92186e455ac 100644 --- a/kratos/spatial_containers/bins_dynamic_objects.h +++ b/kratos/spatial_containers/bins_dynamic_objects.h @@ -59,7 +59,7 @@ class BinsObjectDynamic { ///@name Type Definitions ///@{ - enum { Dimension = TConfigure::Dimension }; + constexpr static std::size_t Dimension = TConfigure::Dimension; typedef TConfigure Configure; typedef typename TConfigure::PointType PointType; @@ -73,11 +73,10 @@ class BinsObjectDynamic { typedef TreeNode TreeNodeType; typedef typename TreeNodeType::CoordinateType CoordinateType; // double - typedef typename TreeNodeType::SizeType SizeType; // std::size_t typedef typename TreeNodeType::IndexType IndexType; // std::size_t typedef Tvector CoordinateArray; - typedef Tvector SizeArray; + typedef Tvector SizeArray; typedef Tvector IndexArray; ///typedef TreeNodeType LeafType; @@ -151,7 +150,7 @@ class BinsObjectDynamic { BinsObjectDynamic (const PointType& MinPoint, const PointType& MaxPoint, CoordinateType CellSize) : mObjectsSize(0), mObjectsBegin(0), mObjectsEnd(0) { - for(SizeType i = 0; i < Dimension; i++) { + for(std::size_t i = 0; i < Dimension; i++) { mMinPoint[i] = MinPoint[i]; mMaxPoint[i] = MaxPoint[i]; } @@ -170,10 +169,10 @@ class BinsObjectDynamic { * @param MaxPoint Max point of the boundingbox containing the bins * @param NumPoints Expected number of elements in the bins */ - BinsObjectDynamic (const PointType& MinPoint, const PointType& MaxPoint, SizeType NumPoints) + BinsObjectDynamic (const PointType& MinPoint, const PointType& MaxPoint, std::size_t NumPoints) : mObjectsSize(0), mObjectsBegin(0), mObjectsEnd(0) { - for(SizeType i = 0; i < Dimension; i++) { + for(std::size_t i = 0; i < Dimension; i++) { mMinPoint[i] = MinPoint[i]; mMaxPoint[i] = MaxPoint[i]; } @@ -193,7 +192,7 @@ class BinsObjectDynamic { * @param Result [description] * @return [description] */ - SizeType SearchObjects(PointerType& ThisObject, ResultContainerType& Result) { + std::size_t SearchObjects(PointerType& ThisObject, ResultContainerType& Result) { PointType Low, High; SearchStructureType Box; @@ -211,10 +210,10 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - SizeType SearchObjects(PointerType& ThisObject, ResultIteratorType& Result, const SizeType& MaxNumberOfResults) { + std::size_t SearchObjects(PointerType& ThisObject, ResultIteratorType& Result, const std::size_t& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); @@ -229,7 +228,7 @@ class BinsObjectDynamic { * @param Result [description] * @return [description] */ - SizeType SearchObjectsInCell(const PointType& ThisPoint, ResultIteratorType Result) { + std::size_t SearchObjectsInCell(const PointType& ThisPoint, ResultIteratorType Result) { /// Missing API for 'SearchObjectsInCell' without 'MaxNumberOfResults' KRATOS_ERROR << "Missing implementation of SearchObjectsInCell(PointerType, ResultIteratorType)" << std::endl; } @@ -241,7 +240,7 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - SizeType SearchObjectsInCell(const PointType& ThisPoint, ResultIteratorType Result, const SizeType& MaxNumberOfResults) { + std::size_t SearchObjectsInCell(const PointType& ThisPoint, ResultIteratorType Result, const std::size_t& MaxNumberOfResults) { IndexType icell = CalculateIndex(ThisPoint); if(mCells[icell].Size() < MaxNumberOfResults) { @@ -250,7 +249,7 @@ class BinsObjectDynamic { } return mCells[icell].Size(); } else { - return std::numeric_limits::max(); + return std::numeric_limits::max(); } } @@ -261,7 +260,7 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - SizeType SearchObjectsExclusive(PointerType& ThisObject, ResultIteratorType& Result) { + std::size_t SearchObjectsExclusive(PointerType& ThisObject, ResultIteratorType& Result) { PointType Low, High; SearchStructureType Box; @@ -279,10 +278,10 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - SizeType SearchObjectsExclusive(PointerType& ThisObject, ResultIteratorType& Result, const SizeType& MaxNumberOfResults) { + std::size_t SearchObjectsExclusive(PointerType& ThisObject, ResultIteratorType& Result, const std::size_t& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); @@ -298,7 +297,7 @@ class BinsObjectDynamic { * @param Results [description] * @return [description] */ - SizeType SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results) { + std::size_t SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results) { /// Missing API for 'SearchObjectsInRadius' without 'MaxNumberOfResults' KRATOS_ERROR << "Missing implementation of SearchObjectsInRadius(PointerType, const double, ResultIteratorType)" << std::endl; } @@ -311,10 +310,10 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - SizeType SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, const SizeType& MaxNumberOfResults) { + std::size_t SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, const std::size_t& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); @@ -331,7 +330,7 @@ class BinsObjectDynamic { * @param ResultDistances [description] * @return [description] */ - SizeType SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances) { + std::size_t SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances) { /// Missing API for 'SearchObjectsInRadius' without 'MaxNumberOfResults' KRATOS_ERROR << "Missing implementation of SearchObjectsInRadius(PointerType, const double, ResultIteratorType, DistanceIteratorType)" << std::endl; } @@ -345,10 +344,10 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - SizeType SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances, const SizeType& MaxNumberOfResults) { + std::size_t SearchObjectsInRadius(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances, const std::size_t& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); @@ -365,7 +364,7 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - virtual SizeType SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results) { + virtual std::size_t SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results) { /// Missing API for 'SearchObjectsInRadiusExclusive' without 'MaxNumberOfResults' KRATOS_ERROR << "Missing implementation of SearchObjectsInRadiusExclusive(PointerType, const double, ResultIteratorType)" << std::endl; } @@ -378,10 +377,10 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - virtual SizeType SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, const SizeType& MaxNumberOfResults) { + virtual std::size_t SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, const std::size_t& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); @@ -398,7 +397,7 @@ class BinsObjectDynamic { * @param ResultDistances [description] * @return [description] */ - virtual SizeType SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances) { + virtual std::size_t SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances) { /// Missing API for 'SearchObjectsInRadiusExclusive' without 'MaxNumberOfResults' KRATOS_ERROR << "Missing implementation of SearchObjectsInRadiusExclusive(PointerType, const double, ResultIteratorType, DistanceIteratorType)" << std::endl; } @@ -412,10 +411,10 @@ class BinsObjectDynamic { * @param MaxNumberOfResults [description] * @return [description] */ - virtual SizeType SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances, const SizeType& MaxNumberOfResults) { + virtual std::size_t SearchObjectsInRadiusExclusive(PointerType& ThisObject, const double& Radius, ResultIteratorType& Results, DistanceIteratorType ResultDistances, const std::size_t& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High, Radius); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); @@ -435,7 +434,7 @@ class BinsObjectDynamic { * @param NumberOfResults [description] * @param MaxNumberOfResults [description] */ - void SearchObjectsInRadius(IteratorType const& ThisObjects, SizeType const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector& NumberOfResults, SizeType const& MaxNumberOfResults) { + void SearchObjectsInRadius(IteratorType const& ThisObjects, std::size_t const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector& NumberOfResults, std::size_t const& MaxNumberOfResults) { struct tls_type { @@ -465,7 +464,7 @@ class BinsObjectDynamic { * @param NumberOfResults [description] * @param MaxNumberOfResults [description] */ - void SearchObjectsInRadius(IteratorType const& ThisObjects, SizeType const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector >& ResultsDistances, std::vector& NumberOfResults, SizeType const& MaxNumberOfResults) { + void SearchObjectsInRadius(IteratorType const& ThisObjects, std::size_t const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector >& ResultsDistances, std::vector& NumberOfResults, std::size_t const& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; @@ -492,7 +491,7 @@ class BinsObjectDynamic { * @param NumberOfResults [description] * @param MaxNumberOfResults [description] */ -virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, SizeType const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector& NumberOfResults, SizeType const& MaxNumberOfResults) { +virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, std::size_t const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector& NumberOfResults, std::size_t const& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; @@ -519,7 +518,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz * @param NumberOfResults [description] * @param MaxNumberOfResults [description] */ -virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, SizeType const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector >& ResultsDistances, std::vector& NumberOfResults, SizeType const& MaxNumberOfResults) { +virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, std::size_t const& NumberOfObjects, const std::vector& Radius, std::vector >& Results, std::vector >& ResultsDistances, std::vector& NumberOfResults, std::size_t const& MaxNumberOfResults) { PointType Low, High; SearchStructureType Box; @@ -588,7 +587,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz IndexArray CalculateCell(const GenericCoordType& ThisObject) { IndexArray IndexCell; - for(SizeType i = 0 ; i < Dimension ; i++) { + for(std::size_t i = 0 ; i < Dimension ; i++) { IndexCell[i] = CalculatePosition(ThisObject[i],i); } @@ -605,7 +604,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz IndexType CalculateIndex(const GenericCoordType& ThisObject) { IndexType Index = 0; - for(SizeType iDim = Dimension-1 ; iDim > 0 ; iDim--) { + for(std::size_t iDim = Dimension-1 ; iDim > 0 ; iDim--) { Index += CalculatePosition(ThisObject[iDim],iDim); Index *= mN[iDim-1]; } @@ -621,7 +620,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz * @param ThisDimension [description] * @return [description] */ - virtual IndexType CalculatePosition(CoordinateType const& ThisCoord, const SizeType& ThisDimension) { + virtual IndexType CalculatePosition(CoordinateType const& ThisCoord, const std::size_t& ThisDimension) { CoordinateType d_index = (ThisCoord - mMinPoint[ThisDimension]) * mInvCellSize[ThisDimension]; IndexType index = static_cast( (d_index < 0.00) ? 0.00 : d_index ); @@ -706,17 +705,17 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz */ virtual void PrintData(std::ostream& rOStream, std::string const& Perfix = std::string()) const { rOStream << " BinsSize: "; - for(SizeType i = 0 ; i < Dimension ; i++) { + for(std::size_t i = 0 ; i < Dimension ; i++) { rOStream << "[" << mN[i] << "]"; } rOStream << std::endl; rOStream << " CellSize: "; - for(SizeType i = 0 ; i < Dimension ; i++) { + for(std::size_t i = 0 ; i < Dimension ; i++) { rOStream << "[" << mCellSize[i] << "]"; } rOStream << std::endl; - SizeType nn = 0; - for(SizeType i = 0 ; i < mCells.size(); i++) { + std::size_t nn = 0; + for(std::size_t i = 0 ; i < mCells.size(); i++) { nn += mCells[i].Size(); } rOStream << "NumPointers: " << nn << std::endl; @@ -728,7 +727,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz */ void PrintSize(std::ostream& rout) { rout << " BinsSize: "; - for(SizeType i = 0 ; i < Dimension ; i++) { + for(std::size_t i = 0 ; i < Dimension ; i++) { rout << "[" << mN[i] << "]"; } rout << std::endl; @@ -777,18 +776,18 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz TConfigure::CalculateBoundingBox(*mObjectsBegin,mMinPoint,mMaxPoint); #ifdef _OPENMP - SizeType number_of_threads = omp_get_max_threads(); + std::size_t number_of_threads = omp_get_max_threads(); #else - SizeType number_of_threads = 1; + std::size_t number_of_threads = 1; #endif - std::vector node_partition; + std::vector node_partition; CreatePartition(number_of_threads, mObjectsSize, node_partition); std::vector Max(number_of_threads); std::vector Min(number_of_threads); - for(SizeType k=0; k Low[i]) ? Low[i] : mMinPoint[i]; @@ -809,7 +808,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz auto Epsilon = PointType{mMaxPoint - mMinPoint}; - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) { mMaxPoint[i] += Epsilon[i] * 0.01; mMinPoint[i] -= Epsilon[i] * 0.01; @@ -830,20 +829,20 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz std::array lengths; double average_length = 0.00; - for (int i = 0; i < Dimension; i++) { + for (std::size_t i = 0; i < Dimension; i++) { lengths[i] = mMaxPoint[i] - mMinPoint[i]; average_length += lengths[i]; } average_length *= 1.00 / 3.00; if (average_length < std::numeric_limits::epsilon()) { - for(int i = 0; i < Dimension; i++) { + for(std::size_t i = 0; i < Dimension; i++) { mN[i] = 1; } return; } - for (int i = 0; i < Dimension; i++) { + for (std::size_t i = 0; i < Dimension; i++) { mN[i] = static_cast(lengths[i] / average_length * (double)average_number_of_cells) + 1; if (mN[i] > 1) { @@ -865,11 +864,11 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz */ void AssignCellSize(CoordinateType CellSize) { - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) { mCellSize[i] = CellSize; mInvCellSize[i] = 1.00 / mCellSize[i]; - mN[i] = static_cast( (mMaxPoint[i]-mMinPoint[i]) / mCellSize[i]) + 1; + mN[i] = static_cast( (mMaxPoint[i]-mMinPoint[i]) / mCellSize[i]) + 1; } } @@ -888,8 +887,8 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // **** THREAD SAFE // Dimension = 1 - void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -901,13 +900,13 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -929,14 +928,14 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 3 void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, - SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -967,7 +966,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 1 void SearchInBoxLocal(PointerType& ThisObject, ResultContainerType& Result, - SearchStructure& Box ) + SearchStructure& Box ) { PointType MinCell, MaxCell; @@ -983,12 +982,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 2 void SearchInBoxLocal(PointerType& ThisObject, ResultContainerType& Result, - SearchStructure& Box ) + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1011,12 +1010,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 3 void SearchInBoxLocal(PointerType& ThisObject, ResultContainerType& Result, - SearchStructure& Box ) + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1047,8 +1046,8 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // **** THREAD SAFE // Dimension = 1 - void SearchObjectLocalExclusive(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchObjectLocalExclusive(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -1060,13 +1059,13 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - void SearchObjectLocalExclusive(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchObjectLocalExclusive(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1088,14 +1087,14 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 3 void SearchObjectLocalExclusive(PointerType& ThisObject, ResultIteratorType& Result, - SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1126,7 +1125,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 1 void SearchObjectLocalExclusive(PointerType& ThisObject, ResultContainerType& Result, - SearchStructure& Box ) + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -1140,12 +1139,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 2 void SearchObjectLocalExclusive(PointerType& ThisObject, ResultContainerType& Result, - SearchStructure& Box ) + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1168,12 +1167,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // Dimension = 3 void SearchObjectLocalExclusive(PointerType& ThisObject, ResultContainerType& Result, - SearchStructure& Box ) + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1204,8 +1203,8 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // **** THREAD SAFE // Dimension = 1 - void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -1219,13 +1218,13 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1246,14 +1245,14 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 3 - void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1283,8 +1282,8 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // **** THREAD SAFE // Dimension = 1 - void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -1298,13 +1297,13 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1325,14 +1324,14 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 3 - void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInRadius(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1362,8 +1361,8 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // **** THREAD SAFE // Dimension = 1 - virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -1377,13 +1376,13 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1404,14 +1403,14 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 3 - virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1441,8 +1440,8 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz // **** THREAD SAFE // Dimension = 1 - virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; @@ -1456,13 +1455,13 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1483,14 +1482,14 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 3 - virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + virtual void SearchInRadiusExclusive(PointerType& ThisObject, CoordinateType const& Radius, ResultIteratorType& Result, DistanceIteratorType ResultDistances, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1518,7 +1517,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 1 - void FillObject( SearchStructure& Box, const PointerType& i_object) + void FillObject( SearchStructure& Box, const PointerType& i_object) { PointType MinCell, MaxCell; @@ -1532,12 +1531,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - void FillObject( SearchStructure& Box, const PointerType& i_object) + void FillObject( SearchStructure& Box, const PointerType& i_object) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1558,12 +1557,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 3 - virtual void FillObject( SearchStructure& Box, const PointerType& i_object) + virtual void FillObject( SearchStructure& Box, const PointerType& i_object) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1589,7 +1588,7 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 1 - void RemoveObjectLocal( SearchStructure& Box, const PointerType& i_object) + void RemoveObjectLocal( SearchStructure& Box, const PointerType& i_object) { PointType MinCell, MaxCell; @@ -1603,12 +1602,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 2 - void RemoveObjectLocal( SearchStructure& Box, const PointerType& i_object) + void RemoveObjectLocal( SearchStructure& Box, const PointerType& i_object) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1629,12 +1628,12 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz } // Dimension = 3 - void RemoveObjectLocal( SearchStructure& Box, const PointerType& i_object) + void RemoveObjectLocal( SearchStructure& Box, const PointerType& i_object) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -1661,19 +1660,19 @@ virtual void SearchObjectsInRadiusExclusive(IteratorType const& ThisObjects, Siz void AllocateContainer() { - SizeType Size = mN[0]; - for(SizeType i = 1 ; i < Dimension ; i++) + std::size_t Size = mN[0]; + for(std::size_t i = 1 ; i < Dimension ; i++) Size *= mN[i]; mCells.resize(Size); } - inline void CreatePartition(SizeType number_of_threads, const SizeType number_of_rows, std::vector& partitions) + inline void CreatePartition(std::size_t number_of_threads, const std::size_t number_of_rows, std::vector& partitions) { partitions.resize(number_of_threads+1); - SizeType partition_size = number_of_rows / number_of_threads; + std::size_t partition_size = number_of_rows / number_of_threads; partitions[0] = 0; partitions[number_of_threads] = number_of_rows; - for(SizeType i = 1; i TreeNodeType; - typedef typename TreeNodeType::SizeType SizeType; typedef typename TreeNodeType::IndexType IndexType; typedef typename TreeNodeType::CoordinateType CoordinateType; typedef Tvector CoordinateArray; - typedef Tvector SizeArray; + typedef Tvector SizeArray; typedef Tvector IndexArray; typedef typename TreeNodeType::IteratorIteratorType IteratorIteratorType; @@ -65,15 +64,15 @@ class Bins : public TreeNode LocalContainerType; typedef typename LocalContainerType::iterator LocalIterator; - typedef Tvector CellType; + typedef Tvector CellType; typedef std::vector IteratorVector; typedef typename IteratorVector::iterator IteratorIterator; typedef typename IteratorVector::const_iterator IteratorConstIterator; typedef Kratos::SearchUtils::SearchNearestInRange SearchNearestInRange; - typedef Kratos::SearchUtils::SearchRadiusInRange SearchRadiusInRange; - typedef Kratos::SearchUtils::SearchBoxInRange SearchBoxInRange; + typedef Kratos::SearchUtils::SearchRadiusInRange SearchRadiusInRange; + typedef Kratos::SearchUtils::SearchBoxInRange SearchBoxInRange; // Legacy typedef ( to preserve compativility in case someone was using this definitions) typedef LocalContainerType PointVector; @@ -99,7 +98,7 @@ class Bins : public TreeNode mMaxPoint[i] ) mMaxPoint[i] = (**Point)[i]; @@ -261,20 +260,20 @@ class Bins : public TreeNode lengths; double average_length = 0.00; - for (int i = 0; i < Dimension; i++) { + for (std::size_t i = 0; i < Dimension; i++) { lengths[i] = mMaxPoint[i] - mMinPoint[i]; average_length += lengths[i]; } average_length *= 1.00 / 3.00; if (average_length < std::numeric_limits::epsilon()) { - for(int i = 0; i < Dimension; i++) { + for(std::size_t i = 0; i < Dimension; i++) { mN[i] = 1; } return; } - for (int i = 0; i < Dimension; i++) { + for (std::size_t i = 0; i < Dimension; i++) { mN[i] = static_cast(lengths[i] / average_length * (double)average_number_of_cells) + 1; if (mN[i] > 1) { @@ -291,11 +290,11 @@ class Bins : public TreeNode( (mMaxPoint[i]-mMinPoint[i]) / mCellSize[i]) + 1; + mN[i] = static_cast( (mMaxPoint[i]-mMinPoint[i]) / mCellSize[i]) + 1; } } @@ -303,8 +302,8 @@ class Bins : public TreeNode( (d_index < 0.00) ? 0.00 : d_index ); + IndexType index = static_cast( (d_index < 0.00) ? 0.00 : d_index ); return (index > mN[ThisDimension]-1) ? mN[ThisDimension]-1 : index; } @@ -362,7 +361,7 @@ class Bins : public TreeNode 0 ; iDim--) + for(std::size_t iDim = Dimension-1 ; iDim > 0 ; iDim--) { Index += CalculatePosition(ThisPoint[iDim],iDim); Index *= mN[iDim-1]; @@ -376,7 +375,7 @@ class Bins : public TreeNode 0 ; iDim--) + for(std::size_t iDim = Dimension-1 ; iDim > 0 ; iDim--) { Index += ThisIndex[iDim]; Index *= mN[iDim-1]; @@ -390,7 +389,7 @@ class Bins : public TreeNode ResultsDistances) + void SearchNearestPoint( PointerType const& ThisPoints, std::size_t const& NumberOfPoints, IteratorType &Results, std::vector ResultsDistances) { - IndexPartition(NumberOfPoints).for_each( - [&](SizeType iPoint) + IndexPartition(NumberOfPoints).for_each( + [&](std::size_t iPoint) { Results[iPoint] = SearchNearestPoint((&(*ThisPoints))[iPoint],ResultsDistances[iPoint]); } ); } @@ -558,11 +557,11 @@ class Bins : public TreeNode const& Radius, std::vector Results, - std::vector ResultsDistances, std::vector& NumberOfResults, SizeType const& MaxNumberOfResults ) + void SearchInRadius( PointerType const& ThisPoints, std::size_t const& NumberOfPoints, std::vector const& Radius, std::vector Results, + std::vector ResultsDistances, std::vector& NumberOfResults, std::size_t const& MaxNumberOfResults ) { - IndexPartition(NumberOfPoints).for_each( - [&](SizeType iPoint) + IndexPartition(NumberOfPoints).for_each( + [&](std::size_t iPoint) { NumberOfResults[iPoint] = SearchInRadius((&(*ThisPoints))[iPoint],Radius[iPoint],Results[iPoint],ResultsDistances[iPoint],MaxNumberOfResults); } ); } @@ -615,16 +614,16 @@ class Bins : public TreeNode& Box ) + DistanceIteratorType& ResultsDistances, std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { SearchRadiusInRange()(*(Box.RowBegin),*(Box.RowEnd),ThisPoint,Radius2,Results,ResultsDistances,NumberOfResults,MaxNumberOfResults); } // Dimension = 2 void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results, - DistanceIteratorType& ResultsDistances, SizeType& NumberOfResults, SizeType const& MaxNumberOfResults, - SearchStructure& Box ) + DistanceIteratorType& ResultsDistances, std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) SearchRadiusInRange()(Box.RowBegin[I],Box.RowEnd[I],ThisPoint,Radius2,Results,ResultsDistances,NumberOfResults,MaxNumberOfResults); @@ -632,8 +631,8 @@ class Bins : public TreeNode& Box ) + DistanceIteratorType& ResultsDistances, std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) for(IndexType I = II + Box.Axis[1].Begin() ; I <= II + Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -643,10 +642,10 @@ class Bins : public TreeNode& Box ) + std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { SearchRadiusInRange()(*(Box.RowBegin),*(Box.RowEnd),ThisPoint,Radius2,Results,NumberOfResults,MaxNumberOfResults); } // Dimension = 2 void SearchInRadiusLocal( PointType const& ThisPoint, CoordinateType const& Radius, CoordinateType const& Radius2, IteratorType& Results, - SizeType& NumberOfResults, SizeType const& MaxNumberOfResults, - SearchStructure& Box ) + std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) SearchRadiusInRange()(Box.RowBegin[I],Box.RowEnd[I],ThisPoint,Radius2,Results,NumberOfResults,MaxNumberOfResults); @@ -703,8 +702,8 @@ class Bins : public TreeNode& Box ) + std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) for(IndexType I = II + Box.Axis[1].Begin() ; I <= II + Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -716,7 +715,7 @@ class Bins : public TreeNode& Box, bool& Found ) + SearchStructure& Box, bool& Found ) { Found = false; SearchNearestInRange()( *(Box.RowBegin), *(Box.RowEnd), ThisPoint, ResultPoint, ResultDistance, Found ); @@ -724,7 +723,7 @@ class Bins : public TreeNode& Box, bool& Found ) + SearchStructure& Box, bool& Found ) { Found = false; for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -733,7 +732,7 @@ class Bins : public TreeNode& Box, bool& Found ) + SearchStructure& Box, bool& Found ) { Found = false; for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) @@ -746,7 +745,7 @@ class Bins : public TreeNode& Box, bool& Found ) + SearchStructure& Box, bool& Found ) { Found = false; SearchNearestInnerInRange( *(Box.RowBegin), *(Box.RowEnd), ThisPoint, ResultPoint, ResultDistance, Found ); @@ -754,7 +753,7 @@ class Bins : public TreeNode& Box, bool& Found ) + SearchStructure& Box, bool& Found ) { Found = false; for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -763,7 +762,7 @@ class Bins : public TreeNode& Box, bool& Found ) + SearchStructure& Box, bool& Found ) { Found = false; for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) @@ -793,10 +792,10 @@ class Bins : public TreeNode& Box ) + std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { SearchBoxInRange()(SearchMinPoint,SearchMaxPoint,*(Box.RowBegin),*(Box.RowEnd),ResultsPoint,NumberOfResults,MaxNumberOfResults); } // Dimension = 2 void SearchInBoxLocal( PointType const& SearchMinPoint, PointType const& SearchMaxPoint, IteratorType& ResultsPoint, - SizeType& NumberOfResults, SizeType const& MaxNumberOfResults, - SearchStructure& Box ) + std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) SearchBoxInRange()(SearchMinPoint,SearchMaxPoint,Box.RowBegin[I],Box.RowEnd[I],ResultsPoint,NumberOfResults,MaxNumberOfResults); @@ -833,8 +832,8 @@ class Bins : public TreeNode& Box ) + std::size_t& NumberOfResults, std::size_t const& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) for(IndexType I = II + Box.Axis[1].Begin() ; I <= II + Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -874,7 +873,7 @@ class Bins : public TreeNode TreeNodeType; typedef typename TreeNodeType::CoordinateType CoordinateType; // double - typedef typename TreeNodeType::SizeType SizeType; // std::size_t typedef typename TreeNodeType::IndexType IndexType; // std::size_t typedef Tvector CoordinateArray; - typedef Tvector SizeArray; + typedef Tvector SizeArray; typedef Tvector IndexArray; typedef typename TreeNodeType::IteratorIteratorType IteratorIteratorType; @@ -124,7 +123,7 @@ class BinsObjectStatic GenerateBins(); } - BinsObjectStatic (IteratorType const& ObjectsBegin, IteratorType const& ObjectsEnd, const SizeType Nx, const SizeType Ny, const SizeType Nz ) + BinsObjectStatic (IteratorType const& ObjectsBegin, IteratorType const& ObjectsEnd, const std::size_t Nx, const std::size_t Ny, const std::size_t Nz ) : mObjectsBegin(ObjectsBegin), mObjectsEnd(ObjectsEnd) { CalculateBoundingBox(); @@ -135,8 +134,8 @@ class BinsObjectStatic double delta[Dimension]; // double mult_delta = 1.00; - SizeType index = 0; - for(SizeType i = 0 ; i < Dimension ; i++) + std::size_t index = 0; + for(std::size_t i = 0 ; i < Dimension ; i++) { delta[i] = mMaxPoint[i] - mMinPoint[i]; if ( delta[i] > delta[index] ) @@ -144,7 +143,7 @@ class BinsObjectStatic delta[i] = (delta[i] == 0.00) ? 1.00 : delta[i]; } - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) { mCellSize[i] = delta[i] / mN[i]; mInvCellSize[i] = 1.00 / mCellSize[i]; @@ -199,12 +198,12 @@ class BinsObjectStatic { // Container Size rOStream << " Container Size: "; - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) rOStream << "[" << mN[i] << "]"; rOStream << std::endl; // CellSize rOStream << " Cell Size: "; - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) rOStream << "[" << mCellSize[i] << "]"; rOStream << std::endl; rOStream << " Contained Objects: " << SearchUtils::PointerDistance(mObjectsBegin,mObjectsEnd) << std::endl; @@ -215,7 +214,7 @@ class BinsObjectStatic void PrintSize( std::ostream& rout ) { rout << " Container Size: "; - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) rout << "[" << this->mN[i] << "]"; rout << std::endl; } @@ -409,12 +408,12 @@ class BinsObjectStatic PointType Low, High; SearchStructureType Box; -// SizeType n_objects = SearchUtils::PointerDistance(mObjectsBegin,mObjectsEnd); /// WARNING +// std::size_t n_objects = SearchUtils::PointerDistance(mObjectsBegin,mObjectsEnd); /// WARNING // Allocate CellAcess - SizeType Size = 1; - for(SizeType i = 0 ; i < Dimension ; i++) + std::size_t Size = 1; + for(std::size_t i = 0 ; i < Dimension ; i++) Size *= mN[i]; mObjectsAccess.resize(Size+1,0); @@ -461,7 +460,7 @@ class BinsObjectStatic //************************************************************************ // Dimension = 1 - void CountObject( SearchStructure& Box, PointerType object) + void CountObject( SearchStructure& Box, PointerType object) { PointType MinCell, MaxCell; @@ -477,12 +476,12 @@ class BinsObjectStatic //************************************************************************ // Dimension = 2 - void CountObject( SearchStructure& Box, PointerType object ) + void CountObject( SearchStructure& Box, PointerType object ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -504,12 +503,12 @@ class BinsObjectStatic //************************************************************************ // Dimension = 3 - void CountObject( SearchStructure& Box, PointerType object ) + void CountObject( SearchStructure& Box, PointerType object ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -535,11 +534,11 @@ class BinsObjectStatic //************************************************************************ //************************************************************************ - SizeType SearchObjects(PointerType& ThisObject, ResultIteratorType& Result, const SizeType& MaxNumberOfResults ) + std::size_t SearchObjects(PointerType& ThisObject, ResultIteratorType& Result, const std::size_t& MaxNumberOfResults ) { PointType Low, High; SearchStructureType Box; - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; TConfigure::CalculateBoundingBox(ThisObject, Low, High); Box.Set( CalculateCell(Low), CalculateCell(High), mN ); SearchInBoxLocal(ThisObject, Result, NumberOfResults, MaxNumberOfResults, Box ); @@ -550,7 +549,7 @@ class BinsObjectStatic //************************************************************************ //************************************************************************ - SizeType SearchObjects(PointerType& ThisObject, ResultContainerType& Result) + std::size_t SearchObjects(PointerType& ThisObject, ResultContainerType& Result) { PointType Low, High; SearchStructureType Box; @@ -573,9 +572,9 @@ class BinsObjectStatic //************************************************************************ //************************************************************************ /* - SizeType SearchContact(IteratorContactType& Result, const SizeType& MaxNumberOfResults ) + std::size_t SearchContact(IteratorContactType& Result, const std::size_t& MaxNumberOfResults ) { - SizeType NumberOfResults = 0; + std::size_t NumberOfResults = 0; for (CellContainerIterator icell = mCells.begin() ; icell!= mCells.end(); icell++) if(icell->Size()>1) icell->SearchContact(Result, NumberOfResults, MaxNumberOfResults); @@ -585,7 +584,7 @@ class BinsObjectStatic //************************************************************************ //************************************************************************ - void SearchObjectRow(PointerType& ThisObject, LocalIteratorType RowBegin, LocalIteratorType RowEnd, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults) + void SearchObjectRow(PointerType& ThisObject, LocalIteratorType RowBegin, LocalIteratorType RowEnd, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults) { for(LocalIteratorType iter = RowBegin ; iter != RowEnd && NumberOfResults < MaxNumberOfResults ; iter++) { @@ -604,23 +603,23 @@ class BinsObjectStatic // **** THREAD SAFE // Dimension = 1 - void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { SearchObjectRow(ThisObject,mObjectList.begin()+mObjectsAccess[Box.Axis[0].Begin()],mObjectList.begin()+mObjectsAccess[Box.Axis[0].End()+1],Result,NumberOfResults,MaxNumberOfResults); } // Dimension = 2 - void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) SearchObjectRow(ThisObject,mObjectList.begin()+mObjectsAccess[I+Box.Axis[0].Begin()],mObjectList.begin()+mObjectsAccess[I+Box.Axis[0].End()+1],Result,NumberOfResults,MaxNumberOfResults); } // Dimension = 3 - void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInBoxLocal(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) for(IndexType I = II + Box.Axis[1].Begin() ; I <= II + Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -628,14 +627,14 @@ class BinsObjectStatic } // Dimension = 3 - void SearchInBoxLocal_(PointerType& ThisObject, ResultIteratorType& Result, SizeType& NumberOfResults, const SizeType& MaxNumberOfResults, - SearchStructure& Box ) + void SearchInBoxLocal_(PointerType& ThisObject, ResultIteratorType& Result, std::size_t& NumberOfResults, const std::size_t& MaxNumberOfResults, + SearchStructure& Box ) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; IndexType objects_begin, objects_end; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -694,14 +693,14 @@ class BinsObjectStatic // Dimension = 1 void SearchInBoxLocal(PointerType& ThisObject, ResultContainerType& Results, - SearchStructure& Box ) + SearchStructure& Box ) { SearchObjectRow(ThisObject,mObjectList.begin()+mObjectsAccess[Box.Axis[0].Begin()],mObjectList.begin()+mObjectsAccess[Box.Axis[0].End()+1],Results); } // Dimension = 2 void SearchInBoxLocal(PointerType& ThisObject, ResultContainerType& Results, - SearchStructure& Box ) + SearchStructure& Box ) { for(IndexType I = Box.Axis[1].Begin() ; I <= Box.Axis[1].End() ; I += Box.Axis[1].Block ) SearchObjectRow(ThisObject,mObjectList.begin()+mObjectsAccess[I+Box.Axis[0].Begin()],mObjectList.begin()+mObjectsAccess[I+Box.Axis[0].End()+1],Results); @@ -709,7 +708,7 @@ class BinsObjectStatic // Dimension = 3 void SearchInBoxLocal(PointerType& ThisObject, ResultContainerType& Results, - SearchStructure& Box ) + SearchStructure& Box ) { for(IndexType II = Box.Axis[2].Begin() ; II <= Box.Axis[2].End() ; II += Box.Axis[2].Block ) for(IndexType I = II + Box.Axis[1].Begin() ; I <= II + Box.Axis[1].End() ; I += Box.Axis[1].Block ) @@ -724,7 +723,7 @@ class BinsObjectStatic Tvector CalculateCell( const PointType& ThisPoint ) { Tvector Cell; - for(SizeType i = 0 ; i < Dimension ; i++) + for(std::size_t i = 0 ; i < Dimension ; i++) Cell[i] = CalculatePosition(ThisPoint[i],i); return Cell; } @@ -734,7 +733,7 @@ class BinsObjectStatic //************************************************************************ // Dimension = 1 - void FillObject( SearchStructure& Box, const PointerType& object) + void FillObject( SearchStructure& Box, const PointerType& object) { PointType MinCell, MaxCell; @@ -747,12 +746,12 @@ class BinsObjectStatic // Dimension = 2 - void FillObject( SearchStructure& Box, const PointerType& object) + void FillObject( SearchStructure& Box, const PointerType& object) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 2; i++) + for(std::size_t i = 0; i < 2; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -772,12 +771,12 @@ class BinsObjectStatic // Dimension = 3 - void FillObject( SearchStructure& Box, const PointerType& object) + void FillObject( SearchStructure& Box, const PointerType& object) { PointType MinCell, MaxCell; PointType MinBox, MaxBox; - for(SizeType i = 0; i < 3; i++) + for(std::size_t i = 0; i < 3; i++) { MinBox[i] = static_cast(Box.Axis[i].Min) * mCellSize[i] + mMinPoint[i]; // MaxBox[i] = MinBox[i] + mCellSize[i]; @@ -804,7 +803,7 @@ class BinsObjectStatic //************************************************************************ - IndexType CalculatePosition( CoordinateType const& ThisCoord, SizeType& ThisDimension ) + IndexType CalculatePosition( CoordinateType const& ThisCoord, std::size_t& ThisDimension ) { CoordinateType d_index = (ThisCoord - mMinPoint[ThisDimension]) * mInvCellSize[ThisDimension]; IndexType index = static_cast( (d_index < 0.00) ? 0.00 : d_index ); diff --git a/kratos/utilities/body_distance_calculation_utils.h b/kratos/utilities/body_distance_calculation_utils.h index 2e83e98af332..76784da2277d 100644 --- a/kratos/utilities/body_distance_calculation_utils.h +++ b/kratos/utilities/body_distance_calculation_utils.h @@ -350,12 +350,10 @@ class BodyDistanceCalculationUtils //approximate computation of distance on failed nodes - unsigned int confirmed_failures = 0; for (PointerVector< Node >::iterator it = failed_nodes.begin(); it != failed_nodes.end(); it++) { if (it->GetValue(IS_VISITED) != 1 ) //it was not possible to calculate the distance { - confirmed_failures++; double davg = 0.0; double counter = 0.0; for (GlobalPointersVector< Node >::iterator in = it->GetValue(NEIGHBOUR_NODES).begin(); in != it->GetValue(NEIGHBOUR_NODES).end(); in++) diff --git a/kratos/utilities/enrichment_utilities.h b/kratos/utilities/enrichment_utilities.h index 3459f2eef872..ad05a9c9d5f5 100644 --- a/kratos/utilities/enrichment_utilities.h +++ b/kratos/utilities/enrichment_utilities.h @@ -1238,7 +1238,6 @@ class EnrichmentUtilities BoundedMatrix coord_subdomain; //used to pass arguments when we must calculate areas, shape functions, etc BoundedMatrix DN_DX_subdomain; //used to retrieve derivatives - double most_common_sign=0; //the side of the cut in which two nodes are found (same sign) will be the ones that remains unchanged when builing the discontinuity double Area;//area of the complete element rGPShapeFunctionValues(0,0)=one_third; rGPShapeFunctionValues(0,1)=one_third; @@ -1392,12 +1391,10 @@ class EnrichmentUtilities if (rDistances[i] < 0.0) { exact_distance[i] = -abs_distance[i]; - --most_common_sign; } else { exact_distance[i] = abs_distance[i]; - ++most_common_sign; } } diff --git a/kratos/utilities/iso_printer.h b/kratos/utilities/iso_printer.h index 5cb951c1de68..daf3d2ff3d3e 100644 --- a/kratos/utilities/iso_printer.h +++ b/kratos/utilities/iso_printer.h @@ -148,13 +148,11 @@ class IsosurfacePrinterApplication //now we have to search for the conditions. they can only be triangles, otherwise -> not stored - int number_of_local_conditions=0; for (ModelPart::ConditionsContainerType::iterator it = this_model_part.ConditionsBegin(); it != this_model_part.ConditionsEnd(); it++) { Geometry& geom = it->GetGeometry(); if (geom.size()==3) { - ++number_of_local_conditions; //conditions are always owned for (unsigned int i = 0; i < geom.size(); i++) { int node_position = this_model_part.Nodes().find(geom[i].Id()) - it_begin_node_old; //probably there-s a better way to do this, i only need the position in the array, (not the ID) @@ -201,13 +199,11 @@ class IsosurfacePrinterApplication array_1d list_matching_nodes; // used to save the new nodes that match exactly old nodes (very unlikely, but might be 4 for very plane elements) unsigned int exact_nodes = 0; unsigned int outside_nodes = 0; - int current_element=0; int number_of_cuts=0; for (ElementsArrayType::iterator it = it_begin; it != it_end; ++it) { bool print_element=false; - ++current_element; number_of_cuts = 0; exact_nodes = 0; outside_nodes = 0; @@ -294,13 +290,11 @@ class IsosurfacePrinterApplication array_1d list_matching_nodes; // used to save the new nodes that match exactly old nodes (very unlikely, but might be 4 for very plane elements) unsigned int exact_nodes = 0; unsigned int outside_nodes = 0; - int current_element=0; int number_of_cuts=0; for (ElementsArrayType::iterator it = it_begin; it != it_end; ++it) { bool print_element=false; - ++current_element; number_of_cuts = 0; exact_nodes = 0; outside_nodes = 0; @@ -399,13 +393,11 @@ class IsosurfacePrinterApplication array_1d list_matching_nodes; // used to save the new nodes that match exactly old nodes (very unlikely, but might be 4 for very plane elements) unsigned int exact_nodes = 0; unsigned int outside_nodes = 0; - int current_element=0; int number_of_cuts=0; for (ElementsArrayType::iterator it = it_begin; it != it_end; ++it) { bool print_element=false; - ++current_element; number_of_cuts = 0; exact_nodes = 0; outside_nodes = 0;