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
>
8
#include <
sparse_grids_simulation.h
>
9
10
extern
"C"
void
CombineSolutions
(
SimulationObject
*,
11
double
*
const
*
const
,
12
const
int
,
13
SimulationObject
*,
14
double
*
const
,
15
const
double
*
const
);
16
23
void
SparseGridsSimulation::CombinationTechnique
(
SimulationObject
*
const
a_sim )
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
32
::CombineSolutions
(
m_sims_sg
.data(),
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
SimulationObject
Structure defining a simulation.
Definition:
simulation_object.h:23
CombineSolutions
void CombineSolutions(SimulationObject *, double *const *const, const int, SimulationObject *, double *const, const double *const)
Definition:
CombineSolutions.c:19
SparseGridsSimulation::CombinationTechnique
void CombinationTechnique(SimulationObject *const)
Definition:
SparseGridsCombinationTechnique.cpp:23
HyPar::u
double * u
Definition:
hypar.h:116
SimulationObject::solver
HyPar solver
Definition:
simulation_object.h:26
SparseGridsSimulation::m_combination
std::vector< SGCTElem > m_combination
Definition:
sparse_grids_simulation.h:236
sparse_grids_simulation.h
SparseGridsSimulation::m_sims_sg
std::vector< SimulationObject > m_sims_sg
Definition:
sparse_grids_simulation.h:231
std_vec_ops.h
Contains some vector ops.
SparseGridsSimulation::m_nsims_sg
int m_nsims_sg
Definition:
sparse_grids_simulation.h:214
arrayfunctions.h
Contains macros and function definitions for common array operations.