www.mooseframework.org
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PhysicsBasedPreconditioner Class Reference

Implements a segregated solve preconditioner. More...

#include <PhysicsBasedPreconditioner.h>

Inheritance diagram for PhysicsBasedPreconditioner:
[legend]

Public Member Functions

 PhysicsBasedPreconditioner (const InputParameters &params)
 Constructor. More...
 
virtual ~PhysicsBasedPreconditioner ()
 
void addSystem (unsigned int var, std::vector< unsigned int > off_diag, PreconditionerType type=AMG_PRECOND)
 Add a diagonal system + possibly off-diagonals ones as well, also specifying type of preconditioning. More...
 
virtual void apply (const NumericVector< Number > &x, NumericVector< Number > &y)
 Computes the preconditioned vector "y" based on input "x". More...
 
virtual void clear ()
 Release all memory and clear data structures. More...
 
virtual void init ()
 Initialize data structures if not done so already. More...
 
virtual void setup ()
 This is called every time the "operator might have changed". More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 

Static Public Member Functions

static void copyVarValues (MeshBase &mesh, const unsigned int from_system, const unsigned int from_var, const NumericVector< Number > &from_vector, const unsigned int to_system, const unsigned int to_var, NumericVector< Number > &to_vector)
 Helper function for copying values associated with variables in vectors from two different systems. More...
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 

Protected Attributes

NonlinearSystemBase_nl
 The nonlinear system this PBP is associated with (convenience reference) More...
 
std::vector< LinearImplicitSystem * > _systems
 List of linear system that build up the preconditioner. More...
 
std::vector< Preconditioner< Number > * > _preconditioners
 Holds one Preconditioner object per small system to solve. More...
 
std::vector< unsigned int > _solve_order
 Holds the order the blocks are solved for. More...
 
std::vector< PreconditionerType > _pre_type
 Which preconditioner to use for each solve. More...
 
std::vector< std::vector< unsigned int > > _off_diag
 Holds which off diagonal blocks to compute. More...
 
std::vector< std::vector< SparseMatrix< Number > * > > _off_diag_mats
 Holds pointers to the off-diagonal matrices. More...
 
FEProblemBase_fe_problem
 Subproblem this preconditioner is part of. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 

Detailed Description

Implements a segregated solve preconditioner.

Definition at line 37 of file PhysicsBasedPreconditioner.h.

Constructor & Destructor Documentation

PhysicsBasedPreconditioner::PhysicsBasedPreconditioner ( const InputParameters params)

Constructor.

Initializes PhysicsBasedPreconditioner data structures

Definition at line 61 of file PhysicsBasedPreconditioner.C.

