15 #include "libmesh/string_to_enum.h" 23 params.
addClassDescription(
"Single purpose problem object that does not run the given input but " 24 "allows deconstructing actions into their series of underlying Moose " 25 "objects and variables.");
27 "dump_path",
"Syntax path of the action of which to dump the generated syntax");
35 _aux = std::make_shared<AuxiliarySystem>(*
this,
"aux0");
52 std::string param_text;
53 for (
auto & value_pair : specified_params)
56 const auto & param_name = value_pair.first;
57 const auto & param_value = value_pair.second;
59 auto factory_it = factory_params.find(param_name);
60 if (factory_it == factory_params.end() || factory_it->second != param_value)
61 param_text +=
" " + param_name +
" = " + param_value +
'\n';
69 const std::string & type,
70 const std::string & name,
79 +
" type = " +
type +
'\n' 87 const std::string & var_name,
91 const std::set<SubdomainID> *
const active_subdomains)
94 std::string param_text;
96 if (active_subdomains)
99 for (
auto & subdomain_id : *active_subdomains)
101 auto subdomain_name =
_mesh.
getMesh().subdomain_name(subdomain_id);
102 if (subdomain_name ==
"")
103 subdomain_name = std::to_string(subdomain_id);
108 blocks += subdomain_name;
111 if (active_subdomains->size() > 1)
112 blocks =
"'" + blocks +
"'";
114 param_text +=
" blocks = " + blocks +
'\n';
118 param_text +=
" family = " + libMesh::Utility::enum_to_string<FEFamily>(family) +
'\n';
120 param_text +=
" order = " + libMesh::Utility::enum_to_string<Order>(order) +
'\n';
121 if (scale_factor != 1.0)
122 param_text +=
" scale = " + std::to_string(scale_factor);
126 " [./" + var_name +
"]\n" 145 Moose::out <<
"**START DUMP DATA**\n";
146 for (
const auto & system_pair : pathit->second)
147 Moose::out <<
'[' << system_pair.first <<
"]\n" << system_pair.second <<
"[]\n\n";
148 Moose::out <<
"**END DUMP DATA**\n";
149 Moose::out << std::flush;
152 std::map<std::string, std::string>
155 std::map<std::string, std::string> parameter_map;
164 const auto & param_name = value_pair.first;
168 if (param_name ==
"control_tags")
178 std::string param_value;
182 param_value = b ?
"true" :
"false";
186 std::stringstream ss;
187 value_pair.second->print(ss);
188 param_value = ss.str();
192 if (!param_value.empty() && param_value.back() ==
' ')
193 param_value.pop_back();
196 if (param_value.find_first_of(
" ") != std::string::npos || param_value.length() == 0)
197 param_value =
"'" + param_value +
"'";
199 parameter_map[param_name] = param_value;
204 return parameter_map;
Factory & _factory
The Factory for building objects.
static InputParameters validParams()
std::shared_ptr< DumpObjectsNonlinearSystem > _nl_sys
Specialization of SubProblem for dumping generated objects as input file syntax.
std::string getCurrentActionName() const
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const std::string & name() const
Get the name of the class.
virtual void newAssemblyArray(std::vector< std::shared_ptr< NonlinearSystemBase >> &nl)
void dumpObjectHelper(const std::string &system, const std::string &type, const std::string &name, const InputParameters ¶meters)
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
Nonlinear system for dumping objects.
void createTagSolutions()
Create extra tagged solution vectors.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
void createTagVectors()
Create extra tagged vectors and matrices.
virtual void solve(unsigned int nl_sys_num) override
output data in solve
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
const std::string & type() const
Get the type of this class.
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
MooseApp & _app
The MOOSE application this is associated with.
std::map< std::string, std::string > stringifyParameters(const InputParameters ¶meters)
create a string map form parameter names to stringified parameter values
std::map< std::string, std::map< std::string, std::string > > _generated_syntax
store input syntax to build objects generated by a specific action
registerMooseObject("MooseApp", DumpObjectsProblem)
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
void dumpGeneratedSyntax(const std::string path)
output input blocks for a given action path
std::string deduceNecessaryParameters(const std::string &type, const InputParameters ¶meters)
build a text snippet of the minimal set of parameters that need to be specified
DumpObjectsProblem(const InputParameters ¶meters)
void dumpVariableHelper(const std::string &system, const std::string &var_name, FEFamily family, Order order, Real scale_factor, const std::set< SubdomainID > *const active_subdomains)