OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
parallel.cpp
Go to the documentation of this file.
1 // Contributing authors : Michail Tzoufras, Benjamin Winjum
3 //
4 // Last Modified: September 1, 2016
6 
7 //
8 // Contains the declerations for the communications
9 // between nodes, boundaries and the parallel output
11 //
12 // This file contains three modules:
13 //
14 // 1. class Node_Communications:
15 // Allows the nodes to exchange information in order
16 // to update their guard cells. For boundary nodes
17 // it provides the appropriate boundary conditions.
18 //
19 // 2. class Parallel_Output:
20 // Collects the output information from all of the
21 // nodes and combines them to the final file ready
22 // to be exported. For the moments of the distribution
23 // function it also performs the integration over
24 // momentum space and for detailed information on
25 // phasespace it calls the appropriate functions from
26 // "Output" to convert the spherical harmonics to
27 // cartesian geometry.
28 //
29 // 3. class Parallel_Environment:
30 // - It decomposes the computational domain
31 // - It controls the node communications
32 // - It controls the parallel output
33 // - It controls the restart facility
34 //
36 //
39 
40 // Standard libraries
41 #include <mpi.h>
42 #include <iostream>
43 #include <algorithm>
44 #include <vector>
45 #include <valarray>
46 #include <complex>
47 #include <cmath>
48 #include <stdio.h>
49 #include <float.h>
50 #include <string>
51 #include <iomanip>
52 #include <fstream>
53 
54 // My libraries
55 #include "H5Cpp.h"
56 #include "lib-array.h"
57 #include "lib-algorithms.h"
58 #include <map>
59 
60 // Declerations
61 #include "input.h"
62 #include "state.h"
63 // #include "decl-output.h"
64 // #include "setup.h"
65 // #include "export.h"
66 #include "parallel.h"
67 
68 
69 //**************************************************************
70 //**************************************************************
71 // Definition of the Nodes Communications class
72 //**************************************************************
73 //**************************************************************
74 
75 
76 //**************************************************************
77 //--------------------------------------------------------------
79 //--------------------------------------------------------------
80 // Constructor
81 //--------------------------------------------------------------
82  Nbc(Input::List().BoundaryCells), // # of boundary cells
83  bndX(Input::List().bndX) { // Type of boundary in X
84 
85  // 3 components for Bx, By, Bz
86  msg_sizeX = 3;
87 
88  msg_sizeX *= Nbc; //(IN().inp().y.dim()*Nbc);
89  msg_bufX = new complex<double>[msg_sizeX];
90 
91 }
92 //--------------------------------------------------------------
93 
94 //--------------------------------------------------------------
96 //--------------------------------------------------------------
97 // Destructor
98 //--------------------------------------------------------------
99  delete[] msg_bufX;
100 }
101 //--------------------------------------------------------------
102 
103 //--------------------------------------------------------------
105 //--------------------------------------------------------------
106 
107 //--------------------------------------------------------------
108 
109 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
110 // Send and receive in the X direction
111 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
112 
113 //--------------------------------------------------------------
115 //--------------------------------------------------------------
116 // X-axis : Read data from the right boundary and send them
117 // to the node on the right
118 //--------------------------------------------------------------
119 
120  static size_t step_f(Nbc);
121  size_t bufind(0);
122 
123  // Fields: x0 "Right-Bound --> "
124  for(size_t i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
125  for(int e(0); e < Nbc; e++) {
126  msg_bufX[bufind + e] = Y.FLD(i)(Y.FLD(i).numx()-2*Nbc+e);
127  }
128  bufind += step_f;
129  }
130 
131  MPI_Send(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, dest, 0, MPI_COMM_WORLD);
132 }
133 //--------------------------------------------------------------
134 
135 //--------------------------------------------------------------
137 //--------------------------------------------------------------
138 // X-axis : Receive data from the node on the left and update
139 // the left guard cells
140 //--------------------------------------------------------------
141 
142  static size_t step_f(Nbc);
143  size_t bufind(0);
144  MPI_Status status;
145 
146  // Receive Data
147  MPI_Recv(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, origin, 0, MPI_COMM_WORLD, &status);
148 
149  // Fields: x0-"---> Left-Guard"
150  for(int i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
151  for(int e(0); e < Nbc; e++) {
152  Y.FLD(i)(e) = msg_bufX[bufind + e];
153  }
154  bufind += step_f;
155  }
156 }
157 //--------------------------------------------------------------
158 
159 //--------------------------------------------------------------
161 //--------------------------------------------------------------
162 // X-axis : Read data from the left boundary and send them
163 // to the node on the left
164 //--------------------------------------------------------------
165 
166  static size_t step_f(Nbc);
167  size_t bufind(0);
168 
169  // Fields: x0 " <--- Left-Bound "
170  for(int i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
171  for(int e(0); e < Nbc; e++) {
172  msg_bufX[bufind + e] = Y.FLD(i)(Nbc+e);
173  }
174  bufind += step_f;
175  }
176 
177  MPI_Send(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, dest, 1, MPI_COMM_WORLD);
178 }
179 //--------------------------------------------------------------
180 
181 //--------------------------------------------------------------
183 //--------------------------------------------------------------
184 // X-axis : Receive data from the node on the right and update
185 // the right guard cells
186 //--------------------------------------------------------------
187 
188  static size_t step_f(Nbc);
189  size_t bufind(0);
190  MPI_Status status;
191 
192  // Receive Data
193  MPI_Recv(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, origin, 1, MPI_COMM_WORLD, &status);
194 
195  // Fields: x0-"Right-Guard <--- "
196  for(int i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
197  for(int e(0); e < Nbc; e++) {
198  Y.FLD(i)(Y.FLD(i).numx()-Nbc+e) = msg_bufX[bufind + e];
199  }
200  bufind += step_f;
201  }
202 }
203 //--------------------------------------------------------------
204 
205 
206 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
207 // Boundary conditions
208 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
209 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
210 // Mirror conditions on one side
211 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
212 
213 //*************************************************************************************
214 //-------------------------------------------------------------------------------------
216 //-------------------------------------------------------------------------------------
217 // Mirror boundary in the x direction on the left
218 //-------------------------------------------------------------------------------------
219 
220  size_t Nx(Y.SH(0,0,0).numx());
221 
222  // Mirror the fields
223  for(int i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
224  for (int c(0); c < Nbc; ++c)
225  Y.FLD(i)(c) = Y.FLD(i)(2*Nbc-c-1);
226  }
227 
228  //Bx
229  for(int c(0); c < Nbc; ++c) {
230  Y.EMF().Bx()(c) *= -1.0; // left boundary
231  }
232 
233 }
234 //-------------------------------------------------------------------------------------
235 
236 //--------------------------------------------------------------
238 //--------------------------------------------------------------
239 // Mirror boundary in the x direction on the right
240 //--------------------------------------------------------------
241 
242  size_t Nx(Y.SH(0,0,0).numx());
243 
244  // Mirror the fields
245  for(int i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
246  for (int c(0); c < Nbc; ++c)
247  Y.FLD(i)(Nx-c-1) = Y.FLD(i)(Nx-2*Nbc+c);
248  }
249 
250  //Bx
251  for(int c(0); c < Nbc; ++c) {
252  Y.EMF().Bx()(Nx-1-c) *= -1.0; // right boundary
253  }
254 
255 }
256 //--------------------------------------------------------------
257 
258 
259 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
260 // Boundary conditions on both sides of a node
261 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
262 
263 //--------------------------------------------------------------
265 //--------------------------------------------------------------
266 // Choose between boundary conditions in the x direction
267 //--------------------------------------------------------------
268  switch (BNDX()) {
269  case 0: // periodic
271 
272  break;
273  case 1: // mirror boundary
275  break;
276  default:
277  cout<<"Not a valid boundary condition." << endl;
278  break;
279  }
280 }
281 //--------------------------------------------------------------
282 
283 //--------------------------------------------------------------
285 //--------------------------------------------------------------
286 // Periodic boundary in the x direction for 1 node
287 //--------------------------------------------------------------
288 
289  // Fields: x0 "Right-Bound ---> Left-Guard"
290  for(int i(3); i < Y.EMF().dim(); ++i) // "3" as opposed to "0"
291  for(int c(0); c < Nbc; c++) {
292  Y.FLD(i)(c) = Y.FLD(i)(Y.EMF().Ex().numx()-2*Nbc+c);
293  }
294 
295  // Fields: x0 "Left-Bound ---> Right-Guard"
296  for(int i(3); i < Y.EMF().dim(); ++i) // "3" as opposed to "0"
297  for(int c(0); c < Nbc; c++) {
298  Y.FLD(i)(Y.EMF().Ex().numx()-Nbc+c) = Y.FLD(i)(Nbc+c);
299  }
300 
301 }
302 //--------------------------------------------------------------
303 
304 //--------------------------------------------------------------
306 //--------------------------------------------------------------
307 // Mirror boundary in the x direction for 1 node
308 //--------------------------------------------------------------
309 
310  size_t Nx(Y.SH(0,0,0).numx());
311 
312  // Mirror the fields
313  for(int i(3); i < Y.EMF().dim(); ++i){ // "3" as opposed to "0"
314  // right boundary
315  for (int c(0); c < Nbc; ++c)
316  Y.FLD(i)(Nx-c-1) = Y.FLD(i)(Nx-2*Nbc+c);
317  // left boundary
318  for (int c(0); c < Nbc; ++c)
319  Y.FLD(i)(c) = Y.FLD(i)(2*Nbc-c-1);
320  }
321 
322  //Bx
323  for (int c(0); c < Nbc; ++c) {
324  Y.EMF().Bx()(c) *= -1.0; // left boundary
325  Y.EMF().Bx()(Nx-Nbc+c) *= -1.0; // right boundary
326  }
327 
328 }
329 //--------------------------------------------------------------
330 
331 
332 //**************************************************************
333 //**************************************************************
334 // Definition of the Nodes Communications class
335 //**************************************************************
336 //**************************************************************
337 
338 
339 //**************************************************************
340 //--------------------------------------------------------------
342 //--------------------------------------------------------------
343 // Constructor
344 //--------------------------------------------------------------
345  Nbc(Input::List().BoundaryCells), // # of boundary cells
346  bndX(Input::List().bndX) { // Type of boundary in X
347 
348  numspec = Input::List().ls.size();
349  // numpmax = Input::List().ps;
350 
351  double temp;
352 
353  // # of harmonics
354  msg_sizeX = 0; temp = 0;
355  for(int s(0); s < numspec; ++s) {
356  temp = ((Input::List().ms[s]+1)*(2*Input::List().ls[s]-Input::List().ms[s]+2))/2;
357  msg_sizeX += temp*Input::List().ps[s];
358  }
359  // (# of harmonics) * (# cells in p)
360  // msg_sizeX *= numpmax
361  // 6 fields: Ex, Ey, Ez, Bx, By, Bz
362  msg_sizeX += 6;
363 
364  // 6 Hydro Quantities, density, vx, vy, vz, temp, Z
365  if (Input::List().hydromotion)
366  {
367  msg_sizeX += 6;
368  }
369 
370  msg_sizeX *= Nbc; //(IN().inp().y.dim()*Nbc);
371  msg_bufX = new complex<double>[msg_sizeX];
372 
373 }
374 //--------------------------------------------------------------
375 
376 //--------------------------------------------------------------
378 //--------------------------------------------------------------
379 // Destructor
380 //--------------------------------------------------------------
381  delete[] msg_bufX;
382 }
383 //--------------------------------------------------------------
384 
385 //--------------------------------------------------------------
386 int Node_Communications:: BNDX() const {return bndX;}
387 //--------------------------------------------------------------
388 
389 //--------------------------------------------------------------
390 
391 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
392 // Send and receive in the X direction
393 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
394 
395 //--------------------------------------------------------------
397 //--------------------------------------------------------------
398 // X-axis : Read data from the right boundary and send them
399 // to the node on the right
400 //--------------------------------------------------------------
401 
402  // static size_t step_h(numpmax*Nbc);
403  static size_t step_f(Nbc);
404  size_t bufind(0);
405 
406  // Harmonics:x0 "Right-Bound ---> "
407  for(int s(0); s < Y.Species(); ++s) {
408  for(size_t i = 0; i < Y.DF(s).dim(); ++i){
409  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
410  for(int e(0); e < Nbc; e++) {
411  msg_bufX[bufind + e] = (Y.DF(s)(i))(p, Y.FLD(0).numx()-2*Nbc+e);
412  }
413  bufind += step_f;
414  }
415  }
416  }
417  // Fields: x0 "Right-Bound --> "
418  for(size_t i = 0; i < Y.EMF().dim(); ++i){
419  for(int e(0); e < Nbc; e++) {
420  msg_bufX[bufind + e] = Y.FLD(i)(Y.FLD(0).numx()-2*Nbc+e);
421  }
422  bufind += step_f;
423  }
424 
425  if (Input::List().hydromotion)
426  {
427  // Hydro-velocity: x0 "Right-Bound --> "
428  for(int e(0); e < Nbc; e++) {
429  msg_bufX[bufind + e] = Y.HYDRO().density(Y.FLD(0).numx()-2*Nbc+e);
430  }
431  bufind += step_f;
432  // Hydro-velocity: x0 "Right-Bound --> "
433  for(int e(0); e < Nbc; e++) {
434  msg_bufX[bufind + e] = Y.HYDRO().vx(Y.FLD(0).numx()-2*Nbc+e);
435  }
436  bufind += step_f;
437 
438  for(int e(0); e < Nbc; e++) {
439  msg_bufX[bufind + e] = Y.HYDRO().vy(Y.FLD(0).numx()-2*Nbc+e);
440  }
441  bufind += step_f;
442 
443  for(int e(0); e < Nbc; e++) {
444  msg_bufX[bufind + e] = Y.HYDRO().vz(Y.FLD(0).numx()-2*Nbc+e);
445  }
446  bufind += step_f;
447 
448  // Hydro-temperature: x0 "Right-Bound --> "
449  for(int e(0); e < Nbc; e++) {
450  msg_bufX[bufind + e] = Y.HYDRO().temperature(Y.FLD(0).numx()-2*Nbc+e);
451  }
452  bufind += step_f;
453 
454  // Hydro-chargefraction: x0 "Right-Bound --> "
455  for(int e(0); e < Nbc; e++) {
456  msg_bufX[bufind + e] = Y.HYDRO().Z(Y.FLD(0).numx()-2*Nbc+e);
457  }
458  bufind += step_f;
459  }
460  MPI_Send(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, dest, 0, MPI_COMM_WORLD);
461 }
462 //--------------------------------------------------------------
463 
464 //--------------------------------------------------------------
466 //--------------------------------------------------------------
467 // X-axis : Receive data from the node on the left and update
468 // the left guard cells
469 //--------------------------------------------------------------
470 
471  // static size_t step_h(Y.SH(s,0,0).nump()*Nbc);
472  static size_t step_f(Nbc);
473  size_t bufind(0);
474  MPI_Status status;
475 
476  // Receive Data
477  MPI_Recv(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, origin, 0, MPI_COMM_WORLD, &status);
478 
479  // Harmonics:x0-"---> Left-Guard"
480  for(int s(0); s < Y.Species(); ++s) {
481  for(int i = 0; i < Y.DF(s).dim(); ++i){
482  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
483  for(int e(0); e < Nbc; e++) {
484  (Y.DF(s)(i))(p, e) = msg_bufX[bufind + e];
485  }
486  bufind += step_f;
487  }
488  }
489  }
490 
491 
492  // Fields: x0-"---> Left-Guard"
493  for(int i = 0; i < Y.EMF().dim(); ++i){
494  for(int e(0); e < Nbc; e++) {
495  Y.FLD(i)(e) = msg_bufX[bufind + e];
496  }
497  bufind += step_f;
498  }
499 
500  if (Input::List().hydromotion)
501  {
502  // Hydro-velocity: x0-"---> Left-Guard"
503  for(int e(0); e < Nbc; e++) {
504  Y.HYDRO().density(e) = (msg_bufX[bufind + e]).real();
505  }
506  bufind += step_f;
507 
508  // Hydro-velocity: x0-"---> Left-Guard"
509  for(int e(0); e < Nbc; e++) {
510  Y.HYDRO().vx(e) = (msg_bufX[bufind + e]).real();
511  }
512  bufind += step_f;
513 
514  // Hydro-velocity: x0-"---> Left-Guard"
515  for(int e(0); e < Nbc; e++) {
516  Y.HYDRO().vy(e) = (msg_bufX[bufind + e]).real();
517  }
518  bufind += step_f;
519 
520  // Hydro-velocity: x0-"---> Left-Guard"
521  for(int e(0); e < Nbc; e++) {
522  Y.HYDRO().vz(e) = (msg_bufX[bufind + e]).real();
523  }
524  bufind += step_f;
525 
526  // Hydro-temperature: x0-"---> Left-Guard"
527  for(int e(0); e < Nbc; e++) {
528  Y.HYDRO().temperature(e) = (msg_bufX[bufind + e]).real();
529  }
530  bufind += step_f;
531 
532  // Hydro-charge fraction: x0-"---> Left-Guard"
533  for(int e(0); e < Nbc; e++) {
534  Y.HYDRO().Z(e) = (msg_bufX[bufind + e]).real();
535  }
536  bufind += step_f;
537  }
538 
539 
540 }
541 //--------------------------------------------------------------
542 
543 //--------------------------------------------------------------
545 //--------------------------------------------------------------
546 // X-axis : Read data from the left boundary and send them
547 // to the node on the left
548 //--------------------------------------------------------------
549 
550  // static size_t step_h(Y.SH(s,0,0).nump()*Nbc);
551  static size_t step_f(Nbc);
552  size_t bufind(0);
553 
554  // Harmonics:x0 " <--- Left-Bound "
555  for(int s(0); s < Y.Species(); ++s) {
556  for(int i = 0; i < Y.DF(s).dim(); ++i){
557  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
558  for(int e(0); e < Nbc; e++) {
559  msg_bufX[bufind + e] = (Y.DF(s)(i))(p, Nbc+e);
560  }
561  bufind += step_f;
562  }
563  }
564  }
565  // Fields: x0 " <--- Left-Bound "
566  for(int i = 0; i < Y.EMF().dim(); ++i){
567  for(int e(0); e < Nbc; e++) {
568  msg_bufX[bufind + e] = Y.FLD(i)(Nbc+e);
569  }
570  bufind += step_f;
571  }
572 
573  if (Input::List().hydromotion)
574  {
575  // Hydro-velocity: x0 " <--- Left-Bound "
576  for(int e(0); e < Nbc; e++) {
577  msg_bufX[bufind + e] = Y.HYDRO().density(Nbc+e);
578  }
579  bufind += step_f;
580  // Hydro-velocity: x0 " <--- Left-Bound "
581  for(int e(0); e < Nbc; e++) {
582  msg_bufX[bufind + e] = Y.HYDRO().vx(Nbc+e);
583  }
584  bufind += step_f;
585 
586  // Hydro-velocity: x0 " <--- Left-Bound "
587  for(int e(0); e < Nbc; e++) {
588  msg_bufX[bufind + e] = Y.HYDRO().vy(Nbc+e);
589  }
590  bufind += step_f;
591 
592  // Hydro-velocity: x0 " <--- Left-Bound "
593  for(int e(0); e < Nbc; e++) {
594  msg_bufX[bufind + e] = Y.HYDRO().vz(Nbc+e);
595  }
596  bufind += step_f;
597 
598  // Hydro-temperature: x0 " <--- Left-Bound "
599  for(int e(0); e < Nbc; e++) {
600  msg_bufX[bufind + e] = Y.HYDRO().temperature(Nbc+e);
601  }
602  bufind += step_f;
603 
604  // Hydro-charge-fraction: x0 " <--- Left-Bound "
605  for(int e(0); e < Nbc; e++) {
606  msg_bufX[bufind + e] = Y.HYDRO().Z(Nbc+e);
607  }
608  bufind += step_f;
609  }
610 
611  MPI_Send(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, dest, 1, MPI_COMM_WORLD);
612 }
613 //--------------------------------------------------------------
614 
615 //--------------------------------------------------------------
617 //--------------------------------------------------------------
618 // X-axis : Receive data from the node on the right and update
619 // the right guard cells
620 //--------------------------------------------------------------
621 
622  // static size_t step_h(Y.SH(s,0,0).nump()*Nbc);
623  static size_t step_f(Nbc);
624  size_t bufind(0);
625  MPI_Status status;
626 
627  // Receive Data
628  MPI_Recv(msg_bufX, msg_sizeX, MPI_DOUBLE_COMPLEX, origin, 1, MPI_COMM_WORLD, &status);
629 
630  // Harmonics:x0-"Right-Guard <--- "
631  for(int s(0); s < Y.Species(); ++s) {
632  for(int i = 0; i < Y.DF(s).dim(); ++i){
633  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
634  for(int e(0); e < Nbc; e++) {
635  (Y.DF(s)(i))(p, Y.FLD(0).numx()-Nbc+e) = msg_bufX[bufind + e];
636  }
637  bufind += step_f;
638  }
639  }
640  }
641  // Fields: x0-"Right-Guard <--- "
642  for(int i = 0; i < Y.EMF().dim(); ++i){
643  for(int e(0); e < Nbc; e++) {
644  Y.FLD(i)(Y.FLD(0).numx()-Nbc+e) = msg_bufX[bufind + e];
645  }
646  bufind += step_f;
647  }
648 
649  if (Input::List().hydromotion)
650  {
651  // Hydro-density: x0-"Right-Guard <--- "
652  for(int e(0); e < Nbc; e++) {
653  Y.HYDRO().density(Y.FLD(0).numx()-Nbc+e) = (msg_bufX[bufind + e]).real();
654  }
655  bufind += step_f;
656 
657  // Hydro-velocity: x0-"Right-Guard <--- "
658  for(int e(0); e < Nbc; e++) {
659  Y.HYDRO().vx(Y.FLD(0).numx()-Nbc+e) = (msg_bufX[bufind + e]).real();
660  }
661  bufind += step_f;
662 
663  // Hydro-velocity: x0-"Right-Guard <--- "
664  for(int e(0); e < Nbc; e++) {
665  Y.HYDRO().vy(Y.FLD(0).numx()-Nbc+e) = (msg_bufX[bufind + e]).real();
666  }
667  bufind += step_f;
668 
669  // Hydro-velocity: x0-"Right-Guard <--- "
670  for(int e(0); e < Nbc; e++) {
671  Y.HYDRO().vz(Y.FLD(0).numx()-Nbc+e) = (msg_bufX[bufind + e]).real();
672  }
673  bufind += step_f;
674 
675  // Hydro-temperature: x0-"Right-Guard <--- "
676  for(int e(0); e < Nbc; e++) {
677  Y.HYDRO().temperature(Y.FLD(0).numx()-Nbc+e) = (msg_bufX[bufind + e]).real();
678  }
679  bufind += step_f;
680 
681  // Hydro-charge fraction: x0-"Right-Guard <--- "
682  for(int e(0); e < Nbc; e++) {
683  Y.HYDRO().Z(Y.FLD(0).numx()-Nbc+e) = (msg_bufX[bufind + e]).real();
684  }
685  bufind += step_f;
686  }
687 
688 }
689 //--------------------------------------------------------------
690 
691 
692 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
693 // Boundary conditions
694 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
695 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
696 // Mirror conditions on one side
697 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
698 
699 //**************************************************************
700 //--------------------------------------------------------------
702 //--------------------------------------------------------------
703 // Mirror boundary in the x direction on the left
704 //--------------------------------------------------------------
705  int sign(1);
706  size_t Nx(Y.SH(0,0,0).numx());
707 
708  // Mirror the harmonics
709  for(int s(0); s < Y.Species(); ++s) {
710  for(int l(0); l < Y.DF(s).l0(); ++l){
711  for(int m(0); m < ((Y.DF(s).m0() < l)? Y.DF(s).m0():l)+1; ++m){
712  sign = 1-2*((l+m)%2); //(-1)^(m+n)
713 
714  for (int c(0); c < Nbc; ++c) {
715  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
716  Y.SH(s,l,m)(p, c) = Y.SH(s,l,m)(p, 2*Nbc-c-1);
717  Y.SH(s,l,m)(p, c) *= sign;
718  }
719  }
720 
721  }
722  }
723  }
724 
725  // Mirror the fields
726  for(int i(0); i < Y.EMF().dim(); ++i){
727  for (int c(0); c < Nbc; ++c)
728  Y.FLD(i)(c) = Y.FLD(i)(2*Nbc-c-1);
729  }
730 
731  for (int c(0); c < Nbc; ++c) {
732 // Ey
733  Y.EMF().Ey()(c) *= -1.0; // left boundary
734 // Ez
735  Y.EMF().Ez()(c) *= -1.0; // left boundary
736 // Bx
737  Y.EMF().Bx()(c) *= -1.0; // left boundary
738 
739 // Y.EMF().By()(c) = 1e-3; // left boundary
740  }
741 
742  if (Input::List().hydromotion)
743  {
744  // Hydro Quantities: x0 "Right-Bound ---> Left-Guard"
745  for(int c(0); c < Nbc; c++) {
746  Y.HYDRO().density(c) = Y.HYDRO().density(2*Nbc-c-1);
747  Y.HYDRO().temperature(c) = Y.HYDRO().temperature(2*Nbc-c-1);
748  Y.HYDRO().Z(c) = Y.HYDRO().Z(2*Nbc-c-1);
749 
750  Y.HYDRO().vx(c) *= -1.0;
751  }
752  }
753 
754 
755 }
756 //--------------------------------------------------------------
757 
758 //--------------------------------------------------------------
760 //--------------------------------------------------------------
761 // Mirror boundary in the x direction on the right
762 //--------------------------------------------------------------
763  int sign(1);
764  size_t Nx(Y.SH(0,0,0).numx());
765 
766  // Mirror the harmonics
767  for(int s(0); s < Y.Species(); ++s) {
768  for(int l(0); l < Y.DF(s).l0(); ++l){
769  for(int m(0); m < ((Y.DF(s).m0() < l)? Y.DF(s).m0():l)+1; ++m){
770  sign = 1-2*((l+m)%2); //(-1)^(m+n)
771 
772  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
773  for (int c(0); c < Nbc; ++c) {
774  Y.SH(s,l,m)(p, Nx-c-1) = Y.SH(s,l,m)(p, Nx-2*Nbc+c);
775  Y.SH(s,l,m)(p, Nx-c-1) *= sign;
776  }
777  }
778 
779  }
780  }
781  }
782 
783  // Mirror the fields
784  for(int i(0); i < Y.EMF().dim(); ++i){
785  for (int c(0); c < Nbc; ++c)
786  Y.FLD(i)(Nx-c-1) = Y.FLD(i)(Nx-2*Nbc+c);
787  }
788 
789  for (int c(0); c < Nbc; ++c) {
790  //Ey
791  Y.EMF().Ey()(Nx-c-1) *= -1.0; // right boundary
792  //Ez
793  Y.EMF().Ez()(Nx-c-1) *= -1.0; // right boundary
794  //Bx
795  Y.EMF().Bx()(Nx-c-1) *= -1.0; // right boundary
796 
797 // Y.EMF().By()(Nx-c-1) = 1e-3; // right boundary
798  }
799 
800  if (Input::List().hydromotion)
801  {
802  // Hydro Quantities: x0 "Left-Bound ---> Right-Guard"
803  for(int c(0); c < Nbc; c++) {
804  Y.HYDRO().density(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().density(Y.EMF().Ex().numx()-2*Nbc+c);
805  Y.HYDRO().temperature(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().temperature(Y.EMF().Ex().numx()-2*Nbc+c);
806  Y.HYDRO().Z(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().Z(Y.EMF().Ex().numx()-2*Nbc+c);
807 
808 
809  Y.HYDRO().vx(Y.EMF().Ex().numx()-Nbc+c) *= -1.0;
810  }
811  }
812 
813 }
814 //--------------------------------------------------------------
815 
816 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
817 // Boundary conditions on both sides of a node
818 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
819 
820 //--------------------------------------------------------------
822 //--------------------------------------------------------------
823 // Choose between boundary conditions in the x direction
824 //--------------------------------------------------------------
825 
826  switch (BNDX()) {
827  case 0: // periodic
829 
830  break;
831  case 1: // mirror boundary
833  break;
834  default:
835  cout<<"Not a valid boundary condition." << endl;
836  break;
837  }
838 }
839 //--------------------------------------------------------------
840 
841 //--------------------------------------------------------------
843 //--------------------------------------------------------------
844 // Periodic boundary in the x direction for 1 node
845 //--------------------------------------------------------------
846 
847  // Harmonics:x0 "Right-Bound ---> Left-Guard"
848  for(int s(0); s < Y.Species(); ++s) {
849  for(int i(0); i < Y.DF(s).dim(); ++i) {
850  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
851  for(int c(0); c < Nbc; c++) {
852  (Y.DF(s)(i))(p, c) = (Y.DF(s)(i))(p, Y.EMF().Ex().numx()-2*Nbc+c);
853  // std::cout << "\n 1: DF(" << i << "," << p << "," << c << ") = " << (Y.DF(s)(i))(p, Y.EMF().Ex().numx()-2*Nbc+c) << "\n";
854  }
855  }
856  }
857  }
858  // Fields: x0 "Right-Bound ---> Left-Guard"
859  for(int i(0); i < Y.EMF().dim(); ++i) {
860  for(int c(0); c < Nbc; c++) {
861  Y.FLD(i)(c) = Y.FLD(i)(Y.EMF().Ex().numx()-2*Nbc+c);
862  // std::cout << "\n 2: FLD(" << i << "," << c << ") = " << Y.FLD(i)(Y.EMF().Ex().numx()-2*Nbc+c) << "\n";
863  }
864  }
865 
866 
867 
868  // Harmonics:x0 "Left-Bound ---> Right-Guard"
869  for(int s(0); s < Y.Species(); ++s) {
870  for(int i(0); i < Y.DF(s).dim(); ++i) {
871  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
872  for(int c(0); c < Nbc; c++) {
873  // std::cout << "\n 3: DF(" << i << "," << p << "," << Y.EMF().Ex().numx()-Nbc+c << ") = " << (Y.DF(s)(i))(p, Y.EMF().Ex().numx()-Nbc+c) << "\n";
874 
875  (Y.DF(s)(i))(p, Y.EMF().Ex().numx()-Nbc+c) = (Y.DF(s)(i))(p, Nbc+c);
876 
877  // std::cout << "\n 3n: DF(" << i << "," << p << "," << Y.EMF().Ex().numx()-Nbc+c << ") = " << (Y.DF(s)(i))(p, Y.EMF().Ex().numx()-Nbc+c-100.0) << "\n";
878  // if (c==2)
879 
880 
881  }
882  }
883  }
884  }
885 
886  // Fields: x0 "Left-Bound ---> Right-Guard"
887  for(int i(0); i < Y.EMF().dim(); ++i) {
888  for(int c(0); c < Nbc; c++) {
889  // if (i == 0) std::cout << "\n 4: FLD(" << i << "," << Y.EMF().Ex().numx()-Nbc+c << ") = " << Y.FLD(i)(Y.EMF().Ex().numx()-Nbc+c) << "\n";
890  Y.FLD(i)(Y.EMF().Ex().numx()-Nbc+c) = Y.FLD(i)(Nbc+c);
891  // if (i == 0) std::cout << "\n 4n: FLD(" << i << "," << Y.EMF().Ex().numx()-Nbc+c << ") = " << Y.FLD(i)(Y.EMF().Ex().numx()-Nbc+c) << "\n";
892 
893 
894  }
895  // Y.FLD(i)(Y.EMF().Ex().numx()-1) = 0.0;
896  }
897 
898  // temp = Y.DF(0).getcurrent(0);
899  // for (size_t ix(0);ix<Y.SH(0,0,0).numx();++ix)
900  // {
901  // std::cout<<"\n new[" << ix << "] = " << temp[ix] << "\n";
902 
903  // }
904 
905 
906  if (Input::List().hydromotion)
907  {
908  // Hydro Quantities: x0 "Right-Bound ---> Left-Guard"
909  for(int c(0); c < Nbc; c++) {
910  Y.HYDRO().density(c) = Y.HYDRO().density(Y.EMF().Ex().numx()-2*Nbc+c);
911  Y.HYDRO().vx(c) = Y.HYDRO().vx(Y.EMF().Ex().numx()-2*Nbc+c);
912  Y.HYDRO().vy(c) = Y.HYDRO().vy(Y.EMF().Ex().numx()-2*Nbc+c);
913  Y.HYDRO().vz(c) = Y.HYDRO().vz(Y.EMF().Ex().numx()-2*Nbc+c);
914  Y.HYDRO().temperature(c) = Y.HYDRO().temperature(Y.EMF().Ex().numx()-2*Nbc+c);
915  Y.HYDRO().Z(c) = Y.HYDRO().Z(Y.EMF().Ex().numx()-2*Nbc+c);
916  // Y.HYDRO().kpressure(c) = Y.HYDRO().velocity(Y.EMF().Ex().numx()-2*Nbc+c);
917  // Y.HYDRO().mpressure(c) = Y.HYDRO().velocity(Y.EMF().Ex().numx()-2*Nbc+c);
918  }
919 
920  // Hydro Quantities: x0 "Left-Bound ---> Right-Guard"
921  for(int c(0); c < Nbc; c++) {
922  Y.HYDRO().density(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().density(Nbc+c);
923  Y.HYDRO().vx(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().vx(Nbc+c);
924  Y.HYDRO().vy(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().vy(Nbc+c);
925  Y.HYDRO().vz(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().vz(Nbc+c);
926  Y.HYDRO().temperature(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().temperature(Nbc+c);
927  Y.HYDRO().Z(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().Z(Nbc+c);
928  // Y.HYDRO().kpressure(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().velocity(Nbc+c);
929  // Y.HYDRO().mpressure(Y.EMF().Ex().numx()-Nbc+c) = Y.HYDRO().velocity(Nbc+c);
930 
931  }
932  }
933 
934 }
935 //--------------------------------------------------------------
936 
937 //--------------------------------------------------------------
939 //--------------------------------------------------------------
940 // Mirror boundary in the x direction for 1 node
941 //--------------------------------------------------------------
942  int sign(1);
943  size_t Nx(Y.SH(0,0,0).numx());
944 
945  // Mirror the harmonics
946  for(int s(0); s < Y.Species(); ++s) {
947  for(int l(0); l < Y.DF(s).l0(); ++l){
948  for(int m(0); m < ((Y.DF(s).m0() < l)? Y.DF(s).m0():l)+1; ++m){
949  sign = 1-2*((l+m)%2); //(-1)^(m+n)
950 
951  // right boundary
952  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
953  for (int c(0); c < Nbc; ++c) {
954  Y.SH(s,l,m)(p, Nx-c-1) = Y.SH(s,l,m)(p, Nx-2*Nbc+c);
955  Y.SH(s,l,m)(p, Nx-c-1) *= sign;
956  }
957  }
958 
959  // left boundary
960  for(int p(0); p < Y.SH(s,0,0).nump(); ++p) {
961  for (int c(0); c < Nbc; ++c) {
962  Y.SH(s,l,m)(p, c) = Y.SH(s,l,m)(p, 2*Nbc-c-1);
963  Y.SH(s,l,m)(p, c) *= sign;
964  }
965  }
966 
967  }
968  }
969  }
970 
971  // Mirror the fields
972  for(int i(0); i < Y.EMF().dim(); ++i){
973  // right boundary
974  for (int c(0); c < Nbc; ++c)
975  Y.FLD(i)(Nx-c-1) = Y.FLD(i)(Nx-2*Nbc+c);
976  // left boundary
977  for (int c(0); c < Nbc; ++c)
978  Y.FLD(i)(c) = Y.FLD(i)(2*Nbc-c-1);
979  }
980 
981  for(int c(0); c < Nbc; c++) {
982  //Ey
983  Y.EMF().Ey()(Nx-Nbc+c) *= -1.0; // right boundary
984  Y.EMF().Ey()(c) *= -1.0; // left boundary
985 
986  //Ez
987  Y.EMF().Ez()(Nx-Nbc+c) *= -1.0; // right boundary
988  Y.EMF().Ez()(c) *= -1.0; // left boundary
989 
990  //Bx
991  Y.EMF().Bx()(Nx-Nbc+c) *= -1.0; // right boundary
992  Y.EMF().Bx()(c) *= -1.0; // left boundary
993  }
994 
995 
996  if (Input::List().hydromotion)
997  {
998  // Hydro Quantities: x0 "Right-Bound ---> Left-Guard"
999  for(int c(0); c < Nbc; c++) {
1000  Y.HYDRO().vx(c) *= -1.0;
1001  }
1002 
1003  // Hydro Quantities: x0 "Left-Bound ---> Right-Guard"
1004  for(int c(0); c < Nbc; c++) {
1005  Y.HYDRO().vx(Y.EMF().Ex().numx()-Nbc+c) *= -1.0;
1006 
1007 
1008  }
1009  }
1010 
1011 }
1012 //--------------------------------------------------------------
1013 
1014 
1015 //**************************************************************
1016 //**************************************************************
1017 // Definition of the Parallel Environment
1018 //**************************************************************
1019 //**************************************************************
1020 
1021 
1022 //--------------------------------------------------------------
1024 //--------------------------------------------------------------
1025 // Constructor, domain decomposition
1026 //--------------------------------------------------------------
1027  bndX(Input::List().bndX), // Type of boundary
1028  Nnodes(Input::List().NnodesX) // Number of nodes in X-direction
1029 {
1030  // Determination of the rank and size of the run
1031  MPI_Comm_size(MPI_COMM_WORLD, &Nnodes);
1032  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
1033 
1034  if (error_check()) {MPI_Finalize(); exit(1);}
1035 
1036  // Determination of the local computational domain (i.e. the x-axis and the y-axis)
1037 
1038  for(size_t i(0); i < Input::List().xminLocal.size(); ++i) {
1039 
1044  + (Input::List().NxLocal[i]) * Input::List().globdx[i];
1045  }
1046 
1047  // Restart files will be generated when output_step % restart_step == 0
1048 // if ( ( (Input::List().n_outsteps + 1) > Input::List().n_restarts ) &&
1049 // (Input::List().n_restarts > 0) ) {
1050 // restart_step = Input::List().n_outsteps / Input::List().n_restarts ;
1051 // }
1052 // else restart_step = -1;
1053 // if ( Input::List().restart_time > Input::List().n_restarts ) {
1054 // restart_time = 0;
1055 // }
1056 // else restart_time = Input::List().restart_time;
1057 
1058 }
1059 //--------------------------------------------------------------
1060 // Destructor
1061 //--------------------------------------------------------------
1063 //--------------------------------------------------------------
1064 
1065 //--------------------------------------------------------------
1067 //--------------------------------------------------------------
1068 // Temporary error check
1069 //--------------------------------------------------------------
1070 
1071  // Test the number of cells
1072  if (rank == 0){
1073  if (Input::List().NxLocal[0] < 2*Input::List().BoundaryCells+2){
1074  std::cout << "Not enough cells per processor" << endl;
1075  return true;
1076  }
1077  if ( Nnodes != (Input::List().NnodesX) ) {
1078  std:: cout << "the number of nodes in the input deck is "
1079  << (Input::List().NnodesX) << ", terminating ..." << endl;
1080  return true;
1081  }
1082  }
1083  return false;
1084 }
1085 //--------------------------------------------------------------
1086 
1087 //--------------------------------------------------------------
1088 // Basic information
1089 //--------------------------------------------------------------
1091 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1093 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1095 //--------------------------------------------------------------
1096 
1097 
1098 //--------------------------------------------------------------
1100 //--------------------------------------------------------------
1101 // Information exchange between neighbors
1102 //--------------------------------------------------------------
1103 
1104  int moduloX(RANK()%2);
1105  int RNx((RANK()+1)%NODES()), // This is the right neighbor
1106  LNx((RANK()-1+NODES())%NODES()); // This is the left neighbor
1107 
1108  if (NODES() > 1) {
1109  //even nodes
1110  if (moduloX==0){
1111  Bfield_Data.Send_right_X(Y,RNx); // (Send) 0 --> 1
1112  if ((RANK() != 0) || (BNDX()==0)){
1113  Bfield_Data.Recv_from_left_X(Y,LNx); // 1 --> 0 (Receive)
1114  Bfield_Data.Send_left_X(Y,LNx); // 1 <-- 0 (Send)
1115  }
1116  else {
1117  if (BNDX()==1) {
1118  Bfield_Data.mirror_bound_Xleft(Y); // Update node "0" in the x direction
1119  }
1120  else {
1121  cout<<"Invalid Boundary." << endl;
1122  }
1123  }
1124  Bfield_Data.Recv_from_right_X(Y,RNx); // (Receive) 0 <-- 1
1125  }
1126  //odd nodes
1127  else {
1128  Bfield_Data.Recv_from_left_X(Y,LNx); // 0 --> 1 (Receive)
1129  if ((RANK()!=(NODES()-1)) || (BNDX()==0)){
1130  Bfield_Data.Send_right_X(Y,RNx); // (Send) 1 --> 0
1131  Bfield_Data.Recv_from_right_X(Y,RNx); // (Receive) 1 <-- 0
1132  }
1133  else {
1134  if (BNDX()==1) {
1135  Bfield_Data.mirror_bound_Xright(Y); // Update node "N-1" in the x direction
1136  }
1137  else {
1138  cout<<"Invalid Boundary." << endl;;
1139  }
1140  }
1141  Bfield_Data.Send_left_X(Y,LNx); // 0 <-- 1 (Send)
1142  }
1143  }
1144  else { Bfield_Data.sameNode_bound_X(Y); }
1145 
1146 }
1147 //--------------------------------------------------------------
1148 
1149 
1150 //--------------------------------------------------------------
1152 //--------------------------------------------------------------
1153 // Information exchange between neighbors
1154 //--------------------------------------------------------------
1155 
1156  int moduloX(RANK() % 2);
1157  int RNx((RANK() + 1) % NODES()), // This is the right neighbor
1158  LNx((RANK() - 1 + NODES()) % NODES()); // This is the left neighbor
1159 
1160  if (NODES() > 1) {
1161  //even nodes
1162 // if (moduloX==0){
1163  if (BNDX() == 0) {
1164  if (((RANK() != 0) && (RANK() != NODES() - 1))) {
1165  X_Data.Send_right_X(Y, RNx); // (Send) 0 --> 1
1166  X_Data.Recv_from_left_X(Y, LNx); // 1 --> 0 (Receive)
1167  X_Data.Send_left_X(Y, LNx); // 1 <-- 0 (Send)
1168  X_Data.Recv_from_right_X(Y, RNx); // (Receive) 0 <-- 1
1169  } else if (RANK() == 0) {
1170  X_Data.Recv_from_left_X(Y, NODES() - 1); // 1 --> 0 (Receive)
1171  X_Data.Send_left_X(Y, NODES() - 1); // 1 <-- 0 (Send)
1172  X_Data.Send_right_X(Y, RNx);
1173  X_Data.Recv_from_right_X(Y, RNx);
1174  } else if (RANK() == NODES() - 1) {
1175  X_Data.Send_right_X(Y, 0); // (Send) 0 --> 1
1176  X_Data.Recv_from_right_X(Y, 0);
1177  X_Data.Recv_from_left_X(Y, LNx); // 1 --> 0 (Receive)
1178  X_Data.Send_left_X(Y, LNx); // 1 <-- 0 (Send)
1179  }
1180  } else if (BNDX() == 1) {
1181  if (((RANK() != 0) && (RANK() != NODES() - 1))) {
1182  X_Data.Send_right_X(Y, RNx); // (Send) 0 --> 1
1183  X_Data.Recv_from_left_X(Y, LNx); // 1 --> 0 (Receive)
1184  X_Data.Send_left_X(Y, LNx); // 1 <-- 0 (Send)
1185  X_Data.Recv_from_right_X(Y, RNx); // (Receive) 0 <-- 1
1186  } else if (RANK() == 0) {
1188  X_Data.Send_right_X(Y, RNx);
1189  X_Data.Recv_from_right_X(Y, RNx);
1190  } else if (RANK() == NODES() - 1) {
1192  X_Data.Recv_from_left_X(Y, LNx); // 1 --> 0 (Receive)
1193  X_Data.Send_left_X(Y, LNx); // 1 <-- 0 (Send)
1194  }
1195 
1196  } else {
1197  cout << "Invalid Boundary." << endl;
1198  }
1199 
1200 // //odd nodes
1201 // else {
1202 // X_Data.Recv_from_left_X(Y,LNx); // 0 --> 1 (Receive)
1203 // if ((RANK()!=(NODES()-1)) || (BNDX()==0)){
1204 // X_Data.Send_right_X(Y,RNx); // (Send) 1 --> 0
1205 // X_Data.Recv_from_right_X(Y,RNx); // (Receive) 1 <-- 0
1206 // }
1207 // else {
1208 // if (BNDX()==1) {
1209 // X_Data.mirror_bound_Xright(Y); // Update node "N-1" in the x direction
1210 // }
1211 // else {
1212 // cout<<"Invalid Boundary." << endl;
1213 // }
1214 // }
1215 // X_Data.Send_left_X(Y,LNx); // 0 <-- 1 (Send)
1216 // }
1217  } else { X_Data.sameNode_bound_X(Y); }
1218 
1219 }
1220 //--------------------------------------------------------------
1221 
1222 
1223 
1224 //**************************************************************
Algorithms
void Recv_from_left_X(State1D &Y, int origin)
Definition: parallel.cpp:465
std::vector< double > xmaxLocal
Definition: input.h:173
size_t numx() const
Definition: state.h:197
std::vector< size_t > NxLocal
Definition: input.h:168
void Recv_from_left_X(State1D &Y, int origin)
Definition: parallel.cpp:136
Input reader - Declarations.
void sameNode_bound_X(State1D &Y)
Definition: parallel.cpp:264
void Send_left_X(State1D &Y, int dest)
Definition: parallel.cpp:544
Underlying data structures.
complex< double > * msg_bufX
Definition: parallel.h:113
bool hydromotion
Definition: input.h:82
std::vector< double > xminLocal
Definition: input.h:172
void sameNode_bound_X(State1D &Y)
Definition: parallel.cpp:821
std::vector< size_t > ps
Definition: input.h:158
Node_ImplicitE_Communications Bfield_Data
Definition: parallel.h:166
void Send_right_X(State1D &Y, int dest)
Definition: parallel.cpp:114
void sameNode_periodic_X(State1D &Y)
Definition: parallel.cpp:842
Node_Communications X_Data
Definition: parallel.h:167
void Neighbor_Communications(State1D &Y)
Definition: parallel.cpp:1151
std::vector< size_t > ls
Definition: input.h:156
void mirror_bound_Xleft(State1D &Y)
Definition: parallel.cpp:215
size_t dim() const
Definition: state.h:286
std::vector< double > xminGlobal
Definition: input.h:170
double & vz(size_t i)
Definition: state.h:536
size_t numx() const
Definition: state.h:72
size_t dim() const
Definition: state.h:395
Field1D & Ez()
Definition: state.h:292
void Neighbor_ImplicitE_Communications(State1D &Y)
Definition: parallel.cpp:1099
std::vector< size_t > ms
Definition: input.h:157
Definition: state.h:577
void Send_left_X(State1D &Y, int dest)
Definition: parallel.cpp:160
int BNDX() const
Definition: parallel.cpp:386
void Recv_from_right_X(State1D &Y, int origin)
Definition: parallel.cpp:616
std::vector< size_t > NxLocalnobnd
Definition: input.h:167
Field1D & Bx()
Definition: state.h:293
void mirror_bound_Xright(State1D &Y)
Definition: parallel.cpp:237
Hydro1D & HYDRO()
Definition: state.h:613
double & temperature(size_t i)
Definition: state.h:539
double & Z(size_t i)
Definition: state.h:542
void Send_right_X(State1D &Y, int dest)
Definition: parallel.cpp:396
size_t nump() const
Definition: state.h:71
void sameNode_mirror_X(State1D &Y)
Definition: parallel.cpp:305
size_t m0() const
Definition: state.h:397
DistFunc1D & DF(size_t s)
Definition: state.h:602
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
void sameNode_periodic_X(State1D &Y)
Definition: parallel.cpp:284
Fields, Distributions, Harmonics, States - Declarations.
Field1D & Ex()
Definition: state.h:290
std::vector< double > globdx
Definition: input.h:174
double & vx(size_t i)
Definition: state.h:530
void Recv_from_right_X(State1D &Y, int origin)
Definition: parallel.cpp:182
size_t NnodesX
Definition: input.h:30
void sameNode_mirror_X(State1D &Y)
Definition: parallel.cpp:938
Input_List & List()
Definition: input.cpp:1585
Field1D & FLD(size_t ip) const
Definition: state.h:611
double & density(size_t i)
Definition: state.h:527
Field1D & Ey()
Definition: state.h:291
size_t l0() const
Definition: state.h:396
double & vy(size_t i)
Definition: state.h:533
void mirror_bound_Xleft(State1D &Y)
Definition: parallel.cpp:701
complex< double > * msg_bufX
Definition: parallel.h:68
Definition: input.h:18
int BoundaryCells
Definition: input.h:50
size_t Species() const
Definition: state.h:596
void mirror_bound_Xright(State1D &Y)
Definition: parallel.cpp:759
EMF1D & EMF() const
Definition: state.h:610