54 int nprocs, decomp_mode;
55 int i,
j,
k, idim, nv;
56 int nx, ny, nz, nghost, status;
67 double scrh, dxmin[3], dxming[3];
70 MPI_Datatype rgb_type;
71 MPI_Datatype Float_Vect_type;
76 sprintf (ini_file,
"pluto.ini");
86 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
91 MPI_Bcast (runtime,
sizeof (
struct RUNTIME) , MPI_BYTE, 0, MPI_COMM_WORLD);
96 MPI_Allreduce (&nghost, &idim, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
100 gsize[idim] = runtime->
npoint[idim];
101 ghosts[idim] = nghost;
168 MPI_Type_contiguous (3, MPI_FLOAT, &Float_Vect_type);
169 MPI_Type_commit (&Float_Vect_type);
187 grid[idim].
nghost = nghost;
188 grid[idim].
np_tot = lsize[idim] + 2*ghosts[idim];
189 grid[idim].
np_int = lsize[idim];
192 grid[idim].
beg = beg[idim];
193 grid[idim].
end = end[idim];
194 grid[idim].
gbeg = gbeg[idim];
195 grid[idim].
gend = gend[idim];
196 grid[idim].
lbeg = lbeg[idim];
197 grid[idim].
lend = lend[idim];
200 grid[idim].
nproc = procs[idim];
299 int coords[3] = {0,0,0};
303 MPI_Cart_get(cartcomm, DIMENSIONS, procs, periods, coords);
304 MPI_Cart_rank(cartcomm, coords, &rank);
306 printf (
"! Initialize: rank and prank are different\n");
324 grid[idim].
nghost = nghost;
327 grid[idim].
beg = grid[idim].
gbeg = grid[idim].
lbeg = nghost;
329 = (grid[idim].
lbeg - 1) + grid[idim].np_int;
332 grid[idim].
nproc = 1;
351 print1 (
"\n> Generating grid...\n\n");
400 for (idim = 0; idim <
DIMENSIONS; idim++) dxmin[idim] = 1.e30;
418 MPI_Allreduce (dxmin, dxming, 3, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
434 #if RECONSTRUCTION == PARABOLIC
448 print1 (
"\n> Memory allocation\n");
478 #if EOS == PVTE_LAW && NIONS == 0
479 #if TV_ENERGY_TABLE == YES
505 print1 (
"> Number of processors: %d\n",nprocs);
511 print1 (
"> Parallel Directions: ");
513 if (pardim[
JDIR]) print1 (
"/X2"); ,
514 if (pardim[
KDIR]) print1 (
"/X3");)
543 long int npx = 1, npy = 1, npz = 1;
554 if (npx == -1 || npy == -1 || npz == -1){
563 if (npx > 0 && npy > 0 && npz > 0){
570 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
572 printf (
"! The specified parallel decomposition (%d, %d, %d) is not\n",
574 printf (
"! consistent with the number of processors (%d).\n",nprocs);
580 printf (
"! GetDecompMode: invalid decomposition mode");
int AL_Is_boundary(int sz_ptr, int *is_gbeg, int *is_gend)
double Length_2(int i, int j, int k, Grid *)
int lbound
When different from zero, it specifies the boundary condition to be applied at leftmost grid side whe...
void ShowDomainDecomposition(int, Grid *)
double **** Vs
The main four-index data array used for face-centered staggered magnetic fields.
void PPM_CoefficientsSet(Grid *grid)
int end
Global end index for the local array.
void ShowConfig(int, char *a[], char *)
double **** J
Electric current defined as curl(B).
#define USER_DEF_PARAMETERS
int SetLogFile(char *, Cmd_Line *)
int npoint[3]
Global number of zones in the interior domain.
long int NX1
Number of interior zones in the X1 directions (boundaries excluded) for the local processor...
int AL_Get_gbounds(int, int *, int *, int *, int)
void print1(const char *fmt,...)
char output_dir[256]
The name of the output directory (output_dir for static PLUTO, Output_dir for PLUTO-Chombo) ...
int np_int_glob
Total number of points in the global domain (boundaries excluded).
int left_bound[3]
Array of left boundary types.
int rbound
Same as lbound, but for the right edge of the grid.
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
double **** Vc
The main four-index data array used for cell-centered primitive variables.
int g_maxRiemannIter
Maximum number of iterations for iterative Riemann Solver.
double g_dt
The current integration time step.
double *** Ax3
Vector potential component in the direction.
int lend
Local end index for the local array.
int lbeg
Local start index for the local array.
int AL_Get_local_dim(int, int *)
double *** ArrayBox(long int nrl, long int nrh, long int ncl, long int nch, long int ndl, long int ndh)
int gend
Global end index for the global array.
#define ARRAY_3D(nx, ny, nz, type)
int AL_Set_global_dim(int *, int)
int AL_Set_staggered_dim(int *, int)
int np_tot_glob
Total number of points in the global domain (boundaries included).
unsigned char *** flag
Pointer to a 3D array setting useful integration flags that are retrieved during integration.
int AL_Decompose(int sz_ptr, int *procs, int mode)
int right_bound[3]
Array of right boundary types.
int AL_Get_cart_comm(int, MPI_Comm *)
double g_maxMach
The maximum Mach number computed during integration.
void Startup(Data *, Grid *)
long int NX2
Number of interior zones in the X2 directions (boundaries excluded) for the local processor...
double Length_1(int i, int j, int k, Grid *)
int beg
Global start index for the local array.
void PLM_CoefficientsSet(Grid *grid)
int AL_Sz_init(MPI_Comm, int *)
double g_inputParam[32]
Array containing the user-defined parameters.
int gbeg
Global start index for the global array.
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
#define UPDATE_VECTOR_POTENTIAL
#define ARRAY_4D(nx, ny, nz, nv, type)
int nghost
Number of ghost zones.
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
int RuntimeSetup(Runtime *, Cmd_Line *, char *)
double dl_min
minimum cell length (e.g.
static int GetDecompMode(Cmd_Line *cmd_line, int procs[])
void MakeEV_TemperatureTable()
int rank_coord
Parallel coordinate in a Cartesian topology.
#define ARRAY_1D(nx, type)
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
void ParseCmdLineArgs(int argc, char *argv[], char *ini_file, Cmd_Line *cmd)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
double g_time
The current integration time.
void MakeInternalEnergyTable()
double **** Uc
The main four-index data array used for cell-centered conservative variables.
int AL_Set_parallel_dim(int *, int)
double Length_3(int i, int j, int k, Grid *)
int AL_Set_periodic_dim(int *, int)
void Initialize(int argc, char *argv[], Data *data, Runtime *runtime, Grid *grid, Cmd_Line *cmd_line)
void MakePV_TemperatureTable()
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
double first_dt
The initial time step (first_dt)
int np_tot
Total number of points in the local domain (boundaries included).
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
int AL_Set_dimensions(int, int)
double *** Ax1
Vector potential component in the direction.
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
void SetGrid(Runtime *, Grid *)
int AL_Set_type(AL_Datatype, int, int)
double *** Ax2
Vector potential component in the direction.
#define QUIT_PLUTO(e_code)
int AL_Get_lbounds(int, int *, int *, int *, int)
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
long int g_usedMemory
Amount of used memory in bytes.
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
int nproc
number of processors for this grid.
long int NX3
Number of interior zones in the X3 directions (boundaries excluded) for the local processor...
void RuntimeSet(Runtime *runtime)
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
int AL_Set_ghosts(int *, int)
int AL_Get_bounds(int, int *, int *, int *, int)
void SetOutput(Data *d, Runtime *input)
int np_int
Total number of points in the local domain (boundaries excluded).