62  : MoosePreconditioner(params),
63  Preconditioner<Number>(MoosePreconditioner::_communicator),
65 {
66  unsigned int num_systems = _nl.system().n_vars();
67  _systems.resize(num_systems);
68  _preconditioners.resize(num_systems);
69  _off_diag.resize(num_systems);
70  _off_diag_mats.resize(num_systems);
71  _pre_type.resize(num_systems);
72 
73  { // Setup the Coupling Matrix so MOOSE knows what we're doing
75  unsigned int n_vars = nl.nVariables();
76 
77  // The coupling matrix is held and released by FEProblemBase, so it is not released in this
78  // object
79  std::unique_ptr<CouplingMatrix> cm = libmesh_make_unique<CouplingMatrix>(n_vars);
80 
81  bool full = false; // getParam<bool>("full"); // TODO: add a FULL option for PBP
82 
83  if (!full)
84  {
85  // put 1s on diagonal
86  for (unsigned int i = 0; i < n_vars; i++)
87  (*cm)(i, i) = 1;
88 
89  // off-diagonal entries
90  std::vector<std::vector<unsigned int>> off_diag(n_vars);
91  for (unsigned int i = 0; i < getParam<std::vector<std::string>>("off_diag_row").size(); i++)
92  {
93  unsigned int row =
94  nl.getVariable(0, getParam<std::vector<std::string>>("off_diag_row")[i]).number();
95  unsigned int column =
96  nl.getVariable(0, getParam<std::vector<std::string>>("off_diag_column")[i]).number();
97  (*cm)(row, column) = 1;
98  }
99 
100  // TODO: handle coupling entries between NL-vars and SCALAR-vars
101  }
102  else
103  {
104  for (unsigned int i = 0; i < n_vars; i++)
105  for (unsigned int j = 0; j < n_vars; j++)
106  (*cm)(i, j) = 1;
107  }
108 
109  _fe_problem.setCouplingMatrix(std::move(cm));
110  }
111 
112  // PC types
113  const std::vector<std::string> & pc_types = getParam<std::vector<std::string>>("preconditioner");
114  for (unsigned int i = 0; i < num_systems; i++)
115  _pre_type[i] = Utility::string_to_enum<PreconditionerType>(pc_types[i]);
116 
117  // solve order
118  const std::vector<std::string> & solve_order = getParam<std::vector<std::string>>("solve_order");
119  _solve_order.resize(solve_order.size());
120  for (unsigned int i = 0; i < solve_order.size(); i++)
121  _solve_order[i] = _nl.system().variable_number(solve_order[i]);
122 
123  // diag and off-diag systems
124  unsigned int n_vars = _nl.system().n_vars();
125 
126  // off-diagonal entries
127  const std::vector<std::string> & odr = getParam<std::vector<std::string>>("off_diag_row");
128  const std::vector<std::string> & odc = getParam<std::vector<std::string>>("off_diag_column");
129  std::vector<std::vector<unsigned int>> off_diag(n_vars);
130  for (unsigned int i = 0; i < odr.size(); i++)
131  {
132  unsigned int row = _nl.system().variable_number(odr[i]);
133  unsigned int column = _nl.system().variable_number(odc[i]);
134  off_diag[row].push_back(column);
135  }
136  // Add all of the preconditioning systems
137  for (unsigned int var = 0; var < n_vars; var++)
138  addSystem(var, off_diag[var], _pre_type[var]);
139 
140  _nl.nonlinearSolver()->attach_preconditioner(this);
141 
143  mooseError("PBP must be used with JFNK solve type");
144 }
std::vector< std::vector< unsigned int > > _off_diag
Holds which off diagonal blocks to compute.
SolverParams & solverParams()
Get the solver parameters.
NonlinearSystemBase & getNonlinearSystemBase()
virtual NonlinearSolver< Number > * nonlinearSolver()=0
NonlinearSystemBase & _nl
The nonlinear system this PBP is associated with (convenience reference)
std::vector< Preconditioner< Number > * > _preconditioners
Holds one Preconditioner object per small system to solve.
std::vector< PreconditionerType > _pre_type
Which preconditioner to use for each solve.
std::vector< LinearImplicitSystem * > _systems
List of linear system that build up the preconditioner.
void setCouplingMatrix(std::unique_ptr< CouplingMatrix > cm)
Set custom coupling matrix.
FEProblemBase & _fe_problem
Subproblem this preconditioner is part of.
NonlinearSystemBase * nl
Nonlinear system to be solved.
MoosePreconditioner(const InputParameters &params)
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:248
std::vector< std::vector< SparseMatrix< Number > * > > _off_diag_mats
Holds pointers to the off-diagonal matrices.
Moose::SolveType _type
Definition: SolverParams.h:25
void addSystem(unsigned int var, std::vector< unsigned int > off_diag, PreconditionerType type=AMG_PRECOND)
Add a diagonal system + possibly off-diagonals ones as well, also specifying type of preconditioning...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:122
unsigned int number() const
Get variable number coming from libMesh.
virtual System & system() override
Get the reference to the libMesh system.
std::vector< unsigned int > _solve_order
Holds the order the blocks are solved for.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
virtual unsigned int nVariables()
Get the number of variables in this system.
Definition: SystemBase.C:580
PhysicsBasedPreconditioner::~PhysicsBasedPreconditioner ( )
virtual

Definition at line 146 of file PhysicsBasedPreconditioner.C.

147 {
148  this->clear();
149 
150  for (auto & pc : _preconditioners)
151  delete pc;
152 }
std::vector< Preconditioner< Number > * > _preconditioners
Holds one Preconditioner object per small system to solve.
static PetscErrorCode Vec Mat Mat pc
virtual void clear()
Release all memory and clear data structures.

