MooseApp Base Class

  • Every MOOSE application contains a MooseApp-derived class.
  • The MooseApp contains:
    • Factories where application objects are built.
    • Warehouses where application objects are stored.
  • MooseApp objects can be combined (coupled) together to form larger simulations, see the MultiApp discussion.
  • MooseApp objects specialize the validParams() function.
  • Parameters for MooseApps are read from the command line via:
    • InputParameters::addRequiredCommandLineParam()
    • InputParameters::addCommandLineParam()

Your AnimalApp.h/.C

  • Your application's MooseApp-derived class must implement several important static functions:
    • registerApps()
    • registerObjects()
    • associateSyntax() (optional)
  • The MooseApp is a convenient place to see the other applications and objects a given application depends on.

Object Registration

  • The MooseApp object calls its own registerObjects() function and those of applications to which it is coupled.
    • This is where you register all of the objects created in your application.
    • Typically done in the constructor.
  • Strong coupling to other applications is implemented by calling the registerObjects() functions of other applications (also done in the constructor).
    • This makes the other application's objects available in your application.
  • Newly-created applications (via Stork) register all MOOSE and MOOSE module objects by default.


  • Every MOOSE application has a main() program, typically located in src/main.C.
  • By default, a MOOSE application's main() program only does a few very specific things:
    • Calls MooseInit()
    • Calls YourApp::registerApps()
    • Builds your application object
    • Runs your application object
    • Deletes your application object
  • See main.C in Example 1
  • While it is possible to add additional code in main(), it's not recommended.