https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ExplicitMixedOrder Class Reference

Implements a form of the central difference time integrator that calculates acceleration directly from the residual forces. More...

#include <ExplicitMixedOrder.h>

Inheritance diagram for ExplicitMixedOrder:
[legend]

Public Types

enum  TimeOrder { FIRST, SECOND }
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 ExplicitMixedOrder (const InputParameters &parameters)
 
virtual int order () override
 
virtual void computeTimeDerivatives () override
 
virtual void solve () override
 
virtual void postResidual (NumericVector< Number > &residual) override
 
virtual bool overridesSolve () const override
 
virtual void postSolve () override
 
virtual bool advancesProblemState () const override
 
virtual bool performExplicitSolve (SparseMatrix< Number > &mass_matrix) override
 
void computeADTimeDerivatives (ADReal &, const dof_id_type &, ADReal &) const override
 
virtual void init () override
 
TimeOrder findVariableTimeOrder (unsigned int var_num) const
 Retrieve the order of the highest time derivative of a variable. More...
 
virtual void initialSetup () override
 
virtual void preSolve () override
 
virtual void meshChanged () override
 
virtual bool isExplicit () const override
 
virtual void preStep ()
 
virtual void postStep ()
 
virtual unsigned int getNumNonlinearIterations () const
 
virtual unsigned int getNumLinearIterations () const
 
const Realdt () const
 
virtual unsigned int numStatesRequired () const
 
virtual const bool & isLumped () const
 
bool integratesVar (const unsigned int var_num) const
 
void setNumIterationsLastSolve ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
TagID uDotFactorTag () const
 
TagID uDotDotFactorTag () const
 
virtual Real timeDerivativeRHSContribution (dof_id_type dof_id, const std::vector< Real > &factors={}) const
 
virtual Real timeDerivativeMatrixContribution (const Real factor) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 

Protected Types

enum  SolveType
 

Protected Member Functions

virtual TagID massMatrixTagID () const override
 
template<typename T , typename T2 , typename T3 , typename T4 >
void computeTimeDerivativeHelper (T &u_dot, T2 &u_dotdot, const T3 &u_old, const T4 &u_older) const
 Helper function that actually does the math for computing the time derivative. More...
 
void computeICs ()
 
bool solveLinearSystem (SparseMatrix< Number > &mass_matrix)
 
bool checkLinearConvergence ()
 
unsigned int getNumNonlinearIterationsLastSolve () const
 
unsigned int getNumLinearIterationsLastSolve () const
 
void copyVector (const NumericVector< Number > &from, NumericVector< Number > &to)
 
virtual Real duDotDuCoeff () const
 
void computeDuDotDu ()
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
NumericVector< Number > * addVector (const std::string &name, const bool project, const libMesh::ParallelType type)
 

Protected Attributes

const bool & _constant_mass
 Whether we are reusing the mass matrix. More...
 
const TagName & _mass_matrix
 Mass matrix name. More...
 
const NumericVector< Number > & _solution_older
 The older solution. More...
 
std::unordered_set< unsigned int > & _vars_first
 
std::vector< dof_id_type > & _local_first_order_indices
 
std::unordered_set< unsigned int > & _vars_second
 
std::vector< dof_id_type > & _local_second_order_indices
 
 CONSISTENT
 
 LUMPED
 
 LUMP_PRECONDITIONED
 
MooseEnum _solve_type
 
NumericVector< Real > * _explicit_residual
 
NumericVector< Real > * _solution_update
 
NumericVector< Real > * _mass_matrix_diag_inverted
 
NumericVector< Real > * _ones
 
TagID _Ke_time_tag
 
std::unique_ptr< libMesh::LinearSolver< Number > > _linear_solver
 
std::unique_ptr< LumpedPreconditioner_preconditioner
 
Real _current_time
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
std::vector< Real > & _du_dot_du
 
int_t_step
 
Real_dt
 
Real_dt_old
 
unsigned int _n_nonlinear_iterations
 
unsigned int _n_linear_iterations
 
bool _is_lumped
 
bool & _var_restriction
 
std::vector< dof_id_type > & _local_indices
 
std::unordered_set< unsigned int > & _vars
 
