diff --git a/framework/include/outputs/formatters/ExodusFormatter.h b/framework/include/outputs/formatters/ExodusFormatter.h index d025faeffc7f..5154b3409eea 100644 --- a/framework/include/outputs/formatters/ExodusFormatter.h +++ b/framework/include/outputs/formatters/ExodusFormatter.h @@ -11,6 +11,12 @@ #include "InputFileFormatter.h" +#include +#include +#include + +class ActionWarehouse; + /* * Dumps the input file in the Exodus output */ diff --git a/framework/include/outputs/formatters/SyntaxFormatterInterface.h b/framework/include/outputs/formatters/SyntaxFormatterInterface.h index 22403a5cabbb..675fd11da581 100644 --- a/framework/include/outputs/formatters/SyntaxFormatterInterface.h +++ b/framework/include/outputs/formatters/SyntaxFormatterInterface.h @@ -12,9 +12,7 @@ #include #include -#include "InputParameters.h" -#include "ActionWarehouse.h" -#include "MooseSyntax.h" +class InputParameters; /** * This interface is for classes that want to be called to format InputParameters. When the diff --git a/framework/include/utils/InputParameters.h b/framework/include/utils/InputParameters.h index e62458553fc8..64c4da3ca379 100644 --- a/framework/include/utils/InputParameters.h +++ b/framework/include/utils/InputParameters.h @@ -1015,6 +1015,7 @@ class InputParameters : public Parameters friend InputParameters emptyInputParameters(); friend class InputParameterWarehouse; friend class Parser; + friend class ActionWarehouse; // For setting _from_legacy_construction (remove with #19440) template diff --git a/framework/include/utils/SyntaxTree.h b/framework/include/utils/SyntaxTree.h index 9dfc1c4f99e1..d00ccdb7afd7 100644 --- a/framework/include/utils/SyntaxTree.h +++ b/framework/include/utils/SyntaxTree.h @@ -13,6 +13,7 @@ #include #include +#include // Forward declarations class InputParameters; diff --git a/framework/src/actions/ActionWarehouse.C b/framework/src/actions/ActionWarehouse.C index 67c40c9ff316..4b21e3a0543e 100644 --- a/framework/src/actions/ActionWarehouse.C +++ b/framework/src/actions/ActionWarehouse.C @@ -20,6 +20,7 @@ #include "InfixIterator.h" #include "FEProblem.h" #include "MemoryUtils.h" +#include "InputParameterWarehouse.h" #include "libmesh/simple_range.h" @@ -411,10 +412,15 @@ ActionWarehouse::printInputFile(std::ostream & out) bool is_parent; if (_syntax.isAssociated(name, &is_parent) != "") { - InputParameters params = act->parameters(); + const auto & all_params = _app.getInputParameterWarehouse().getInputParameters(); + InputParameters & params = *(all_params.find(act->uniqueActionName())->second.get()); + + // temporarily allow input parameter copies required by the input file formatter + params.allowCopy(true); // TODO: Do we need to insert more nodes for each task? tree.insertNode(name, *tasks.begin(), true, ¶ms); + params.allowCopy(false); MooseObjectAction * moose_object_action = dynamic_cast(act); if (moose_object_action) diff --git a/framework/src/outputs/formatters/ExodusFormatter.C b/framework/src/outputs/formatters/ExodusFormatter.C index 3684eb2e0ef3..4a8ecd9c8946 100644 --- a/framework/src/outputs/formatters/ExodusFormatter.C +++ b/framework/src/outputs/formatters/ExodusFormatter.C @@ -13,6 +13,7 @@ #include "MooseApp.h" #include "SystemInfo.h" #include "CommandLine.h" +#include "ActionWarehouse.h" #include "libmesh/exodusII.h" diff --git a/framework/src/utils/InputParameterWarehouse.C b/framework/src/utils/InputParameterWarehouse.C index 457060b74202..235980a034bc 100644 --- a/framework/src/utils/InputParameterWarehouse.C +++ b/framework/src/utils/InputParameterWarehouse.C @@ -95,10 +95,7 @@ InputParameterWarehouse::addInputParameters(const std::string & name, ptr->addPrivateParam("_tid", tid); // no more copies allowed - // Note: we have to skip action parameters for now due to parameter copy operations in - // the input parameter printing capability in ActionWarehouse::printInputFile. - if (base != "Action") - ptr->allowCopy(false); + ptr->allowCopy(false); // Return a reference to the InputParameters object return *ptr;