www.mooseframework.org
PetscOutput.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #pragma once
11 
12 // MOOSE includes
13 #include "Output.h"
14 
15 // Forward declerations
16 class PetscOutput;
17 
18 template <>
20 
24 class PetscOutput : public Output
25 {
26 public:
32 
41  virtual Real time() override;
42 
43 protected:
45  Real _norm;
46 
48  PetscInt _nonlinear_iter;
49 
51  PetscInt _linear_iter;
52 
53 private:
57  void solveSetup() override;
58 
59 #ifdef LIBMESH_HAVE_PETSC
60 
65  static PetscErrorCode petscNonlinearOutput(SNES, PetscInt its, PetscReal fnorm, void * void_ptr);
66 
72  static PetscErrorCode petscLinearOutput(KSP, PetscInt its, PetscReal fnorm, void * void_ptr);
73 #endif
74 
77 
80 
83 
85  Real _linear_dt;
86 
89 
92 
95 
98 
101 
104 
107 
110 };
static PetscErrorCode petscLinearOutput(KSP, PetscInt its, PetscReal fnorm, void *void_ptr)
Performs the output onlinear iterations.
Definition: PetscOutput.C:213
virtual Real time() override
Get the output time.
Definition: PetscOutput.C:253
void solveSetup() override
Internal setup function that executes at the beginning of the time step.
Definition: PetscOutput.C:129
bool _on_linear_residual
True if current output calls is on the linear residual (used by time())
Definition: PetscOutput.h:88
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Real _nonlinear_dt
The pseuedo non-linear time step.
Definition: PetscOutput.h:79
Real _linear_time
Psuedo linear time.
Definition: PetscOutput.h:82
bool _on_nonlinear_residual
True if current output call is on the non-linear residual (used by time())
Definition: PetscOutput.h:91
Real _linear_start_time
Linear residual output start time.
Definition: PetscOutput.h:103
Real _nonlinear_start_time
Non-linear residual output start time.
Definition: PetscOutput.h:100
Based class for output objects.
Definition: Output.h:41
Real _linear_end_time
Linear residual output end time.
Definition: PetscOutput.h:109
PetscInt _linear_iter
Current linear iteration returned from PETSc.
Definition: PetscOutput.h:51
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
Real _linear_dt
Psuedo linear time step.
Definition: PetscOutput.h:85
Real _nonlinear_time
The psuedo non-linear time.
Definition: PetscOutput.h:76
Real _norm
Current norm returned from PETSc.
Definition: PetscOutput.h:45
PetscOutput(const InputParameters &parameters)
Class constructor.
Definition: PetscOutput.C:80
InputParameters validParams< PetscOutput >()
Definition: PetscOutput.C:20
Real _nonlinear_dt_divisor
Pseudo non-linear timestep divisor.
Definition: PetscOutput.h:94
static PetscErrorCode petscNonlinearOutput(SNES, PetscInt its, PetscReal fnorm, void *void_ptr)
Performs the output on non-linear iterations.
Definition: PetscOutput.C:173
Real _linear_dt_divisor
Pseudo linear timestep divisor.
Definition: PetscOutput.h:97
Adds the ability to output on every nonlinear and/or linear residual.
Definition: PetscOutput.h:24
Real _nonlinear_end_time
Non-linear residual output end time.
Definition: PetscOutput.h:106
PetscInt _nonlinear_iter
Current non-linear iteration returned from PETSc.
Definition: PetscOutput.h:48