www.mooseframework.org
ExternalPETScProblem.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 #include "ExternalProblem.h"
13 #include "PETScDiffusionFDM.h"
14 #include "ExternalPetscSolverApp.h"
15 
17 
18 template <>
19 InputParameters validParams<ExternalPETScProblem>();
20 
27 class ExternalPETScProblem : public ExternalProblem
28 {
29 public:
30  ExternalPETScProblem(const InputParameters & params);
31 #if LIBMESH_HAVE_PETSC
32  ~ExternalPETScProblem() { VecDestroy(&_petsc_sol); }
33 #endif
34 
35  virtual void externalSolve() override;
36  virtual void syncSolutions(Direction /*direction*/) override;
37 
38  virtual bool converged() override { return true; }
39 
40 private:
42  const VariableName & _sync_to_var_name;
44 
45 #if LIBMESH_HAVE_PETSC
46  TS & _ts;
50 #endif
51 };
52 
This is an interface to call a pure PETSc solver.
virtual void syncSolutions(Direction) override
InputParameters validParams< ExternalPETScProblem >()
This is a demo used to demonstrate how to couple an external app through the MOOSE wrapper APP...
virtual void externalSolve() override
TS & _ts
PETSc solver.
virtual bool converged() override
Vec _petsc_sol
PETSc solver solution.
ExternalPetscSolverApp & _petsc_app
const VariableName & _sync_to_var_name
The name of the variable to transfer to.
ExternalPETScProblem(const InputParameters &params)