Skip to content

Commit

Permalink
Add post-aux ordering boolean to UO
Browse files Browse the repository at this point in the history
Move ordering options from GeneralUO to UOs in general, closes idaholab#18593 idaholab#18594
  • Loading branch information
GiudGiud committed Aug 12, 2021
1 parent 0e5f088 commit 956f781
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
8 changes: 7 additions & 1 deletion framework/include/loops/ComputeUserObjectsThread.h
Expand Up @@ -103,7 +103,7 @@ groupUserObjects(TheWarehouse & w,
//
// This function attempts to sort a UO based on any ICs or AuxKernels which depend on
// it. Alternatively, a user may select which group to execute their object with by
// controlling the force_preic and force_preaux input parameters.
// controlling the force_preic, force_preaux and force_postaux input parameters.
//
for (const auto obj : objs)
{
Expand All @@ -123,5 +123,11 @@ groupUserObjects(TheWarehouse & w,
w.update(obj, AttribPreAux(w, true));
w.update(obj, AttribPostAux(w, false));
}

if (obj->isParamValid("force_postaux") && obj->template getParam<bool>("force_postaux"))
{
w.update(obj, AttribPreAux(w, false));
w.update(obj, AttribPostAux(w, true));
}
}
}
8 changes: 1 addition & 7 deletions framework/src/userobject/GeneralUserObject.C
Expand Up @@ -16,13 +16,7 @@ GeneralUserObject::validParams()
{
InputParameters params = UserObject::validParams();
params += MaterialPropertyInterface::validParams();
params.addParam<bool>(
"force_preaux", false, "Forces the GeneralUserObject to be executed in PREAUX");
params.addParam<bool>(
"force_preic",
false,
"Forces the GeneralUserObject to be executed in PREIC during initial setup");
params.addParamNamesToGroup("force_preaux force_preic", "Advanced");

return params;
}

Expand Down
18 changes: 17 additions & 1 deletion framework/src/userobject/UserObject.C
Expand Up @@ -32,17 +32,28 @@ UserObject::validParams()
"in the case this is true but no "
"displacements are provided in the Mesh block "
"the undisplaced mesh will still be used.");

// Execution parameters
params.addParam<bool>("allow_duplicate_execution_on_initial",
false,
"In the case where this UserObject is depended upon by an initial "
"condition, allow it to be executed twice during the initial setup (once "
"before the IC and again after mesh adaptivity (if applicable).");
params.declareControllable("enable");

params.addParam<bool>(
"force_preaux", false, "Forces the UserObject to be executed in PREAUX");
params.addParam<bool>(
"force_postaux", false, "Forces the UserObject to be executed in POSTAUX");
params.addParam<bool>(
"force_preic",
false,
"Forces the UserObject to be executed in PREIC during initial setup");

params.registerBase("UserObject");
params.registerSystemAttributeName("UserObject");

params.addParamNamesToGroup("use_displaced_mesh allow_duplicate_execution_on_initial",
params.addParamNamesToGroup("use_displaced_mesh allow_duplicate_execution_on_initial force_preaux force_postaux force_preic",
"Advanced");
return params;
}
Expand All @@ -69,6 +80,11 @@ UserObject::UserObject(const InputParameters & parameters)
_coord_sys(_assembly.coordSystem()),
_duplicate_initial_execution(getParam<bool>("allow_duplicate_execution_on_initial"))
{
// Check the pre/post aux flag
if (!parameters.isParamSetByAddParam("force_preaux") &&
!parameters.isParamSetByAddParam("force_postaux"))
paramError("force_preaux", "A user object may be specified as executing before or after "
"AuxKernels, not both.");
}

std::set<UserObjectName>
Expand Down
File renamed without changes.

0 comments on commit 956f781

Please sign in to comment.