21 {
"um",
"vm",
"wm",
"rhom",
"pm",
"cm"},
22 {
"u'",
"v'",
"w'",
"u'v'",
"v'w'",
"w'u'",
"p'"},
23 {
"u''",
"v''",
"w''"},
24 {
"u'''",
"v'''",
"w'''"},
26 {
"vort_x",
"vort_y",
"vort_z"},
27 {
"c0",
"dc0_dx",
"dc0_dy",
"dc0_dz"},
28 {
"wxv_x",
"wxv_y",
"wxv_z"},
29 {
"gradm_u_x",
"gradm_v_y",
"gradm_w_z"},
30 {
"gradm_rho_x",
"gradm_rho_y",
"gradm_rho_z"},
31 {
"gradm_p_x",
"gradm_p_y",
"gradm_p_z"},
32 {
"gradm_u_x",
"gradm_u_y",
"gradm_u_z",
"gradm_v_x",
"gradm_v_y",
"gradm_v_z",
"gradm_w_x",
"gradm_w_y",
34 {
"ugradu_x",
"ugradu_y",
"ugradu_z"},
35 {
"ugradrho_x",
"ugradrho_y",
"ugradrho_z"},
36 {
"mgrad_p_rho_x",
"mgrad_p_rho_y",
"mgrad_p_rho_z"},
37 {
"rhodivu_x",
"rhodivu_y",
"rhodivu_z"},
42 {
"um",
"vm",
"rhom",
"pm",
"cm"},
43 {
"u'",
"v'",
"u'v'",
"p'"},
48 {
"c0",
"dc0_dx",
"dc0_dy"},
50 {
"gradm_u_x",
"gradm_v_y"},
51 {
"gradm_rho_x",
"gradm_rho_y"},
52 {
"gradm_p_x",
"gradm_p_y"},
53 {
"gradm_u_x",
"gradm_u_y",
"gradm_v_x",
"gradm_v_y"},
54 {
"ugradu_x",
"ugradu_y"},
55 {
"ugradrho_x",
"ugradrho_y"},
56 {
"mgrad_p_rho_x",
"mgrad_p_rho_y"},
57 {
"rhodivu_x",
"rhodivu_y"},
64 m_geometry(&geometry_),
71 m_variableOffset.push_back(std::make_pair(std::numeric_limits<MInt>::max(), -std::numeric_limits<MInt>::max()));
90 m_outputFormat =
"NETCDF";
91 m_outputFormat = Context::getSolverProperty<MString>(
"outputFormat", m_solverId, AT_, &m_outputFormat);
104 m_solutionOffset = 0;
105 m_solutionOffset = Context::getSolverProperty<MInt>(
"solutionOffset", m_solverId, AT_, &m_solutionOffset);
108 m_noVariables = Context::getSolverProperty<MInt>(
"noVariables", m_solverId, AT_, &m_noVariables);
116 for(
MInt i = 0; i < noNeighborDomains(); i++) {
117 for(
MInt c = 0; c < noHaloCells(i); c++) {
118 a_isHalo(haloCellId(i, c)) =
true;
120 for(
MInt j = 0; j < noWindowCells(i); j++) {
121 a_isWindow(windowCellId(i, j)) =
true;
127 for(
MInt c = 0; c < a_noCells(); c++) {
140 m_cells.reset(grid().maxNoCells());
141 this->setHaloCellsOnInactiveRanks();
145 setAndAllocateSolverData(
true);
153 const MInt maxNoCells = maxNoGridCells();
155 mAlloc(m_recalcIds, maxNoCells,
"m_recalcIds", -1, AT_);
156 for(
MInt i = 0; i < maxNoCells; i++) {
160 m_cells.setNoVariables(noVariables());
162 m_cells.reset(grid().raw().treeb().capacity());
163 m_cells.append(c_noCells());
165 copyGridProperties();
171 for(
MInt cellId = 0; cellId < noInternalCells(); cellId++) {
172 for(
MInt v = 0; v < noVariables(); v++) {
173 a_variable(cellId, v) = 0;
184 m_variablesName.clear();
186 for(
MInt i = 0; i < noVariables(); i++) {
187 MString s = getVariableName(i);
188 auto it = std::find(m_variablesName.begin(), m_variablesName.end(), s);
189 if(it == m_variablesName.end()) {
190 m_variablesName.push_back(getVariableName(i));
198 MString s =
"var" + std::to_string(offset);
199 if(offset >= getPropertyVariableOffset(
"primitive").first && offset < getPropertyVariableOffset(
"primitive").second) {
200 MInt index = offset - getPropertyVariableOffset(
"primitive").first;
201 s = m_averageVariableName[0][index];
203 if(offset >= getPropertyVariableOffset(
"square").first && offset < getPropertyVariableOffset(
"square").second) {
204 MInt index = offset - getPropertyVariableOffset(
"square").first;
205 s = m_averageVariableName[1][index];
207 if(offset >= getPropertyVariableOffset(
"skewness").first && offset < getPropertyVariableOffset(
"skewness").second) {
208 MInt index = offset - getPropertyVariableOffset(
"skewness").first;
209 s = m_averageVariableName[2][index];
211 if(offset >= getPropertyVariableOffset(
"kurtosis").first && offset < getPropertyVariableOffset(
"kurtosis").second) {
212 MInt index = offset - getPropertyVariableOffset(
"kurtosis").first;
213 s = m_averageVariableName[3][index];
215 if(offset >= getPropertyVariableOffset(
"statisticCombustionAnalysis").first
216 && offset < getPropertyVariableOffset(
"statisticCombustionAnalysis").second) {
217 MInt index = offset - getPropertyVariableOffset(
"statisticCombustionAnalysis").first;
218 s = m_averageVariableName[4][index];
220 if(offset >= getPropertyVariableOffset(
"averageVorticity").first
221 && offset < getPropertyVariableOffset(
"averageVorticity").second) {
222 MInt index = offset - getPropertyVariableOffset(
"averageVorticity").first;
223 s = m_averageVariableName[5][index];
225 if(offset >= getPropertyVariableOffset(
"averageSpeedOfSound").first
226 && offset < getPropertyVariableOffset(
"averageSpeedOfSound").second) {
227 MInt index = offset - getPropertyVariableOffset(
"averageSpeedOfSound").first;
228 s = m_averageVariableName[6][index];
230 if(offset >= getPropertyVariableOffset(
"lamb0").first && offset < getPropertyVariableOffset(
"lamb0").second) {
231 MInt index = offset - getPropertyVariableOffset(
"lamb0").first;
232 s = m_averageVariableName[7][index];
234 if(offset >= getPropertyVariableOffset(
"du").first && offset < getPropertyVariableOffset(
"du").second) {
235 MInt index = offset - getPropertyVariableOffset(
"du").first;
236 s = m_averageVariableName[8][index];
238 if(offset >= getPropertyVariableOffset(
"drho").first && offset < getPropertyVariableOffset(
"drho").second) {
239 MInt index = offset - getPropertyVariableOffset(
"drho").first;
240 s = m_averageVariableName[9][index];
242 if(offset >= getPropertyVariableOffset(
"dp").first && offset < getPropertyVariableOffset(
"dp").second) {
243 MInt index = offset - getPropertyVariableOffset(
"dp").first;
244 s = m_averageVariableName[10][index];
246 if(offset >= getPropertyVariableOffset(
"gradu").first && offset < getPropertyVariableOffset(
"gradu").second) {
247 MInt index = offset - getPropertyVariableOffset(
"gradu").first;
248 s = m_averageVariableName[11][index];
250 if(offset >= getPropertyVariableOffset(
"ugradu").first && offset < getPropertyVariableOffset(
"ugradu").second) {
251 MInt index = offset - getPropertyVariableOffset(
"ugradu").first;
252 s = m_averageVariableName[12][index];
254 if(offset >= getPropertyVariableOffset(
"ugradrho").first && offset < getPropertyVariableOffset(
"ugradrho").second) {
255 MInt index = offset - getPropertyVariableOffset(
"ugradrho").first;
256 s = m_averageVariableName[13][index];
258 if(offset >= getPropertyVariableOffset(
"gradprho").first && offset < getPropertyVariableOffset(
"gradprho").second) {
259 MInt index = offset - getPropertyVariableOffset(
"gradprho").first;
260 s = m_averageVariableName[14][index];
262 if(offset >= getPropertyVariableOffset(
"rhodivu").first && offset < getPropertyVariableOffset(
"rhodivu").second) {
263 MInt index = offset - getPropertyVariableOffset(
"rhodivu").first;
264 s = m_averageVariableName[15][index];
266 if(offset >= getPropertyVariableOffset(
"correlation").first
267 && offset < getPropertyVariableOffset(
"correlation").second) {
268 MInt index = offset - getPropertyVariableOffset(
"correlation").first;
269 s = m_averageVariableName[16][0 ] + to_string(index);
279 if(!isActive())
return;
291 MInt* recalcIdTree) {
295 if(noVariables() == 0)
return;
297 m_currentGridFileName = gridFileName;
299 if(m_recalcIds !=
nullptr) {
300 for(
MInt cellId = 0; cellId < maxNoGridCells(); cellId++) {
301 m_recalcIds[cellId] = recalcIdTree[cellId];
306 saveRestartFile(writeBackup);
315 writeGridRestart =
false;
318 if(m_restartInterval == -1 && !writeRestart) {
319 writeRestart =
false;
323 MInt relativeRestartTimeStep = m_restartTimeStep - m_restartOffset;
325 if(((relativeTimeStep % m_restartInterval) == 0 && relativeTimeStep > relativeRestartTimeStep) || writeRestart) {
329 if(m_forceWriteRestart) {
331 if(m_adaptationSinceLastRestart) {
332 writeGridRestart =
true;
349 m_adaptationSinceLastRestart =
false;
352 m_forceWriteRestart =
false;
359 ASSERT(noVariables() > 0,
"No variables set for PostData restart!");
360 ASSERT(!m_variablesName.empty(),
"");
361 ASSERT((
MInt)m_variablesName.size() == noVariables(),
"");
365 stringstream fileName;
366 fileName << outputDir() <<
"restartFile_" << solverId() <<
"_" <<
globalTimeStep << ParallelIo::fileExt();
368 saveDataFile(writeBackup, fileName.str(), noVariables(), m_variablesName, &a_variable(0, 0));
373 std::vector<MString>& variablesName,
MFloat* variables) {
376 ASSERT(noVars > 0,
"No variables set for PostData restart!");
377 ASSERT((
MInt)variablesName.size() == noVars,
"");
379 if(domainId() == 0) {
380 cerr <<
"Writing post data file '" << fileName <<
"' for solver " << solverId() <<
" at time step "
384 vector<MInt> reOrderedCells;
385 MInt countInternal = 0;
386 if(grid().newMinLevel() > 0) {
387 if(domainId() == 0) {
388 cerr <<
"Increasing minLevel for solver " << m_solverId;
390 this->reOrderCellIds(reOrderedCells);
391 for(
MUint i = 0; i < reOrderedCells.size(); i++) {
392 if(a_isHalo(reOrderedCells[i]))
continue;
395 m_recalcIds =
nullptr;
397 const MInt noCells = grid().newMinLevel() < 0 ? noInternalCells() : reOrderedCells.size();
398 const MInt noInternalCellIds = grid().newMinLevel() < 0 ? noInternalCells() : countInternal;
404 vector<MString> dbVariablesName;
405 vector<MString> idVariablesName;
406 vector<MString> dbParametersName;
407 vector<MString> idParametersName;
409 this->collectVariables(variables, dbVariables, variablesName, dbVariablesName, noVars, noCells);
411 this->collectParameters(
globalTimeStep, idParameters,
"globalTimeStep", idParametersName);
414 if(m_recalcIds !=
nullptr) {
416 for(
MInt gridcell = 0; gridcell < grid().raw().m_noInternalCells; gridcell++) {
417 if(grid().raw().a_hasProperty(gridcell, Cell::IsHalo))
continue;
418 MInt l_solverId = grid().tree().grid2solver(m_recalcIds[gridcell]);
419 if(l_solverId > -1) {
420 recalcIdsSolver[cellId] = l_solverId;
422 ASSERT(grid().solverFlag(m_recalcIds[gridcell], m_solverId),
"");
425 ASSERT(cellId == grid().noInternalCells(),
"recalc ids size is wrong");
428 MString gridFile = (m_currentGridFileName ==
"") ? grid().gridInputFileName() : m_currentGridFileName;
430 saveGridFlowVars(fileName.c_str(), gridFile.c_str(), noCells, noInternalCellIds, dbVariables, dbVariablesName, 0,
431 idVariables, idVariablesName, 0, dbParameters, dbParametersName, idParameters, idParametersName,
432 recalcIdsSolver.
begin(), -1);
436 stringstream backupFileName;
437 backupFileName.clear();
438 backupFileName.str(
"");
439 backupFileName << outputDir() <<
"restartFileBackup_" << solverId() <<
"_" <<
globalTimeStep;
440 backupFileName << ParallelIo::fileExt();
441 if(domainId() == 0) cerr <<
"Writing post data (backup) for solver " << solverId() <<
"... ";
443 saveGridFlowVars((backupFileName.str()).c_str(), gridFile.c_str(), noCells, noInternalCellIds, dbVariables,
444 dbVariablesName, 0, idVariables, idVariablesName, 0, dbParameters, dbParametersName, idParameters,
445 idParametersName, recalcIdsSolver.
begin(), -1);
449 if(domainId() == 0) cerr <<
"ok" << endl;
457 stringstream fileName;
458 fileName << restartDir() <<
"restartFile_" << solverId() <<
"_" <<
globalTimeStep << ParallelIo::fileExt();
460 if(domainId() == 0) {
461 cerr <<
"loading post data for solver " << solverId() <<
" at time step " <<
globalTimeStep <<
" ...";
464 vector<MString> name;
465 for(
MInt v = 0; v < noVariables(); v++) {
466 name.push_back(m_variablesName[v]);
469 m_log <<
"loading postprocessing variables ... ";
471 loadGridFlowVars((fileName.str()).c_str(), noVariables(), name);
473 m_log <<
"ok" << endl;
491 if(!isActive())
return;
495 if(parallelIo.hasAttribute(
MString(
"isMeanFile"))) {
497 ParallelIo::size_type dimLen = noInternalCells();
498 ParallelIo::size_type start = domainOffset(domainId()) - grid().bitOffset();
501 parallelIo.setOffset(dimLen, start);
503 vector<MString> var_names = parallelIo.getDatasetNames(1);
504 m_fileNoVars = var_names.size();
505 const MInt noCells = noInternalCells();
508 mAlloc(m_averagedVars, noCells, m_fileNoVars,
"m_averagedVars", AT_);
511 m_fileVarNames.clear();
512 for(
MInt varId = 0; varId < m_fileNoVars; varId++) {
514 if(parallelIo.hasAttribute(
"name", var_names[varId])) {
516 parallelIo.getAttribute(&varName,
"name", var_names[varId]);
517 m_fileVarNames.push_back(varName);
519 TERMM(1,
"Variable has no attribute 'name'.");
522 parallelIo.readArray(tmpVars.
begin(), var_names[varId]);
523 for(
MInt cellId = 0; cellId < noCells; cellId++) {
524 m_averagedVars[cellId][varId] = tmpVars[cellId];
527 TERMM_IF_COND(m_fileVarNames.size() > 0 && (
MInt)m_fileVarNames.size() != m_fileNoVars,
528 "Error: not every variable in '" +
MString(fileName) +
"' has the 'name' attribute.");
532 TERMM(1,
"FIXME try to load regular data file");
533 m_isMeanFile =
false;
549 stringstream variables;
552 ParallelIo parallelIo(fileName, PIO_READ, mpiComm());
555 ParallelIo::size_type dimLen = noInternalCells();
556 ParallelIo::size_type start = domainOffset(domainId()) - grid().bitOffset();
559 parallelIo.setOffset(dimLen, start);
561 for(
MInt vId = 0; vId < noVariables; vId++) {
567 parallelIo.readArray(tmpVar.
getPointer(),
"variables" + to_string(vId));
568 for(
MInt i = 0; i < (
MInt)dimLen; ++i) {
569 a_variable(i, vId) = tmpVar.
p[i];
578 if(!isActive())
return;
580 MInt offset = m_solutionOffset;
587 cerr <<
"solverId: " << m_solverId <<
", Writing " << m_outputFormat <<
" output at time step " <<
globalTimeStep
588 <<
", time " << m_time <<
" ... ";
590 m_log <<
"Writing " << m_outputFormat <<
" output at time step " <<
globalTimeStep <<
", time " << m_time
591 <<
" for postData ... ";
597 vector<MString> dbVariablesName;
598 vector<MString> idVariablesName;
599 vector<MString> dbParametersName;
600 vector<MString> idParametersName;
601 vector<MString> name;
603 stringstream fileName;
607 for(
MInt v = 0; v < noVariables(); v++) {
608 name.push_back(m_variablesName[v]);
611 this->collectVariables(&a_variable(0, 0), dbVariables, name, dbVariablesName, noVariables(), a_noCells());
613 this->collectParameters(
globalTimeStep, idParameters,
"globalTimeStep", idParametersName);
617 fileName << ParallelIo::fileExt();
621 saveGridFlowVars((fileName.str()).c_str(), grid().gridInputFileName().c_str(), a_noCells(), noInternalCells(),
622 dbVariables, dbVariablesName, 0, idVariables, idVariablesName, 0, dbParameters,
623 dbParametersName, idParameters, idParametersName, m_recalcIds, -1);
632 stringstream errorMessage;
633 errorMessage <<
"PostData::saveSolverSolution(): switch variable 'm_outputFormat' with value " << m_outputFormat
634 <<
" not matching any case." << endl;
635 mTerm(1, AT_, errorMessage.str());
639 if(domainId() == 0) cerr <<
"ok" << endl;
651 const MString namePrefix =
"s" + std::to_string(solverId()) +
"_";
653 const MFloat load = returnLoadRecord();
654 const MFloat idle = returnIdleRecord();
656 solverTimings.emplace_back(namePrefix +
"loadPostData", load);
657 solverTimings.emplace_back(namePrefix +
"idlePostData", idle);
673 const MInt noLsLoadTypes = 1;
675 return noLsLoadTypes;
688 names[0] =
"pp_cell";
693 if(noLoadTypes() != count) {
694 TERMM(1,
"Count does not match noLoadTypes.");
706 const MString namePrefix =
"s" + std::to_string(solverId()) +
"_";
709 const MInt noCells = c_noCells();
711 domainInfo.emplace_back(namePrefix +
"noPostCells", noCells);
723 const MInt noCellsGrid = grid().raw().treeb().size();
724 const MInt offset = noCellsGrid * solverId();
726 for(
MInt cellId = 0; cellId < c_noCells(); cellId++) {
727 const MInt gridCellId = grid().tree().solver2grid(cellId);
728 const MInt id = gridCellId + offset;
730 solverCellWeight[
id] = 0.2;
751 for(
MInt type = 0; type < noLoadTypes(); type++) {
752 loadQuantities[type] = 0;
755 loadQuantities[0] = c_noCells();
773 ASSERT(isActive(),
"solver is not active");
776 const MInt cellId = grid().tree().grid2solver(gridCellId);
781 if(cellId < 0 || cellId >= grid().noInternalCells()) {
782 TERMM(1,
"The given cell id is invalid.");
788 cellLoad = weights[0];
803 ASSERT(m_freeIndices.empty(),
"");
805 m_adaptationLevel = maxUniformRefinementLevel();
807 if(!isActive())
return;
816 std::vector<MFloat>& sensorWeight,
817 std::vector<std::bitset<64>>& sensorCellFlag,
818 std::vector<MInt>& sensorSolverId) {
821 const MInt sensorOffset = (signed)sensors.size();
822 ASSERT(sensorOffset == 0 || grid().raw().treeb().
noSolvers() > 1,
"");
823 sensors.resize(sensorOffset + this->m_noSensors, vector<MFloat>(grid().raw().m_noInternalCells, F0));
824 sensorWeight.resize(sensorOffset + this->m_noSensors, -1);
825 sensorCellFlag.resize(grid().raw().m_noInternalCells, sensorOffset + this->m_noSensors);
826 sensorSolverId.resize(sensorOffset + this->m_noSensors, solverId());
829 for(
MInt sen = 0; sen < this->m_noSensors; sen++) {
830 sensorWeight[sensorOffset + sen] = this->m_sensorWeight[sen];
833 ASSERT(m_freeIndices.empty(),
"");
834 m_freeIndices.clear();
836 if(!isActive())
return;
837 if(!this->m_adapts)
return;
839 if(domainId() == 0) {
840 cerr <<
"Setting " << this->m_noSensors <<
" sensors for post-Data adaptation." << endl;
843 for(
MInt sen = 0; sen < this->m_noSensors; sen++) {
844 (this->*(this->m_sensorFnPtr[sen]))(sensors, sensorCellFlag, sensorWeight, sensorOffset, sen);
858 this->compactCells();
859 m_freeIndices.clear();
861 grid().updateGridMap();
864 grid().updateOther();
866 updateDomainInfo(grid().domainId(), grid().noDomains(), grid().mpiComm(), AT_);
867 this->checkNoHaloLayers();
870 if(!isActive())
return;
872 copyGridProperties();
885 m_forceAdaptation =
false;
886 m_adaptationSinceLastRestart =
true;
897 const MInt solverCellId = grid().tree().grid2solver(gridCellId);
899 for(
MInt child = 0; child < grid().m_maxNoChilds; child++) {
900 const MInt childId = grid().raw().treeb().child(gridCellId, child);
901 if(childId == -1)
continue;
903 if(!grid().raw().a_hasProperty(childId, Cell::WasNewlyCreated)
904 && grid().raw().a_hasProperty(gridCellId, Cell::IsPartLvlAncestor)) {
908 if(!
g_multiSolverGrid) ASSERT(grid().raw().a_hasProperty(childId, Cell::WasNewlyCreated),
"");
911 if(!isActive()) ASSERT(grid().raw().a_isHalo(childId),
"");
913 if(!grid().solverFlag(childId, solverId()))
continue;
915 const MInt solverChildId = this->createCellId(childId);
919 for(
MInt v = 0; v < noVariables(); v++) {
920 a_variable(solverChildId, v) = a_variable(solverCellId, v);
925 for(
MInt v = 0; v < noVariables(); v++) {
926 if(std::isnan(a_variable(solverChildId, v))) {
927 cerr <<
"Invalid-value in refined-Cell! "
928 <<
" " << solverChildId <<
" in rank " << domainId() << endl;
941 ASSERT(grid().raw().a_isHalo(gridCellId),
"");
944 const MInt solverCellId = grid().tree().grid2solver(gridCellId);
946 ASSERT(solverCellId > -1 && solverCellId < m_cells.size(),
"solverCellId is: " << solverCellId);
950 for(
MInt c = 0; c < grid().m_maxNoChilds; c++) {
951 MInt childId = c_childId(solverCellId, c);
952 if(childId < 0)
continue;
953 this->removeCellId(childId);
957 ASSERT((grid().raw().treeb().size() - m_cells.size()) <= grid().m_maxNoChilds,
"");
970 ASSERT(grid().raw().a_isHalo(gridCellId),
"");
973 const MInt solverCellId = grid().tree().grid2solver(gridCellId);
975 ASSERT(gridCellId > -1 && gridCellId < grid().raw().treeb().size() && solverCellId > -1
976 && solverCellId < m_cells.size() && grid().tree().solver2grid(solverCellId) == gridCellId,
979 this->removeCellId(solverCellId);
985 grid().resizeGridMap(m_cells.size());
997 const MInt size = m_cells.size();
1000 m_cells.copy(cellId0, size);
1001 m_cells.copy(cellId1, cellId0);
1002 m_cells.copy(size, cellId1);
1003 m_cells.erase(size);
1014 grid().swapGridIds(cellId0, cellId1);
1028 std::ignore = coords;
1029 std::ignore = level;
1030 std::ignore = gridCellId;
1053 m_loadBalancingReinitStage = 0;
1061 if(!grid().isActive()) {
1063 updateDomainInfo(-1, -1, MPI_COMM_NULL, AT_);
1066 updateDomainInfo(grid().domainId(), grid().noDomains(), grid().mpiComm(), AT_);
1070 if(!grid().isActive()) {
1071 m_cells.reset(grid().maxNoCells());
1072 this->setHaloCellsOnInactiveRanks();
1077 m_cells.reset(grid().raw().treeb().capacity());
1079 setAndAllocateSolverData(
false);
1080 this->checkNoHaloLayers();
1090 m_loadBalancingReinitStage = 1;
1091 m_adaptationSinceLastRestart =
true;
1094 if(!grid().isActive())
return;
1096 m_loadBalancingReinitStage = 2;
1106 if(!grid().isActive())
return;
1108 m_loadBalancingReinitStage = -1;
1120 const MInt cellId = grid().tree().grid2solver(gridCellId);
1121 if(cellId < 0 || cellId >= noInternalCells()) {
1129 dataSize = noVariables();
1132 TERMM(1,
"Unknown data id.");
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
MBool mDeallocate(T *&a)
deallocates the memory previously allocated for element 'a'
MFloat getCellLoad(const MInt cellId, const MFloat *const weights) const override
Return the load of a single cell (given computational weights).
MInt cellDataSizeDlb(const MInt dataId, const MInt gridCellId) override
Return data size to be communicated during DLB for a grid cell and given data id.
void prepareAdaptation() override
prepare solver adaptation
void postAdaptation() override
reinit the solver after a single adaptation step
void finalizeInitSolver() override
void getDefaultWeights(MFloat *weights, std::vector< MString > &names) const
Return the default weights for all load quantities.
void refineCell(const MInt) override
MInt noLoadTypes() const override
Return the number of Ls load types.
void resizeGridMap() override
Swap the given cells.
void setCellWeights(MFloat *) override
sets the cell-weight for balancing and a restarting
typename CartesianSolver::GridProxy GridProxy
void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &domainInfo) override
Return decomposition information, i.e. number of local elements,...
void loadGridFlowVars(const MChar *fileName, MInt noVariables, std::vector< MString > name)
This function reads the parallel Netcdf cartesian grid cell based solution/restart file currently use...
void finalizeAdaptation() override
reinit the solver after the full adaptation loop!
void saveRestartFile(const MBool writeBackup)
std::vector< std::pair< MInt, MInt > > m_variableOffset
MBool prepareRestart(MBool, MBool &) override
Prepare the solvers for a grid-restart.
MInt cellOutside(const MFloat *, const MInt, const MInt) override
checks if a child lies outSide of the domain! necessary for refinement at the bndry!
void saveDataFile(const MBool writeBackup, const MString fileName, const MInt noVars, std::vector< MString > &variablesName, MFloat *variables)
const std::vector< MString > m_propertyName
void removeChilds(const MInt) override
Coarsen the given cell.
void balancePre() override
Reinitialize solver for DLB prior to setting solution data.
void finalizeBalance() override
Reinitialize solver after all data structures have been recreated.
void initSolver() override
void setSensors(std::vector< std::vector< MFloat > > &sensors, std::vector< MFloat > &sensorWeight, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MInt > &sensorSolverId) override
set the sensors for a single adaptation step
void getSolverTimings(std::vector< std::pair< MString, MFloat > > &solverTimings, const MBool) override
Get solver timings.
PostData(MInt, GridProxy &gridProxy_, Geom &geometry_, const MPI_Comm comm)
void removeCell(const MInt) override
Remove the given cell.
void swapCells(const MInt, const MInt) override
MString getVariableName(MInt offset)
void setAndAllocateSolverData(const MBool)
void resetSolver() override
Reset the solver prior to load balancing.
void saveSolverSolution(const MBool, const MBool)
typename maia::CartesianSolver< nDim, PostData > CartesianSolver
void reIntAfterRestart(MBool)
This function resets the grid-trigger after a restart that is handled by the grid-controller!
void copyGridProperties()
void loadMeanFile(const MString fileName)
load a file for averaging
void balancePost() override
Reinitialize solver for DLB after to setting solution data.
void writeRestartFile(const MBool, const MBool, const MString, MInt *) override
void swapProxy(const MInt cellId0, const MInt cellId1) override
void getLoadQuantities(MInt *const loadQuantities) const override
Return the cumulative load quantities on this domain.
This class is a ScratchSpace.
T * getPointer() const
Deprecated: use begin() instead!
pointer p
Deprecated: use [] instead!
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
void mTerm(const MInt errorCode, const MString &location, const MString &message)
std::basic_string< char > MString
Namespace for auxiliary functions/classes.
PARALLELIO_DEFAULT_BACKEND ParallelIo