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

Resolved some warnings related to float/double conversion.

parent 88be8bd4
...@@ -631,7 +631,7 @@ public: ...@@ -631,7 +631,7 @@ public:
if (ndata != typeFReal[1]){ if (ndata != typeFReal[1]){
typeFReal[1] = ndata; typeFReal[1] = ndata;
} }
FReal x = boxWidth *0.5; FReal x = boxWidth * FReal(0.5);
if(this->binaryFile) { if(this->binaryFile) {
this->writerBinaryHeader(centerOfBox,x,nbParticles,typeFReal); this->writerBinaryHeader(centerOfBox,x,nbParticles,typeFReal);
} }
...@@ -654,7 +654,7 @@ public: ...@@ -654,7 +654,7 @@ public:
void writeHeader(const FPoint<FReal> &centerOfBox,const FReal &boxWidth, const FSize &nbParticles, void writeHeader(const FPoint<FReal> &centerOfBox,const FReal &boxWidth, const FSize &nbParticles,
const unsigned int dataType, const unsigned int nbDataPerRecord) { const unsigned int dataType, const unsigned int nbDataPerRecord) {
unsigned int typeFReal[2] = {dataType , nbDataPerRecord }; unsigned int typeFReal[2] = {dataType , nbDataPerRecord };
FReal x = boxWidth *0.5; FReal x = boxWidth * FReal(0.5);
if(this->binaryFile) { if(this->binaryFile) {
this->writerBinaryHeader(centerOfBox,x,nbParticles,typeFReal); this->writerBinaryHeader(centerOfBox,x,nbParticles,typeFReal);
} }
......
...@@ -144,7 +144,7 @@ public: ...@@ -144,7 +144,7 @@ public:
{ 1, 1, -1}, { 1, 1, -1},
{ 1, 1, 1} }; { 1, 1, 1} };
// Translate center if cell widths are extended // 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.setX(FReal(RelativeChildPositions[ChildIndex][0]) * frac);
ChildCenter.setY(FReal(RelativeChildPositions[ChildIndex][1]) * frac); ChildCenter.setY(FReal(RelativeChildPositions[ChildIndex][1]) * frac);
......
...@@ -121,7 +121,7 @@ class FUnifInterpolator : FNoCopyable ...@@ -121,7 +121,7 @@ class FUnifInterpolator : FNoCopyable
FReal(FReal(ParentWidth)/FReal(2.) + CellWidthExtension) / FReal(ParentWidth + CellWidthExtension); FReal(FReal(ParentWidth)/FReal(2.) + CellWidthExtension) / FReal(ParentWidth + CellWidthExtension);
// Child cell width // Child cell width
const FReal ChildWidth(2.*ExtendedCellRatio); const FReal ChildWidth(FReal(2.)*ExtendedCellRatio);
// loop: child cells // loop: child cells
for (unsigned int child=0; child<8; ++child) { for (unsigned int child=0; child<8; ++child) {
......
...@@ -75,9 +75,9 @@ struct FUnifRoots : FNoCopyable ...@@ -75,9 +75,9 @@ struct FUnifRoots : FNoCopyable
// NB: scale factor could be hardcoded (just as the roots) // NB: scale factor could be hardcoded (just as the roots)
FReal scale; FReal scale;
int omn = order-n-1; int omn = order-n-1;
if(omn%2) scale=-1.; // (-1)^(n-1-(k+1)+1)=(-1)^(omn-1) if(omn%2) scale=FReal(-1.); // (-1)^(n-1-(k+1)+1)=(-1)^(omn-1)
else scale=1.; else scale=FReal(1.);
scale/=FMath::pow(2.,order-1)*FMath::factorial<FReal>(n)*FMath::factorial<FReal>(omn); scale/=FReal(FMath::pow(FReal(2.),order-1)*FMath::factorial<FReal>(n)*FMath::factorial<FReal>(omn));
// compute L // compute L
FReal L=FReal(1.); FReal L=FReal(1.);
...@@ -88,7 +88,7 @@ struct FUnifRoots : FNoCopyable ...@@ -88,7 +88,7 @@ struct FUnifRoots : FNoCopyable
// new version (reducing round-off) // 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.) // 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));
} }
} }
......
Supports Markdown
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