https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12
13#include "libmesh/petsc_solver_exception.h"
14
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
34Real
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
43Real
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}
registerMooseObject("ExternalPetscSolverApp", ExternalPetscTimeStepper)
This is an interface to call a pure PETSc solver.
ExternalPetscTimeStepper(const InputParameters &parameters)
ExternalPETScProblem & _external_petsc_problem
virtual Real computeInitialDT() override
virtual Real computeDT() override
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()