std::unique_ptr< NumericVector< Number > > _from_subvector
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
NonlinearSystemBase_nl
 
libMesh::NonlinearImplicitSystem_nonlinear_implicit_system
 
NumericVector< Number > * _Re_time
 
NumericVector< Number > * _Re_non_time
 
const TagID _u_dot_factor_tag
 
const TagID _u_dotdot_factor_tag
 
LinearSystem_linear_system
 
libMesh::LinearImplicitSystem_linear_implicit_system
 
FEProblemBase_mci_feproblem
 
const NumericVector< Number > *const & _solution
 
const NumericVector< Number > & _solution_old
 
std::unique_ptr< NumericVector< Number > > & _solution_sub
 
std::unique_ptr< NumericVector< Number > > & _solution_old_sub
 
const Parallel::Communicator & _communicator
 

Detailed Description

Implements a form of the central difference time integrator that calculates acceleration directly from the residual forces.

Definition at line 25 of file ExplicitMixedOrder.h.

Member Enumeration Documentation

◆ TimeOrder

Enumerator
FIRST 
SECOND 

Definition at line 54 of file ExplicitMixedOrder.h.

Constructor & Destructor Documentation

◆ ExplicitMixedOrder()

ExplicitMixedOrder::ExplicitMixedOrder ( const InputParameters parameters)

Definition at line 75 of file ExplicitMixedOrder.C.

77  _constant_mass(getParam<bool>("use_constant_mass")),
78  _mass_matrix(getParam<TagName>("mass_matrix_tag")),
80  _vars_first(declareRestartableData<std::unordered_set<unsigned int>>("first_order_vars")),
82  declareRestartableData<std::vector<dof_id_type>>("first_local_indices")),
83  _vars_second(declareRestartableData<std::unordered_set<unsigned int>>("second_order_vars")),
85  declareRestartableData<std::vector<dof_id_type>>("second_local_indices"))
86 {
90 }
virtual void setUDotDotRequested(const bool u_dotdot_requested)
std::unordered_set< unsigned int > & _vars_second
FEProblemBase & _fe_problem
const NumericVector< Number > & _solution_older
The older solution.
const bool & _constant_mass
Whether we are reusing the mass matrix.
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
const TagName & _mass_matrix
Mass matrix name.
T & declareRestartableData(const std::string &data_name, Args &&... args)
virtual void setUDotOldRequested(const bool u_dot_old_requested)
std::unordered_set< unsigned int > & _vars_first
std::vector< dof_id_type > & _local_second_order_indices
virtual void setUDotRequested(const bool u_dot_requested)
const InputParameters & parameters() const
std::vector< dof_id_type > & _local_first_order_indices
ExplicitTimeIntegrator(const InputParameters &parameters)

Member Function Documentation

◆ advancesProblemState()

virtual bool ExplicitMixedOrder::advancesProblemState ( ) const
inlineoverridevirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 44 of file ExplicitMixedOrder.h.

44 { return true; }

◆ computeADTimeDerivatives()

void ExplicitMixedOrder::computeADTimeDerivatives ( ADReal ,
const dof_id_type ,
ADReal  
) const
inlineoverridevirtual

Implements ExplicitTimeIntegrator.

Definition at line 48 of file ExplicitMixedOrder.h.

49  {
50  mooseError("NOT SUPPORTED");
51  }
void mooseError(Args &&... args) const

◆ computeICs()

void ExplicitMixedOrder::computeICs ( )
protected

Definition at line 317 of file ExplicitMixedOrder.C.

Referenced by init().

318 {
319  // Compute the first-order approximation of the velocity at the current time step
320  // using the Euler scheme, where the velocity is estimated as the difference
321  // between the current solution and the previous time step, divided by the time
322  auto vel = _sys.solutionUDot();
323  *vel = *_solution;
324  *vel -= _solution_old;
325  *vel /= _dt;
326  vel->close();
327 }
virtual NumericVector< Number > * solutionUDot()
const NumericVector< Number > *const & _solution
const NumericVector< Number > & _solution_old

◆ computeTimeDerivativeHelper()

