7#ifndef POSTPROCESSING_H_
8#define POSTPROCESSING_H_
34 return ((left < right) && (std::fabs(left - right) > 1000 * MFloatEps));
44 MBool operator()(
const std::pair<MFloat, MFloat>& left,
const std::pair<MFloat, MFloat>& right)
const {
45 if(left.first < right.first) {
47 }
else if(
approx(left.first, right.first, 100 * MFloatEps)) {
48 if(left.second < right.second) {
84template <MInt nDim,
class ppType>
134 virtual void writeSprayData() { TERMM(1,
"Not implemented for this solverType"); };
152 template <MBool inSolution = false>
176 std::map<MFloat, MFloat, coord_comp_1d_>& cell_to_map);
178 std::map<std::pair<MFloat, MFloat>, std::pair<MFloat, MFloat>,
coord_comp_2d_>& cell_to_map);
215 const MInt noVariables =
pp->solver().noVariables();
216 std::vector<MFloat> cellVarsDeriv(noVariables * nDim);
218 if(
pp->getSampleVarsDerivatives(cellIdSolver, cellVarsDeriv)) {
219 const MFloatTensor deriv(cellVarsDeriv.data(), noVariables, nDim);
220 for(
MInt d = 0; d < nDim; d++) {
221 divergence += deriv(d, d);
228 if constexpr(nDim == 2) {
229 vorticity[0] = deriv(1, 0) - deriv(0, 1);
231 vorticity[0] = deriv(2, 1) - deriv(1, 2);
232 vorticity[1] = deriv(0, 2) - deriv(2, 0);
233 vorticity[2] = deriv(1, 0) - deriv(0, 1);
238 std::ignore = vorticity;
239 TERMM(1,
"Not implemented for this solverType");
242 std::ignore = vorticity;
243 TERMM(1,
"Not implemented for this solverType");
249 TERMM(1,
"Not implemented for this solverType");
253 std::ignore = cellId;
262 std::ignore = cellId;
264 TERMM(1,
"Not implemented for this solverType");
267 std::ignore = cellId;
268 TERMM(1,
"Not implemented for this solver");
272 TERMM(1,
"Not implemented for this solverType");
300 ppType*
pp =
static_cast<ppType*
>(
this);
313 postData().m_solverId ==
pp->solver().m_solverId) {
597 {
"q_mI",
"q_mI_linear",
"q_mII",
"q_mIII",
"q_mIV",
"q_c",
"q_e"}};
virtual void saveVolumeSamplingData()
Solver * mSolver() const override
virtual void averageSolutionsInSolve()
std::vector< MInt > m_noSliceVars
Number of variables for each slice variable.
virtual void getVorticityT(MFloat *const vorticity)
void initTimeStepProperties()
Initializes timestep properties for postprocessing.
MBool m_computeAndSaveMean
MInt * m_noCorrelationIds
std::map< MFloat, MFloat, coord_comp_1d_ > m_spatialGlobalLineCellToMap
virtual void initSurfaceSamplingData()
virtual void computePLIsoTurbulenceStatistics()
MInt * m_globalNoProbeLineIds
MInt * m_correlationVariableIndex
std::ofstream * m_probeFileStreams
MInt m_spatialLineNoCells
std::vector< std::vector< MString > > m_postprocessingMethodsDesc
MInt * m_probeLineDirection
std::vector< MInt > m_activeSourceTerms
std::map< std::pair< MFloat, MFloat >, MInt, coord_comp_2d_ > m_spatialGlobalPlaneCoordinates
virtual void getPrimitiveVariables(MInt, MFloat *, MFloat *, MInt)
MBool m_averageSpeedOfSound
void createCellToMap1D(std::map< MFloat, MInt, coord_comp_1d_ > &coordinates, std::map< MFloat, MFloat, coord_comp_1d_ > &cell_to_map)
void averageSolutions()
Averages solutions.
std::set< MInt > m_activeMeanVars
virtual void initSprayData()
virtual void initParticleStatistics()
MInt * m_globalNoArbSlicePoints
MInt ** m_noGlobalProbeLineIds
MInt m_noSpeedOfSoundVars
MFloat ** m_globalCorrelationPositions
void getSampleVariables(MInt const cellId, std::vector< MFloat > &vars)
void initProbeLine()
Initializes properties and memory for line probing.
MString m_ReStressesAverageFileName
MInt ** m_probeLineAverageCoordinatesSign
void probeArbitrarySlicePost()
void transferSensorWeights()
MInt m_probeSliceStartTimestep
MInt m_averageStopTimestep
MInt * m_probeLineOffsets
MInt * m_noProbeSliceMaxNoHilbertIds
std::vector< tpost > tvecpost
void initProbeSlice()
Initializes properties and memory for slice probing.
MInt m_probeSliceInterval
MFloat ** m_globalCorrelationExchangeVar
MInt ** m_noProbeLineAverageIds
std::map< std::pair< MFloat, MFloat >, std::pair< MFloat, MFloat >, coord_comp_2d_ > m_spatialPlaneCellToMap
virtual void initMovingAverage()
Initializes properties and allocates memory for moving averaging.
MFloat * m_probeSliceCoordinate
void pp_saveCoarseSolution()
MInt ** m_globalNoProbeLineAverageIds
void initProbeArbitraryLine()
initializes properties and data for arbitrary line probing
virtual void getPrimitiveVarNames(MString *names) const
MString * m_probeSliceGridNames
MInt m_probeLineStartTimestep
void movePointsToGrid(MFloat *in_points, MInt in_noPoints, MInt in_moveType)
std::map< std::pair< MFloat, MFloat >, MInt, coord_comp_2d_ > m_spatialPlaneCoordinates
MInt ** m_noProbeSliceHilbertInfo
void initProbeLinePeriodic()
void initProbeArbitrarySlice()
initializes properties and data for arbitrary slice probing
MBool m_statisticCombustionAnalysis
MInt m_probeSliceStopTimestep
void initProbePoint()
Initializes properties for point probing.
void createCellToMap2D(std::map< std::pair< MFloat, MFloat >, MInt, coord_comp_2d_ > &coordinates, std::map< std::pair< MFloat, MFloat >, std::pair< MFloat, MFloat >, coord_comp_2d_ > &cell_to_map)
MInt ** m_noGlobalProbeSliceIds
virtual void initAverageVariables()
allocates memory for averageSolutions() and averageSolutionsInSolve()
MInt * m_moveLinePointsToGrid
MInt m_probeLineStopTimestep
void computeAndSaveDivergence()
std::vector< MFloat > m_pdPoints
MFloat *** m_globalProbeLineAverageVars
void averageSolutionsSlice()
virtual MFloat & vorticityAtCell(const MInt cellId, const MInt dir)
virtual void computeAcousticSourceTermQe(MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &, MFloatScratchSpace &)
MFloat *** m_probeLineAveragePositions
MFloat ** m_correlationExchangeVarRMS
MInt * m_noProbeSliceNoHilbertIds
MFloat ** m_globalCorrelationExchangeVarMean
void probeArbitrarySlice()
std::vector< std::vector< MString > > m_sliceVarNames
List of variable names for each slice variable.
void initSpatialAveraging()
virtual void saveSurfaceSamplingData()
virtual void getVorticity(MFloat *const vorticity)
virtual void writeSprayData()
virtual void writeLPTSolutionFile()
MInt * m_probeLineAverageDirection
void probeArbitraryLinePost()
MFloat m_spatialLvlWeight[20]
MFloat * m_arbSlicePoints
MInt m_averageStartTimestep
typename maia::grid::Proxy< nDim > GridProxy
MInt * m_noArbSlicePoints
void postprocessInSolve(MBool finalTimeStep) override
virtual void initPointSamplingData()
MFloat ** m_correlationCoordinates
std::map< MFloat, MInt, coord_comp_1d_ > m_spatialGlobalLineCoordinates
MString * m_movAvgVarNames
virtual void probeLinePeriodicPost()
std::map< std::pair< MFloat, MFloat >, std::pair< MFloat, MFloat >, coord_comp_2d_ > m_spatialGlobalPlaneCellToMap
std::vector< MInt > m_sliceVarIds
List of slice variables.
MInt m_movingAverageStartTimestep
MFloat ** m_correlationPositions
MInt * m_probeSliceOffsets
PostProcessing(MInt postprocessingId_, PostData< nDim > *data)
void initAverageSolutionsSlice()
Initializes properties for slice averaging.
virtual void calcVorticity(const MFloatTensor &deriv, MFloat vorticity[nDim *2 - 3])
void spatialAveragingPost()
void initWritePointData()
void postprocessPostSolve() override
virtual void initLPTSolutionFile()
MInt * m_globalNoArbLineIds
MFloat * m_sliceIntercept
void postprocessSolution() override
MInt * m_globalNoProbeSliceIds
MFloat ** m_probeLinePositions
MBool getSampleVarsDerivatives(const MInt, std::vector< MFloat > &)
void initPostProcessing() override
Reads all required properties in and prepares for postprocessing.
MInt * m_arbLineHasNewDistribution
virtual void initAveragingProperties()
Initialize properties relevant for temporal averaging.
std::vector< MInt > m_pdCells
void computeAndSaveMean()
void getSampleVarsDerivatives(const MInt cellId, const MFloat *&vars)
MInt m_movingAverageDataPoints
MInt ** m_globalCorrelationIds
void calcSamplingVar(const MInt cellId, const MInt sampleVarId, MFloat *const vars)
MFloat ** m_correlationExchangeVar
MInt * m_spatialVarsRecvcnts
void initTimeStepPropertiesSlice()
MInt m_movingAverageInterval
MFloat ** m_movAvgVariables
MInt m_noCorrelationLines
MFloat m_spatialWeightSinglePoint
MInt m_sprayWriteInterval
MFloat ** m_probeSlicePositions
std::vector< MInt > * m_cell2globalIndex
MInt m_movingAverageCounter
void neededMeanVarsForSourceTerm(const MInt sourceTerm, std::vector< MInt > &meanVars) const
MInt * m_correlationDirection
MInt m_noProbeLineAverageSteps
std::vector< tvecpost > m_postprocessingMethods
void findClosestProbePointsGridCells()
void collectMinLvlCells()
MFloat * m_arbSlicePointsDistribution
MFloat * m_spatialLineAllVars
MInt *** m_probeLineAverageIds
MInt m_globalnoSlicePositions
virtual void initIsoTurbulenceStatistics()
MInt findNearestGridCell(const MFloat *coord)
MInt m_sprayComputeInterval
MInt * m_probeLinePeriodic
void findContainingCell(const MFloat *coord, MInt &cellId)
virtual void computeSprayData()
void postprocessPreSolve() override
MInt ** m_correlationIndexMapping
std::multimap< MFloat, MFloat > m_sliceGlobalPositions
std::array< MString, ST::totalNoSourceTerms > s_sourceTermNames
MFloat * m_spatialPlaneAllCoord
virtual void initPLIsoTurbulenceStatistics()
virtual void computeIsoTurbulenceStatistics()
MFloat ** m_arbLineCoordinates
MFloat * m_arbLinePointsDistribution
tvecpost m_postprocessingSolution
MFloat * m_spatialPlaneAllVars
MString * m_postprocessingOps
MString m_postprocessFileName
std::map< MFloat, MInt, coord_comp_1d_ > m_spatialLineCoordinates
MFloat calcDivergence(const MInt cellIdSolver)
MFloat * m_spatialLineAllCoord
typename PPGrid::Cell Cell
MInt m_noAveragedVorticities
void probeArbitraryLine()
virtual MFloat getBoundaryHeatFlux(const MInt cellId) const
MInt m_movingAverageStopTimestep
std::map< MFloat, MFloat, coord_comp_1d_ > m_spatialLineCellToMap
~PostProcessing()
Destructor for the massive paralle postprocessing solver.
virtual void probeLinePeriodic()
MInt m_spatialPlaneNoCells
virtual void computeParticleStatistics()
MFloat ** m_globalCorrelationExchangeVarRMS
MInt * m_noProbeSliceMaxNoContHilbertIds
MFloat ** m_injectionData
MInt m_LPTSolutionInterval
MBool m_sliceAiaFileFormat
MInt * m_spatialVarsDispls
MFloat ** m_correlationExchangeVarMean
MInt * m_noPeriodicSliceCells
MFloat ** m_probeCoordinates
MFloat ** m_probeLineCoordinates
MInt * m_noProbeSliceNoContHilbertIds
virtual void savePointSamplingData()
MFloat ** m_arbSliceCoordinates
void initPeriodicSliceAverage()
Initializes the periodic averaging on a slice.
std::vector< MFloat > m_pdVars
void getSampleVariables(MInt cellId, const MFloat *&vars, MBool mode)
MInt ** m_noProbeSliceContHilbertInfo
MFloat ** m_probeLineAverageCoordinates
MInt * m_globalNoCorrelationIds
void initReduceToLevelAvg()
Initializes properties for grid level reduction.
void(PostProcessing::* tpost)()
virtual void initVolumeSamplingData()
void initTimeStepPropertiesLine()
MInt m_probeWriteInterval
void periodicSliceAverage()
MInt m_noPostprocessingOps
void saveSliceAiaFileFormat(const MInt step, const MInt noVars, MFloatScratchSpace &vars, const MInt sliceId)
PostProcessingInterface(const MInt postprocessingId_)
virtual void initPostProcessing()=0
PostProcessingInterface & operator=(const PostProcessingInterface &)=delete
virtual void postprocessInSolve(MBool finalTimeStep)=0
MInt a_postprocessingId() const
virtual void postprocessPreSolve()=0
PostProcessingInterface(const PostProcessingInterface &)=delete
virtual void postprocessSolution()=0
virtual ~PostProcessingInterface()=default
virtual void postprocessPostSolve()=0
virtual Solver * mSolver() const =0
This class is a ScratchSpace.
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
MBool approx(const T &, const U &, const T)
std::basic_string< char > MString
static constexpr const MInt UGRADU
static constexpr const MInt DP
static constexpr const MInt GRADU
static constexpr const MInt UGRADRHO
static constexpr const MInt RHODIVU
static constexpr const MInt GRADPRHO
static constexpr const MInt DRHO
static constexpr const MInt DU
static constexpr const MInt LAMB0
static constexpr const MInt VORT0
static constexpr const MInt totalNoSourceTerms
static constexpr const MInt Q_mIV
static constexpr const MInt Q_e
static constexpr const MInt Q_mI
static constexpr const MInt Q_mI_linear
static constexpr const MInt Q_mIII
static constexpr const MInt Q_mII
static constexpr const MInt Q_c
compare struct for 1D coordinates
MBool operator()(const MFloat &left, const MFloat &right) const
compare struct for 2D coordinates
MBool operator()(const std::pair< MFloat, MFloat > &left, const std::pair< MFloat, MFloat > &right) const