Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ int main (int argc, char** argv)
sync_obj);
}

// We'll need to update caches of subdomain ids too, to keep the
// mesh prepared.
mesh.cache_elem_data();

// Now we set the sources of the field: prism-shaped objects that are
// determined here by containing certain points:
auto p_pt_lctr = mesh.sub_point_locator();
Expand Down
3 changes: 3 additions & 0 deletions src/mesh/mesh_smoother_vsmoother.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ VariationalMeshSmoother::VariationalMeshSmoother(
void VariationalMeshSmoother::setup()
{
// Check for multiple dimensions
if (!_mesh.preparation().has_cached_elem_data)
_mesh.cache_elem_data();

if (_mesh.elem_dimensions().size() > 1)
libmesh_not_implemented_msg("Meshes containing elements of differing dimension are not yet supported.");

Expand Down
12 changes: 8 additions & 4 deletions tests/mesh/mesh_input.C
Original file line number Diff line number Diff line change
Expand Up @@ -888,15 +888,19 @@ public:
MeshType mesh(*TestCommWorld);

EquationSystems es(mesh);
System & sys = es.add_system<System> ("SimpleSystem");
auto e_var = sys.add_variable("e", CONSTANT, MONOMIAL_VEC);
auto e_no_p_var = sys.add_variable("e_no_p",
FEType(CONSTANT, MONOMIAL_VEC).set_p_refinement(false));

// We need a mesh.spatial_dimension() *before* adding a
// vector-valued variable, so add_variable() can figure out how
// many components it needs.
MeshTools::Generation::build_square (mesh,
3, 3,
0., 1., 0., 1.);

System & sys = es.add_system<System> ("SimpleSystem");
auto e_var = sys.add_variable("e", CONSTANT, MONOMIAL_VEC);
auto e_no_p_var = sys.add_variable("e_no_p",
FEType(CONSTANT, MONOMIAL_VEC).set_p_refinement(false));

es.init();

// Here, we're going to manually set up the solution because the 'project_solution()' and
Expand Down
11 changes: 7 additions & 4 deletions tests/mesh/mesh_smoother_test.C
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,15 @@ public:

mesh.comm().sum(distorted_subdomain_volumes[sub_id]);
}

// We've just invalidated the get_mesh_subdomains() cache by
// adding a new one; fix it.
mesh.cache_elem_data();
}

// We may have just invalidated the get_mesh_subdomains() cache by
// adding a new one, and libMesh marked our spatial_dimension()
// cache as invalidated in redistribute(). Just rebuild our
// caches before we start asking for anything like
// elem_default_orders().
mesh.cache_elem_data();

// Get the mesh order
const auto & elem_orders = mesh.elem_default_orders();
libmesh_error_msg_if(elem_orders.size() != 1,
Expand Down