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  registerExecFlag("MULTIAPP_FIXED_POINT_ITERATION_END");
39  registerDefaultExecFlag("MULTIAPP_FIXED_POINT_END");
41  registerDefaultExecFlag("MULTIAPP_FIXED_POINT_BEGIN");
43  registerDefaultExecFlag("MULTIAPP_FIXED_POINT_CONVERGENCE");
44 const ExecFlagType EXEC_FINAL = registerDefaultExecFlag("FINAL");
45 const ExecFlagType EXEC_FORCED = registerExecFlag("FORCED");
46 const ExecFlagType EXEC_FAILED = registerExecFlag("FAILED");
47 const ExecFlagType EXEC_CUSTOM = registerDefaultExecFlag("CUSTOM");
48 const ExecFlagType EXEC_SUBDOMAIN = registerExecFlag("SUBDOMAIN");
49 const ExecFlagType EXEC_ALWAYS = registerExecFlag("ALWAYS");
50 const ExecFlagType EXEC_PRE_DISPLACE = registerExecFlag("PRE_DISPLACE");
51 const ExecFlagType EXEC_SAME_AS_MULTIAPP = registerExecFlag("SAME_AS_MULTIAPP");
52 const ExecFlagType EXEC_PRE_MULTIAPP_SETUP = registerExecFlag("PRE_MULTIAPP_SETUP");
53 const ExecFlagType EXEC_TRANSFER = registerExecFlag("TRANSFER");
54 const ExecFlagType EXEC_PRE_KERNELS = registerExecFlag("PRE_KERNELS");
55 #ifdef LIBMESH_ENABLE_AMR
56 const ExecFlagType EXEC_POST_ADAPTIVITY = registerExecFlag("POST_ADAPTIVITY");
57 #endif
58 
59 namespace Moose
60 {
61 
62 void associateSyntaxInner(Syntax & syntax, ActionFactory & action_factory);
63 
64 void
66 {
67  registerObjects(f, {"MooseApp"});
68  associateSyntaxInner(s, af);
69  registerActions(s, af, {"MooseApp"});
70  registerAppDataFilePath("moose");
71  registerRepository("moose", "github.com/idaholab/moose");
72 }
73 
74 void
75 registerObjects(Factory & factory, const std::set<std::string> & obj_labels)
76 {
77  Registry::registerObjectsTo(factory, obj_labels);
78 }
79 
80 void
82 {
95  // clang-format off
96  /**************************/
97  /**** Register Actions ****/
98  /**************************/
99  registerMooseObjectTask("create_problem", Problem, false);
100  registerMooseObjectTask("setup_executioner", Executioner, false);
101  registerMooseObjectTask("read_executor", Executor, false);
102  registerTask("add_executor", true);
103 
104  // TODO Organize these somewhere
105  registerTask("init_physics", false);
106  registerTask("init_component_physics", false);
107  registerTask("meta_action_component", false);
108  registerTask("setup_component", false);
109  // 'list_component' is used to retrieve ActionComponents for the syntax JSON
110  registerTask("list_component", false);
111 
112  // This task does not construct an object, but it needs all of the parameters that
113  // would normally be used to construct an object.
114  registerMooseObjectTask("determine_system_type", Executioner, true);
115 
116  registerMooseObjectTask("setup_mesh", MooseMesh, false);
117  registerMooseObjectTask("set_mesh_base", MooseMesh, false);
118  registerMooseObjectTask("init_mesh", MooseMesh, false);
119  registerMooseObjectTask("add_mesh_generator", MeshGenerator, false);
120  registerTask("create_added_mesh_generators", true);
121  registerMooseObjectTask("append_mesh_generator", MeshGenerator, false);
122 
123  registerMooseObjectTask("add_kernel", Kernel, false);
124  appendMooseObjectTask ("add_kernel", EigenKernel);
125  appendMooseObjectTask ("add_kernel", VectorKernel);
126  appendMooseObjectTask ("add_kernel", ArrayKernel);
127 
128  registerMooseObjectTask("add_variable", MooseVariableBase, false);
129  registerMooseObjectTask("add_aux_variable", MooseVariableBase, false);
130  registerMooseObjectTask("add_elemental_field_variable", MooseVariableBase, false);
131 
132  registerMooseObjectTask("add_nodal_kernel", NodalKernel, false);
133 
134  registerMooseObjectTask("add_functor_material", FunctorMaterial, false);
135  registerMooseObjectTask("add_material", MaterialBase, false);
136  appendDeprecatedMooseObjectTask("add_material", FunctorMaterial);
137  registerMooseObjectTask("add_bc", BoundaryCondition, false);
138 
139  registerMooseObjectTask("add_function", Function, false);
140  registerMooseObjectTask("add_distribution", Distribution, false);
141  registerMooseObjectTask("add_sampler", Sampler, false);
142 
143  registerMooseObjectTask("add_aux_kernel", AuxKernel, false);
144  appendMooseObjectTask ("add_aux_kernel", VectorAuxKernel);
145  appendMooseObjectTask ("add_aux_kernel", ArrayAuxKernel);
146  registerMooseObjectTask("add_bound", Bounds, false);
147 
148  registerMooseObjectTask("add_scalar_kernel", ScalarKernel, false);
149  registerMooseObjectTask("add_aux_scalar_kernel", AuxScalarKernel, false);
150  registerMooseObjectTask("add_dirac_kernel", DiracKernel, false);
151  appendMooseObjectTask ("add_dirac_kernel", VectorDiracKernel);
152  registerMooseObjectTask("add_dg_kernel", DGKernel, false);
153  registerMooseObjectTask("add_fv_kernel", FVKernel, false);
154  registerMooseObjectTask("add_linear_fv_kernel", LinearFVKernel, false);
155  registerMooseObjectTask("add_fv_bc", FVBoundaryCondition, false);
156  registerMooseObjectTask("add_linear_fv_bc", LinearFVBoundaryCondition, false);
157  registerMooseObjectTask("add_fv_ik", FVInterfaceKernel, false);
158  registerMooseObjectTask("add_interface_kernel", InterfaceKernel, false);
159  appendMooseObjectTask ("add_interface_kernel", VectorInterfaceKernel);
160  registerMooseObjectTask("add_constraint", Constraint, false);
161  registerMooseObjectTask("add_hybridized_kernel", HDGKernel, false);
162  registerMooseObjectTask("add_hybridized_integrated_bc", HDGIntegratedBC, false);
163 
164  registerMooseObjectTask("add_ic", InitialCondition, false);
165  appendMooseObjectTask ("add_ic", ScalarInitialCondition);
166 
167  registerMooseObjectTask("add_fv_ic", FVInitialCondition, false);
168 
169  registerMooseObjectTask("add_damper", Damper, false);
170  registerMooseObjectTask("setup_predictor", Predictor, false);
171  registerMooseObjectTask("add_time_steppers", TimeStepper, false);
172  registerMooseObjectTask("add_time_stepper", TimeStepper, false);
173  registerTask ("compose_time_stepper", true);
174  registerMooseObjectTask("setup_time_integrators", TimeIntegrator, false);
175  registerMooseObjectTask("setup_time_integrator", TimeIntegrator, false);
176  registerMooseObjectTask("add_convergence", Convergence, false);
177 
178  registerMooseObjectTask("add_preconditioning", MoosePreconditioner, false);
179  registerMooseObjectTask("add_field_split", Split, false);
180 
181  registerMooseObjectTask("add_mesh_division", MeshDivision, false);
182  registerMooseObjectTask("add_user_object", UserObject, false);
183  appendMooseObjectTask ("add_user_object", Postprocessor);
184  appendDeprecatedMooseObjectTask("add_user_object", Corrector);
185  registerMooseObjectTask("add_corrector", Corrector, false);
186  appendDeprecatedMooseObjectTask("add_user_object", MeshModifier);
187  registerMooseObjectTask("add_mesh_modifier", MeshModifier, false);
188 
189  registerMooseObjectTask("add_postprocessor", Postprocessor, false);
190  registerMooseObjectTask("add_vector_postprocessor", VectorPostprocessor, false);
191  registerMooseObjectTask("add_reporter", Reporter, false);
192  registerMooseObjectTask("add_positions", Positions, false);
193  registerMooseObjectTask("add_times", Times, false);
194 
195  registerMooseObjectTask("add_indicator", Indicator, false);
196  registerMooseObjectTask("add_marker", Marker, false);
197 
198  registerMooseObjectTask("add_multi_app", MultiApp, false);
199  registerMooseObjectTask("add_transfer", Transfer, false);
200 
201  registerMooseObjectTask("add_output", Output, false);
202 
203  registerMooseObjectTask("add_control", Control, false);
204  registerMooseObjectTask("add_chain_control", ChainControl, false);
205  registerMooseObjectTask("add_partitioner", MoosePartitioner, false);
206 
207  // clang-format on
208 
209  registerTask("dynamic_object_registration", false);
210  registerTask("common_output", true);
211  registerTask("setup_recover_file_base", true);
212  registerTask("recover_meta_data", true);
213 
214  registerTask("add_bounds_vectors", false);
215  registerTask("add_periodic_bc", false);
216  registerTask("add_aux_variable", false);
217  registerTask("add_external_aux_variables", true);
218  registerTask("add_variable", false);
219  registerTask("add_mortar_variable", false);
220 
221  registerTask("execute_mesh_generators", true);
222  registerTask("uniform_refine_mesh", false);
223  registerTask("prepare_mesh", false);
224  registerTask("delete_remote_elements_after_late_geometric_ghosting", false);
225  registerTask("setup_mesh_complete", true); // calls prepare
226  registerTask("post_mesh_prepared", false);
227  registerTask("add_geometric_rm", false);
228  registerTask("attach_geometric_rm", true);
229  registerTask("attach_geometric_rm_final", true);
230 
231  registerTask("init_displaced_problem", false);
232 
233  registerTask("add_algebraic_rm", false);
234  registerTask("attach_algebraic_rm", true);
235  registerTask("add_coupling_rm", false);
236  registerTask("attach_coupling_rm", true);
237  registerTask("init_problem", true);
238  registerTask("check_copy_nodal_vars", true);
239  registerTask("copy_nodal_vars", true);
240  registerTask("copy_nodal_aux_vars", true);
241  registerTask("copy_vars_physics", false);
242  registerTask("setup_postprocessor_data", false);
243  registerTask("setup_time_steppers", true);
244 
245  registerTask("setup_dampers", true);
246  registerTask("check_integrity", true);
247  registerTask("resolve_optional_materials", true);
248  registerTask("check_integrity_early", true);
249  registerTask("check_integrity_early_physics", false);
250  registerTask("setup_quadrature", true);
251 
252  registerTask("mesh_modifiers", false);
253 
255  registerTask("no_action", false); // Used for Empty Action placeholders
256  registerTask("set_global_params", false);
257  registerTask("setup_adaptivity", false);
258  registerTask("meta_action", false);
259  registerTask("setup_residual_debug", false);
260  registerTask("setup_oversampling", false);
261  registerTask("deprecated_block", false);
262  registerTask("set_adaptivity_options", false);
263  registerTask("add_mortar_interface", false);
264  registerTask("coupling_functor_check", true);
265  registerTask("add_master_action_material", false);
266  registerTask("setup_projected_properties", false);
267  registerTask("create_application_block", false);
268 
269  // Dummy Actions (useful for sync points in the dependencies)
270  registerTask("setup_function_complete", false);
271  registerTask("setup_variable_complete", false);
272  registerTask("setup_executioner_complete", false);
273  registerTask("ready_to_init", true);
274 
275  // Output related actions
276  registerTask("add_output_aux_variables", true);
277  registerTask("check_output", true);
278  registerTask("declare_late_reporters", true);
279 
280  registerTask("create_problem_default", true);
281  registerTask("create_problem_custom", false);
282  registerTask("create_problem_complete", false);
283 
284  registerTask("add_default_nonlinear_convergence", true);
285  registerTask("add_default_multiapp_fixed_point_convergence", true);
286  registerTask("add_default_steady_state_convergence", true);
287 
288  registerTask("chain_control_setup", true);
289 
290  // Action for setting up the signal-based checkpoint
291  registerTask("auto_checkpoint_action", true);
292  /**************************/
293  /****** Dependencies ******/
294  /**************************/
305  // clang-format off
306  syntax.addDependencySets("(meta_action)"
307  "(meta_action_component)"
308  "(dynamic_object_registration)"
309  "(common_output)"
310  "(set_global_params)"
311  "(setup_recover_file_base)"
312  "(check_copy_nodal_vars)"
313  "(setup_mesh)"
314  "(add_geometric_rm)"
315  "(add_partitioner)"
316  "(add_mesh_generator)"
317  "(create_added_mesh_generators)"
318  "(append_mesh_generator)"
319  "(execute_mesh_generators)"
320  "(recover_meta_data)"
321  "(set_mesh_base)"
322  "(attach_geometric_rm)"
323  "(init_mesh)"
324  "(prepare_mesh)"
325  "(add_mortar_interface)"
326  "(uniform_refine_mesh)"
327  "(setup_mesh_complete)"
328  "(post_mesh_prepared)"
329  "(determine_system_type)"
330  "(create_problem)"
331  "(create_problem_custom)"
332  "(create_problem_default)"
333  "(create_problem_complete)"
334  "(init_displaced_problem)" // Problem must be init-ed before we start adding functors
335  "(add_function)" // Functions can depend on scalar variables & PPs, but this dependence can be
336  // added on initialSetup() rather than construction
337  "(init_component_physics)" // components must add their blocks to physics before init_physics
338  "(init_physics)"
339  "(setup_postprocessor_data)"
340  "(setup_time_integrator, setup_time_integrators)"
341  "(setup_executioner)"
342  "(setup_executioner_complete)"
343  "(setup_component)" // no particular reason for that placement
344  "(read_executor)"
345  "(add_executor)"
346  "(check_integrity_early)"
347  "(setup_predictor)"
348  "(add_aux_variable, add_variable, add_elemental_field_variable,"
349  " add_external_aux_variables)"
350  "(add_mortar_variable)"
351  "(setup_variable_complete)"
352  "(check_integrity_early_physics)" // checks that systems and variables are consistent
353  "(setup_quadrature)"
354  "(add_convergence)"
355  "(add_default_nonlinear_convergence,"
356  " add_default_multiapp_fixed_point_convergence,"
357  " add_default_steady_state_convergence)"
358  "(add_positions)"
359  "(add_periodic_bc)"
360  "(add_user_object, add_corrector, add_mesh_modifier)"
361  "(add_distribution)"
362  "(add_sampler)"
363  "(setup_function_complete)"
364  "(setup_adaptivity)"
365  "(set_adaptivity_options)"
366  "(add_ic, add_fv_ic)"
367  "(add_constraint, add_field_split)"
368  "(add_preconditioning)"
369  "(add_times)"
370  "(add_time_stepper, add_time_steppers)"
371  "(compose_time_stepper)"
372  "(setup_time_steppers)"
373  "(ready_to_init)"
374  "(setup_dampers)"
375  "(setup_residual_debug)"
376  "(add_bounds_vectors)"
377  "(add_mesh_division)" // NearestPositionsDivision uses a Positions
378  "(add_multi_app)"
379  "(add_transfer)"
380  "(copy_nodal_vars, copy_nodal_aux_vars, copy_vars_physics)"
381  "(add_material)"
382  "(add_master_action_material)"
383  "(add_functor_material)"
384  "(setup_projected_properties)"
385  "(add_output_aux_variables)"
386  "(add_output)"
387  "(auto_checkpoint_action)"
388  "(add_postprocessor)"
389  "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
390  // to be after material objects are created.
391  "(add_reporter)"
392  "(declare_late_reporters)"
393  "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
394  " add_nodal_kernel, add_dg_kernel, add_fv_kernel, add_linear_fv_kernel,"
395  " add_fv_bc, add_linear_fv_bc, add_fv_ik, add_interface_kernel,"
396  " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker,"
397  " add_bound, add_hybridized_kernel, add_hybridized_integrated_bc)"
398  "(resolve_optional_materials)"
399  "(add_algebraic_rm)"
400  "(add_coupling_rm)"
401  "(attach_geometric_rm_final)"
402  "(attach_algebraic_rm)"
403  "(attach_coupling_rm)"
404  "(coupling_functor_check)"
405  "(delete_remote_elements_after_late_geometric_ghosting)"
406  "(init_problem)"
407  "(add_control, add_chain_control)"
408  "(chain_control_setup)"
409  "(check_output)"
410  "(check_integrity)"
411  "(create_application_block)");
412  // clang-format on
413 
414 #ifdef MOOSE_MFEM_ENABLED
415  registerTask("add_mfem_problem_operator", true);
416  addTaskDependency("add_mfem_problem_operator", "init_mesh");
417  addTaskDependency("add_variable", "add_mfem_problem_operator");
418  addTaskDependency("add_aux_variable", "add_mfem_problem_operator");
419  addTaskDependency("add_elemental_field_variable", "add_mfem_problem_operator");
420  addTaskDependency("add_kernel", "add_mfem_problem_operator");
421 
422  // add SubMeshes
423  registerMooseObjectTask("add_mfem_submeshes", MFEMSubMesh, false);
424  addTaskDependency("add_mfem_submeshes", "create_problem_complete");
425 
426  // add SubMesh transfers
427  appendMooseObjectTask("add_transfer", MFEMSubMeshTransfer);
428 
429  // add FESpaces
430  registerMooseObjectTask("add_mfem_fespaces", MFEMFESpace, false);
431  appendMooseObjectTask("add_mfem_fespaces", MFEMFECollection);
432  addTaskDependency("add_mfem_fespaces", "add_mfem_submeshes");
433  addTaskDependency("add_variable", "add_mfem_fespaces");
434  addTaskDependency("add_aux_variable", "add_mfem_fespaces");
435  addTaskDependency("add_elemental_field_variable", "add_mfem_fespaces");
436  addTaskDependency("add_kernel", "add_mfem_fespaces");
437 
438  // set mesh FE space
439  registerTask("set_mesh_fe_space", true);
440  addTaskDependency("set_mesh_fe_space", "add_variable");
441  addTaskDependency("set_mesh_fe_space", "init_mesh");
442 
443  // add preconditioning.
444  registerMooseObjectTask("add_mfem_preconditioner", MFEMSolverBase, false);
445  addTaskDependency("add_mfem_preconditioner", "add_mfem_problem_operator");
446  addTaskDependency("add_mfem_preconditioner", "add_variable");
447 
448  // add solver.
449  registerMooseObjectTask("add_mfem_solver", MFEMSolverBase, true);
450  addTaskDependency("add_mfem_solver", "add_mfem_preconditioner");
451  addTaskDependency("add_mfem_solver", "add_mfem_problem_operator");
452 #endif
453 
454  registerTask("parse_neml2", /*required=*/false);
455  addTaskDependency("add_material", "parse_neml2");
456  addTaskDependency("add_user_object", "parse_neml2");
457 }
458 
487 void
488 registerActions(Syntax & syntax, ActionFactory & action_factory)
489 {
490  mooseDeprecated("use registerAll instead of registerActions");
491  registerActions(syntax, action_factory, {"MooseApp"});
492 }
493 
494 void
496  ActionFactory & action_factory,
497  const std::set<std::string> & obj_labels)
498 {
499  Registry::registerActionsTo(action_factory, obj_labels);
500 
501  // Add these actions here so they are always executed last, without setting any dependency
502  registerTask("dump_objects", false);
503  registerTask("finish_input_file_output", false);
504 }
505 
506 void
507 associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/)
508 {
514  registerSyntax("DiffusionCG", "Physics/Diffusion/ContinuousGalerkin/*");
515  registerSyntax("DiffusionFV", "Physics/Diffusion/FiniteVolume/*");
516 
517  registerSyntax("AddActionComponentAction", "ActionComponents/*");
518  registerSyntax("CombineComponentsMeshes", "ActionComponents");
519 
520  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "check_copy_nodal_vars");
521  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "copy_nodal_vars");
522  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "check_copy_nodal_vars");
523  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "copy_nodal_aux_vars");
524 
525  registerSyntaxTask("AddKernelAction", "Kernels/*", "add_kernel");
526  registerSyntaxTask("AddNodalKernelAction", "NodalKernels/*", "add_nodal_kernel");
527  registerSyntaxTask("AddKernelAction", "AuxKernels/*", "add_aux_kernel");
528 
529  registerSyntaxTask("AddHDGKernelAction", "HDGKernels/*", "add_hybridized_kernel");
530 
531  registerSyntax("AddAuxKernelAction", "AuxVariables/*/AuxKernel");
532 
533  registerSyntaxTask("AddScalarKernelAction", "ScalarKernels/*", "add_scalar_kernel");
534  registerSyntaxTask("AddScalarKernelAction", "AuxScalarKernels/*", "add_aux_scalar_kernel");
535 
536  registerSyntaxTask("AddBCAction", "BCs/*", "add_bc");
537 
538  registerSyntax("CreateProblemAction", "Problem");
539  registerSyntax("DynamicObjectRegistrationAction", "Problem");
540 
541  registerSyntax("SetupMeshAction", "Mesh");
542  registerSyntax("SetupMeshCompleteAction", "Mesh");
543  // Components should be able create a Mesh without a Mesh block
544  registerSyntax("CreateMeshSetupActionsForComponents", "ActionComponents");
545  registerSyntax("CreateDisplacedProblemAction", "Mesh");
546  registerSyntax("DisplayGhostingAction", "Mesh");
547  registerSyntax("AddMeshGeneratorAction", "Mesh/*");
548  registerSyntaxTask("EmptyAction", "Mesh/BatchMeshGeneratorAction", "no_action");
549  registerSyntax("BatchMeshGeneratorAction", "Mesh/BatchMeshGeneratorAction/*");
550  registerSyntax("ElementIDOutputAction", "Mesh");
551  syntax.registerSyntaxType("Mesh/*", "MeshGeneratorName");
552 
553  registerSyntax("AddFunctionAction", "Functions/*");
554  syntax.registerSyntaxType("Functions/*", "FunctionName");
555 
556  registerSyntax("AddMeshDivisionAction", "MeshDivisions/*");
557  syntax.registerSyntaxType("MeshDivisions/*", "MeshDivisionName");
558  registerSyntax("AddConvergenceAction", "Convergence/*");
559  syntax.registerSyntaxType("Convergence/*", "ConvergenceName");
560 
561  registerSyntax("GlobalParamsAction", "GlobalParams");
562 
563  registerSyntax("AddDistributionAction", "Distributions/*");
564  syntax.registerSyntaxType("Distributions/*", "DistributionName");
565 
566  registerSyntax("AddSamplerAction", "Samplers/*");
567  syntax.registerSyntaxType("Samplers/*", "SamplerName");
568 
569  registerSyntax("SetupDebugAction", "Debug");
570  registerSyntax("SetupResidualDebugAction", "Debug");
571 
573  registerSyntax("AddVariableAction", "Variables/*");
574  syntax.registerSyntaxType("Variables/*", "VariableName");
575  syntax.registerSyntaxType("Variables/*", "NonlinearVariableName");
576 
577  registerSyntax("AddICAction", "Variables/*/InitialCondition");
578  registerSyntax("AddFVICAction", "Variables/*/FVInitialCondition");
579 
580  registerSyntax("AddAuxVariableAction", "AuxVariables/*");
581  syntax.registerSyntaxType("AuxVariables/*", "VariableName");
582  syntax.registerSyntaxType("AuxVariables/*", "AuxVariableName");
583 
584  registerSyntax("AddICAction", "AuxVariables/*/InitialCondition");
585  registerSyntax("AddFVICAction", "AuxVariables/*/FVInitialCondition");
586 
587  registerSyntaxTask("EmptyAction", "BCs/Periodic", "no_action"); // placeholder
588  registerSyntax("AddPeriodicBCAction", "BCs/Periodic/*");
589 
590  registerSyntaxTask("AddInitialConditionAction", "ICs/*", "add_ic");
591  registerSyntaxTask("AddFVInitialConditionAction", "FVICs/*", "add_fv_ic");
592 
593  registerSyntax("AddMaterialAction", "Materials/*");
594  syntax.registerSyntaxType("Materials/*", "MaterialName");
595 
596  registerSyntax("AddFunctorMaterialAction", "FunctorMaterials/*");
597  syntax.registerSyntaxType("FunctorMaterials/*", "MaterialName");
598 
599  registerSyntax("AddPostprocessorAction", "Postprocessors/*");
600  syntax.registerSyntaxType("Postprocessors/*", "PostprocessorName");
601  syntax.registerSyntaxType("Postprocessors/*", "UserObjectName");
602 
603  registerSyntax("AddVectorPostprocessorAction", "VectorPostprocessors/*");
604  syntax.registerSyntaxType("VectorPostprocessors/*", "VectorPostprocessorName");
605 
606  registerSyntax("AddReporterAction", "Reporters/*");
607  syntax.registerSyntaxType("Reporters/*", "ReporterName");
608 
609  registerSyntax("AddPositionsAction", "Positions/*");
610  syntax.registerSyntaxType("Positions/*", "PositionsName");
611 
612  registerSyntax("AddTimesAction", "Times/*");
613  syntax.registerSyntaxType("Times/*", "TimesName");
614 
615  registerSyntax("AddDamperAction", "Dampers/*");
616 
617  registerSyntax("AddOutputAction", "Outputs/*");
618  registerSyntax("CommonOutputAction", "Outputs");
619  registerSyntax("MaterialOutputAction", "Outputs");
620  registerSyntax("AutoCheckpointAction", "Outputs");
621  syntax.registerSyntaxType("Outputs/*", "OutputName");
622 
623  // Note: Preconditioner Actions will be built by this setup action
624  registerSyntax("SetupPreconditionerAction", "Preconditioning/*");
625  registerSyntax("AddFieldSplitAction", "Preconditioning/*/*");
626 
627  registerSyntax("CreateExecutionerAction", "Executioner");
628  registerSyntax("ReadExecutorParamsAction", "Executors/*");
629 
630  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeSteppers/*", "add_time_steppers");
631  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeStepper", "add_time_stepper");
632  registerSyntaxTask(
633  "ComposeTimeStepperAction", "Executioner/TimeSteppers", "compose_time_stepper");
634  registerSyntaxTask(
635  "SetupTimeIntegratorAction", "Executioner/TimeIntegrators/*", "setup_time_integrators");
636  registerSyntaxTask(
637  "SetupTimeIntegratorAction", "Executioner/TimeIntegrator", "setup_time_integrator");
638  syntax.registerSyntaxType("Executors/*", "ExecutorName");
639 
640  registerSyntax("SetupQuadratureAction", "Executioner/Quadrature");
641  registerSyntax("SetupPredictorAction", "Executioner/Predictor");
642 #ifdef LIBMESH_ENABLE_AMR
643  registerSyntax("AdaptivityAction", "Executioner/Adaptivity");
644 #endif
645 
646  registerSyntax("PartitionerAction", "Mesh/Partitioner");
647 
648  registerSyntax("AddDiracKernelAction", "DiracKernels/*");
649 
650  registerSyntax("AddDGKernelAction", "DGKernels/*");
651  registerSyntax("AddFVKernelAction", "FVKernels/*");
652  registerSyntax("AddFVBCAction", "FVBCs/*");
653  registerSyntax("AddLinearFVBCAction", "LinearFVBCs/*");
654  registerSyntax("AddFVInterfaceKernelAction", "FVInterfaceKernels/*");
655  registerSyntax("CheckFVBCAction", "FVBCs");
656 
657  registerSyntax("AddLinearFVKernelAction", "LinearFVKernels/*");
658 
659  registerSyntax("AddInterfaceKernelAction", "InterfaceKernels/*");
660 
661  registerSyntax("AddConstraintAction", "Constraints/*");
662 
663  registerSyntax("AddControlAction", "Controls/*");
664  registerSyntax("AddChainControlAction", "ChainControls/*");
665  registerSyntax("AddBoundAction", "Bounds/*");
666  registerSyntax("AddBoundsVectorsAction", "Bounds");
667 
668  // UserObject and some derived classes
669  registerSyntax("AddUserObjectAction", "UserObjects/*");
670  syntax.registerSyntaxType("UserObjects/*", "UserObjectName");
671  registerSyntax("AddCorrectorAction", "Correctors/*");
672  syntax.registerSyntaxType("Correctors/*", "UserObjectName");
673  registerSyntax("AddMeshModifiersAction", "MeshModifiers/*");
674  syntax.registerSyntaxType("MeshModifiers/*", "UserObjectName");
675 
676  registerSyntax("AddNodalNormalsAction", "NodalNormals");
677 
678  // Indicator
679  registerSyntax("AddElementalFieldAction", "Adaptivity/Indicators/*");
680  registerSyntax("AddIndicatorAction", "Adaptivity/Indicators/*");
681  syntax.registerSyntaxType("Adaptivity/Indicators/*", "IndicatorName");
682 
683  // Marker
684  registerSyntax("AddElementalFieldAction", "Adaptivity/Markers/*");
685  registerSyntax("AddMarkerAction", "Adaptivity/Markers/*");
686  syntax.registerSyntaxType("Adaptivity/Markers/*", "MarkerName");
687 
688  // New Adaptivity System
689  registerSyntax("SetAdaptivityOptionsAction", "Adaptivity");
690 
691  // Deprecated Block
692  registerSyntax("DeprecatedBlockAction", "DeprecatedBlock");
693 
694  // Multi Apps
695  registerSyntax("AddMultiAppAction", "MultiApps/*");
696  syntax.registerSyntaxType("MultiApps/*", "MultiAppName");
697 
698  // Transfers
699  registerSyntax("AddTransferAction", "Transfers/*");
700 
701  // Material derivative test
702  registerSyntaxTask("EmptyAction", "Debug/MaterialDerivativeTest", "no_action"); // placeholder
703  registerSyntax("MaterialDerivativeTestAction", "Debug/MaterialDerivativeTest/*");
704 
705  registerSyntax("ProjectedStatefulMaterialStorageAction", "ProjectedStatefulMaterialStorage/*");
706 
707  // Application Block System
708  registerSyntax("CreateApplicationBlockAction", "Application");
709 
710 #ifdef MOOSE_MFEM_ENABLED
711  registerSyntaxTask("AddMFEMSubMeshAction", "SubMeshes/*", "add_mfem_submeshes");
712  registerSyntaxTask("AddMFEMFESpaceAction", "FESpaces/*", "add_mfem_fespaces");
713  registerSyntaxTask("AddMFEMPreconditionerAction", "Preconditioner/*", "add_mfem_preconditioner");
714  registerSyntaxTask("AddMFEMSolverAction", "Solver", "add_mfem_solver");
715 #endif
716 
717  registerSyntax("NEML2ActionCommon", "NEML2");
718  registerSyntax("NEML2Action", "NEML2/*");
719 
720  addActionTypes(syntax);
721 }
722 
723 void
724 associateSyntax(Syntax & syntax, ActionFactory & action_factory)
725 {
726  associateSyntaxInner(syntax, action_factory);
727  registerActions(syntax, action_factory);
728 }
729 
730 void
732 {
733  // May be a touch expensive to create a new DM every time, but probably safer to do it this way
735 }
736 
737 MPI_Comm
738 swapLibMeshComm(MPI_Comm new_comm)
739 {
740  MPI_Comm old_comm = PETSC_COMM_WORLD;
741  PETSC_COMM_WORLD = new_comm;
742  return old_comm;
743 }
744 
745 static bool _color_console = isatty(fileno(stdout));
746 
747 bool
749 {
750  return _color_console;
751 }
752 
753 bool
754 setColorConsole(bool use_color, bool force)
755 {
756  _color_console = (isatty(fileno(stdout)) || force) && use_color;
757  return _color_console;
758 }
759 
760 bool _warnings_are_errors = false;
761 bool _deprecated_is_error = false;
762 bool _throw_on_error = false;
763 bool _throw_on_warning = false;
765 bool show_trace = true;
766 bool show_multiple = false;
767 
768 } // 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:765
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:748
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:738
const ExecFlagType EXEC_PRE_KERNELS
Definition: Moose.C:54
Generic factory class for build all sorts of objects.
Definition: Factory.h:28
void setSolverDefaults(FEProblemBase &problem)
Definition: Moose.C:731
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:760
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:488
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:52
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:724
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:56
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:49
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:761
static bool _color_console
Definition: Moose.C:745
Base class for making kernels that work on auxiliary scalar variables.
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_ITERATION_END
Definition: Moose.C:36
Base class for construction of a mfem::ParSubMesh object.
Definition: MFEMSubMesh.h:22
const ExecFlagType EXEC_TRANSFER
Definition: Moose.C:53
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:46
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:40
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:766
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:763
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:65
void registerObjects(Factory &factory, const std::set< std::string > &obj_labels)
Definition: Moose.C:75
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:754
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:38
const ExecFlagType EXEC_CUSTOM
Definition: Moose.C:47
Definition: Kernel.h:15
const ExecFlagType EXEC_SUBDOMAIN
Definition: Moose.C:48
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:764
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:35
const ExecFlagType EXEC_POSTCHECK
Definition: Moose.C:33
const ExecFlagType EXEC_FORCED
Definition: Moose.C:45
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:51
const ExecFlagType EXEC_FINAL
Definition: Moose.C:44
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:762
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:81
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:507
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:42
Base class for all Transfer objects.
Definition: Transfer.h:36
const ExecFlagType EXEC_PRE_DISPLACE
Definition: Moose.C:50