https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
15
23{
24public:
26
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
48private:
50 const VariableName & _sync_to_var_name;
55 TS & _ts;
64};
This is an interface to call a pure PETSc solver.
const VariableName & _sync_to_var_name
The name of the variable to transfer to.
virtual bool converged(unsigned int) override
virtual void externalSolve() override
PetscBool _petsc_converged
If PETSc solver converged.
Vec & _petsc_sol
PETSc solver solution.
virtual Real computeResidualL2Norm() override
ExternalPetscSolverApp & _external_petsc_app
virtual void advanceState() override
Vec & _petsc_sol_old
Solution at the previous time step.
Vec & _petsc_udot
Udot (u_n-u_{n-1})/dt.
static InputParameters validParams()
virtual void syncSolutions(Direction) override
This is a demo used to demonstrate how to couple an external app through the MOOSE wrapper APP.