43std::shared_ptr<Y2dSliceToResults>
45 unsigned int timeStepLength, std::shared_ptr<SimulationResults> simResults,
46 unsigned int ySliceForCalculation)
48 return std::shared_ptr<Y2dSliceToResults>(
52Y2dSliceToResults::Y2dSliceToResults()
56Y2dSliceToResults::Y2dSliceToResults(std::shared_ptr<VectorWriterInformationStruct> vectorWriterInfo,
57 unsigned int timeStepLength, std::shared_ptr<SimulationResults> simResults,
58 unsigned int ySliceForCalculation)
61 this->simResults = simResults;
62 this->ySliceForCalculation = ySliceForCalculation;
65void Y2dSliceToResults::writeTimestep(std::shared_ptr<Parameter> para,
unsigned int t,
int level)
68 maxX = para->getGridX().at(level);
69 maxY = para->getGridY().at(level);
70 maxZ = para->getGridZ().at(level);
72 int numberNodes = (maxX - 1) * (maxZ - 1);
73 std::vector<double>
x(numberNodes),
y(numberNodes),
z(numberNodes);
74 std::vector<double> vx(numberNodes), vy(numberNodes), vz(numberNodes);
75 std::vector<double> press(numberNodes), rho(numberNodes);
76 std::vector<unsigned int> levels(numberNodes);
78 ySliceForCalculation = maxY / 2;
91 (
double)para->getDensityRatio() * (
double)para->getVelocityRatio() *
92 (
double)para->getVelocityRatio();
94 (
double)para->getDensityRatio() * (
double)para->getVelocityRatio() *
95 (
double)para->getVelocityRatio();
99 simResults->addTimeStep(timestep,
t, levels,
x,
y,
z, vx, vy, vz, press, rho);
102int Y2dSliceToResults::CoordPara3DTo1D(
int x,
int y,
int z)
104 return z * maxY * maxX +
y * maxX +
x + 1;
107int Y2dSliceToResults::CoordResults2DTo1D(
int x,
int z)
109 return z * (maxX - 1) +
x;
unsigned int timeStepLength
static std::shared_ptr< Y2dSliceToResults > getNewInstance(std::shared_ptr< VectorWriterInformationStruct > vectorWriterInfo, unsigned int timeStepLength, std::shared_ptr< SimulationResults > simResults, unsigned int ySliceForCalculation)
std::shared_ptr< T > SPtr