METHOD
parallelBoundaryConds.h
Go to the documentation of this file.
1 #ifndef PARALLEL_BOUNDARYCONDS_H
2 #define PARALLEL_BOUNDARYCONDS_H
3 
4 #include "simData.h"
5 #include "boundaryConds.h"
6 #include "parallelEnv.h"
7 
9 
16 class ParallelBcs : public Bcs
17 {
18 
19  public:
20 
22 
24 
31  ParallelBcs(Data *data, ParallelEnv *env) : Bcs(data), env(env)
32  {
33  }
34 
35  virtual ~ParallelBcs() { }
36 
50  void swapGhostBuffers(double *sendToLeftBuf, double *sendToRightBuf, double *recvFromLeftBuf,
51  double *recvFromRightBuf, int leftNeighbour, int rightNeighbour, int numCellsSent);
52 
65  void packXBuffer(double *sendToLeftBuf, double *sendToRightBuf, double *stateVector, int nVars);
66 
78  void unpackXBuffer(double *recvFromLeftBuf, double *recfFromRightBuf, double *stateVector, int nVars);
79 
92  void packYBuffer(double *sendToLeftBuf, double *sendToRightBuf, double *stateVector, int nVars);
93 
105  void unpackYBuffer(double *recvFromLeftBuf, double *recfFromRightBuf, double *stateVector, int nVars);
106 
118  void packZBuffer(double *sendToLeftBuf, double *sendToRightBuf, double *stateVector, int nVars);
119 
131  void unpackZBuffer(double *recvFromLeftBuf, double *recfFromRightBuf, double *stateVector, int nVars);
132 
133 };
134 
136 
156 {
157  public:
159  /*
160  Calls constructor of base class to store the pointer to the Data class and ParallelEnv class.
161  @param[in] *data pointer to Data class
162  @param[in] *env pointer to ParallelEnv class!
163  @sa ParallelBcs::ParallelBcs
164  */
166 
167  virtual ~ParallelOutflow() { }
168 
170 
178  void apply(double * cons, double * prims = NULL, double * aux = NULL);
179 
187  void setXBoundary(double *stateVector, int nVars);
188 
196  void setYBoundary(double *stateVector, int nVars);
197 
205  void setZBoundary(double *stateVector, int nVars);
206 };
207 
208 
210 
231 {
232 
233  public:
234 
236 
243 
244  virtual ~ParallelPeriodic() { }
245 
247 
255  void apply(double * cons, double * prims = NULL, double * aux = NULL);
256 
257 };
258 
260 
265 class ParallelFlow : public ParallelBcs
266 {
267  public:
269 
276 
277  virtual ~ParallelFlow() { }
278 
280 
288  void apply(double * cons, double * prims = NULL, double * aux = NULL);
289 
297  void setYBoundary(double *stateVector, int nVars);
298 
306  void setZBoundary(double *stateVector, int nVars);
307 };
308 
309 
310 #endif
Periodic boundary conditions for a data structure that has been distributed across ranks ...
Flow boundary conditions for a data structure that has been distributed across ranks ...
ParallelEnv * env
Pointer to ParallelEnv class containing platform specific info such as MPI details.
Boundary Conditions
Definition: boundaryConds.h:13
ParallelFlow(Data *data, ParallelEnv *env)
Constructor.
void unpackXBuffer(double *recvFromLeftBuf, double *recfFromRightBuf, double *stateVector, int nVars)
ParallelOutflow(Data *data, ParallelEnv *env)
Constructor.
virtual ~ParallelOutflow()
Destructor.
void unpackZBuffer(double *recvFromLeftBuf, double *recfFromRightBuf, double *stateVector, int nVars)
void packYBuffer(double *sendToLeftBuf, double *sendToRightBuf, double *stateVector, int nVars)
virtual void apply(double *cons, double *prims=NULL, double *aux=NULL)=0
Application function.
Outflow boundary conditions for a data structure that has been distributed across ranks ...
ParallelBcs(Data *data, ParallelEnv *env)
Constructor.
void packXBuffer(double *sendToLeftBuf, double *sendToRightBuf, double *stateVector, int nVars)
void packZBuffer(double *sendToLeftBuf, double *sendToRightBuf, double *stateVector, int nVars)
Boundary Conditions for a data structure that has been distributed across ranks
Data * data
Pointer to Data class containing global simulation data.
Definition: boundaryConds.h:17
ParallelEnv
Definition: parallelEnv.h:19
ParallelPeriodic(Data *data, ParallelEnv *env)
Constructor.
virtual ~ParallelFlow()
Destructor.
Data object
Definition: simData.h:49
void swapGhostBuffers(double *sendToLeftBuf, double *sendToRightBuf, double *recvFromLeftBuf, double *recvFromRightBuf, int leftNeighbour, int rightNeighbour, int numCellsSent)
virtual ~ParallelPeriodic()
Destructor.
void unpackYBuffer(double *recvFromLeftBuf, double *recfFromRightBuf, double *stateVector, int nVars)
virtual ~ParallelBcs()
Destructor.