Go to the documentation of this file.
15 #include "libmesh/string_to_enum.h"
25 params.
addClassDescription(
"Single purpose problem object that does not run the given input but "
26 "allows deconstructing actions into their series of underlying Moose "
27 "objects and variables.");
29 "dump_path",
"Syntax path of the action of which to dump the generated syntax");
37 _aux = std::make_shared<AuxiliarySystem>(*
this,
"aux0");
46 const std::string & var_name,
55 const std::string & var_name,
64 const std::string & name,
73 const std::string & name,
82 const std::string & name,
91 const std::string & name,
100 const std::string & name,
109 const std::string & name,
118 const std::string & name,
127 const std::string & name,
136 const std::string & name,
145 const std::string & name,
154 const std::string & name,
163 const std::string & name,
172 const std::string & name,
186 std::string param_text;
187 for (
auto & value_pair : specified_params)
190 const auto & param_name = value_pair.first;
191 const auto & param_value = value_pair.second;
193 auto factory_it = factory_params.find(param_name);
194 if (factory_it == factory_params.end() || factory_it->second != param_value)
195 param_text +=
" " + param_name +
" = " + param_value +
'\n';
203 const std::string &
type,
204 const std::string & name,
212 " [./" +
name +
"]\n"
213 +
" type = " +
type +
'\n'
221 const std::string & var_name,
225 const std::set<SubdomainID> *
const active_subdomains)
228 std::string param_text;
230 if (active_subdomains)
233 for (
auto & subdomain_id : *active_subdomains)
235 auto subdomain_name =
_mesh.
getMesh().subdomain_name(subdomain_id);
236 if (subdomain_name ==
"")
237 subdomain_name = std::to_string(subdomain_id);
242 blocks += subdomain_name;
245 if (active_subdomains->size() > 1)
246 blocks =
"'" + blocks +
"'";
248 param_text +=
" blocks = " + blocks +
'\n';
251 if (family != LAGRANGE)
252 param_text +=
" family = " + libMesh::Utility::enum_to_string<FEFamily>(family) +
'\n';
254 param_text +=
" order = " + libMesh::Utility::enum_to_string<Order>(order) +
'\n';
255 if (scale_factor != 1.0)
256 param_text +=
" scale = " + std::to_string(scale_factor);
260 " [./" + var_name +
"]\n"
279 for (
const auto & system_pair : pathit->second)
280 Moose::out <<
'[' << system_pair.first <<
"]\n" << system_pair.second <<
"[]\n\n";
283 std::map<std::string, std::string>
286 std::map<std::string, std::string> parameter_map;
290 syntax =
parameters.get<std::string>(
"parser_syntax");
295 const auto & param_name = value_pair.first;
299 if (param_name ==
"control_tags")
307 auto param_bool =
dynamic_cast<InputParameters::Parameter<bool> *
>(value_pair.second);
310 std::string param_value;
312 param_value = param_bool->get() ?
"true" :
"false";
315 std::stringstream ss;
316 value_pair.second->print(ss);
317 param_value = ss.str();
321 if (param_value.back() ==
' ')
322 param_value.pop_back();
325 if (param_value.find_first_of(
" ") != std::string::npos)
326 param_value =
"'" + param_value +
"'";
328 parameter_map[param_name] = param_value;
333 return parameter_map;
defineLegacyParams(DumpObjectsProblem)
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding a non-linear variable.
std::shared_ptr< DumpObjectsNonlinearSystem > _nl_sys
void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms) override
Canonical method for adding an auxiliary variable.
void addAuxKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name)
Get valid parameters for the object.
void dumpObjectHelper(const std::string &system, const std::string &type, const std::string &name, const InputParameters ¶meters)
void addAuxScalarKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
static InputParameters validParams()
std::shared_ptr< NonlinearSystemBase > _nl
std::map< std::string, std::map< std::string, std::string > > _generated_syntax
store input syntax to build objects generated by a specific action
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
virtual void addMaterial(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
const std::string & type() const
Get the type of this object.
static InputParameters validParams()
virtual void addFunction(std::string type, const std::string &name, InputParameters ¶meters)
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
const InputParameters & parameters() const
Get the parameters of the object.
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)
virtual void newAssemblyArray(NonlinearSystemBase &nl)
void addInitialCondition(const std::string &type, const std::string &name, InputParameters ¶meters) override
Nonlinear system for dumping objects.
registerMooseObject("MooseApp", DumpObjectsProblem)
Specialization of SubProblem for dumping generated objects as input file syntax.
virtual void addDGKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
std::map< std::string, std::string > stringifyParameters(const InputParameters ¶meters)
create a string map form parameter names to stringified parameter values
void addDGKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void addMaterial(const std::string &type, const std::string &name, InputParameters ¶meters) override
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters)
void addFunction(std::string type, const std::string &name, InputParameters ¶meters) override
void addKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
virtual void addConstraint(const std::string &c_name, const std::string &name, InputParameters ¶meters)
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void addBoundaryCondition(const std::string &type, const std::string &name, InputParameters ¶meters) override
std::string getCurrentActionName() const
void dumpGeneratedSyntax(const std::string path)
output input blocks for a given action path
void addInterfaceKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
ActionWarehouse & actionWarehouse()
Return a writable reference to the ActionWarehouse associated with this app.
void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms) override
Canonical method for adding a non-linear variable.
virtual void addInterfaceKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
DumpObjectsProblem(const InputParameters ¶meters)
virtual void addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void addNodalKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
void addScalarKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters)
Factory & _factory
The Factory for building objects.
void createTagVectors()
Create extra tagged vectors and matrices.
std::shared_ptr< AuxiliarySystem > _aux
void addConstraint(const std::string &type, const std::string &name, InputParameters ¶meters) override
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseApp & _app
The MooseApp this object is associated with.
virtual void solve() override
output data in solve
virtual const std::string & name() const
Get the name of the object.
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void addDiracKernel(const std::string &type, const std::string &name, InputParameters ¶meters) override
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding an auxiliary variable.