www.mooseframework.org
AddFieldSplitAction.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // MOOSE includes
11 #include "AddFieldSplitAction.h"
12 #include "FEProblem.h"
13 #include "NonlinearSystemBase.h"
14 
15 registerMooseAction("MooseApp", AddFieldSplitAction, "add_field_split");
16 
17 template <>
20 {
22  params.addParam<std::string>("type", "Split", "Classname of the split object");
23  params.addParam<std::vector<NonlinearVariableName>>("vars", "variables for this field");
24  params.addParam<MultiMooseEnum>(
25  "petsc_options", Moose::PetscSupport::getCommonPetscFlags(), "Singleton PETSc options");
26  params.addParam<MultiMooseEnum>("petsc_options_iname",
28  "Names of PETSc name/value pairs");
29  params.addParam<std::vector<std::string>>(
30  "petsc_options_value",
31  "Values of PETSc name/value pairs (must correspond with \"petsc_options_iname\"");
32  return params;
33 }
34 
36 
37 void
39 {
40  _problem->getNonlinearSystemBase().addSplit(_type, _name, _moose_object_pars);
41 }
MultiMooseEnum getCommonPetscKeys()
A helper function to produce a MultiMooseEnum with commonly used PETSc iname options (keys in key-val...
Definition: PetscSupport.C:872
AddFieldSplitAction(InputParameters params)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
registerMooseAction("MooseApp", AddFieldSplitAction, "add_field_split")
std::string _name
The name of the action.
Definition: Action.h:177
MultiMooseEnum getCommonPetscFlags()
A helper function to produce a MultiMooseEnum with commonly used PETSc single options (flags) ...
Definition: PetscSupport.C:860
void act()
Method to add objects to the simulation or perform other setup tasks.
InputParameters validParams< MooseObjectAction >()
std::string _type
The Object type that is being created.
InputParameters _moose_object_pars
The parameters for the object to be created.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:216
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
InputParameters validParams< AddFieldSplitAction >()