15 #include "libmesh/libmesh_common.h" 16 #include "libmesh/petsc_nonlinear_solver.h" 36 if (!ptr->inNonlinearTimeWindow())
41 ptr->_linear_time = ptr->_nonlinear_time;
45 ptr->_nonlinear_iter = its;
48 ptr->_on_nonlinear_residual =
true;
64 ptr->_app.getOutputWarehouse().flushConsoleBuffer();
67 ptr->_on_nonlinear_residual =
false;
86 if (!ptr->inLinearTimeWindow())
94 ptr->_linear_iter = its;
97 ptr->_on_linear_residual =
true;
113 ptr->_app.getOutputWarehouse().flushConsoleBuffer();
116 ptr->_on_linear_residual =
false;
129 params.
addParam<
bool>(
"output_linear",
131 "Specifies whether output occurs on each PETSc linear residual evaluation");
135 "Specifies whether output occurs on each PETSc nonlinear residual evaluation");
140 "nonlinear_residual_dt_divisor",
142 "Number of divisions applied to time step when outputting non-linear residuals");
144 "linear_residual_dt_divisor",
146 "Number of divisions applied to time step when outputting linear residuals");
150 "linear_residual_start_time",
151 "Specifies a start time to begin output on each linear residual evaluation");
153 "nonlinear_residual_start_time",
154 "Specifies a start time to begin output on each nonlinear residual evaluation");
160 "Specifies an end time to begin output on each linear residual evaluation");
162 "nonlinear_residual_end_time",
163 "Specifies an end time to begin output on each nonlinear residual evaluation");
166 "nonlinear_residual_start_time linear_residual_end_time " 167 "nonlinear_residual_end_time nonlinear_residual_dt_divisor " 168 "linear_residual_dt_divisor",
169 "PETSc linear/nonlinear output");
178 _on_linear_residual(false),
179 _on_nonlinear_residual(false),
180 _nonlinear_dt_divisor(getParam<
Real>(
"nonlinear_residual_dt_divisor")),
181 _linear_dt_divisor(getParam<
Real>(
"linear_residual_dt_divisor")),
182 _nonlinear_start_time(-
std::numeric_limits<
Real>::
max()),
183 _linear_start_time(-
std::numeric_limits<
Real>::
max()),
184 _nonlinear_end_time(
std::numeric_limits<
Real>::
max()),
185 _linear_end_time(
std::numeric_limits<
Real>::
max())
188 if (getParam<bool>(
"output_linear"))
190 if (getParam<bool>(
"output_nonlinear"))
241 SNESGetKSP(snes, &ksp);
Real & _time_old
The old time.
ExecFlagEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
static PetscErrorCode petscLinearOutput(KSP, PetscInt its, PetscReal fnorm, void *void_ptr)
Performs the output onlinear iterations This is the monitor method that PETSc will call on linear ite...
virtual Real time() override
Get the output time.
void solveSetup() override
Internal setup function that executes at the beginning of the time step.
bool _on_linear_residual
True if current output calls is on the linear residual (used by time())
static PetscErrorCode petscNonlinearOutput(SNES, PetscInt its, PetscReal fnorm, void *void_ptr)
Performs the output on non-linear iterations This is the monitor method that PETSc will call on non-l...
const Parallel::Communicator & _communicator
Real _nonlinear_dt
The pseuedo non-linear time step.
Real _linear_time
Psuedo linear time.
bool _on_nonlinear_residual
True if current output call is on the non-linear residual (used by time())
Real _linear_start_time
Linear residual output start time.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
auto max(const L &left, const R &right)
PetscOutputInterface(PetscOutput *obj)
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Real _nonlinear_start_time
Non-linear residual output start time.
Nonlinear system to be solved.
Based class for output objects.
Real _linear_end_time
Linear residual output end time.
static InputParameters validParams()
NonlinearSystemBase & currentNonlinearSystem()
Real _linear_dt
Psuedo linear time step.
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
PetscOutput * _petsc_output
Real _nonlinear_time
The psuedo non-linear time.
MooseApp & _app
The MOOSE application this is associated with.
const ExecFlagType EXEC_LINEAR
PetscOutput(const InputParameters ¶meters)
Class constructor.
virtual Real time()
Get the output time.
const ExecFlagType EXEC_NONLINEAR
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _nonlinear_dt_divisor
Pseudo non-linear timestep divisor.
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
Real _linear_dt_divisor
Pseudo linear timestep divisor.
const std::vector< T * > & getInterfaceObjects() const
Gets the registered interface objects for a given interface.
Adds the ability to output on every nonlinear and/or linear residual.
Real _nonlinear_end_time
Non-linear residual output end time.
static InputParameters validParams()
virtual Real getOutputTime()
Get the time that will be used for stream/file outputting.
Real & _dt
Time step delta.
void registerInterfaceObject(T &interface)
Registers an interface object for accessing with getInterfaceObjects.