https://mooseframework.inl.gov
Moose.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "libmesh/petsc_macro.h"
11 #include "libmesh/libmesh_config.h"
12 
13 #include "Moose.h"
14 #include "MooseApp.h"
15 
16 #include "ActionWarehouse.h"
17 #include "ActionFactory.h"
18 #include "AuxiliarySystem.h"
19 #include "Factory.h"
20 #include "PetscSupport.h"
21 #include "Syntax.h"
22 #include "MooseSyntax.h"
23 #include "ExecFlagRegistry.h"
24 
25 #include <unistd.h>
26 
27 const ExecFlagType EXEC_NONE = registerDefaultExecFlag("NONE");
28 const ExecFlagType EXEC_INITIAL = registerDefaultExecFlag("INITIAL");
29 const ExecFlagType EXEC_LINEAR = registerDefaultExecFlag("LINEAR");
30 const ExecFlagType EXEC_LINEAR_CONVERGENCE = registerDefaultExecFlag("LINEAR_CONVERGENCE");
31 const ExecFlagType EXEC_NONLINEAR = registerDefaultExecFlag("NONLINEAR");
32 const ExecFlagType EXEC_NONLINEAR_CONVERGENCE = registerDefaultExecFlag("NONLINEAR_CONVERGENCE");
33 const ExecFlagType EXEC_POSTCHECK = registerDefaultExecFlag("POSTCHECK");
34 const ExecFlagType EXEC_TIMESTEP_END = registerDefaultExecFlag("TIMESTEP_END");
35 const ExecFlagType EXEC_TIMESTEP_BEGIN = registerDefaultExecFlag("TIMESTEP_BEGIN");
37  registerDefaultExecFlag("MULTIAPP_FIXED_POINT_END");
39  registerDefaultExecFlag("MULTIAPP_FIXED_POINT_BEGIN");
41  registerDefaultExecFlag("MULTIAPP_FIXED_POINT_CONVERGENCE");
42 const ExecFlagType EXEC_FINAL = registerDefaultExecFlag("FINAL");
43 const ExecFlagType EXEC_FORCED = registerExecFlag("FORCED");
44 const ExecFlagType EXEC_FAILED = registerExecFlag("FAILED");
45 const ExecFlagType EXEC_CUSTOM = registerDefaultExecFlag("CUSTOM");
46 const ExecFlagType EXEC_SUBDOMAIN = registerExecFlag("SUBDOMAIN");
47 const ExecFlagType EXEC_ALWAYS = registerExecFlag("ALWAYS");
48 const ExecFlagType EXEC_PRE_DISPLACE = registerExecFlag("PRE_DISPLACE");
49 const ExecFlagType EXEC_SAME_AS_MULTIAPP = registerExecFlag("SAME_AS_MULTIAPP");
50 const ExecFlagType EXEC_PRE_MULTIAPP_SETUP = registerExecFlag("PRE_MULTIAPP_SETUP");
51 const ExecFlagType EXEC_TRANSFER = registerExecFlag("TRANSFER");
52 const ExecFlagType EXEC_PRE_KERNELS = registerExecFlag("PRE_KERNELS");
53 #ifdef LIBMESH_ENABLE_AMR
54 const ExecFlagType EXEC_POST_ADAPTIVITY = registerExecFlag("POST_ADAPTIVITY");
55 #endif
56 
57 namespace Moose
58 {
59 
60 void associateSyntaxInner(Syntax & syntax, ActionFactory & action_factory);
61 
62 void
64 {
65  registerObjects(f, {"MooseApp"});
66  associateSyntaxInner(s, af);
67  registerActions(s, af, {"MooseApp"});
68  registerAppDataFilePath("moose");
69  registerRepository("moose", "github.com/idaholab/moose");
70 }
71 
72 void
73 registerObjects(Factory & factory, const std::set<std::string> & obj_labels)
74 {
75  Registry::registerObjectsTo(factory, obj_labels);
76 }
77 
78 void
80 {
93  // clang-format off
94  /**************************/
95  /**** Register Actions ****/
96  /**************************/
97  registerMooseObjectTask("create_problem", Problem, false);
98  registerMooseObjectTask("setup_executioner", Executioner, false);
99  registerMooseObjectTask("read_executor", Executor, false);
100  registerTask("add_executor", true);
101 
102  // TODO Organize these somewhere
103  registerTask("init_physics", false);
104  registerTask("init_component_physics", false);
105  registerTask("meta_action_component", false);
106  registerTask("setup_component", false);
107  // 'list_component' is used to retrieve ActionComponents for the syntax JSON
108  registerTask("list_component", false);
109 
110  // This task does not construct an object, but it needs all of the parameters that
111  // would normally be used to construct an object.
112  registerMooseObjectTask("determine_system_type", Executioner, true);
113 
114  registerMooseObjectTask("setup_mesh", MooseMesh, false);
115  registerMooseObjectTask("set_mesh_base", MooseMesh, false);
116  registerMooseObjectTask("init_mesh", MooseMesh, false);
117  registerMooseObjectTask("add_mesh_generator", MeshGenerator, false);
118  registerTask("create_added_mesh_generators", true);
119  registerMooseObjectTask("append_mesh_generator", MeshGenerator, false);
120 
121  registerMooseObjectTask("add_kernel", Kernel, false);
122  appendMooseObjectTask ("add_kernel", EigenKernel);
123  appendMooseObjectTask ("add_kernel", VectorKernel);
124  appendMooseObjectTask ("add_kernel", ArrayKernel);
125 
126  registerMooseObjectTask("add_variable", MooseVariableBase, false);
127  registerMooseObjectTask("add_aux_variable", MooseVariableBase, false);
128  registerMooseObjectTask("add_elemental_field_variable", MooseVariableBase, false);
129 
130  registerMooseObjectTask("add_nodal_kernel", NodalKernel, false);
131 
132  registerMooseObjectTask("add_functor_material", FunctorMaterial, false);
133  registerMooseObjectTask("add_material", MaterialBase, false);
134  appendDeprecatedMooseObjectTask("add_material", FunctorMaterial);
135  registerMooseObjectTask("add_bc", BoundaryCondition, false);
136 
137  registerMooseObjectTask("add_function", Function, false);
138  registerMooseObjectTask("add_distribution", Distribution, false);
139  registerMooseObjectTask("add_sampler", Sampler, false);
140 
141  registerMooseObjectTask("add_aux_kernel", AuxKernel, false);
142  appendMooseObjectTask ("add_aux_kernel", VectorAuxKernel);
143  appendMooseObjectTask ("add_aux_kernel", ArrayAuxKernel);
144  registerMooseObjectTask("add_bound", Bounds, false);
145 
146  registerMooseObjectTask("add_scalar_kernel", ScalarKernel, false);
147  registerMooseObjectTask("add_aux_scalar_kernel", AuxScalarKernel, false);
148  registerMooseObjectTask("add_dirac_kernel", DiracKernel, false);
149  appendMooseObjectTask ("add_dirac_kernel", VectorDiracKernel);
150  registerMooseObjectTask("add_dg_kernel", DGKernel, false);
151  registerMooseObjectTask("add_fv_kernel", FVKernel, false);
152  registerMooseObjectTask("add_linear_fv_kernel", LinearFVKernel, false);
153  registerMooseObjectTask("add_fv_bc", FVBoundaryCondition, false);
154  registerMooseObjectTask("add_linear_fv_bc", LinearFVBoundaryCondition, false);
155  registerMooseObjectTask("add_fv_ik", FVInterfaceKernel, false);
156  registerMooseObjectTask("add_interface_kernel", InterfaceKernel, false);
157  appendMooseObjectTask ("add_interface_kernel", VectorInterfaceKernel);
158  registerMooseObjectTask("add_constraint", Constraint, false);
159  registerMooseObjectTask("add_hybridized_kernel", HDGKernel, false);
160  registerMooseObjectTask("add_hybridized_integrated_bc", HDGIntegratedBC, false);
161 
162  registerMooseObjectTask("add_ic", InitialCondition, false);
163  appendMooseObjectTask ("add_ic", ScalarInitialCondition);
164 
165  registerMooseObjectTask("add_fv_ic", FVInitialCondition, false);
166 
167  registerMooseObjectTask("add_damper", Damper, false);
168  registerMooseObjectTask("setup_predictor", Predictor, false);
169  registerMooseObjectTask("add_time_steppers", TimeStepper, false);
170  registerMooseObjectTask("add_time_stepper", TimeStepper, false);
171  registerTask ("compose_time_stepper", true);
172  registerMooseObjectTask("setup_time_integrators", TimeIntegrator, false);
173  registerMooseObjectTask("setup_time_integrator", TimeIntegrator, false);
174  registerMooseObjectTask("add_convergence", Convergence, false);
175 
176  registerMooseObjectTask("add_preconditioning", MoosePreconditioner, false);
177  registerMooseObjectTask("add_field_split", Split, false);
178 
179  registerMooseObjectTask("add_mesh_division", MeshDivision, false);
180  registerMooseObjectTask("add_user_object", UserObject, false);
181  appendMooseObjectTask ("add_user_object", Postprocessor);
182  appendDeprecatedMooseObjectTask("add_user_object", Corrector);
183  registerMooseObjectTask("add_corrector", Corrector, false);
184  appendDeprecatedMooseObjectTask("add_user_object", MeshModifier);
185  registerMooseObjectTask("add_mesh_modifier", MeshModifier, false);
186 
187  registerMooseObjectTask("add_postprocessor", Postprocessor, false);
188  registerMooseObjectTask("add_vector_postprocessor", VectorPostprocessor, false);
189  registerMooseObjectTask("add_reporter", Reporter, false);
190  registerMooseObjectTask("add_positions", Positions, false);
191  registerMooseObjectTask("add_times", Times, false);
192 
193  registerMooseObjectTask("add_indicator", Indicator, false);
194  registerMooseObjectTask("add_marker", Marker, false);
195 
196  registerMooseObjectTask("add_multi_app", MultiApp, false);
197  registerMooseObjectTask("add_transfer", Transfer, false);
198 
199  registerMooseObjectTask("add_output", Output, false);
200 
201  registerMooseObjectTask("add_control", Control, false);
202  registerMooseObjectTask("add_chain_control", ChainControl, false);
203  registerMooseObjectTask("add_partitioner", MoosePartitioner, false);
204 
205  // clang-format on
206 
207  registerTask("dynamic_object_registration", false);
208  registerTask("common_output", true);
209  registerTask("setup_recover_file_base", true);
210  registerTask("recover_meta_data", true);
211 
212  registerTask("add_bounds_vectors", false);
213  registerTask("add_periodic_bc", false);
214  registerTask("add_aux_variable", false);
215  registerTask("add_external_aux_variables", true);
216  registerTask("add_variable", false);
217  registerTask("add_mortar_variable", false);
218 
219  registerTask("execute_mesh_generators", true);
220  registerTask("uniform_refine_mesh", false);
221  registerTask("prepare_mesh", false);
222  registerTask("delete_remote_elements_after_late_geometric_ghosting", false);
223  registerTask("setup_mesh_complete", true); // calls prepare
224  registerTask("post_mesh_prepared", false);
225  registerTask("add_geometric_rm", false);
226  registerTask("attach_geometric_rm", true);
227  registerTask("attach_geometric_rm_final", true);
228 
229  registerTask("init_displaced_problem", false);
230 
231  registerTask("add_algebraic_rm", false);
232  registerTask("attach_algebraic_rm", true);
233  registerTask("add_coupling_rm", false);
234  registerTask("attach_coupling_rm", true);
235  registerTask("init_problem", true);
236  registerTask("check_copy_nodal_vars", true);
237  registerTask("copy_nodal_vars", true);
238  registerTask("copy_nodal_aux_vars", true);
239  registerTask("copy_vars_physics", false);
240  registerTask("setup_postprocessor_data", false);
241  registerTask("setup_time_steppers", true);
242 
243  registerTask("setup_dampers", true);
244  registerTask("check_integrity", true);
245  registerTask("resolve_optional_materials", true);
246  registerTask("check_integrity_early", true);
247  registerTask("check_integrity_early_physics", false);
248  registerTask("setup_quadrature", true);
249 
250  registerTask("mesh_modifiers", false);
251 
253  registerTask("no_action", false); // Used for Empty Action placeholders
254  registerTask("set_global_params", false);
255  registerTask("setup_adaptivity", false);
256  registerTask("meta_action", false);
257  registerTask("setup_residual_debug", false);
258  registerTask("setup_oversampling", false);
259  registerTask("deprecated_block", false);
260  registerTask("set_adaptivity_options", false);
261  registerTask("add_mortar_interface", false);
262  registerTask("coupling_functor_check", true);
263  registerTask("add_master_action_material", false);
264  registerTask("setup_projected_properties", false);
265  registerTask("create_application_block", false);
266 
267  // Dummy Actions (useful for sync points in the dependencies)
268  registerTask("setup_function_complete", false);
269  registerTask("setup_variable_complete", false);
270  registerTask("setup_executioner_complete", false);
271  registerTask("ready_to_init", true);
272 
273  // Output related actions
274  registerTask("add_output_aux_variables", true);
275  registerTask("check_output", true);
276  registerTask("declare_late_reporters", true);
277 
278  registerTask("create_problem_default", true);
279  registerTask("create_problem_custom", false);
280  registerTask("create_problem_complete", false);
281 
282  registerTask("add_default_nonlinear_convergence", true);
283  registerTask("add_default_multiapp_fixed_point_convergence", true);
284 
285  registerTask("chain_control_setup", true);
286 
287  // Action for setting up the signal-based checkpoint
288  registerTask("auto_checkpoint_action", true);
289  /**************************/
290  /****** Dependencies ******/
291  /**************************/
302  // clang-format off
303  syntax.addDependencySets("(meta_action)"
304  "(meta_action_component)"
305  "(dynamic_object_registration)"
306  "(common_output)"
307  "(set_global_params)"
308  "(setup_recover_file_base)"
309  "(check_copy_nodal_vars)"
310  "(setup_mesh)"
311  "(add_geometric_rm)"
312  "(add_partitioner)"
313  "(add_mesh_generator)"
314  "(create_added_mesh_generators)"
315  "(append_mesh_generator)"
316  "(execute_mesh_generators)"
317  "(recover_meta_data)"
318  "(set_mesh_base)"
319  "(attach_geometric_rm)"
320  "(init_mesh)"
321  "(prepare_mesh)"
322  "(add_mortar_interface)"
323  "(uniform_refine_mesh)"
324  "(setup_mesh_complete)"
325  "(post_mesh_prepared)"
326  "(determine_system_type)"
327  "(create_problem)"
328  "(create_problem_custom)"
329  "(create_problem_default)"
330  "(create_problem_complete)"
331  "(init_displaced_problem)" // Problem must be init-ed before we start adding functors
332  "(add_function)" // Functions can depend on scalar variables & PPs, but this dependence can be
333  // added on initialSetup() rather than construction
334  "(init_component_physics)" // components must add their blocks to physics before init_physics
335  "(init_physics)"
336  "(setup_postprocessor_data)"
337  "(setup_time_integrator, setup_time_integrators)"
338  "(setup_executioner)"
339  "(setup_executioner_complete)"
340  "(setup_component)" // no particular reason for that placement
341  "(read_executor)"
342  "(add_executor)"
343  "(check_integrity_early)"
344  "(setup_predictor)"
345  "(add_aux_variable, add_variable, add_elemental_field_variable,"
346  " add_external_aux_variables)"
347  "(add_mortar_variable)"
348  "(setup_variable_complete)"
349  "(check_integrity_early_physics)" // checks that systems and variables are consistent
350  "(setup_quadrature)"
351  "(add_convergence)"
352  "(add_default_nonlinear_convergence,"
353  " add_default_multiapp_fixed_point_convergence)"
354  "(add_periodic_bc)"
355  "(add_user_object, add_corrector, add_mesh_modifier)"
356  "(add_distribution)"
357  "(add_sampler)"
358  "(setup_function_complete)"
359  "(setup_adaptivity)"
360  "(set_adaptivity_options)"
361  "(add_ic, add_fv_ic)"
362  "(add_constraint, add_field_split)"
363  "(add_preconditioning)"
364  "(add_times)"
365  "(add_time_stepper, add_time_steppers)"
366  "(compose_time_stepper)"
367  "(setup_time_steppers)"
368  "(ready_to_init)"
369  "(setup_dampers)"
370  "(setup_residual_debug)"
371  "(add_bounds_vectors)"
372  "(add_positions)"
373  "(add_mesh_division)" // NearestPositionsDivision uses a Positions
374  "(add_multi_app)"
375  "(add_transfer)"
376  "(copy_nodal_vars, copy_nodal_aux_vars, copy_vars_physics)"
377  "(add_material)"
378  "(add_master_action_material)"
379  "(add_functor_material)"
380  "(setup_projected_properties)"
381  "(add_output_aux_variables)"
382  "(add_output)"
383  "(auto_checkpoint_action)"
384  "(add_postprocessor)"
385  "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
386  // to be after material objects are created.
387  "(add_reporter)"
388  "(declare_late_reporters)"
389  "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
390  " add_nodal_kernel, add_dg_kernel, add_fv_kernel, add_linear_fv_kernel,"
391  " add_fv_bc, add_linear_fv_bc, add_fv_ik, add_interface_kernel,"
392  " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker,"
393  " add_bound, add_hybridized_kernel, add_hybridized_integrated_bc)"
394  "(resolve_optional_materials)"
395  "(add_algebraic_rm)"
396  "(add_coupling_rm)"
397  "(attach_geometric_rm_final)"
398  "(attach_algebraic_rm)"
399  "(attach_coupling_rm)"
400  "(coupling_functor_check)"
401  "(delete_remote_elements_after_late_geometric_ghosting)"
402  "(init_problem)"
403  "(add_control, add_chain_control)"
404  "(chain_control_setup)"
405  "(check_output)"
406  "(check_integrity)"
407  "(create_application_block)");
408  // clang-format on
409 
410 #ifdef MOOSE_MFEM_ENABLED
411  registerTask("add_mfem_problem_operator", true);
412  addTaskDependency("add_mfem_problem_operator", "init_mesh");
413  addTaskDependency("add_variable", "add_mfem_problem_operator");
414  addTaskDependency("add_aux_variable", "add_mfem_problem_operator");
415  addTaskDependency("add_elemental_field_variable", "add_mfem_problem_operator");
416  addTaskDependency("add_kernel", "add_mfem_problem_operator");
417 
418  // add SubMeshes
419  registerMooseObjectTask("add_mfem_submeshes", MFEMSubMesh, false);
420  addTaskDependency("add_mfem_submeshes", "create_problem_complete");
421 
422  // add SubMesh transfers
423  appendMooseObjectTask("add_transfer", MFEMSubMeshTransfer);
424 
425  // add FESpaces
426  registerMooseObjectTask("add_mfem_fespaces", MFEMFESpace, false);
427  appendMooseObjectTask("add_mfem_fespaces", MFEMFECollection);
428  addTaskDependency("add_mfem_fespaces", "add_mfem_submeshes");
429  addTaskDependency("add_variable", "add_mfem_fespaces");
430  addTaskDependency("add_aux_variable", "add_mfem_fespaces");
431  addTaskDependency("add_elemental_field_variable", "add_mfem_fespaces");
432  addTaskDependency("add_kernel", "add_mfem_fespaces");
433 
434  // set mesh FE space
435  registerTask("set_mesh_fe_space", true);
436  addTaskDependency("set_mesh_fe_space", "add_variable");
437  addTaskDependency("set_mesh_fe_space", "init_mesh");
438 
439  // add preconditioning.
440  registerMooseObjectTask("add_mfem_preconditioner", MFEMSolverBase, false);
441  addTaskDependency("add_mfem_preconditioner", "add_mfem_problem_operator");
442  addTaskDependency("add_mfem_preconditioner", "add_variable");
443 
444  // add solver.
445  registerMooseObjectTask("add_mfem_solver", MFEMSolverBase, true);
446  addTaskDependency("add_mfem_solver", "add_mfem_preconditioner");
447  addTaskDependency("add_mfem_solver", "add_mfem_problem_operator");
448 #endif
449 
450  registerTask("parse_neml2", /*required=*/false);
451  addTaskDependency("add_material", "parse_neml2");
452  addTaskDependency("add_user_object", "parse_neml2");
453 }
454 
483 void
484 registerActions(Syntax & syntax, ActionFactory & action_factory)
485 {
486  mooseDeprecated("use registerAll instead of registerActions");
487  registerActions(syntax, action_factory, {"MooseApp"});
488 }
489 
490 void
492  ActionFactory & action_factory,
493  const std::set<std::string> & obj_labels)
494 {
495  Registry::registerActionsTo(action_factory, obj_labels);
496 
497  // Add these actions here so they are always executed last, without setting any dependency
498  registerTask("dump_objects", false);
499  registerTask("finish_input_file_output", false);
500 }
501 
502 void
503 associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/)
504 {
510  registerSyntax("DiffusionCG", "Physics/Diffusion/ContinuousGalerkin/*");
511  registerSyntax("DiffusionFV", "Physics/Diffusion/FiniteVolume/*");
512 
513  registerSyntax("AddActionComponentAction", "ActionComponents/*");
514  registerSyntax("CombineComponentsMeshes", "ActionComponents");
515 
516  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "check_copy_nodal_vars");
517  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "copy_nodal_vars");
518  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "check_copy_nodal_vars");
519  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "copy_nodal_aux_vars");
520 
521  registerSyntaxTask("AddKernelAction", "Kernels/*", "add_kernel");
522  registerSyntaxTask("AddNodalKernelAction", "NodalKernels/*", "add_nodal_kernel");
523  registerSyntaxTask("AddKernelAction", "AuxKernels/*", "add_aux_kernel");
524 
525  registerSyntaxTask("AddHDGKernelAction", "HDGKernels/*", "add_hybridized_kernel");
526 
527  registerSyntax("AddAuxKernelAction", "AuxVariables/*/AuxKernel");
528 
529  registerSyntaxTask("AddScalarKernelAction", "ScalarKernels/*", "add_scalar_kernel");
530  registerSyntaxTask("AddScalarKernelAction", "AuxScalarKernels/*", "add_aux_scalar_kernel");
531 
532  registerSyntaxTask("AddBCAction", "BCs/*", "add_bc");
533 
534  registerSyntax("CreateProblemAction", "Problem");
535  registerSyntax("DynamicObjectRegistrationAction", "Problem");
536 
537  registerSyntax("SetupMeshAction", "Mesh");
538  registerSyntax("SetupMeshCompleteAction", "Mesh");
539  // Components should be able create a Mesh without a Mesh block
540  registerSyntax("CreateMeshSetupActionsForComponents", "ActionComponents");
541  registerSyntax("CreateDisplacedProblemAction", "Mesh");
542  registerSyntax("DisplayGhostingAction", "Mesh");
543  registerSyntax("AddMeshGeneratorAction", "Mesh/*");
544  registerSyntaxTask("EmptyAction", "Mesh/BatchMeshGeneratorAction", "no_action");
545  registerSyntax("BatchMeshGeneratorAction", "Mesh/BatchMeshGeneratorAction/*");
546  registerSyntax("ElementIDOutputAction", "Mesh");
547  syntax.registerSyntaxType("Mesh/*", "MeshGeneratorName");
548 
549  registerSyntax("AddFunctionAction", "Functions/*");
550  syntax.registerSyntaxType("Functions/*", "FunctionName");
551 
552  registerSyntax("AddMeshDivisionAction", "MeshDivisions/*");
553  syntax.registerSyntaxType("MeshDivisions/*", "MeshDivisionName");
554  registerSyntax("AddConvergenceAction", "Convergence/*");
555  syntax.registerSyntaxType("Convergence/*", "ConvergenceName");
556 
557  registerSyntax("GlobalParamsAction", "GlobalParams");
558 
559  registerSyntax("AddDistributionAction", "Distributions/*");
560  syntax.registerSyntaxType("Distributions/*", "DistributionName");
561 
562  registerSyntax("AddSamplerAction", "Samplers/*");
563  syntax.registerSyntaxType("Samplers/*", "SamplerName");
564 
565  registerSyntax("SetupDebugAction", "Debug");
566  registerSyntax("SetupResidualDebugAction", "Debug");
567 
569  registerSyntax("AddVariableAction", "Variables/*");
570  syntax.registerSyntaxType("Variables/*", "VariableName");
571  syntax.registerSyntaxType("Variables/*", "NonlinearVariableName");
572 
573  registerSyntax("AddICAction", "Variables/*/InitialCondition");
574  registerSyntax("AddFVICAction", "Variables/*/FVInitialCondition");
575 
576  registerSyntax("AddAuxVariableAction", "AuxVariables/*");
577  syntax.registerSyntaxType("AuxVariables/*", "VariableName");
578  syntax.registerSyntaxType("AuxVariables/*", "AuxVariableName");
579 
580  registerSyntax("AddICAction", "AuxVariables/*/InitialCondition");
581  registerSyntax("AddFVICAction", "AuxVariables/*/FVInitialCondition");
582 
583  registerSyntaxTask("EmptyAction", "BCs/Periodic", "no_action"); // placeholder
584  registerSyntax("AddPeriodicBCAction", "BCs/Periodic/*");
585 
586  registerSyntaxTask("AddInitialConditionAction", "ICs/*", "add_ic");
587  registerSyntaxTask("AddFVInitialConditionAction", "FVICs/*", "add_fv_ic");
588 
589  registerSyntax("AddMaterialAction", "Materials/*");
590  syntax.registerSyntaxType("Materials/*", "MaterialName");
591 
592  registerSyntax("AddFunctorMaterialAction", "FunctorMaterials/*");
593  syntax.registerSyntaxType("FunctorMaterials/*", "MaterialName");
594 
595  registerSyntax("AddPostprocessorAction", "Postprocessors/*");
596  syntax.registerSyntaxType("Postprocessors/*", "PostprocessorName");
597  syntax.registerSyntaxType("Postprocessors/*", "UserObjectName");
598 
599  registerSyntax("AddVectorPostprocessorAction", "VectorPostprocessors/*");
600  syntax.registerSyntaxType("VectorPostprocessors/*", "VectorPostprocessorName");
601 
602  registerSyntax("AddReporterAction", "Reporters/*");
603  syntax.registerSyntaxType("Reporters/*", "ReporterName");
604 
605  registerSyntax("AddPositionsAction", "Positions/*");
606  syntax.registerSyntaxType("Positions/*", "PositionsName");
607 
608  registerSyntax("AddTimesAction", "Times/*");
609  syntax.registerSyntaxType("Times/*", "TimesName");
610 
611  registerSyntax("AddDamperAction", "Dampers/*");
612 
613  registerSyntax("AddOutputAction", "Outputs/*");
614  registerSyntax("CommonOutputAction", "Outputs");
615  registerSyntax("MaterialOutputAction", "Outputs");
616  registerSyntax("AutoCheckpointAction", "Outputs");
617  syntax.registerSyntaxType("Outputs/*", "OutputName");
618 
619  // Note: Preconditioner Actions will be built by this setup action
620  registerSyntax("SetupPreconditionerAction", "Preconditioning/*");
621  registerSyntax("AddFieldSplitAction", "Preconditioning/*/*");
622 
623  registerSyntax("CreateExecutionerAction", "Executioner");
624  registerSyntax("ReadExecutorParamsAction", "Executors/*");
625 
626  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeSteppers/*", "add_time_steppers");
627  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeStepper", "add_time_stepper");
628  registerSyntaxTask(
629  "ComposeTimeStepperAction", "Executioner/TimeSteppers", "compose_time_stepper");
630  registerSyntaxTask(
631  "SetupTimeIntegratorAction", "Executioner/TimeIntegrators/*", "setup_time_integrators");
632  registerSyntaxTask(
633  "SetupTimeIntegratorAction", "Executioner/TimeIntegrator", "setup_time_integrator");
634  syntax.registerSyntaxType("Executors/*", "ExecutorName");
635 
636  registerSyntax("SetupQuadratureAction", "Executioner/Quadrature");
637  registerSyntax("SetupPredictorAction", "Executioner/Predictor");
638 #ifdef LIBMESH_ENABLE_AMR
639  registerSyntax("AdaptivityAction", "Executioner/Adaptivity");
640 #endif
641 
642  registerSyntax("PartitionerAction", "Mesh/Partitioner");
643 
644  registerSyntax("AddDiracKernelAction", "DiracKernels/*");
645 
646  registerSyntax("AddDGKernelAction", "DGKernels/*");
647  registerSyntax("AddFVKernelAction", "FVKernels/*");
648  registerSyntax("AddFVBCAction", "FVBCs/*");
649  registerSyntax("AddLinearFVBCAction", "LinearFVBCs/*");
650  registerSyntax("AddFVInterfaceKernelAction", "FVInterfaceKernels/*");
651  registerSyntax("CheckFVBCAction", "FVBCs");
652 
653  registerSyntax("AddLinearFVKernelAction", "LinearFVKernels/*");
654 
655  registerSyntax("AddInterfaceKernelAction", "InterfaceKernels/*");
656 
657  registerSyntax("AddConstraintAction", "Constraints/*");
658 
659  registerSyntax("AddControlAction", "Controls/*");
660  registerSyntax("AddChainControlAction", "ChainControls/*");
661  registerSyntax("AddBoundAction", "Bounds/*");
662  registerSyntax("AddBoundsVectorsAction", "Bounds");
663 
664  // UserObject and some derived classes
665  registerSyntax("AddUserObjectAction", "UserObjects/*");
666  syntax.registerSyntaxType("UserObjects/*", "UserObjectName");
667  registerSyntax("AddCorrectorAction", "Correctors/*");
668  syntax.registerSyntaxType("Correctors/*", "UserObjectName");
669  registerSyntax("AddMeshModifiersAction", "MeshModifiers/*");
670  syntax.registerSyntaxType("MeshModifiers/*", "UserObjectName");
671 
672  registerSyntax("AddNodalNormalsAction", "NodalNormals");
673 
674  // Indicator
675  registerSyntax("AddElementalFieldAction", "Adaptivity/Indicators/*");
676  registerSyntax("AddIndicatorAction", "Adaptivity/Indicators/*");
677  syntax.registerSyntaxType("Adaptivity/Indicators/*", "IndicatorName");
678 
679  // Marker
680  registerSyntax("AddElementalFieldAction", "Adaptivity/Markers/*");
681  registerSyntax("AddMarkerAction", "Adaptivity/Markers/*");
682  syntax.registerSyntaxType("Adaptivity/Markers/*", "MarkerName");
683 
684  // New Adaptivity System
685  registerSyntax("SetAdaptivityOptionsAction", "Adaptivity");
686 
687  // Deprecated Block
688  registerSyntax("DeprecatedBlockAction", "DeprecatedBlock");
689 
690  // Multi Apps
691  registerSyntax("AddMultiAppAction", "MultiApps/*");
692  syntax.registerSyntaxType("MultiApps/*", "MultiAppName");
693 
694  // Transfers
695  registerSyntax("AddTransferAction", "Transfers/*");
696 
697  // Material derivative test
698  registerSyntaxTask("EmptyAction", "Debug/MaterialDerivativeTest", "no_action"); // placeholder
699  registerSyntax("MaterialDerivativeTestAction", "Debug/MaterialDerivativeTest/*");
700 
701  registerSyntax("ProjectedStatefulMaterialStorageAction", "ProjectedStatefulMaterialStorage/*");
702 
703  // Application Block System
704  registerSyntax("CreateApplicationBlockAction", "Application");
705 
706 #ifdef MOOSE_MFEM_ENABLED
707  registerSyntaxTask("AddMFEMSubMeshAction", "SubMeshes/*", "add_mfem_submeshes");
708  registerSyntaxTask("AddMFEMFESpaceAction", "FESpaces/*", "add_mfem_fespaces");
709  registerSyntaxTask("AddMFEMPreconditionerAction", "Preconditioner/*", "add_mfem_preconditioner");
710  registerSyntaxTask("AddMFEMSolverAction", "Solver", "add_mfem_solver");
711 #endif
712 
713  registerSyntax("NEML2ActionCommon", "NEML2");
714  registerSyntax("NEML2Action", "NEML2/*");
715 
716  addActionTypes(syntax);
717 }
718 
719 void
720 associateSyntax(Syntax & syntax, ActionFactory & action_factory)
721 {
722  associateSyntaxInner(syntax, action_factory);
723  registerActions(syntax, action_factory);
724 }
725 
726 void
728 {
729  // May be a touch expensive to create a new DM every time, but probably safer to do it this way
731 }
732 
733 MPI_Comm
734 swapLibMeshComm(MPI_Comm new_comm)
735 {
736  MPI_Comm old_comm = PETSC_COMM_WORLD;
737  PETSC_COMM_WORLD = new_comm;
738  return old_comm;
739 }
740 
741 static bool _color_console = isatty(fileno(stdout));
742 
743 bool
745 {
746  return _color_console;
747 }
748 
749 bool
750 setColorConsole(bool use_color, bool force)
751 {
752  _color_console = (isatty(fileno(stdout)) || force) && use_color;
753  return _color_console;
754 }
755 
756 bool _warnings_are_errors = false;
757 bool _deprecated_is_error = false;
758 bool _throw_on_error = false;
759 bool _throw_on_warning = false;
761 bool show_trace = true;
762 bool show_multiple = false;
763 
764 } // namespace Moose
const ExecFlagType EXEC_LINEAR_CONVERGENCE
Definition: Moose.C:30
bool show_trace
Set to true (the default) to print the stack trace with error and warning messages - false to omit it...
Definition: Moose.C:761
Base class for function objects.
Definition: Function.h:36
A kernel for hybridized finite element formulations.
Definition: HDGKernel.h:17
Base class for boundary conditions for linear FV systems.
bool colorConsole()
Returns whether Console coloring is turned on (default: true).
Definition: Moose.C:744
Base class for split-based preconditioners.
Definition: Split.h:25
Base class for finite volume kernels that contribute to a linear systems.
MPI_Comm swapLibMeshComm(MPI_Comm new_comm)
Swap the libMesh MPI communicator out for ours.
Definition: Moose.C:734
const ExecFlagType EXEC_PRE_KERNELS
Definition: Moose.C:52
Generic factory class for build all sorts of objects.
Definition: Factory.h:28
void setSolverDefaults(FEProblemBase &problem)
Definition: Moose.C:727
This is the base class for Samplers as used within the Stochastic Tools module.
Definition: Sampler.h:43
Base class for predictors.
Definition: Predictor.h:28
void petscSetDefaults(FEProblemBase &problem)
Sets the default options for PETSc.
Definition: PetscSupport.C:488
Base class for creating new types of boundary conditions.
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
Definition: Moose.C:756
InterfaceKernel and VectorInterfaceKernel is responsible for interfacing physics across subdomains...
void registerActions(Syntax &syntax, ActionFactory &action_factory)
Multiple Action class can be associated with a single input file section, in which case all associate...
Definition: Moose.C:484
This is a template class that implements the workhorse compute and computeNodal methods.
Base class for all Constraint types.
Definition: Constraint.h:19
const ExecFlagType EXEC_PRE_MULTIAPP_SETUP
Definition: Moose.C:50
Positions objects are under the hood Reporters.
Definition: Positions.h:20
Class that hold the whole problem being solved.
Definition: Problem.h:19
Definition: Marker.h:41
Base class for time stepping.
Definition: TimeStepper.h:22
Times objects are under the hood Reporters, but limited to a vector of Real.
Definition: Times.h:18
void associateSyntax(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:720
static void registerObjectsTo(Factory &f, const std::set< std::string > &labels)
This registers all MooseObjects known to the registry that have the given label(s) with the factory f...
Definition: Registry.C:34
const ExecFlagType EXEC_POST_ADAPTIVITY
Definition: Moose.C:54
All Distributions should inherit from this class.
Definition: Distribution.h:18
Class to transfer MFEM variable data to or from a restricted copy of the variable defined on an a sub...
Base class for MeshDivision objects.
Definition: MeshDivision.h:35
Reporter objects allow for the declaration of arbitrary data types that are aggregate values for a si...
Definition: Reporter.h:47
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Base class for MOOSE preconditioners.
Based class for output objects.
Definition: Output.h:43
FunctorMaterials compute functor material properties.
const ExecFlagType EXEC_ALWAYS
Definition: Moose.C:47
static void registerActionsTo(ActionFactory &f, const std::set< std::string > &labels)
This registers all Actions known to the registry that have the given label(s) with the factory f...
Definition: Registry.C:68
Base class for convergence criteria.
Definition: Convergence.h:21
The DGKernel class is responsible for calculating the residuals for various physics on internal sides...
Definition: DGKernel.h:18
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
Definition: Moose.C:757
static bool _color_console
Definition: Moose.C:741
Base class for making kernels that work on auxiliary scalar variables.
Base class for construction of a mfem::ParSubMesh object.
Definition: MFEMSubMesh.h:22
const ExecFlagType EXEC_TRANSFER
Definition: Moose.C:51
Specialized factory for generic Action System objects.
Definition: ActionFactory.h:50
Base class for creating kernels that interface physics between subdomains.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
const ExecFlagType EXEC_LINEAR
Definition: Moose.C:29
const ExecFlagType EXEC_FAILED
Definition: Moose.C:44
const ExecFlagType EXEC_NONLINEAR
Definition: Moose.C:31
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:30
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353
Base class for all Postprocessors.
Definition: Postprocessor.h:23
The behavior of this kernel is controlled by one problem-wise global parameter eigen_on_current - boo...
Definition: EigenKernel.h:23
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_BEGIN
Definition: Moose.C:38
const ExecFlagType EXEC_TIMESTEP_END
Definition: Moose.C:34
InitialConditions are objects that set the initial value of variables.
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition: DiracKernel.h:19
Constructs and stores an mfem::ParFiniteElementSpace object.
Definition: MFEMFESpace.h:22
void addDependencySets(const std::string &action_sets)
Adds all dependencies in a single call.
Definition: Syntax.C:69
FVKernel is a base class for all finite volume method kernels.
Definition: FVKernel.h:32
Base class for creating new types of boundary conditions.
Base class for time integrators.
bool show_multiple
Set to false (the default) to display an error message only once for each error call code location (a...
Definition: Moose.C:762
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:18
Base class for Control objects.
Definition: Control.h:33
bool _throw_on_warning
Variable to turn on exceptions during mooseWarning(), should only be used in MOOSE unit tests...
Definition: Moose.C:759
void registerSyntaxType(const std::string &syntax, const std::string &type)
Register a type with a block.
Definition: Syntax.C:362
void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Register objects that are in MOOSE.
Definition: Moose.C:63
void registerObjects(Factory &factory, const std::set< std::string > &obj_labels)
Definition: Moose.C:73
Base class for MOOSE partitioner.
bool setColorConsole(bool use_color, bool force=false)
Turns color escape sequences on/off for info written to stdout.
Definition: Moose.C:750
Base class for wrapping mfem::Solver-derived classes.
Base class for deriving dampers.
Definition: Damper.h:24
Holding syntax for parsing input files.
Definition: Syntax.h:21
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_END
Definition: Moose.C:36
const ExecFlagType EXEC_CUSTOM
Definition: Moose.C:45
Definition: Kernel.h:15
const ExecFlagType EXEC_SUBDOMAIN
Definition: Moose.C:46
int interrupt_signal_number
Used by the signal handler to determine if we should write a checkpoint file out at any point during ...
Definition: Moose.C:760
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:35
const ExecFlagType EXEC_POSTCHECK
Definition: Moose.C:33
const ExecFlagType EXEC_FORCED
Definition: Moose.C:43
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const ExecFlagType EXEC_SAME_AS_MULTIAPP
Definition: Moose.C:49
const ExecFlagType EXEC_FINAL
Definition: Moose.C:42
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:28
const ExecFlagType EXEC_NONE
Definition: Moose.C:27
Base class for creating nodal kernels with hand-coded Jacobians.
Definition: NodalKernel.h:17
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:112
Base class for Postprocessors that produce a vector of values.
bool _throw_on_error
Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or wh...
Definition: Moose.C:758
MaterialBases compute MaterialProperties.
Definition: MaterialBase.h:62
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
This is a template class that implements the workhorse compute and computeNodal methods.
Base class for user-specific data.
Definition: UserObject.h:40
void addActionTypes(Syntax &syntax)
Definition: Moose.C:79
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26
const ExecFlagType EXEC_NONLINEAR_CONVERGENCE
Definition: Moose.C:32
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:503
Control that additionally provides the capability to produce/consume data values, to allow control op...
Definition: ChainControl.h:21
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_CONVERGENCE
Definition: Moose.C:40
Base class for all Transfer objects.
Definition: Transfer.h:36
const ExecFlagType EXEC_PRE_DISPLACE
Definition: Moose.C:48