23 if (retval)
return retval;
29 printf(
"Interpolating grid coordinates to sparse grids domain %d.\n", n);
36 int nvars = solver->
nvars;
37 int ghosts = solver->
ghosts;
43 for (
int d = 0; d <
m_ndims; d++) {
44 for (
int i = 0; i < dim_local[d]; i++) {
45 solver->
dxinv[i+offset+ghosts]
46 = 2.0 / ( solver->
x[i+1+offset+ghosts]
47 - solver->
x[i-1+offset+ghosts] );
49 offset += (dim_local[d] + 2*ghosts);
56 for (
int d = 0; d <
m_ndims; d++) {
58 &(solver->
dxinv[offset]),
63 if (ierr)
return ierr;
64 offset += (dim_local[d] + 2*ghosts);
71 for (
int d = 0; d <
m_ndims; d++) {
72 double *dxinv = &(solver->
dxinv[offset]);
74 if (mpi->
ip[d] == 0) {
76 for (
int i = 0; i < ghosts; i++) dxinv[i] = dxinv[ghosts];
78 if (mpi->
ip[d] == mpi->
iproc[d]-1) {
80 for (
int i = dim[d]+ghosts; i < dim[d]+2*ghosts; i++) {
81 dxinv[i] = dxinv[dim[d]+ghosts-1];
84 offset += (dim[d] + 2*ghosts);
int VolumeIntegral(double *, double *, void *, void *)
void interpolateGrid(SimulationObject *const, const SimulationObject *const)
int MPIExchangeBoundaries1D(void *, double *, int, int, int, int)
Structure containing all solver-specific variables and functions.
std::vector< SimulationObject > m_sims_sg
Structure of MPI-related variables.
SimulationObject * m_sim_fg
Contains macros and function definitions for common array operations.