Permalink
Browse files

Merge pull request #12875 from friedmud/mesh_generator_coverage_12873

Fixup element generator so it works with distributed mesh
  • Loading branch information...
permcody committed Feb 8, 2019
2 parents 76d2da9 + 95a51c5 commit c30e1221db40621d035ef14de443d7d895b6de5c
@@ -179,11 +179,13 @@ ElementGenerator::generate()

// If there was no input mesh then let's just make a new one
if (!mesh)
mesh = libmesh_make_unique<ReplicatedMesh>(comm(), 2);
mesh = _mesh->buildMeshBaseObject();

MooseEnum elem_type_enum = getParam<MooseEnum>("elem_type");
auto elem = getElemType(elem_type_enum);

mesh->set_mesh_dimension(std::max((unsigned int)elem->dim(), mesh->mesh_dimension()));

std::vector<Node *> nodes;

nodes.reserve(_nodal_positions.size());
@@ -193,6 +195,7 @@ ElementGenerator::generate()
nodes.push_back(mesh->add_point(point));

mesh->add_elem(elem);

auto n = elem->n_nodes();

for (dof_id_type i = 0; i < _element_connectivity.size(); i += n)
@@ -6,7 +6,6 @@
requirement = 'MOOSE shall be able to create different subdomains.'
design = 'meshgenerators/BlockDeletionGenerator.md'
issues = '#11640'
mesh_mode = 'REPLICATED'
recover = false
[../]
[]
@@ -7,7 +7,6 @@
requirement = 'MOOSE shall be able to create a mesh based on elements.'
design = 'meshgenerators/ElementGenerator.md'
issues = '#11640'
mesh_mode = 'REPLICATED'
recover = false
[../]
[./test2]
@@ -18,7 +17,6 @@
requirement = 'MOOSE shall be able to create a mesh based on elements.'
design = 'meshgenerators/ElementGenerator.md'
issues = '#11640'
mesh_mode = 'REPLICATED'
recover = false
[../]
[]

0 comments on commit c30e122

Please sign in to comment.