template<typename T , typename T2 , typename T3 , typename T4 >
void ExplicitMixedOrder::computeTimeDerivativeHelper ( T &  u_dot,
T2 &  u_dotdot,
const T3 &  u_old,
const T4 &  u_older 
) const
protected

Helper function that actually does the math for computing the time derivative.

Definition at line 102 of file ExplicitMixedOrder.h.

106 {
107  // computing first derivative
108  // using the Central Difference method
109  // u_dot_old = (first_term - second_term) / 2 / dt
110  // first_term = u
111  // second_term = u_older
112  u_dot -= u_older; // 'older than older' solution
113  u_dot *= 1.0 / (2.0 * _dt);
114 
115  // computing second derivative
116  // using the Central Difference method
117  // u_dotdot_old = (first_term - second_term + third_term) / dt / dt
118  // first_term = u
119  // second_term = 2 * u_old
120  // third_term = u_older
121  u_dotdot -= u_old;
122  u_dotdot -= u_old;
123  u_dotdot += u_older;
124  u_dotdot *= 1.0 / (_dt * _dt);
125 }

◆ computeTimeDerivatives()

void ExplicitMixedOrder::computeTimeDerivatives ( )
overridevirtual

Implements ExplicitTimeIntegrator.

Definition at line 93 of file ExplicitMixedOrder.C.

94 {
95  /*
96  Because this is called in NonLinearSystemBase
97  this should not actually compute the time derivatives.
98  Calculating time derivatives here will cause issues for the
99  solution update.
100  */
101  return;
102 }

◆ findVariableTimeOrder()

ExplicitMixedOrder::TimeOrder ExplicitMixedOrder::findVariableTimeOrder ( unsigned int  var_num) const

Retrieve the order of the highest time derivative of a variable.

Returns
Returns the time order enum of this variable.

Definition at line 330 of file ExplicitMixedOrder.C.

Referenced by ExplicitDirichletBCBase::timestepSetup().

331 {
332  if (_vars_first.empty() && _vars_second.empty())
333  mooseError("Time order sets are both empty.");
334  if (_vars_first.count(var_num))
335  return FIRST;
336  else if (_vars_second.count(var_num))
337  return SECOND;
338  else
339  mooseError("Variable " + _sys.system().variable_name(var_num) +
340  " does not exist in time order sets.");
341 }
std::unordered_set< unsigned int > & _vars_second
virtual libMesh::System & system()=0
std::unordered_set< unsigned int > & _vars_first
const std::string & variable_name(const unsigned int i) const
void mooseError(Args &&... args) const

◆ init()

void ExplicitMixedOrder::init ( )
overridevirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 250 of file ExplicitMixedOrder.C.

251 {
253 
254  // Compute ICs for velocity
255  computeICs();
256 
257  // Seperate variables into first and second time integration order and find
258  // the local indices for each
259  const auto & var_names_first = getParam<std::vector<VariableName>>("first_order_vars");
260  const auto & var_names_second = getParam<std::vector<VariableName>>("second_order_vars");
261  std::vector<unsigned int> var_num_vec;
262 
263  auto & lm_sys = _sys.system();
264  lm_sys.get_all_variable_numbers(var_num_vec);
265  std::unordered_set<unsigned int> var_nums(var_num_vec.begin(), var_num_vec.end());
266 
267  for (const auto & var_name : var_names_first)
268  if (lm_sys.has_variable(var_name))
269  {
270  const auto var_num = lm_sys.variable_number(var_name);
271  _vars_first.insert(var_num);
272  var_nums.erase(var_num);
273  }
274 
275  for (const auto & var_name : var_names_second)
276  if (lm_sys.has_variable(var_name))
277  {
278  const auto var_num = lm_sys.variable_number(var_name);
279  _vars_second.insert(var_num);
280  var_nums.erase(var_num);
281  }
282 
283  // If var_nums is empty then that means the user has specified all the variables in this system
284  if (!var_nums.empty())
285  mooseError("Not all nonlinear variables have their order specified.");
286 
287  std::vector<dof_id_type> var_dof_indices, work_vec;
288  for (const auto var_num : _vars_first)
289  {
290  work_vec = _local_first_order_indices;
292  lm_sys.get_dof_map().local_variable_indices(var_dof_indices, lm_sys.get_mesh(), var_num);
293  std::merge(work_vec.begin(),
294  work_vec.end(),
295  var_dof_indices.begin(),
296  var_dof_indices.end(),
297  std::back_inserter(_local_first_order_indices));
298  }
299 
300  work_vec.clear();
301  var_dof_indices.clear();
302 
303  for (const auto var_num : _vars_second)
304  {
305  work_vec = _local_second_order_indices;
307  lm_sys.get_dof_map().local_variable_indices(var_dof_indices, lm_sys.get_mesh(), var_num);
308  std::merge(work_vec.begin(),
309  work_vec.end(),
310  var_dof_indices.begin(),
311  var_dof_indices.end(),
312  std::back_inserter(_local_second_order_indices));
313  }
314 }
std::unordered_set< unsigned int > & _vars_second
virtual libMesh::System & system()=0
void get_all_variable_numbers(std::vector< unsigned int > &all_variable_numbers) const
std::unordered_set< unsigned int > & _vars_first
std::vector< dof_id_type > & _local_second_order_indices
virtual void init() override
void mooseError(Args &&... args) const
std::vector< dof_id_type > & _local_first_order_indices

