HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SparseGridsInitializationWrapup.cpp
Go to the documentation of this file.
1 
6 #include <arrayfunctions.h>
8 
9 extern "C" int VolumeIntegral (double*,double*,void*,void*);
10 
16 {
17  int ierr;
18 
19  for (int n = 0; n < m_nsims_sg; n++) {
20 
21  if (!m_rank) {
22  printf("Interpolating initial solution to sparse grids domain %d.\n", n);
23  }
25 
26  HyPar* solver = &(m_sims_sg[n].solver);
27  MPIVariables* mpi = &(m_sims_sg[n].mpi);
28 
29  int nvars = solver->nvars;
30  int ghosts = solver->ghosts;
31  int *dim_local = solver->dim_local;
32 
33  /* exchange MPI-boundary values of u between processors */
35  nvars,
36  dim_local,
37  ghosts,
38  mpi,
39  solver->u );
40 
41  /* calculate volume integral of the initial solution */
43  solver->u,
44  solver,
45  mpi );
46  if (ierr) return ierr;
47 
48  if (!mpi->rank) {
49  printf(" Volume integral of the initial solution on sparse grids domain %d:\n", n);
50  for (int d=0; d<nvars; d++) {
51  printf(" %2d: %1.16E\n",d,solver->VolumeIntegralInitial[d]);
52  }
53  }
54 
55  /* Set initial total boundary flux integral to zero */
56  _ArraySetValue_( solver->TotalBoundaryIntegral, nvars, 0 );
57 
58  }
59 
60  return 0;
61 }
std::vector< SimulationObject > m_sims_sg
#define _ArraySetValue_(x, size, value)
double * u
Definition: hypar.h:116
int * dim_local
Definition: hypar.h:37
int ghosts
Definition: hypar.h:52
double * TotalBoundaryIntegral
Definition: hypar.h:386
int nvars
Definition: hypar.h:29
void interpolate(SimulationObject *const, const SimulationObject *const)
double * VolumeIntegralInitial
Definition: hypar.h:380
Contains macros and function definitions for common array operations.
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
int VolumeIntegral(double *VolumeIntegral, double *u, void *s, void *m)