Peano 4
Loading...
Searching...
No Matches
CellData.cpp
Go to the documentation of this file.
1#include "CellData.h"
2
4
6 double* QIn_,
9 double t_,
10 double dt_,
11 double* QOut_
12):
13 CellData(1) {
14 QIn[0] = QIn_;
15 cellCentre[0] = cellCentre_;
16 cellSize[0] = cellSize_;
17 t[0] = t_;
18 dt[0] = dt_;
19 QOut[0] = QOut_;
20 id[0] = -1;
21}
22
23exahype2::CellData::CellData(int numberOfCells_):
24 numberOfCells(numberOfCells_) {
25 QIn = tarch::allocateMemory<double*>(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
26 cellCentre = tarch::allocateMemory< tarch::la::Vector<Dimensions, double> >(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
27 cellSize = tarch::allocateMemory< tarch::la::Vector<Dimensions, double> >(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
28 t = tarch::allocateMemory< double >(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
29 dt = tarch::allocateMemory< double >(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
30 id = tarch::allocateMemory< int >(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
31 QOut = tarch::allocateMemory<double*>(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
32 maxEigenvalue = tarch::allocateMemory< double >(numberOfCells_, tarch::MemoryLocation::ManagedSharedAcceleratorDeviceMemory);
33}
34
45
46std::string exahype2::CellData::toString() const {
47 std::ostringstream msg;
48 msg << "[";
49 for (int i = 0; i < numberOfCells; i++) {
50 msg << "(x=" << cellCentre[i] << ",h=" << cellSize[i] << ",t=" << t[i] << ",dt=" << dt[i] << ",id=" << id[i]
51 << ",lambda=" << maxEigenvalue[i] << ")";
52 }
53 msg << "]";
54 return msg.str();
55}
void freeMemory(void *data, MemoryLocation location)
@ ManagedSharedAcceleratorDeviceMemory
To be used on host only.
Representation of a number of cells which contains all information that's required to process the sto...
Definition CellData.h:79
CellData(double *QIn, const tarch::la::Vector< Dimensions, double > &cellCentre_, const tarch::la::Vector< Dimensions, double > &cellSize_, double t, double dt, double *QOut)
Construct patch data object for one single cell.
Definition CellData.cpp:5
double * maxEigenvalue
Out values.
Definition CellData.h:111
double ** QOut
Out values.
Definition CellData.h:106
std::string toString() const
Definition CellData.cpp:46
double ** QIn
QIn may not be const, as some kernels delete it straightaway once the input data has been handled.
Definition CellData.h:84
tarch::la::Vector< Dimensions, double > * cellSize
Definition CellData.h:86
tarch::la::Vector< Dimensions, double > * cellCentre
Definition CellData.h:85
Simple vector class.
Definition Vector.h:134