Skip to content

Commit eec2968

Browse files
committed
Minor consistency improvements (idaholab#32781)
1 parent de74ae5 commit eec2968

4 files changed

Lines changed: 11 additions & 31 deletions

File tree

framework/src/mfem/indicators/MFEML2ZienkiewiczZhuIndicator.C

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,13 @@ MFEML2ZienkiewiczZhuIndicator::validParams()
2828
MFEML2ZienkiewiczZhuIndicator::MFEML2ZienkiewiczZhuIndicator(const InputParameters & params)
2929
: MFEMIndicator(params)
3030
{
31-
if (isParamSetByUser("flux_fespace"))
32-
{
33-
// fetch the flux_fespace from the object system
34-
auto object_ptr =
35-
getMFEMProblem()
36-
.getMFEMObject<MFEMFESpace>("MFEMFESpace", getParam<MFEMFESpaceName>("flux_fespace"))
37-
.getSharedPtr();
38-
auto fespace_ptr = std::dynamic_pointer_cast<const MFEMFESpace>(object_ptr);
39-
_flux_fes = fespace_ptr->getFESpace();
40-
}
31+
// fetch the flux_fespace from the object system
32+
if (auto * sn = queryParam<MFEMFESpaceName>("flux_fespace"))
33+
_flux_fes = getMFEMProblem().getMFEMObject<MFEMFESpace>("MFEMFESpace", *sn).getFESpace();
4134

42-
if (isParamSetByUser("smooth_flux_fespace"))
43-
{
44-
// fetch the smooth_flux_fespace from the object system
45-
auto object_ptr = getMFEMProblem()
46-
.getMFEMObject<MFEMFESpace>(
47-
"MFEMFESpace", getParam<MFEMFESpaceName>("smooth_flux_fespace"))
48-
.getSharedPtr();
49-
auto fespace_ptr = std::dynamic_pointer_cast<const MFEMFESpace>(object_ptr);
50-
_smooth_flux_fes = fespace_ptr->getFESpace();
51-
}
35+
// fetch the smooth_flux_fespace from the object system
36+
if (auto * sn = queryParam<MFEMFESpaceName>("smooth_flux_fespace"))
37+
_smooth_flux_fes = getMFEMProblem().getMFEMObject<MFEMFESpace>("MFEMFESpace", *sn).getFESpace();
5238
}
5339

5440
void

framework/src/mfem/postprocessors/MFEMPostprocessor.C

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ MFEMPostprocessor::validParams()
1616
{
1717
InputParameters params = MFEMExecutedObject::validParams();
1818
params += Postprocessor::validParams();
19-
params.registerSystemAttributeName("MFEMExecutedObject");
2019
return params;
2120
}
2221

framework/src/mfem/problem/MFEMProblem.C

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@
1010
#ifdef MOOSE_MFEM_ENABLED
1111

1212
#include "MFEMProblem.h"
13-
#include "MFEMInitialCondition.h"
1413
#include "MFEMVariable.h"
1514
#include "MFEMIndicator.h"
1615
#include "MFEMSubMesh.h"
1716
#include "MFEMFunctorMaterial.h"
18-
#include "MFEMSubMeshTransfer.h"
1917
#include "MFEMExecutedObject.h"
20-
#include "Postprocessor.h"
21-
#include "VectorPostprocessor.h"
2218
#include "MFEMVectorUtils.h"
2319
#include "libmesh/string_to_enum.h"
2420

@@ -56,7 +52,7 @@ MFEMProblem::MFEMProblem(const InputParameters & params)
5652
void
5753
MFEMProblem::initialSetup()
5854
{
59-
FEProblemBase::initialSetup();
55+
ExternalProblem::initialSetup();
6056

6157
// MFEM indicators create their estimators during addIndicator(); markers still need an explicit
6258
// setup pass because they are no longer initialized through the libMesh/MOOSE user-object path.
@@ -72,7 +68,7 @@ MFEMProblem::execute(const ExecFlagType & exec_type)
7268
setCurrentExecuteOnFlag(exec_type);
7369
executeMFEMObjects(exec_type);
7470

75-
FEProblemBase::execute(exec_type);
71+
ExternalProblem::execute(exec_type);
7672
}
7773

7874
void
@@ -260,7 +256,7 @@ MFEMProblem::addGridFunction(const std::string & var_type,
260256
else
261257
{
262258
// Add MOOSE variable.
263-
FEProblemBase::addVariable(var_type, var_name, parameters);
259+
ExternalProblem::addVariable(var_type, var_name, parameters);
264260

265261
// Add MFEM variable indirectly ("gridfunction").
266262
InputParameters mfem_variable_params = addMFEMFESpaceFromMOOSEVariable(parameters);
@@ -539,7 +535,7 @@ MFEMProblem::addVectorPostprocessor(const std::string & type,
539535
addObject<MFEMExecutedObject>(type, name, parameters);
540536
}
541537
else
542-
FEProblemBase::addVectorPostprocessor(type, name, parameters);
538+
ExternalProblem::addVectorPostprocessor(type, name, parameters);
543539
}
544540

545541
InputParameters
@@ -688,7 +684,7 @@ MFEMProblem::addTransfer(const std::string & transfer_name,
688684
if (parameters.getBase() == "MFEMSubMeshTransfer")
689685
addObject<MFEMExecutedObject>(transfer_name, name, parameters);
690686
else
691-
FEProblemBase::addTransfer(transfer_name, name, parameters);
687+
ExternalProblem::addTransfer(transfer_name, name, parameters);
692688
}
693689

694690
void

framework/src/mfem/vectorpostprocessors/MFEMVectorPostprocessor.C

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ MFEMVectorPostprocessor::validParams()
1616
{
1717
InputParameters params = MFEMExecutedObject::validParams();
1818
params += VectorPostprocessor::validParams();
19-
params.registerSystemAttributeName("MFEMExecutedObject");
2019
return params;
2120
}
2221

0 commit comments

Comments
 (0)