Skip to content

Commit

Permalink
Revise option to fully remove FiniteElementSpace associated with high…
Browse files Browse the repository at this point in the history
…-order nodes and rely on mesh vertices instead
  • Loading branch information
sebastiangrimberg committed Aug 22, 2023
1 parent c778023 commit 31cf7f0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions palace/utils/geodata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,19 @@ std::unique_ptr<mfem::Mesh> LoadMesh(const std::string &path, bool remove_curvat
}
mesh = std::make_unique<mfem::Mesh>(fi, 1, 1, true);
}
mesh->EnsureNodes();
if (remove_curvature && mesh->GetNodes()->FESpace()->GetMaxElementOrder() > 1)
if (remove_curvature)
{
mesh->SetCurvature(1, false);
mfem::GridFunction *nodes = nullptr;
int own_nodes = true;
mesh->SwapNodes(nodes, own_nodes);
if (own_nodes)
{
delete nodes;
}
}
else
{
mesh->EnsureNodes();
}
return mesh;
}
Expand Down

0 comments on commit 31cf7f0

Please sign in to comment.