12 #if defined(HAVE_CUDA)
30 int n, flag, d, i, offset, ierr;
32 for (n = 0; n < nsims; n++) {
40 strcat(fname_root,
"_");
41 strcat(fname_root, index);
56 fprintf(stderr,
"Error in InitialSolution() on rank %d.\n",
61 fprintf(stderr,
"Error: initial solution file not found.\n");
79 = 2.0 / (simobj[n].
solver.
x[i+1+offset+ghosts]-simobj[n].
solver.
x[i-1+offset+ghosts]);
88 &(simobj[n].solver.dxinv[offset]),
94 fprintf(stderr,
"Error in InitialSolution() on rank %d.\n",
106 if (simobj[n].mpi.ip[d] == 0) {
108 for (i = 0; i < ghosts; i++) dxinv[i] = dxinv[ghosts];
110 if (simobj[n].mpi.ip[d] == simobj[n].
mpi.
iproc[d]-1) {
112 for (i = dim[d]+ghosts; i < dim[d]+2*ghosts; i++) dxinv[i] = dxinv[dim[d]+ghosts-1];
114 offset += (dim[d] + 2*ghosts);
123 fprintf(stderr,
"Error in InitialSolution() on rank %d.\n",
127 if (!simobj[n].mpi.rank) {
128 if (nsims > 1) printf(
"Volume integral of the initial solution on domain %d:\n", n);
129 else printf(
"Volume integral of the initial solution:\n");
131 printf(
"%2d: %1.16E\n",d,simobj[n].solver.VolumeIntegralInitial[d]);
139 #if defined(HAVE_CUDA)
140 if (simobj[0].solver.use_gpu) {
141 for (
int n = 0; n < nsims; n++) {
153 #ifdef CUDA_VAR_ORDERDING_AOS
159 double *h_u = (
double *) malloc(simobj[n].solver.ndof_cells_wghosts*
sizeof(
double));
160 for (
int i=0; i<npoints_local_wghosts; i++) {
161 for (
int v=0; v<nvars; v++) {
162 h_u[i+v*npoints_local_wghosts] = simobj[n].
solver.
u[i*nvars+v];
int npoints_local_wghosts
#define _ArraySetValue_(x, size, value)
void GetStringFromInteger(int, char *, int)
int MPIExchangeBoundaries1D(void *, double *, int, int, int, int)
void gpuMemcpy(void *, const void *, size_t, enum gpuMemcpyKind)
MPI related function definitions.
Function declarations for file I/O functions.
int InitialSolution(void *, int)
int ReadArray(int, int, int *, int *, int, void *, void *, double *, double *, char *, int *)
#define _MAX_STRING_SIZE_
Contains function definitions for common array operations on GPU.
Structure defining a simulation.
Some basic definitions and macros.
Contains macros and function definitions for common array operations.
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
int VolumeIntegral(double *VolumeIntegral, double *u, void *s, void *m)
Some common functions used here and there.