◆ massMatrixTagID()

TagID ExplicitMixedOrder::massMatrixTagID ( ) const
overrideprotectedvirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 105 of file ExplicitMixedOrder.C.

Referenced by solve().

106 {
108 }
const TagName & _mass_matrix
Mass matrix name.
virtual TagID getMatrixTagID(const TagName &tag_name) const
SubProblem & subproblem()

◆ order()

virtual int ExplicitMixedOrder::order ( )
inlineoverridevirtual

Implements ExplicitTimeIntegrator.

Definition at line 32 of file ExplicitMixedOrder.h.

32 { return 1; }

◆ overridesSolve()

virtual bool ExplicitMixedOrder::overridesSolve ( ) const
inlineoverridevirtual

Implements ExplicitTimeIntegrator.

Definition at line 37 of file ExplicitMixedOrder.h.

37 { return true; }

◆ performExplicitSolve()

bool ExplicitMixedOrder::performExplicitSolve ( SparseMatrix< Number > &  mass_matrix)
overridevirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 177 of file ExplicitMixedOrder.C.

Referenced by solve().

178 {
179 
180  bool converged = false;
181 
182  // Grab all the vectors that we will need
183  auto accel = _sys.solutionUDotDot();
184  auto vel = _sys.solutionUDot();
185 
186  // Compute Forward Euler
187  // Split diag mass and residual vectors into correct subvectors
188  const std::unique_ptr<NumericVector<Number>> mass_first(
190  const std::unique_ptr<NumericVector<Real>> exp_res_first(
192  _mass_matrix_diag_inverted->create_subvector(*mass_first, _local_first_order_indices, false);
193  _explicit_residual->create_subvector(*exp_res_first, _local_first_order_indices, false);
194 
195  // Need velocity vector split into subvectors
196  auto vel_first = vel->get_subvector(_local_first_order_indices);
197 
198  // Velocity update for foward euler
199  vel_first->pointwise_mult(*mass_first, *exp_res_first);
200 
201  // Restore the velocities
202  vel->restore_subvector(std::move(vel_first), _local_first_order_indices);
203 
204  // Compute Central Difference
205  // Split diag mass and residual vectors into correct subvectors
206  const std::unique_ptr<NumericVector<Real>> mass_second(
208  const std::unique_ptr<NumericVector<Real>> exp_res_second(
210  _mass_matrix_diag_inverted->create_subvector(*mass_second, _local_second_order_indices, false);
211  _explicit_residual->create_subvector(*exp_res_second, _local_second_order_indices, false);
212 
213  // Only need acceleration and old velocity vector for central difference
214  auto accel_second = accel->get_subvector(_local_second_order_indices);
215 
216  auto vel_second = vel->get_subvector(_local_second_order_indices);
217 
218  // Compute acceleration for central difference
219  accel_second->pointwise_mult(*mass_second, *exp_res_second);
220 
221  // Scaling the acceleration
222  auto accel_scaled = accel_second->clone();
223  accel_scaled->scale((_dt + _dt_old) / 2);
224 
225  // Velocity update for central difference
226  *vel_second += *accel_scaled;
227 
228  // Restore acceleration
229  accel->restore_subvector(std::move(accel_second), _local_second_order_indices);
230 
231  vel->restore_subvector(std::move(vel_second), _local_second_order_indices);
232 
233  // Same solution update for both methods
234  *_solution_update = *vel;
235  _solution_update->scale(_dt);
236 
237  // Check for convergence by seeing if there is a nan or inf
238  auto sum = _solution_update->sum();
239  converged = std::isfinite(sum);
240 
241  // The linear iteration count remains zero
243  vel->close();
244  accel->close();
245 
246  return converged;
247 }
NumericVector< Real > * _solution_update
const Parallel::Communicator & _communicator
bool converged(const std::vector< std::pair< unsigned int, Real >> &residuals, const std::vector< Real > &abs_tolerances)
Based on the residuals, determine if the iterative process converged or not.
std::vector< dof_id_type > & _local_second_order_indices
NumericVector< Real > * _explicit_residual
virtual NumericVector< Number > * solutionUDot()
unsigned int _n_linear_iterations
NumericVector< Real > * _mass_matrix_diag_inverted
static std::unique_ptr< NumericVector< Number > > build(const Parallel::Communicator &comm, SolverPackage solver_package=libMesh::default_solver_package(), ParallelType parallel_type=AUTOMATIC)
virtual NumericVector< Number > * solutionUDotDot()
std::vector< dof_id_type > & _local_first_order_indices

◆ postResidual()

void ExplicitMixedOrder::postResidual ( NumericVector< Number > &  residual)
overridevirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 166 of file ExplicitMixedOrder.C.

167 {
168  residual += *_Re_time;
169  residual += *_Re_non_time;
170  residual.close();
171 
172  // Reset time to the time at which to evaluate nodal BCs, which comes next
174 }
virtual Real & time() const
FEProblemBase & _fe_problem
NumericVector< Number > * _Re_time
virtual void close()=0
NumericVector< Number > * _Re_non_time

◆ postSolve()

virtual void ExplicitMixedOrder::postSolve ( )
inlineoverridevirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 39 of file ExplicitMixedOrder.h.

40  { // Once we have the new solution, we want to adanceState to make sure the
41  // coupling between the solution and the computed material properties is kept correctly.
43  }
FEProblemBase & _fe_problem
virtual void advanceState()

◆ solve()

void ExplicitMixedOrder::solve ( )
overridevirtual

Reimplemented from ExplicitTimeIntegrator.

Definition at line 111 of file ExplicitMixedOrder.C.

112 {
113  // Getting the tagID for the mass matrix
114  auto mass_tag = massMatrixTagID();
115 
116  // Reset iteration counts
119 
121 
122  auto & mass_matrix = _nonlinear_implicit_system->get_system_matrix();
123 
124  // Compute the mass matrix
125  if (!_constant_mass || _t_step == 1)
126  {
127  // We only want to compute "inverted" lumped mass matrix once.
129  *_nonlinear_implicit_system->current_local_solution, mass_matrix, mass_tag);
130 
131  // Calculating the lumped mass matrix for use in residual calculation
132  mass_matrix.vector_mult(*_mass_matrix_diag_inverted, *_ones);
133 
134  // "Invert" the diagonal mass matrix
135  _mass_matrix_diag_inverted->reciprocal();
137  }
138 
139  // Set time to the time at which to evaluate the residual
142 
143  // Compute the residual
144  _explicit_residual->zero();
147 
148  // Move the residual to the RHS
149  *_explicit_residual *= -1.0;
150 
151  // Perform the linear solve
152  bool converged = performExplicitSolve(mass_matrix);
154 
155  // Update the solution
158 
160 
163 }
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
virtual TagID massMatrixTagID() const override
std::unique_ptr< NonlinearSolver< Number > > nonlinear_solver
void overwriteNodeFace(NumericVector< Number > &soln)
virtual Real & time() const
NumericVector< Real > * _solution_update
NumericVector< Real > * _ones
FEProblemBase & _fe_problem
NonlinearSystemBase * _nl
const bool & _constant_mass
Whether we are reusing the mass matrix.
void setSolution(const NumericVector< Number > &soln)
bool converged(const std::vector< std::pair< unsigned int, Real >> &residuals, const std::vector< Real > &abs_tolerances)
Based on the residuals, determine if the iterative process converged or not.
libMesh::NonlinearImplicitSystem * _nonlinear_implicit_system
NumericVector< Real > * _explicit_residual
std::unique_ptr< NumericVector< Number > > solution
unsigned int _n_linear_iterations
unsigned int number() const
void computeResidual(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
NumericVector< Real > * _mass_matrix_diag_inverted
virtual bool performExplicitSolve(SparseMatrix< Number > &mass_matrix) override
std::unique_ptr< NumericVector< Number > > current_local_solution
virtual Real & timeOld() const
unsigned int _n_nonlinear_iterations
NumericVector< Number > & solutionOld()
const SparseMatrix< Number > & get_system_matrix() const

◆ validParams()

InputParameters ExplicitMixedOrder::validParams ( )
static

Definition at line 41 of file ExplicitMixedOrder.C.

42 {
44 
45  params.addClassDescription(
46  "Implementation of explicit time integration without invoking any of the nonlinear solver.");
47 
48  params.addParam<bool>("use_constant_mass",
49  false,
50  "If set to true, will only compute the mass matrix in the first time step, "
51  "and keep using it throughout the simulation.");
52  params.addParam<TagName>("mass_matrix_tag", "mass", "The tag for the mass matrix");
53 
54  params.addParam<std::vector<VariableName>>(
55  "second_order_vars",
56  {},
57  "A subset of variables that require second-order integration (velocity and acceleration) to "
58  "be applied by this time integrator.");
59 
60  params.addParam<std::vector<VariableName>>(
61  "first_order_vars",
62  {},
63  "A subset of variables that require first-order integration (velocity only) to be applied by "
64  "this time integrator.");
65 
66  // Prevent users from using variables option by accident.
67  params.suppressParameter<std::vector<VariableName>>("variables");
68 
69  MooseEnum solve_type("consistent lumped lump_preconditioned", "lumped");
70  params.setParameters("solve_type", solve_type);
71  params.ignoreParameter<MooseEnum>("solve_type");
72  return params;
73 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void suppressParameter(const std::string &name)
static InputParameters validParams()
void ignoreParameter(const std::string &name)
void addClassDescription(const std::string &doc_string)
void setParameters(const std::string &name, const T &value, Ts... extra_input_parameters)

Member Data Documentation

◆ _constant_mass

const bool& ExplicitMixedOrder::_constant_mass
protected

Whether we are reusing the mass matrix.

Definition at line 70 of file ExplicitMixedOrder.h.

Referenced by solve().

◆ _local_first_order_indices

std::vector<dof_id_type>& ExplicitMixedOrder::_local_first_order_indices
protected

Definition at line 82 of file ExplicitMixedOrder.h.

Referenced by init(), and performExplicitSolve().

◆ _local_second_order_indices

std::vector<dof_id_type>& ExplicitMixedOrder::_local_second_order_indices
protected

Definition at line 88 of file ExplicitMixedOrder.h.

Referenced by init(), and performExplicitSolve().

◆ _mass_matrix

const TagName& ExplicitMixedOrder::_mass_matrix
protected

Mass matrix name.

Definition at line 73 of file ExplicitMixedOrder.h.

Referenced by massMatrixTagID().

◆ _solution_older

const NumericVector<Number>& ExplicitMixedOrder::_solution_older
protected

The older solution.

Definition at line 76 of file ExplicitMixedOrder.h.

◆ _vars_first

std::unordered_set<unsigned int>& ExplicitMixedOrder::_vars_first
protected

Definition at line 79 of file ExplicitMixedOrder.h.

Referenced by findVariableTimeOrder(), and init().

◆ _vars_second

std::unordered_set<unsigned int>& ExplicitMixedOrder::_vars_second
protected

Definition at line 85 of file ExplicitMixedOrder.h.

Referenced by findVariableTimeOrder(), and init().


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