HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
simulation.h
Go to the documentation of this file.
1 
6 #ifndef _SIMULATION_H_
7 #define _SIMULATION_H_
8 
9 #include <simulation_object.h>
10 #include <mpivars_cpp.h>
11 #ifdef with_petsc
12 #include <petscinterface.h>
13 #endif
14 
15 extern "C" int ReadInputs(void*,int,int);
16 extern "C" int WriteInputs(void*,int,int);
17 extern "C" int Initialize(void*,int);
18 #if defined(HAVE_CUDA)
19  extern "C" int Initialize_GPU(void*,int);
20 #endif
21 extern "C" int InitialSolution(void*,int);
22 extern "C" int InitializeBoundaries(void*,int);
23 extern "C" int InitializeImmersedBoundaries(void*,int);
24 extern "C" int InitializePhysics(void*,int);
25 extern "C" int InitializePhysicsData(void*,int,int,int*);
26 extern "C" int InitializeSolvers(void*,int);
27 extern "C" int Cleanup(void*,int);
30 extern "C" void SimWriteErrors(void*, int, int, double, double);
31 
32 #ifdef with_petsc
33 int SolvePETSc(void*,int, int, int);
34 #endif
35 int Solve(void*,int, int, int);
47 {
48  public:
49 
51  Simulation() { }
53  virtual ~Simulation() { }
54 
56  virtual int define(int, int) = 0;
57 
59  virtual int ReadInputs() = 0;
60 
62  virtual int Initialize() = 0;
63 
65  virtual int InitialSolution() = 0;
66 
68  virtual int InitializeBoundaries() = 0;
69 
71  virtual int InitializeImmersedBoundaries() = 0;
72 
74  virtual int InitializePhysics() = 0;
75 
77  virtual int InitializePhysicsData() = 0;
78 
80  virtual int InitializeSolvers() = 0;
81 
83  virtual int InitializationWrapup()
84  {
85  return 0;
86  }
87 
89  virtual int Solve() = 0;
90 
92  virtual void WriteErrors(double, double) = 0;
93 
95  virtual bool isDefined() const = 0;
96 
97 #ifndef serial
98 
99  virtual int mpiCommDup() = 0;
100 #endif
101 
102 #ifdef with_petsc
103 
104  virtual void usePetscTS(PetscBool) = 0;
105 
107  virtual int SolvePETSc() = 0;
108 #endif
109 
110  protected:
111 
112  private:
113 
114 };
115 
116 #endif
117 
int Initialize(void *, int)
Definition: Initialize.c:26
int Cleanup(void *, int)
Definition: Cleanup.c:39
virtual int InitializePhysicsData()=0
virtual int mpiCommDup()=0
int InitializeImmersedBoundaries(void *, int)
virtual void usePetscTS(PetscBool)=0
virtual int Solve()=0
int WriteInputs(void *, int, int)
Definition: WriteInputs.c:15
int InitialSolution(void *, int)
int InitializePhysicsData(void *, int, int, int *)
virtual int Initialize()=0
virtual void WriteErrors(double, double)=0
int SolvePETSc(void *, int, int, int)
Integrate in time with PETSc.
Definition: SolvePETSc.cpp:50
virtual int SolvePETSc()=0
Simulation object.
int InitializePhysics(void *, int)
virtual bool isDefined() const =0
int Initialize_GPU(void *, int)
int InitializeBoundaries(void *, int)
int Solve(void *, int, int, int)
Definition: Solve.cpp:37
virtual int InitializationWrapup()
Definition: simulation.h:83
virtual int InitialSolution()=0
int ReadInputs(void *, int, int)
Definition: ReadInputs.c:93
virtual int define(int, int)=0
virtual ~Simulation()
Definition: simulation.h:53
virtual int InitializePhysics()=0
void SimWriteErrors(void *, int, int, double, double)
virtual int InitializeImmersedBoundaries()=0
C++ declarations for MPI-related functions.
virtual int InitializeBoundaries()=0
virtual int ReadInputs()=0
int InitializeSolvers(void *, int)
virtual int InitializeSolvers()=0
Base class for a simulation.
Definition: simulation.h:46