https://mooseframework.inl.gov
ExternalPETScProblem.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 #include "ExternalProblem.h"
13 #include "PETScDiffusionFDM.h"
14 #include "ExternalPetscSolverApp.h"
15 
23 {
24 public:
26 
27  ExternalPETScProblem(const InputParameters & params);
28 
30 
31  virtual void externalSolve() override;
32  virtual void syncSolutions(Direction /*direction*/) override;
33 
34  virtual bool converged(unsigned int) override { return _petsc_converged; }
35 
36  virtual void advanceState() override;
37 
38  virtual Real computeResidualL2Norm() override;
39 
40  Vec & solutionOld() { return _petsc_sol_old; }
41 
42  Vec & currentSolution() { return _petsc_sol; }
43 
44  Vec & udot() { return _petsc_udot; }
45 
46  TS & getPetscTS() { return _ts; }
47 
48 private:
50  const VariableName & _sync_to_var_name;
52  PetscBool _petsc_converged;
55  TS & _ts;
57  Vec & _petsc_sol;
61  Vec & _petsc_udot;
64 };
This is an interface to call a pure PETSc solver.
Vec & _petsc_udot
Udot (u_n-u_{n-1})/dt.
ExternalPetscSolverApp & _external_petsc_app
virtual bool converged(unsigned int) override
virtual void syncSolutions(Direction) override
Vec & _petsc_sol
PETSc solver solution.
This is a demo used to demonstrate how to couple an external app through the MOOSE wrapper APP...
virtual Real computeResidualL2Norm() override
virtual void externalSolve() override
TS & _ts
PETSc solver.
Vec _petsc_rhs
RHS vector.
Vec & _petsc_sol_old
Solution at the previous time step.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void advanceState() override
PetscBool _petsc_converged
If PETSc solver converged.
const VariableName & _sync_to_var_name
The name of the variable to transfer to.
ExternalPETScProblem(const InputParameters &params)
static InputParameters validParams()