Functions

init_mesh.c File Reference

General initialization of the nested mesh hierarchy. More...

Go to the source code of this file.

Functions

static int dom_decomp (const int Nx, const int Ny, const int Nz, const int Np, int *pNGx, int *pNGy, int *pNGz)
 calls auto domain decomposition functions
static int dom_decomp_2d (const int Nx, const int Ny, const int Np, int *pNGx, int *pNGy)
 finds optimum domain decomposition in 2D
static int dom_decomp_3d (const int Nx, const int Ny, const int Nz, const int Np, int *pNGx, int *pNGy, int *pNGz)
 finds optimum domain decomposition in 3D
void init_mesh (MeshS *pM)
 General initialization of the nested mesh hierarchy.
void get_myGridIndex (DomainS *pD, const int myID, int *pi, int *pj, int *pk)
 Searches GData[][][] array to find i,j,k components of block being updated on this processor.

Detailed Description

General initialization of the nested mesh hierarchy.

PURPOSE: General initialization of the nested mesh hierarchy. Works for both nested and uniform meshes, on single and multiple processors. Each Mesh contains one or more levels, each level contains one or more Domains (regions with the same grid resolution), and depending on the parallelization each Domain contains one or more Grids (however there can never be more than one Grid per Domain being updated on any given processor). In the Mesh, this hierarchy is stored as an "array" of Domains indexed as Domain[nlevel][ndomain]. Since ndomain is different for each level, this "array" is not square, (really it is nlevel pointers, each to ndomain[nlevel] Domains).

Note for a uniform mesh on a single processor:

For a nested mesh on multiple processors, there is no relationship between these quantaties in general.

This function:

This function supercedes init_domain() from v3.2. The init_grid() function initializes the data in each Grid structure in each Domain, including finding all child and parent Grids with SMR.

CONTAINS PUBLIC FUNCTIONS:

PRIVATE FUNCTION PROTOTYPES:

Definition in file init_mesh.c.


Function Documentation

static int dom_decomp ( const int  Nx,
const int  Ny,
const int  Nz,
const int  Np,
int *  pNGx,
int *  pNGy,
int *  pNGz 
) [static]

calls auto domain decomposition functions

Calls apropriate 2D or 3D auto decomposition routines Functions written by T.A.G., added May 2007.

Definition at line 886 of file init_mesh.c.

References dom_decomp_2d(), and dom_decomp_3d().

Referenced by init_mesh().

Here is the call graph for this function:

Here is the caller graph for this function:

static int dom_decomp_2d ( const int  Nx,
const int  Ny,
const int  Np,
int *  pNGx,
int *  pNGy 
) [static]

finds optimum domain decomposition in 2D

Pptimizes domain decomposition in 2D.

The TOTAL amount of data communicated (summed over all processes and all INTERNAL boundaries) divided by 2*nghost (where the 2 is for two messages per internal interface) is computed and stored in the variable I, the minimum of which is I0. This assumes that in the x-direction we communicate only computational cells, while in the y-direction we comunicate the computational cells and x-direction ghost cells. Then Total x-communication is (rx - 1)*Ny*(2*nghost) Total y-communication is (ry - 1)*(Nx + rx*(2*nghost))*(2*nghost)

Definition at line 923 of file init_mesh.c.

References rx, and ry.

Referenced by dom_decomp(), and dom_decomp_3d().

Here is the caller graph for this function:

static int dom_decomp_3d ( const int  Nx,
const int  Ny,
const int  Nz,
const int  Np,
int *  pNGx,
int *  pNGy,
int *  pNGz 
) [static]

finds optimum domain decomposition in 3D

Optimizes domain decomposition in 3D.

See the comments for dom_decomp_2d() for more about the algorithm

Definition at line 997 of file init_mesh.c.

References dom_decomp_2d(), rx, ry, and rz.

Referenced by dom_decomp().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_myGridIndex ( DomainS pD,
const int  myID,
int *  pi,
int *  pj,
int *  pk 
)

Searches GData[][][] array to find i,j,k components of block being updated on this processor.

Definition at line 861 of file init_mesh.c.

References ath_error(), DomainS::GData, GridsDataS::ID_Comm_world, and DomainS::NGrid.

Referenced by bvals_grav(), bvals_grav_init(), bvals_mhd(), bvals_mhd_init(), exchange_feedback_init(), grid_limit(), init_grid(), integrate_3d_ctu(), RemapEy_ix1(), RemapEy_ox1(), set_bvals_particle_init(), ShearingSheet_ix1(), and ShearingSheet_ox1().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_mesh ( MeshS pM  )