From cdcce833215d84142d0dde035ce4f6a37ed8a2f2 Mon Sep 17 00:00:00 2001 From: Antoine KARCHER Date: Mon, 16 Jan 2023 10:43:30 +0100 Subject: [PATCH] Fix MEDCOUPLING compilation issue on Windows --- src/INTERP_KERNEL/VolSurfUser.cxx | 11 ----------- src/INTERP_KERNEL/VolSurfUser.txx | 12 ++++++++++++ src/MEDCoupling/MEDCoupling1GTUMesh.cxx | 2 +- src/MEDCoupling/MEDCouplingMemArray.txx | 5 +++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/INTERP_KERNEL/VolSurfUser.cxx b/src/INTERP_KERNEL/VolSurfUser.cxx index fb9bb90f0..1c4ed1376 100644 --- a/src/INTERP_KERNEL/VolSurfUser.cxx +++ b/src/INTERP_KERNEL/VolSurfUser.cxx @@ -277,15 +277,4 @@ namespace INTERP_KERNEL matrix[11]=-p0[0]*matrix[8]-p0[1]*matrix[9]-p0[2]*matrix[10]; return true; } - - template - void ComputeTriangleHeight(const double *PA, const double *PB, const double *PC, double *res) - { - double AB = getDistanceBtw2Pts(PA,PB); - double BC = getDistanceBtw2Pts(PB,PC); - double CA = getDistanceBtw2Pts(PC,PA); - double perim( (AB+BC+CA)*0.5 ); - double num( 2*sqrt(perim*(perim-AB)*(perim-BC)*(perim-CA)) ); - res[0] = num/AB; res[1] = num/BC; res[2] = num/CA; - } } diff --git a/src/INTERP_KERNEL/VolSurfUser.txx b/src/INTERP_KERNEL/VolSurfUser.txx index e77c74c3e..9ad5ee469 100644 --- a/src/INTERP_KERNEL/VolSurfUser.txx +++ b/src/INTERP_KERNEL/VolSurfUser.txx @@ -23,6 +23,7 @@ #include "VolSurfUser.hxx" #include "VolSurfFormulae.hxx" #include "InterpolationUtils.hxx" +#include "VectorUtils.hxx" #include @@ -434,6 +435,17 @@ namespace INTERP_KERNEL return computeBarycenter(type,connec,lgth,coords,res); throw INTERP_KERNEL::Exception("Invalid spaceDim specified for compute barycenter : must be 1, 2 or 3"); } + + template + void ComputeTriangleHeight(const double *PA, const double *PB, const double *PC, double *res) + { + double AB = getDistanceBtw2Pts(PA,PB); + double BC = getDistanceBtw2Pts(PB,PC); + double CA = getDistanceBtw2Pts(PC,PA); + double perim( (AB+BC+CA)*0.5 ); + double num( 2*sqrt(perim*(perim-AB)*(perim-BC)*(perim-CA)) ); + res[0] = num/AB; res[1] = num/BC; res[2] = num/CA; + } } #endif diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 8b6567583..a5ae41bd0 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -27,7 +27,7 @@ #include "DiameterCalculator.hxx" #include "OrientationInverter.hxx" #include "InterpKernelAutoPtr.hxx" -#include "VolSurfUser.cxx" +#include "VolSurfUser.txx" using namespace MEDCoupling; diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index 01863c854..0a0128161 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -4944,8 +4944,9 @@ struct NotInRange this->checkAllocated(); constexpr char MSG1[] = "DataArrayInt::locateComponentId : single component array expected"; valToSearchIntoTuples->checkNbOfComps(1,MSG1); tupleIdHint->checkNbOfComps(1,MSG1); - auto nbOfCompo( this->getNumberOfComponents() ),thisNbTuples( this->getNumberOfTuples() ); - auto nbOfTuples( valToSearchIntoTuples->getNumberOfTuples() ); + std::size_t nbOfCompo( this->getNumberOfComponents() ); + mcIdType thisNbTuples( this->getNumberOfTuples() ); + mcIdType nbOfTuples( valToSearchIntoTuples->getNumberOfTuples() ); tupleIdHint->checkNbOfTuples(nbOfTuples,"Number of tuples of input arrays must be the same."); const T *cPtr(this->begin()),*valSearchPt(valToSearchIntoTuples->begin()); const mcIdType *tHintPtr(tupleIdHint->begin()); -- 2.39.2