20 double*
const*
const a_u_src,
23 double*
const a_u_dst,
24 const double*
const a_coeffs
30 int ndims = solver_dst->
ndims;
31 int nvars = solver_dst->
nvars;
32 int ghosts = solver_dst->
ghosts;
36 int dim_dst_wgpt[ndims];
38 long size_dst_wgpt = nvars;
39 for (
int n=0; n<ndims; n++) {
40 dim_dst_wgpt[n] += 2*ghosts;
41 size_dst_wgpt *= dim_dst_wgpt[n];
45 double *ug_dst_wgpt = NULL;
47 ug_dst_wgpt = (
double*) calloc (size_dst_wgpt,
sizeof(
double));
53 for (
int n = 0; n < a_nsims; n++) {
56 int dim_global_src_wgpt[ndims];
58 long size_src_wgpt = nvars;
59 for (
int n=0; n<ndims; n++) {
60 dim_global_src_wgpt[n] += 2*ghosts;
61 size_src_wgpt *= dim_global_src_wgpt[n];
64 double* ug_src_wgpt = NULL;
65 if (!a_sims_src[n].mpi.rank) {
66 ug_src_wgpt = (
double*) calloc (size_src_wgpt,
sizeof(
double));
70 (
void*) &(a_sims_src[n].mpi),
74 a_sims_src[n].solver.dim_local,
79 double *u_src_interpolated = NULL;
82 a_sims_src[n].solver.dim_global,
88 _ArrayAXPY_(u_src_interpolated, a_coeffs[n], ug_dst_wgpt, size_dst_wgpt);
89 free(u_src_interpolated);
97 (mpi_dst->
rank ? NULL : ug_dst_wgpt),
105 if (!mpi_dst->
rank) free(ug_dst_wgpt);
#define _ArraySetValue_(x, size, value)
void CombineSolutions(SimulationObject *a_sims_src, double *const *const a_u_src, const int a_nsims, SimulationObject *a_sim_dst, double *const a_u_dst, const double *const a_coeffs)
int MPIPartitionArraynDwGhosts(int, void *, double *, double *, int *, int *, int, int)
MPI related function definitions.
int MPIGatherArraynDwGhosts(int, void *, double *, double *, int *, int *, int, int)
int InterpolateGlobalnDVar(const int *const, double **const, const int *const, double *const, const int, const int, const int, const int *const)
Contains function definitions for common mathematical functions.
#define _ArrayCopy1D_(x, y, size)
Structure defining a simulation.
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
#define _ArrayAXPY_(x, a, y, size)
Structure containing all solver-specific variables and functions.