https://mooseframework.inl.gov
PetscOutput.h
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 
10 #pragma once
11 
12 // MOOSE includes
13 #include "Output.h"
14 
15 class PetscOutput;
16 
18 {
19 public:
21 
22 protected:
24 
29  static PetscErrorCode petscNonlinearOutput(SNES, PetscInt its, PetscReal fnorm, void * void_ptr);
30 
35  static PetscErrorCode petscLinearOutput(KSP, PetscInt its, PetscReal fnorm, void * void_ptr);
36 };
37 
41 class PetscOutput : public Output, public PetscOutputInterface
42 {
43 public:
45 
51 
60  virtual Real time() override;
61 
62 protected:
64  {
66  }
68  {
70  }
78  virtual Real getOutputTime();
79 
82 
84  PetscInt _nonlinear_iter;
85 
87  PetscInt _linear_iter;
88 
91 
94 
95 private:
99  void solveSetup() override;
100 
103 
106 
109 
112 
115 
118 
121 
124 
127 
130 
131  friend class PetscOutputInterface;
132 };
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...
Definition: PetscOutput.C:76
virtual Real time() override
Get the output time.
Definition: PetscOutput.C:262
void solveSetup() override
Internal setup function that executes at the beginning of the time step.
Definition: PetscOutput.C:218
bool _on_linear_residual
True if current output calls is on the linear residual (used by time())
Definition: PetscOutput.h:90
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
Definition: PetscOutput.C:26
Real _nonlinear_dt
The pseuedo non-linear time step.
Definition: PetscOutput.h:105
Real _linear_time
Psuedo linear time.
Definition: PetscOutput.h:108
bool _on_nonlinear_residual
True if current output call is on the non-linear residual (used by time())
Definition: PetscOutput.h:93
Real _linear_start_time
Linear residual output start time.
Definition: PetscOutput.h:123
PetscOutputInterface(PetscOutput *obj)
Definition: PetscOutput.C:19
Real _nonlinear_start_time
Non-linear residual output start time.
Definition: PetscOutput.h:120
Based class for output objects.
Definition: Output.h:43
Real _linear_end_time
Linear residual output end time.
Definition: PetscOutput.h:129
PetscInt _linear_iter
Current linear iteration returned from PETSc.
Definition: PetscOutput.h:87
static InputParameters validParams()
Definition: PetscOutput.C:125
Real _linear_dt
Psuedo linear time step.
Definition: PetscOutput.h:111
bool inLinearTimeWindow()
Definition: PetscOutput.h:67
PetscOutput * _petsc_output
Definition: PetscOutput.h:23
Real _nonlinear_time
The psuedo non-linear time.
Definition: PetscOutput.h:102
Real _norm
Current norm returned from PETSc.
Definition: PetscOutput.h:81
PetscOutput(const InputParameters &parameters)
Class constructor.
Definition: PetscOutput.C:174
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _nonlinear_dt_divisor
Pseudo non-linear timestep divisor.
Definition: PetscOutput.h:114
Real _t_tol
Time checking tolerance.
Definition: Output.h:265
bool inNonlinearTimeWindow()
Definition: PetscOutput.h:63
Real _linear_dt_divisor
Pseudo linear timestep divisor.
Definition: PetscOutput.h:117
const InputParameters & parameters() const
Get the parameters of the object.
Adds the ability to output on every nonlinear and/or linear residual.
Definition: PetscOutput.h:41
Real _nonlinear_end_time
Non-linear residual output end time.
Definition: PetscOutput.h:126
Real & _time
The current time for output purposes.
Definition: Output.h:214
virtual Real getOutputTime()
Get the time that will be used for stream/file outputting.
Definition: PetscOutput.C:273
PetscInt _nonlinear_iter
Current non-linear iteration returned from PETSc.
Definition: PetscOutput.h:84