Member Function Documentation

void PhysicsBasedPreconditioner::addSystem ( unsigned int  var,
std::vector< unsigned int >  off_diag,
PreconditionerType  type = AMG_PRECOND 
)

Add a diagonal system + possibly off-diagonals ones as well, also specifying type of preconditioning.

Definition at line 155 of file PhysicsBasedPreconditioner.C.

Referenced by PhysicsBasedPreconditioner().

158 {
159  std::string var_name = _nl.system().variable_name(var);
160 
161  LinearImplicitSystem & precond_system =
162  _fe_problem.es().add_system<LinearImplicitSystem>(var_name + "_system");
163  precond_system.assemble_before_solve = false;
164 
165  const std::set<SubdomainID> * active_subdomains = _nl.getVariableBlocks(var);
166  precond_system.add_variable(
167  var_name + "_prec", _nl.system().variable(var).type(), active_subdomains);
168 
169  _systems[var] = &precond_system;
170  _pre_type[var] = type;
171 
172  _off_diag_mats[var].resize(off_diag.size());
173  for (unsigned int i = 0; i < off_diag.size(); i++)
174  {
175  // Add the matrix to hold the off-diagonal piece
176  _off_diag_mats[var][i] = &precond_system.add_matrix(_nl.system().variable_name(off_diag[i]));
177  }
178 
179  _off_diag[var] = off_diag;
180 }
virtual const std::set< SubdomainID > * getVariableBlocks(unsigned int var_number)
Get the block where a variable of this system is defined.
Definition: SystemBase.C:140
std::vector< std::vector< unsigned int > > _off_diag
Holds which off diagonal blocks to compute.
NonlinearSystemBase & _nl
The nonlinear system this PBP is associated with (convenience reference)
std::vector< PreconditionerType > _pre_type
Which preconditioner to use for each solve.
std::vector< LinearImplicitSystem * > _systems
List of linear system that build up the preconditioner.
FEProblemBase & _fe_problem
Subproblem this preconditioner is part of.
virtual EquationSystems & es() override
std::vector< std::vector< SparseMatrix< Number > * > > _off_diag_mats
Holds pointers to the off-diagonal matrices.
MatType type
virtual System & system() override
Get the reference to the libMesh system.
void PhysicsBasedPreconditioner::apply ( const NumericVector< Number > &  x,
NumericVector< Number > &  y 
)
virtual

Computes the preconditioned vector "y" based on input "x".

Usually by solving Py=x to get the action of P^-1 x.

Definition at line 257 of file PhysicsBasedPreconditioner.C.

