HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
SparseGridsCombinationTechnique.cpp
Go to the documentation of this file.
1 
6 #include <arrayfunctions.h>
7 #include <std_vec_ops.h>
9 
10 extern "C" void CombineSolutions( SimulationObject*,
11  double* const *const,
12  const int,
14  double* const,
15  const double* const );
16 
24 {
25  double** u_sg = (double**) calloc (m_nsims_sg, sizeof(double*));
26  std::vector<double> coeffs(m_nsims_sg, 0.0);
27  for (int n=0; n<m_nsims_sg; n++) {
28  u_sg[n] = m_sims_sg[n].solver.u;
29  coeffs[n] = m_combination[n]._coeff_;
30  }
31 
33  u_sg,
34  m_nsims_sg,
35  a_sim,
36  a_sim->solver.u,
37  coeffs.data() );
38 
39  /* done */
40  return;
41 }
42 
Structure defining a simulation.
void CombineSolutions(SimulationObject *, double *const *const, const int, SimulationObject *, double *const, const double *const)
void CombinationTechnique(SimulationObject *const)
double * u
Definition: hypar.h:116
std::vector< SGCTElem > m_combination
std::vector< SimulationObject > m_sims_sg
Contains some vector ops.
Contains macros and function definitions for common array operations.