Skip to content

Commit 1b20fc6

Browse files
authored
Merge pull request #3402 from roystgnr/fix_disables
Fix --disable-foo configurations
2 parents 1f2ea31 + 3fb5102 commit 1b20fc6

3 files changed

Lines changed: 41 additions & 34 deletions

File tree

src/utils/xdr_cxx.C

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,13 @@ template <>
925925
void Xdr::data_stream (double * val, const unsigned int len, const unsigned int line_break)
926926
{
927927
this->_xfp_data_stream
928-
(val, len, (xdrproc_t)xdr_double, line_break,
929-
std::numeric_limits<double>::max_digits10);
928+
(val, len,
929+
#ifdef LIBMESH_HAVE_XDR
930+
(xdrproc_t)xdr_double,
931+
#else
932+
nullptr,
933+
#endif
934+
line_break, std::numeric_limits<double>::max_digits10);
930935
}
931936

932937

@@ -935,8 +940,13 @@ template <>
935940
void Xdr::data_stream (float * val, const unsigned int len, const unsigned int line_break)
936941
{
937942
this->_xfp_data_stream
938-
(val, len, (xdrproc_t)xdr_float, line_break,
939-
std::numeric_limits<float>::max_digits10);
943+
(val, len,
944+
#ifdef LIBMESH_HAVE_XDR
945+
(xdrproc_t)xdr_float,
946+
#else
947+
nullptr,
948+
#endif
949+
line_break, std::numeric_limits<float>::max_digits10);
940950
}
941951

942952

@@ -963,11 +973,10 @@ void Xdr::data_stream (Real * val, const unsigned int len, const unsigned int li
963973
template <typename XFP>
964974
void Xdr::_xfp_data_stream (XFP * val, const unsigned int len,
965975
#ifdef LIBMESH_HAVE_XDR
966-
xdrproc_t
976+
xdrproc_t xdr_proc,
967977
#else
968-
void *
978+
void *,
969979
#endif
970-
xdr_proc,
971980
const unsigned int line_break,
972981
const int n_digits)
973982
{

tests/mesh/mesh_triangulation.C

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,18 @@ public:
342342
}
343343

344344

345+
void testTriangulatorTrapMesh (UnstructuredMesh & mesh)
346+
{
347+
// A non-square quad, so we don't have ambiguity about which
348+
// diagonal a Delaunay algorithm will pick.
349+
// Manually-numbered points, so we can use the point numbering as
350+
// a segment ordering even on DistributedMesh.
351+
mesh.add_point(Point(0,0), 0);
352+
mesh.add_point(Point(1,0), 1);
353+
mesh.add_point(Point(1,2), 2);
354+
mesh.add_point(Point(0,1), 3);
355+
}
356+
345357

346358
void testTriangulatorInterp(UnstructuredMesh & mesh,
347359
TriangulatorInterface & triangulator,
@@ -353,7 +365,7 @@ public:
353365
commonSettings(triangulator);
354366

355367
if (!mesh.n_nodes())
356-
testPoly2TriTrapMesh(mesh);
368+
testTriangulatorTrapMesh(mesh);
357369

358370
// Interpolate points!
359371
triangulator.set_interpolate_boundary_points(interpolate_boundary_points);
@@ -868,19 +880,6 @@ public:
868880
testTriangulatorSegments(mesh, p2t_tri);
869881
}
870882

871-
872-
void testPoly2TriTrapMesh (UnstructuredMesh & mesh)
873-
{
874-
// A non-square quad, so we don't have ambiguity about which
875-
// diagonal a Delaunay algorithm will pick.
876-
// Manually-numbered points, so we can use the point numbering as
877-
// a segment ordering even on DistributedMesh.
878-
mesh.add_point(Point(0,0), 0);
879-
mesh.add_point(Point(1,0), 1);
880-
mesh.add_point(Point(1,2), 2);
881-
mesh.add_point(Point(0,1), 3);
882-
}
883-
884883
void testPoly2TriRefinementBase
885884
(UnstructuredMesh & mesh,
886885
const std::vector<TriangulatorInterface::Hole*> * holes,
@@ -941,7 +940,7 @@ public:
941940
LOG_UNIT_TEST;
942941

943942
Mesh mesh(*TestCommWorld);
944-
testPoly2TriTrapMesh(mesh);
943+
testTriangulatorTrapMesh(mesh);
945944
testPoly2TriRefinementBase(mesh, nullptr, 1.5, 15);
946945
}
947946

@@ -950,7 +949,7 @@ public:
950949
LOG_UNIT_TEST;
951950

952951
Mesh mesh(*TestCommWorld);
953-
testPoly2TriTrapMesh(mesh);
952+
testTriangulatorTrapMesh(mesh);
954953
// Make sure we see 0 as "don't refine", not "infinitely refine"
955954
testPoly2TriRefinementBase(mesh, nullptr, 1.5, 2, 0);
956955
}
@@ -961,15 +960,15 @@ public:
961960
LOG_UNIT_TEST;
962961

963962
Mesh mesh(*TestCommWorld);
964-
testPoly2TriTrapMesh(mesh);
963+
testTriangulatorTrapMesh(mesh);
965964
testPoly2TriRefinementBase(mesh, nullptr, 1.5, 150, 0.01);
966965
}
967966

968967
void testPoly2TriNonUniformRefined()
969968
{
970969
ParsedFunction<Real> var_area {"0.002*(1+2*x)*(1+2*y)"};
971970
Mesh mesh(*TestCommWorld);
972-
testPoly2TriTrapMesh(mesh);
971+
testTriangulatorTrapMesh(mesh);
973972
testPoly2TriRefinementBase(mesh, nullptr, 1.5, 150, 0, &var_area);
974973
}
975974

@@ -982,7 +981,7 @@ public:
982981
const std::vector<TriangulatorInterface::Hole*> holes { &diamond };
983982

984983
Mesh mesh(*TestCommWorld);
985-
testPoly2TriTrapMesh(mesh);
984+
testTriangulatorTrapMesh(mesh);
986985
testPoly2TriRefinementBase(mesh, &holes, 1.25, 13);
987986
}
988987

@@ -991,7 +990,7 @@ public:
991990
LOG_UNIT_TEST;
992991

993992
Mesh mesh(*TestCommWorld);
994-
testPoly2TriTrapMesh(mesh);
993+
testTriangulatorTrapMesh(mesh);
995994
Poly2TriTriangulator p2t_tri(mesh);
996995

997996
Real total_area = 1.5;
@@ -1040,7 +1039,7 @@ public:
10401039
// Doing extra refinement here to ensure that we had the
10411040
// *opportunity* to refine the hole boundaries.
10421041
Mesh mesh(*TestCommWorld);
1043-
testPoly2TriTrapMesh(mesh);
1042+
testTriangulatorTrapMesh(mesh);
10441043
testPoly2TriRefinementBase(mesh, &holes, 1.25, n_original_elem, desired_area);
10451044

10461045
// Checking that we have more outer boundary sides than we started
@@ -1078,7 +1077,7 @@ public:
10781077
const std::vector<TriangulatorInterface::Hole*> holes { &diamond };
10791078

10801079
Mesh mesh(*TestCommWorld);
1081-
testPoly2TriTrapMesh(mesh);
1080+
testTriangulatorTrapMesh(mesh);
10821081
testPoly2TriRefinementBase(mesh, &holes, 1.25, 125, 0.01);
10831082
}
10841083

@@ -1090,7 +1089,7 @@ public:
10901089

10911090
ParsedFunction<Real> var_area {"0.002*(0.25+2*x)*(0.25+2*y)"};
10921091
Mesh mesh(*TestCommWorld);
1093-
testPoly2TriTrapMesh(mesh);
1092+
testTriangulatorTrapMesh(mesh);
10941093
testPoly2TriRefinementBase(mesh, &holes, 1.25, 150, 0, &var_area);
10951094
}
10961095

tests/numerics/type_vector_test.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
CPPUNIT_TEST( testVectorMultBase ); \
5151
CPPUNIT_TEST( testVectorAddAssignBase ); \
5252
CPPUNIT_TEST( testVectorSubAssignBase ); \
53-
if (LIBMESH_HAVE_METAPHYSICL) \
54-
CPPUNIT_TEST( testReplaceAlgebraicType );
53+
CPPUNIT_TEST( testReplaceAlgebraicType );
5554

5655

5756
using namespace libMesh;
@@ -494,9 +493,9 @@ class TypeVectorTestBase : public CppUnit::TestCase {
494493
LIBMESH_ASSERT_FP_EQUAL( 2.0 , libmesh_real(avector(2)) , TOLERANCE*TOLERANCE );
495494
}
496495

497-
#ifdef LIBMESH_HAVE_METAPHYSICL
498496
void testReplaceAlgebraicType()
499497
{
498+
#ifdef LIBMESH_HAVE_METAPHYSICL
500499
typedef typename MetaPhysicL::ReplaceAlgebraicType<
501500
std::vector<TypeVector<double>>,
502501
typename TensorTools::IncrementRank<
@@ -505,8 +504,8 @@ class TypeVectorTestBase : public CppUnit::TestCase {
505504
constexpr bool assertion =
506505
std::is_same<ReplacedType, std::vector<TensorValue<double>>>::value;
507506
CPPUNIT_ASSERT(assertion);
508-
}
509507
#endif
508+
}
510509
};
511510

512511
#endif // #ifdef __type_vector_test_h__

0 commit comments

Comments
 (0)