The Actions System

  • Actions are used to construct other MOOSE objects (Variables, Kernels, etc.)
  • MOOSE has a large set of common tasks that are performed for every problem
  • Supports complete dependency resolution
  • Customizable and extendable

Actions System Model (tasks)

  • Setting up a problem in MOOSE is very order sensitive.
  • The setup order is defined in Moose.C for all MOOSE-based applications.
  • Each step of the setup phase is called a task.
  • MOOSE looks for Actions that will satisfy the current task.
  • Some of the tasks are optional, but they still have to be executed in the proper order.
  • The list of tasks can be augmented by registering a new task and declaring its dependencies:
    • registerTask(task, isrequired);
    • addTaskDependency(task, dependson);

Actions System Model (Action Object)

  • To build a new Action, inherit from Action and override the act() function.
  • Typically you will set up other MOOSE objects with your Action. For example:
    • Set up and add a group of Kernels.
    • Set up a group of Variables, each with their own Kernel.
    • Inspect other Actions in the warehouse, and add objects appropriately.
  • A single Action can be registered with more than one task.
  • A single Action can only satisfy one task, however the system may create several instances of any one Action to satisfy multiple tasks.

Some built-in MOOSE "tasks"

Action Function
"setup_mesh" SetupMeshAction
"add_variable" AddVariableAction
"add_aux _variable" AddVariableAction
"add_kernel" AddKernelAction
"add_bc" AddBCAction
"add_postprocessor" AddPostprocessorAction
"setup_executioner" SetupExecutionerAction
"init_problem" InitProblemAction
"check_integrity" CheckIntegrityAction

The Parser (briefly)

  • MOOSE comes with an input file parser that will automatically create Actions for you based on the syntax it sees.
  • Using the MOOSE Parser (or any parser) is not required. MOOSE operates on Actions which can be built in any way the developer chooses.
  • To use the Parser, Actions must first be associated with syntax blocks (this works much like object registration).
  • The Parser:
    1. Encounters a new syntax block in the input file.
    2. Checks to see if there is an Action associated with that block.
    3. Gets the InputParameters for your object using the appropriate validParams function.
    4. Parses and fills in the InputParameters object with options from the input file.
    5. Builds and stores the appropriate Action in MOOSE's ActionWarehouse.

Actions System Model

Actions System

Example 15