www.mooseframework.org
ExternalPetscSolverApp.C
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 #include "ExternalPetscSolverApp.h"
11 #include "Moose.h"
12 #include "AppFactory.h"
13 #include "MooseSyntax.h"
14 #include "PETScDiffusionFDM.h"
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<MooseApp>();
21  return params;
22 }
23 
24 ExternalPetscSolverApp::ExternalPetscSolverApp(InputParameters parameters) : MooseApp(parameters)
25 {
26  ExternalPetscSolverApp::registerAll(_factory, _action_factory, _syntax);
27 
28 #if LIBMESH_HAVE_PETSC
29  PETScExternalSolverCreate(_comm->get(), &_ts);
30 #else
31  mooseError("You need to have PETSc installed to use ExternalPETScApp");
32 #endif
33 }
34 
36 {
37 #if LIBMESH_HAVE_PETSC
39 #endif
40 }
41 
42 void
43 ExternalPetscSolverApp::registerAll(Factory & f, ActionFactory & af, Syntax & /*s*/)
44 {
45  Registry::registerObjectsTo(f, {"ExternalPetscSolverApp"});
46  Registry::registerActionsTo(af, {"ExternalPetscSolverApp"});
47 
48  /* register custom execute flags, action syntax, etc. here */
49 }
50 
51 void
53 {
54  registerApp(ExternalPetscSolverApp);
55 }
56 
57 /***************************************************************************************************
58  *********************** Dynamic Library Entry Points - DO NOT MODIFY ******************************
59  **************************************************************************************************/
60 extern "C" void
61 ExternalPetscSolverApp__registerAll(Factory & f, ActionFactory & af, Syntax & s)
62 {
64 }
65 extern "C" void
67 {
69 }
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
PETSC_EXTERN PetscErrorCode PETScExternalSolverCreate(MPI_Comm, TS *)
void ExternalPetscSolverApp__registerAll(Factory &f, ActionFactory &af, Syntax &s)
This is a demo used to demonstrate how to couple an external app through the MOOSE wrapper APP...
PETSC_EXTERN PetscErrorCode PETScExternalSolverDestroy(TS)
void ExternalPetscSolverApp__registerApps()
ExternalPetscSolverApp(InputParameters parameters)
TS _ts
Time-stepping (TS) object.
InputParameters validParams< ExternalPetscSolverApp >()