Skip to content

Commit e698829

Browse files
committed
Workarounds for libMesh bugs
These ought to be fixed in libMesh/libmesh#4435, but I want more CI testing now!
1 parent 5591741 commit e698829

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

framework/src/meshgenerators/GeneratedMeshGenerator.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ GeneratedMeshGenerator::generate()
249249
_boundary_name_prefix + old_nodeset_name;
250250
}
251251

252+
// FIXME: change_boundary_id() was *supposed* to leave the mesh in
253+
// a fully prepared state, but there's a libMesh bug to fix first.
254+
mesh->unset_has_boundary_id_sets();
255+
252256
// Apply the bias if any exists
253257
if (_bias_x != 1.0 || _bias_y != 1.0 || _bias_z != 1.0)
254258
{

framework/src/meshgenerators/TransformGenerator.C

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,37 @@ TransformGenerator::generate()
7777
else
7878
vector_value = getParam<RealVectorValue>("vector_value");
7979

80+
// Any non-identity transform is going to invalidate any existing
81+
// point locator
82+
mesh->clear_point_locator();
83+
8084
switch (_transform)
8185
{
8286
case 1:
8387
case 2:
8488
case 3:
8589
MeshTools::Modification::translate(*mesh, vector_value(0), vector_value(1), vector_value(2));
90+
// libMesh translate() fails to properly mark the spatial
91+
// dimension as unprepared in cases where we've displaced a 1D
92+
// mesh in y or z or a 2D mesh in z. Until that's fixed we work
93+
// around the bug.
94+
mesh->unset_has_cached_elem_data();
8695
break;
8796
case 4:
8897
MeshTools::Modification::rotate(*mesh, vector_value(0), vector_value(1), vector_value(2));
98+
// libMesh rotate() tries to set the spatial dimension properly,
99+
// and probably does for all realistic use cases, but there are
100+
// at least hypothetical cases where it could be wrong.
101+
//
102+
// Until that's fixed we work around it.
103+
mesh->unset_has_cached_elem_data();
89104
break;
90105
case 5:
91106
MeshTools::Modification::scale(*mesh, vector_value(0), vector_value(1), vector_value(2));
107+
// Is anybody using scale() to just squash a manifold's spatial
108+
// dimension down to its mesh dimension? Let's be safe until
109+
// libMesh is handling that case.
110+
mesh->unset_has_cached_elem_data();
92111
break;
93112
case 6:
94113
TransformGenerator::rotateWithMatrix(*mesh, rotation_matrix);

0 commit comments

Comments
 (0)