27 uex = (
double*) calloc (size,
sizeof(
double));
59 std::vector<int> periodic_arr(
m_ndims);
69 uex2 = (
double*) calloc(size,
sizeof(
double));
87 double *uex_global_fg = NULL;
105 double *uex_global_sg = NULL;
114 periodic_arr.data() );
116 fprintf(stderr,
"InterpolateGlobalnDVar() returned with error!\n");
123 *
m_sims_sg[n].solver.npoints_local_wghosts;
124 double* uex_sg = (
double*) calloc(size,
sizeof(
double));
129 (
m_rank ? NULL : uex_global_sg),
137 if (!
m_rank) free(uex_global_sg);
156 double*
const a_uex )
158 static const double tolerance = 1e-15;
164 fprintf(stderr,
"Error in SparseGrids::computeError() -\n");
165 fprintf(stderr,
" exact solution pointer in NULL.\n");
170 double sum, global_sum;
171 double solution_norm[3] = {0.0,0.0,0.0};
181 solution_norm[1] = sqrt(global_sum/((
double)solver->
npoints_global));
186 solution_norm[2] = global_sum;
208 solver->
error[2] = global_sum;
214 if ( (solution_norm[0] > tolerance)
215 && (solution_norm[1] > tolerance)
216 && (solution_norm[2] > tolerance) ) {
217 solver->
error[0] /= solution_norm[0];
218 solver->
error[1] /= solution_norm[1];
219 solver->
error[2] /= solution_norm[2];
std::vector< SimulationObject > m_sims_sg
int npoints_local_wghosts
Contains some vector ops.
void copyFrom(std::vector< int > &a_iv, const int *const a_iv_carr, int a_n)
int MPIPartitionArraynDwGhosts(int, void *, double *, double *, int *, int *, int, int)
INLINE double ArraySumAbsnD(int, int, int *, int, int *, double *)
Contains function definitions for common mathematical functions for C++ code.
int MPISum_double(double *, double *, int, void *)
int MPIMax_double(double *, double *, int, void *)
std::vector< bool > m_is_periodic
#define _MAX_STRING_SIZE_
void allocateDataArrays(const GridDimensions &a_dim, const int a_nvars, double **const a_u, const int a_ngpt=0)
SimulationObject * m_sim_fg
int MPIGatherArraynDwGhosts(int, void *, double *, double *, int *, int *, int, int)
INLINE double ArraySumSquarenD(int, int, int *, int, int *, double *)
int InterpolateGlobalnDVar(const int *const, double **const, const int *const, double *const, const int, const int, const int, const int *const)
#define _ArrayCopy1D_(x, y, size)
long sum(const std::vector< int > &a_iv)
int ExactSolution(void *, void *, double *, char *, int *)
void computeError(SimulationObject &, double *const)
Structure defining a simulation.
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
INLINE double ArrayMaxnD(int, int, int *, int, int *, double *)
#define _ArrayAXPY_(x, a, y, size)
std::vector< int > GridDimensions
Structure containing all solver-specific variables and functions.