Skip to content

Commit

Permalink
clear_spline_nodes param in FileMesh, FM Generator
Browse files Browse the repository at this point in the history
This lets us choose to load an IsoGeometric Analysis mesh without spline
nodes and spline node constraints, whether for debugging purposes or to
experiment with solver behavior or just because libMesh doesn't
parallelize those constraints efficiently enough yet.

Refs idaholab#18768
  • Loading branch information
roystgnr committed Mar 24, 2022
1 parent 71e154c commit ee8247e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions framework/src/mesh/FileMesh.C
Expand Up @@ -15,6 +15,7 @@
#include "RestartableDataIO.h"

#include "libmesh/exodusII_io.h"
#include "libmesh/mesh_tools.h"
#include "libmesh/nemesis_io.h"
#include "libmesh/parallel_mesh.h"

Expand All @@ -25,6 +26,11 @@ FileMesh::validParams()
{
InputParameters params = MooseMesh::validParams();
params.addRequiredParam<MeshFileName>("file", "The name of the mesh file to read");
params.addParam<bool>("clear_spline_nodes",
false,
"If clear_spline_nodes=true, IsoGeometric Analyis spline nodes "
"and constraints are removed from an IGA mesh, after which only "
"C^0 Rational-Bernstein-Bezier elements will remain.");
params.addClassDescription("Read a mesh from a file.");
return params;
}
Expand Down Expand Up @@ -112,6 +118,9 @@ FileMesh::buildMesh()
MooseUtils::checkFileReadable(_file_name);
getMesh().read(_file_name);

if (getParam<bool>("clear_spline_nodes"))
MeshTools::clear_spline_nodes(getMesh());

// we also read declared mesh meta data here if there is meta data file
RestartableDataIO restartable(_app);
std::string fname = _file_name + "/meta_data_mesh" + restartable.getRestartableDataExt();
Expand Down
11 changes: 11 additions & 0 deletions framework/src/meshgenerators/FileMeshGenerator.C
Expand Up @@ -15,6 +15,7 @@
#include "libmesh/face_quad4.h"
#include "libmesh/exodusII_io.h"
#include "libmesh/mesh_communication.h"
#include "libmesh/mesh_tools.h"

registerMooseObject("MooseApp", FileMeshGenerator);

Expand All @@ -35,6 +36,11 @@ FileMeshGenerator::validParams()
false,
"True to skip partitioning, only after this mesh generator, "
"because the mesh was pre-split for example.");
params.addParam<bool>("clear_spline_nodes",
false,
"If clear_spline_nodes=true, IsoGeometric Analyis spline nodes "
"and constraints are removed from an IGA mesh, after which only "
"C^0 Rational-Bernstein-Bezier elements will remain.");
params.addClassDescription("Read a mesh from a file.");
return params;
}
Expand Down Expand Up @@ -72,7 +78,12 @@ FileMeshGenerator::generate()
else
{
if (mesh->processor_id() == 0)
{
exreader->read(_file_name);

if (getParam<bool>("clear_spline_nodes"))
MeshTools::clear_spline_nodes(*mesh);
}
MeshCommunication().broadcast(*mesh);
}
// Skip partitioning if the user requested it
Expand Down

0 comments on commit ee8247e

Please sign in to comment.