Commit 9919134d authored by BLANCHARD Pierre's avatar BLANCHARD Pierre

Resolved some warnings related to float/double conversion.

parent 88be8bd4
......@@ -631,7 +631,7 @@ public:
if (ndata != typeFReal[1]){
typeFReal[1] = ndata;
}
FReal x = boxWidth *0.5;
FReal x = boxWidth * FReal(0.5);
if(this->binaryFile) {
this->writerBinaryHeader(centerOfBox,x,nbParticles,typeFReal);
}
......@@ -654,7 +654,7 @@ public:
void writeHeader(const FPoint<FReal> &centerOfBox,const FReal &boxWidth, const FSize &nbParticles,
const unsigned int dataType, const unsigned int nbDataPerRecord) {
unsigned int typeFReal[2] = {dataType , nbDataPerRecord };
FReal x = boxWidth *0.5;
FReal x = boxWidth * FReal(0.5);
if(this->binaryFile) {
this->writerBinaryHeader(centerOfBox,x,nbParticles,typeFReal);
}
......
......@@ -144,7 +144,7 @@ public:
{ 1, 1, -1},
{ 1, 1, 1} };
// Translate center if cell widths are extended
const FReal frac = (1. - ExtendedCellRatio);
const FReal frac = (FReal(1.) - ExtendedCellRatio);
ChildCenter.setX(FReal(RelativeChildPositions[ChildIndex][0]) * frac);
ChildCenter.setY(FReal(RelativeChildPositions[ChildIndex][1]) * frac);
......
......@@ -121,7 +121,7 @@ class FUnifInterpolator : FNoCopyable
FReal(FReal(ParentWidth)/FReal(2.) + CellWidthExtension) / FReal(ParentWidth + CellWidthExtension);
// Child cell width
const FReal ChildWidth(2.*ExtendedCellRatio);
const FReal ChildWidth(FReal(2.)*ExtendedCellRatio);
// loop: child cells
for (unsigned int child=0; child<8; ++child) {
......
......@@ -75,9 +75,9 @@ struct FUnifRoots : FNoCopyable
// NB: scale factor could be hardcoded (just as the roots)
FReal scale;
int omn = order-n-1;
if(omn%2) scale=-1.; // (-1)^(n-1-(k+1)+1)=(-1)^(omn-1)
else scale=1.;
scale/=FMath::pow(2.,order-1)*FMath::factorial<FReal>(n)*FMath::factorial<FReal>(omn);
if(omn%2) scale=FReal(-1.); // (-1)^(n-1-(k+1)+1)=(-1)^(omn-1)
else scale=FReal(1.);
scale/=FReal(FMath::pow(FReal(2.),order-1)*FMath::factorial<FReal>(n)*FMath::factorial<FReal>(omn));
// compute L
FReal L=FReal(1.);
......@@ -88,7 +88,7 @@ struct FUnifRoots : FNoCopyable
// new version (reducing round-off)
// regular grid on [-1,1] (h simplifies, only the size of the domain and a remains i.e. 2. and -1.)
L *= ((order-1)*(x+1.)-2.*m);
L *= (FReal(order-1)*(x+FReal(1.))-FReal(2.)*FReal(m));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment