OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
parallel.h
Go to the documentation of this file.
1 // Contributing authors : Michail Tzoufras, Benjamin Winjum
3 //
4 // Modified: September 1 2016
6 
7 //
8 // Contains the declerations for the communications
9 // between nodes, boundaries and the parallel output
11 //
12 //
13 // This file contains three modules:
14 //
15 // 1. class Node_ImplicitE_Communications:
16 //
17 // 2. class Node_Communications:
18 // Allows the nodes to exchange information in order
19 // to update their guard cells. For boundary nodes
20 // it provides the appropriate boundary conditions.
21 //
22 // 3. class Parallel_Environment:
23 // - It decomposes the computational domain
24 // - It controls the node communications
25 // - It controls the parallel output
26 // - It controls the restart facility
27 //
29 //
30 
31  #ifndef PARALLEL_ENVIRONMENT_H
32  #define PARALLEL_ENVIRONMENT_H
33 
34 
35 //**************************************************************
36 //--------------------------------------------------------------
38 //--------------------------------------------------------------
39 // Declaration of the parallel module
40 //--------------------------------------------------------------
41  public:
42 // Constructors/Destructors
45 
46 // Boundary conditions
47  int BNDX() const;
48 
49 // Data exchange in x direction
50  void Send_right_X(State1D& Y, int dest);
51  void Recv_from_left_X(State1D& Y,int origin);
52  void Send_left_X(State1D& Y, int dest);
53  void Recv_from_right_X(State1D& Y, int origin);
54 
55 // Boundaries
56  void mirror_bound_Xleft(State1D& Y);
58 
59 // Boundaries for single-node configurations
60  void sameNode_bound_X(State1D& Y);
61 
62  private:
63 // Domain information
64  int Nbc, bndX;
65 
66 // Information exchange
67  int msg_sizeX;
68  complex<double> *msg_bufX;
69 
70 // Boundaries for single-node configurations
72  void sameNode_mirror_X(State1D& Y);
73 
74  };
75 //--------------------------------------------------------------
76 //**************************************************************
77 
78 
79 //**************************************************************
80 //--------------------------------------------------------------
82 //--------------------------------------------------------------
83 // Declaration of the parallel module
84 //--------------------------------------------------------------
85  public:
86 // Constructors/Destructors
89 
90 // Boundary conditions
91  int BNDX() const;
92 
93 // Data exchange in x direction
94  void Send_right_X(State1D& Y, int dest);
95  void Recv_from_left_X(State1D& Y,int origin);
96  void Send_left_X(State1D& Y, int dest);
97  void Recv_from_right_X(State1D& Y, int origin);
98 
99 // Boundaries
100  void mirror_bound_Xleft(State1D& Y);
101  void mirror_bound_Xright(State1D& Y);
102 
103 // Boundaries for single-node configurations
104  void sameNode_bound_X(State1D& Y);
105 
106  private:
107 // Domain information
108  int Nbc, bndX;
109  int numspec, numpmax;
110 
111 // Information exchange
113  complex<double> *msg_bufX;
114 
115 // Boundaries for single-node configurations
116  void sameNode_periodic_X(State1D& Y);
117  void sameNode_mirror_X(State1D& Y);
118 
119  };
120 //--------------------------------------------------------------
121 //**************************************************************
122 
123 
124 //**************************************************************
125 //**************************************************************
126 
127 
128 //**************************************************************
129 //--------------------------------------------------------------
131 //--------------------------------------------------------------
132 // Declaration of the parallel module
133 //--------------------------------------------------------------
134  public:
135 // Constructors/Destructors
138 
139 // Parallel parameters
140  int RANK() const;
141  int NODES() const;
142  int BNDX() const;
143 
144 // Restart
145 // bool READ_RESTART() const;
146 // void Read_Restart(State1D& Y);
147 
148 // bool WRITE_RESTART(const size_t step) const;
149 // void Write_Restart(State1D& Y, size_t step);
150 
151 // size_t T_IN() const;
152 
153 // Information exchange
154  void Neighbor_ImplicitE_Communications(State1D& Y);
155  void Neighbor_Communications(State1D& Y);
156 
157  private:
158 // Parallel parameters
159  int rank;
160  int Nnodes;
161 
162 // Boundaries
163  int bndX;
164 
165 // Information Exchange
168 
169 // Error Checking of the constructor
170  bool error_check();
171  };
172 //--------------------------------------------------------------
173 //**************************************************************
174 
175 
176 
177  #endif
void Recv_from_left_X(State1D &Y, int origin)
Definition: parallel.cpp:136
void sameNode_bound_X(State1D &Y)
Definition: parallel.cpp:264
complex< double > * msg_bufX
Definition: parallel.h:113
Node_ImplicitE_Communications Bfield_Data
Definition: parallel.h:166
void Send_right_X(State1D &Y, int dest)
Definition: parallel.cpp:114
Node_Communications X_Data
Definition: parallel.h:167
void mirror_bound_Xleft(State1D &Y)
Definition: parallel.cpp:215
Definition: state.h:577
void Send_left_X(State1D &Y, int dest)
Definition: parallel.cpp:160
void mirror_bound_Xright(State1D &Y)
Definition: parallel.cpp:237
void sameNode_mirror_X(State1D &Y)
Definition: parallel.cpp:305
void sameNode_periodic_X(State1D &Y)
Definition: parallel.cpp:284
void Recv_from_right_X(State1D &Y, int origin)
Definition: parallel.cpp:182
complex< double > * msg_bufX
Definition: parallel.h:68