Commit 1c22cc6a authored by snuverink_j's avatar snuverink_j
Browse files

Merge branch '512-compiler-errors-in-tests-ippl_src-with-clang9' into 'master'

Resolve "compiler errors in tests/ippl_src with clang9"

Closes #512

See merge request !332
parents deca1fc5 c8e787e9
......@@ -1563,7 +1563,7 @@ getVertRangeVolume(const NDIndex<Dim>& ndi) const
}
// Compute volume of rectangular solid beweeen these extremal vertices:
MFLOAT volume = 1.0;
for (d=0; d<Dim; d++) volume *= abs(v1(d) - v0(d));
for (d=0; d<Dim; d++) volume *= std::abs(v1(d) - v0(d));
return volume;
}
// Volume of range of cells spanned by input NDIndex (index of cells):
......@@ -1593,7 +1593,7 @@ getCellRangeVolume(const NDIndex<Dim>& ndi) const
}
// Compute volume of rectangular solid beweeen these extremal vertices:
MFLOAT volume = 1.0;
for (unsigned int d=0; d<Dim; d++) volume *= abs(v1(d) - v0(d));
for (unsigned int d=0; d<Dim; d++) volume *= std::abs(v1(d) - v0(d));
return volume;
}
......
......@@ -1202,9 +1202,9 @@ TEST(Field, SimpleTest8)
Vektor<double,D3> p1(8,9,10);
Vektor<unsigned,D3> N(static_cast<unsigned> (ceil( (abs(boxMin[0])+boxMax[0])/h[0])),
static_cast<unsigned> (ceil( (abs(boxMin[1])+boxMax[1])/h[1])),
static_cast<unsigned> (ceil( (abs(boxMin[2])+boxMax[2])/h[2])));
Vektor<unsigned,D3> N(static_cast<unsigned> (std::ceil( (std::abs(boxMin[0])+boxMax[0])/h[0])),
static_cast<unsigned> (std::ceil( (std::abs(boxMin[1])+boxMax[1])/h[1])),
static_cast<unsigned> (std::ceil( (std::abs(boxMin[2])+boxMax[2])/h[2])));
std::cout << "orig= " << boxMin << " maxext= " << boxMax << std::endl;
std::cout << "h= " << h << " N= " << N << std::endl;
......
......@@ -121,7 +121,7 @@ TEST(Meshes, Cartesian)
assign(vectorVert, mesh.getVertexPositionField(vectorVert));
scalarCell = Div(vectorVert, scalarCell);
// The value should be 3.0 for all elements; test this:
EXPECT_NEAR(abs(sum(scalarCell)/totcells), 1.0*D, roundOffError);
EXPECT_NEAR(std::abs(sum(scalarCell)/totcells), 1.0*D, roundOffError);
//---------------------------------------------------------------------------
// --------------------------------------------------------------------------
......@@ -160,7 +160,7 @@ TEST(Meshes, Cartesian)
double magDiffVectorVert = 0.0;
for (d = 0; d < D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d);
magDiffVectorVert = sqrt(magDiffVectorVert);
EXPECT_NEAR(abs(magDiffVectorVert), 0, roundOffError);
EXPECT_NEAR(std::abs(magDiffVectorVert), 0, roundOffError);
//---------------------------------------------------------------------------
// --------------------------------------------------------------------------
......@@ -198,7 +198,7 @@ TEST(Meshes, Cartesian)
double magDiffVectorCell = 0.0;
for (d = 0; d < D; d++) magDiffVectorCell += diffVectorCell(d)*diffVectorCell(d);
magDiffVectorCell = sqrt(magDiffVectorCell);
EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError);
EXPECT_NEAR(std::abs(magDiffVectorCell), 0, roundOffError);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
......@@ -224,7 +224,7 @@ TEST(Meshes, Cartesian)
magDiffVectorVert = 0.0;
for (d = 0; d < D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d);
magDiffVectorVert = sqrt(magDiffVectorVert);
EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError);
EXPECT_NEAR(std::abs(magDiffVectorCell), 0, roundOffError);
//---------------------------------------------------------------------------
// --------------------------------------------------------------------------
......@@ -249,7 +249,7 @@ TEST(Meshes, Cartesian)
magDiffTensorCell += diffTensorCell(d,d2)*diffTensorCell(d,d2);
}
}
EXPECT_NEAR(abs(magDiffTensorCell), 0, roundOffError);
EXPECT_NEAR(std::abs(magDiffTensorCell), 0, roundOffError);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
......
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