258 {
259  Moose::perf_log.push("apply()", "PhysicsBasedPreconditioner");
260 
261  const unsigned int num_systems = _systems.size();
262 
263  MooseMesh & mesh = _fe_problem.mesh();
264 
265  // Zero out the solution vectors
266  for (unsigned int sys = 0; sys < num_systems; sys++)
267  _systems[sys]->solution->zero();
268 
269  // Loop over solve order
270  for (unsigned int i = 0; i < _solve_order.size(); i++)
271  {
272  unsigned int system_var = _solve_order[i];
273 
274  LinearImplicitSystem & u_system = *_systems[system_var];
275 
276  // Copy rhs from the big system into the small one
278  mesh, _nl.system().number(), system_var, x, u_system.number(), 0, *u_system.rhs);
279 
280  // Modify the RHS by subtracting off the matvecs of the solutions for the other preconditioning
281  // systems with the off diagonal blocks in this system.
282  for (unsigned int diag = 0; diag < _off_diag[system_var].size(); diag++)
283  {
284  unsigned int coupled_var = _off_diag[system_var][diag];
285  LinearImplicitSystem & coupled_system = *_systems[coupled_var];
286  SparseMatrix<Number> & off_diag = *_off_diag_mats[system_var][diag];
287  NumericVector<Number> & rhs = *u_system.rhs;
288 
289  // This next bit computes rhs -= A*coupled_solution
290  // It does what it does because there is no vector_mult_sub()
291  rhs.close();
292  rhs.scale(-1.0);
293  rhs.close();
294  off_diag.vector_mult_add(rhs, *coupled_system.solution);
295  rhs.close();
296  rhs.scale(-1.0);
297  rhs.close();
298  }
299 
300  // Apply the preconditioner to the small system
301  _preconditioners[system_var]->apply(*u_system.rhs, *u_system.solution);
302 
303  // Copy solution from small system into the big one
304  // copyVarValues(mesh,system,0,*u_system.solution,0,system_var,y);
305  }
306 
307  // Copy the solutions out
308  for (unsigned int system_var = 0; system_var < num_systems; system_var++)
309  {
310  LinearImplicitSystem & u_system = *_systems[system_var];
311 
313  mesh, u_system.number(), 0, *u_system.solution, _nl.system().number(), system_var, y);
314  }
315 
316  y.close();
317 
318  Moose::perf_log.pop("apply()", "PhysicsBasedPreconditioner");
319 }
static void copyVarValues(MeshBase &mesh, const unsigned int from_system, const unsigned int from_var, const NumericVector< Number > &from_vector, const unsigned int to_system, const unsigned int to_var, NumericVector< Number > &to_vector)
Helper function for copying values associated with variables in vectors from two different systems...
std::vector< std::vector< unsigned int > > _off_diag
Holds which off diagonal blocks to compute.
NonlinearSystemBase & _nl
The nonlinear system this PBP is associated with (convenience reference)
std::vector< Preconditioner< Number > * > _preconditioners
Holds one Preconditioner object per small system to solve.
std::vector< LinearImplicitSystem * > _systems
List of linear system that build up the preconditioner.
FEProblemBase & _fe_problem
Subproblem this preconditioner is part of.
static PetscErrorCode Vec x
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
PerfLog perf_log
Perflog to be used by applications.
std::vector< std::vector< SparseMatrix< Number > * > > _off_diag_mats
Holds pointers to the off-diagonal matrices.
virtual System & system() override
Get the reference to the libMesh system.
virtual MooseMesh & mesh() override
std::vector< unsigned int > _solve_order
Holds the order the blocks are solved for.
void PhysicsBasedPreconditioner::clear ( )
virtual

Release all memory and clear data structures.

Definition at line 322 of file PhysicsBasedPreconditioner.C.

Referenced by ~PhysicsBasedPreconditioner().

323 {
324 }
void MoosePreconditioner::copyVarValues ( MeshBase &  mesh,
const unsigned int  from_system,
const unsigned int  from_var,
const NumericVector< Number > &  from_vector,
const unsigned int  to_system,
const unsigned int  to_var,
NumericVector< Number > &  to_vector 
)
staticinherited

Helper function for copying values associated with variables in vectors from two different systems.

Definition at line 55 of file MoosePreconditioner.C.

Referenced by apply().

