Skip to content

Commit 140bce1

Browse files
authored
Merge pull request #4116 from roystgnr/verify_verify
verify() doesn't actually do assert() by itself.
2 parents 25ab562 + e650d33 commit 140bce1

5 files changed

Lines changed: 13 additions & 15 deletions

File tree

include/parallel/parallel_algebra.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ struct TypeVectorAttributes
144144
static const bool has_min_max = true;
145145
static void set_lowest(V & x) {
146146
for (int d=0; d != LIBMESH_DIM; ++d)
147-
TIMPI::Attributes<decltype(x(d))>::set_lowest(x(d));
147+
TIMPI::Attributes<typename std::remove_reference<decltype(x(d))>::type>::set_lowest(x(d));
148148
}
149149
static void set_highest(V & x) {
150150
for (int d=0; d != LIBMESH_DIM; ++d)
151-
TIMPI::Attributes<decltype(x(d))>::set_highest(x(d));
151+
TIMPI::Attributes<typename std::remove_reference<decltype(x(d))>::type>::set_highest(x(d));
152152
}
153153
};
154154

src/mesh/mesh_tools.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ void libmesh_assert_equal_points (const MeshBase & mesh)
16071607
{
16081608
const Point * p = mesh.query_node_ptr(i);
16091609

1610-
mesh.comm().semiverify(p);
1610+
libmesh_assert(mesh.comm().semiverify(p));
16111611
}
16121612
}
16131613

@@ -1628,7 +1628,7 @@ void libmesh_assert_equal_connectivity (const MeshBase & mesh)
16281628
for (auto n : e->node_index_range())
16291629
nodes.push_back(e->node_id(n));
16301630

1631-
mesh.comm().semiverify(e ? &nodes : nullptr);
1631+
libmesh_assert(mesh.comm().semiverify(e ? &nodes : nullptr));
16321632
}
16331633
}
16341634

src/numerics/static_condensation.C

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,7 @@ StaticCondensation::close()
363363
if (!_have_cached_values)
364364
{
365365
const bool closed = _reduced_sys_mat->closed();
366-
#ifndef NDEBUG
367-
_communicator.verify(closed);
368-
#endif
366+
libmesh_assert(_communicator.verify(closed));
369367
if (!closed)
370368
_reduced_sys_mat->close();
371369
return;

src/reduced_basis/rb_construction_base.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void RBConstructionBase<Base>::load_training_set(const std::map<std::string, std
393393
// Check that (new_training_set.size() == get_n_params()) is the same on all processes so that
394394
// we go into the same branch of the "if" statement below on all processes.
395395
const bool size_matches = (new_training_set.size() == n_params);
396-
this->comm().verify(size_matches);
396+
libmesh_assert(this->comm().verify(size_matches));
397397

398398
if (size_matches)
399399
{

src/reduced_basis/rb_eim_evaluation.C

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ write_out_interior_basis_functions(const std::string & directory_name,
11081108
// Quick return if there is no work to do. Note: make sure all procs
11091109
// agree there is no work to do.
11101110
bool is_empty = _local_eim_basis_functions.empty();
1111-
this->comm().verify(is_empty);
1111+
libmesh_assert(this->comm().verify(is_empty));
11121112

11131113
if (is_empty)
11141114
return;
@@ -1279,7 +1279,7 @@ get_interior_basis_functions_as_vecs()
12791279
// Quick return if there is no work to do. Note: make sure all procs
12801280
// agree there is no work to do.
12811281
bool is_empty = _local_eim_basis_functions.empty();
1282-
this->comm().verify(is_empty);
1282+
libmesh_assert(this->comm().verify(is_empty));
12831283

12841284
if (is_empty)
12851285
return interior_basis_functions;
@@ -1315,7 +1315,7 @@ write_out_side_basis_functions(const std::string & directory_name,
13151315
// Quick return if there is no work to do. Note: make sure all procs
13161316
// agree there is no work to do.
13171317
bool is_empty = _local_side_eim_basis_functions.empty();
1318-
this->comm().verify(is_empty);
1318+
libmesh_assert(this->comm().verify(is_empty));
13191319

13201320
if (is_empty)
13211321
return;
@@ -1431,7 +1431,7 @@ write_out_node_basis_functions(const std::string & directory_name,
14311431
// Quick return if there is no work to do. Note: make sure all procs
14321432
// agree there is no work to do.
14331433
bool is_empty = _local_node_eim_basis_functions.empty();
1434-
this->comm().verify(is_empty);
1434+
libmesh_assert(this->comm().verify(is_empty));
14351435

14361436
if (is_empty)
14371437
return;
@@ -1899,7 +1899,7 @@ void RBEIMEvaluation::gather_bfs()
18991899
// each processor is the same, the only thing that differs is the number
19001900
// of elements, so make sure that is the case now.
19011901
auto n_bf = _local_eim_basis_functions.size();
1902-
this->comm().verify(n_bf);
1902+
libmesh_assert(this->comm().verify(n_bf));
19031903

19041904
// This function should never be called if there are no basis
19051905
// functions, so if it was, something went wrong.
@@ -2047,7 +2047,7 @@ void RBEIMEvaluation::side_gather_bfs()
20472047
// each processor is the same, the only thing that differs is the number
20482048
// of elements, so make sure that is the case now.
20492049
auto n_bf = _local_side_eim_basis_functions.size();
2050-
this->comm().verify(n_bf);
2050+
libmesh_assert(this->comm().verify(n_bf));
20512051

20522052
// This function should never be called if there are no basis
20532053
// functions, so if it was, something went wrong.
@@ -2195,7 +2195,7 @@ void RBEIMEvaluation::node_gather_bfs()
21952195
// each processor is the same, the only thing that differs is the number
21962196
// of elements, so make sure that is the case now.
21972197
auto n_bf = _local_node_eim_basis_functions.size();
2198-
this->comm().verify(n_bf);
2198+
libmesh_assert(this->comm().verify(n_bf));
21992199

22002200
// This function should never be called if there are no basis
22012201
// functions, so if it was, something went wrong.

0 commit comments

Comments
 (0)