https://mooseframework.inl.gov
ExternalPetscTimeStepper.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
11 #include "ExternalPETScProblem.h"
12 
13 #include "libmesh/petsc_solver_exception.h"
14 
15 registerMooseObject("ExternalPetscSolverApp", ExternalPetscTimeStepper);
16 
19 {
21 
22  params.addClassDescription("Timestepper that queries the step size of the external petsc solver, "
23  "and use that as the time step size.");
24  return params;
25 }
26 
28  : TimeStepper(parameters),
29  // ExternalPetscTimeStepper always requires ExternalPETScProblem
30  _external_petsc_problem(static_cast<ExternalPETScProblem &>(_fe_problem))
31 {
32 }
33 
34 Real
36 {
37  // Query the time step size of PETSc solver
38  PetscReal dt;
39  LibmeshPetscCall(TSGetTimeStep(_external_petsc_problem.getPetscTS(), &dt));
40  return dt;
41 }
42 
43 Real
45 {
46  // Query the time step size of PETSc solver
47  PetscReal dt;
48  LibmeshPetscCall(TSGetTimeStep(_external_petsc_problem.getPetscTS(), &dt));
49  return dt;
50 }
static InputParameters validParams()
This is an interface to call a pure PETSc solver.
ExternalPETScProblem & _external_petsc_problem
static InputParameters validParams()
ExternalPetscTimeStepper(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeDT() override
void addClassDescription(const std::string &doc_string)
virtual Real computeInitialDT() override
registerMooseObject("ExternalPetscSolverApp", ExternalPetscTimeStepper)