62 {
63  {
64  MeshBase::node_iterator it = mesh.local_nodes_begin();
65  MeshBase::node_iterator it_end = mesh.local_nodes_end();
66 
67  for (; it != it_end; ++it)
68  {
69  Node * node = *it;
70 
71  unsigned int n_comp = node->n_comp(from_system, from_var);
72 
73  mooseAssert(node->n_comp(from_system, from_var) == node->n_comp(to_system, to_var),
74  "Number of components does not match in each system");
75 
76  for (unsigned int i = 0; i < n_comp; i++)
77  {
78  dof_id_type from_dof = node->dof_number(from_system, from_var, i);
79  dof_id_type to_dof = node->dof_number(to_system, to_var, i);
80 
81  to_vector.set(to_dof, from_vector(from_dof));
82  }
83  }
84  }
85  {
86  MeshBase::element_iterator it = mesh.local_elements_begin();
87  MeshBase::element_iterator it_end = mesh.local_elements_end();
88 
89  for (; it != it_end; ++it)
90  {
91  Elem * elem = *it;
92 
93  unsigned int n_comp = elem->n_comp(from_system, from_var);
94 
95  mooseAssert(elem->n_comp(from_system, from_var) == elem->n_comp(to_system, to_var),
96  "Number of components does not match in each system");
97 
98  for (unsigned int i = 0; i < n_comp; i++)
99  {
100  dof_id_type from_dof = elem->dof_number(from_system, from_var, i);
101  dof_id_type to_dof = elem->dof_number(to_system, to_var, i);
102 
103  to_vector.set(to_dof, from_vector(from_dof));
104  }
105  }
106  }
107 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
void PhysicsBasedPreconditioner::init ( )
virtual

Initialize data structures if not done so already.

Definition at line 183 of file PhysicsBasedPreconditioner.C.

184 {
185  Moose::perf_log.push("init()", "PhysicsBasedPreconditioner");
186 
187  // Tell libMesh that this is initialized!
188  _is_initialized = true;
189 
190  const unsigned int num_systems = _systems.size();
191 
192  // If no order was specified, just solve them in increasing order
193  if (_solve_order.size() == 0)
194  {
195  _solve_order.resize(num_systems);
196  for (unsigned int i = 0; i < num_systems; i++)
197  _solve_order[i] = i;
198  }
199 
200  // Loop over variables
201  for (unsigned int system_var = 0; system_var < num_systems; system_var++)
202  {
203  LinearImplicitSystem & u_system = *_systems[system_var];
204 
205  if (!_preconditioners[system_var])
206  _preconditioners[system_var] =
207  Preconditioner<Number>::build(MoosePreconditioner::_communicator);
208 
209  // we have to explicitly set the matrix in the preconditioner, because h-adaptivity could have
210  // changed it and we have to work with the current one
211  Preconditioner<Number> * preconditioner = _preconditioners[system_var];
212  preconditioner->set_matrix(*u_system.matrix);
213  preconditioner->set_type(_pre_type[system_var]);
214 
215  preconditioner->init();
216  }
217 
218  Moose::perf_log.pop("init()", "PhysicsBasedPreconditioner");
219 }
std::vector< Preconditioner< Number > * > _preconditioners
Holds one Preconditioner object per small system to solve.
std::vector< PreconditionerType > _pre_type
Which preconditioner to use for each solve.
std::vector< LinearImplicitSystem * > _systems
List of linear system that build up the preconditioner.
PerfLog perf_log
Perflog to be used by applications.
std::vector< unsigned int > _solve_order
Holds the order the blocks are solved for.
bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 67 of file MooseObject.h.

Referenced by BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), MultiAppNearestNodeTransfer::getLocalNodes(), MultiAppNearestNodeTransfer::getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), AssignElementSubdomainID::modify(), RenameBlock::modify(), ParsedSubdomainMeshModifier::modify(), SubdomainBoundingBox::modify(), EigenExecutionerBase::normalizeSolution(), Output::Output(), Exodus::outputSetup(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), Piecewise::setData(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

67 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited
template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 80 of file MooseObject.h.

Referenced by FEProblemBase::addInitialCondition(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMesh::buildMesh3D(), MooseMesh::buildRefinementMap(), EigenExecutionerBase::chebyshev(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), SubProblem::checkMatProps(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), FEProblemBase::computeResidual(), Material::computeSubdomainProperties(), PenetrationAux::computeValue(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DGKernel::DGKernel(), SolutionUserObject::discontinuousPointValue(), SolutionUserObject::discontinuousPointValueGradient(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), PerflogDumper::execute(), NodalValueSampler::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), FindValueOnLine::execute(), MultiAppInterpolationTransfer::execute(), TimeExtremeValue::execute(), LeastSquaresFit::execute(), FEProblemBase::executeControls(), FileOutput::FileOutput(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::finalize(), DiscreteElementUserObject::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), FunctionDT::FunctionDT(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), GeneratedMesh::GeneratedMesh(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), GeneratedMesh::getMaxInDimension(), AnnularMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), GeneratedMesh::getMinInDimension(), AnnularMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), MooseMesh::getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), MooseMesh::getSubdomainBoundaryIds(), MooseMesh::getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObjectBase(), NumVars::getValue(), PerformanceData::getValue(), Residual::getValue(), FindValueOnLine::getValueAtPoint(), DisplacedProblem::getVariable(), FEProblemBase::getVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), FEProblemBase::init(), NumPicardIterations::initialize(), FullSolveMultiApp::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), KernelBase::KernelBase(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< T >::LineMaterialSamplerBase(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), AssignElementSubdomainID::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), VTKOutput::output(), XDA::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMultilinear::PiecewiseMultilinear(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postStep(), LStableDirk3::postStep(), ImplicitMidpoint::postStep(), ExplicitTVDRK2::postStep(), AStableDirk4::postStep(), LStableDirk4::postStep(), ExplicitRK2::postStep(), Predictor::Predictor(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), Piecewise::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromPoints::SideSetsFromPoints(), SolutionUserObject::SolutionUserObject(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), and VolumeHistogram::VolumeHistogram().

81  {
82  std::ostringstream oss;
83  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
84  std::string msg = oss.str();
85  callMooseErrorRaw(msg, &_app);
86  }
void mooseStreamAll(std::ostringstream &ss)
Definition: MooseError.C:78
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

Definition at line 101 of file MooseObject.h.

102  {
103  moose::internal::mooseInfoStream(_console, std::forward<Args>(args)...);
104  }
void mooseInfoStream(S &oss, Args &&...args)
Definition: MooseError.h:145
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited
const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 47 of file MooseObject.h.

Referenced by FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), AStableDirk4::AStableDirk4(), Function::average(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), DGKernel::DGKernel(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), GeneralUserObject::GeneralUserObject(), MultiApp::getBoundingBox(), Control::getControllableParameterHelper(), Control::getControllableValue(), AuxKernel::getDependObjects(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), OutputWarehouse::getOutput(), Transient::getTimeStepperName(), InitialCondition::getUserObject(), AuxKernel::getUserObject(), InitialCondition::getUserObjectByName(), AuxKernel::getUserObjectByName(), AdvancedOutput::hasOutputHelper(), FEProblemBase::init(), CSVReader::initialize(), MultiAppProjectionTransfer::initialSetup(), InitialCondition::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), KernelBase::KernelBase(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MaterialDerivativeTestKernelBase< T >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), ElementDeleterBase::modify(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::parameters(), Executioner::parentOutputPositionChanged(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), Material::resetQpProperties(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), Function::timeDerivative(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), and AdvancedOutput::wantOutput().

47 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
const InputParameters& MooseObject::parameters ( ) const
inlineinherited
void PhysicsBasedPreconditioner::setup ( )
virtual

This is called every time the "operator might have changed".

This is essentially where you need to fill in your preconditioning matrix.

Definition at line 222 of file PhysicsBasedPreconditioner.C.

223 {
224  const unsigned int num_systems = _systems.size();
225 
226  std::vector<JacobianBlock *> blocks;
227 
228  // Loop over variables
229  for (unsigned int system_var = 0; system_var < num_systems; system_var++)
230  {
231  LinearImplicitSystem & u_system = *_systems[system_var];
232 
233  {
234  JacobianBlock * block = new JacobianBlock(u_system, *u_system.matrix, system_var, system_var);
235  blocks.push_back(block);
236  }
237 
238  for (unsigned int diag = 0; diag < _off_diag[system_var].size(); diag++)
239  {
240  unsigned int coupled_var = _off_diag[system_var][diag];
241  std::string coupled_name = _nl.system().variable_name(coupled_var);
242 
243  JacobianBlock * block =
244  new JacobianBlock(u_system, *_off_diag_mats[system_var][diag], system_var, coupled_var);
245  blocks.push_back(block);
246  }
247  }
248 
250 
251  // cleanup
252  for (auto & block : blocks)
253  delete block;
254 }
Helper class for holding the preconditioning blocks to fill.
std::vector< std::vector< unsigned int > > _off_diag
Holds which off diagonal blocks to compute.
NonlinearSystemBase & _nl
The nonlinear system this PBP is associated with (convenience reference)
std::vector< LinearImplicitSystem * > _systems
List of linear system that build up the preconditioner.
FEProblemBase & _fe_problem
Subproblem this preconditioner is part of.
std::vector< std::vector< SparseMatrix< Number > * > > _off_diag_mats
Holds pointers to the off-diagonal matrices.
virtual System & system() override
Get the reference to the libMesh system.
virtual void computeJacobianBlocks(std::vector< JacobianBlock * > &blocks)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...

Member Data Documentation

MooseApp& MooseObject::_app
protectedinherited

The MooseApp this object is associated with.

Definition at line 108 of file MooseObject.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), Executioner::addAttributeReporter(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), FEProblemBase::checkNonlinearConvergence(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobian(), FEProblemBase::computeResidualType(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), NonlinearEigen::execute(), Transient::execute(), Steady::execute(), FileOutput::FileOutput(), FEProblemBase::forceOutput(), MooseObject::getMooseApp(), InversePowerMethod::init(), NonlinearEigen::init(), Transient::init(), Steady::init(), MooseMesh::init(), NumPicardIterations::initialize(), TimePeriod::initialSetup(), Console::initialSetup(), MultiApp::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPetscOutput(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), InversePowerMethod::InversePowerMethod(), MooseObject::mooseError(), MooseMesh::MooseMesh(), NonlinearEigen::NonlinearEigen(), Tecplot::output(), Exodus::output(), Nemesis::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), Console::outputSystemInformation(), MultiApp::parentOutputPositionChanged(), PerformanceData::PerformanceData(), PetscOutput::petscLinearOutput(), PetscOutput::petscNonlinearOutput(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), and Console::write().

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 37 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), CreateProblemAction::act(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), FEProblemBase::advanceMultiApps(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualType(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), FEProblemBase::useFECache(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

const bool& MooseObject::_enabled
protectedinherited

Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.

Definition at line 117 of file MooseObject.h.

Referenced by MooseObject::enabled().

FEProblemBase& MoosePreconditioner::_fe_problem
protectedinherited
const std::string& MooseObject::_name
protectedinherited
NonlinearSystemBase& PhysicsBasedPreconditioner::_nl
protected

The nonlinear system this PBP is associated with (convenience reference)

Definition at line 80 of file PhysicsBasedPreconditioner.h.

Referenced by addSystem(), apply(), PhysicsBasedPreconditioner(), and setup().

std::vector<std::vector<unsigned int> > PhysicsBasedPreconditioner::_off_diag
protected

Holds which off diagonal blocks to compute.

Definition at line 90 of file PhysicsBasedPreconditioner.h.

Referenced by addSystem(), apply(), PhysicsBasedPreconditioner(), and setup().

std::vector<std::vector<SparseMatrix<Number> *> > PhysicsBasedPreconditioner::_off_diag_mats
protected

Holds pointers to the off-diagonal matrices.

This is in the same order as _off_diag.

This is really just for convenience so we don't have to keep looking this thing up through it's name.

Definition at line 99 of file PhysicsBasedPreconditioner.h.

Referenced by addSystem(), apply(), PhysicsBasedPreconditioner(), and setup().

const InputParameters& MooseObject::_pars
protectedinherited
std::vector<PreconditionerType> PhysicsBasedPreconditioner::_pre_type
protected

Which preconditioner to use for each solve.

Definition at line 88 of file PhysicsBasedPreconditioner.h.

Referenced by addSystem(), init(), and PhysicsBasedPreconditioner().

std::vector<Preconditioner<Number> *> PhysicsBasedPreconditioner::_preconditioners
protected

Holds one Preconditioner object per small system to solve.

Definition at line 84 of file PhysicsBasedPreconditioner.h.

Referenced by apply(), init(), PhysicsBasedPreconditioner(), and ~PhysicsBasedPreconditioner().

std::vector<unsigned int> PhysicsBasedPreconditioner::_solve_order
protected

Holds the order the blocks are solved for.

Definition at line 86 of file PhysicsBasedPreconditioner.h.

Referenced by apply(), init(), and PhysicsBasedPreconditioner().

std::vector<LinearImplicitSystem *> PhysicsBasedPreconditioner::_systems
protected

List of linear system that build up the preconditioner.

Definition at line 82 of file PhysicsBasedPreconditioner.h.

Referenced by addSystem(), apply(), init(), PhysicsBasedPreconditioner(), and setup().


The documentation for this class was generated from the following files: