mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-24 08:20:01 -06:00
Always allocate buffers when restarting
This commit is contained in:
parent
337f36bac1
commit
cf7c8552a5
@ -145,7 +145,7 @@ public:
|
||||
* \brief Allocate memory for the scalar fields we would like to
|
||||
* write to ECL output files
|
||||
*/
|
||||
void allocBuffers(unsigned bufferSize, unsigned reportStepNum, const bool substep, const bool log)
|
||||
void allocBuffers(unsigned bufferSize, unsigned reportStepNum, const bool substep, const bool log, const bool isRestart)
|
||||
{
|
||||
if (!std::is_same<Discretization, Opm::EcfvDiscretization<TypeTag> >::value)
|
||||
return;
|
||||
@ -219,8 +219,11 @@ public:
|
||||
// always allocate memory for temperature
|
||||
temperature_.resize(bufferSize, 0.0);
|
||||
|
||||
// Only provide restart on restart steps
|
||||
if (!restartConfig.getWriteRestartFile(reportStepNum, log) || substep)
|
||||
// field data should be allocated
|
||||
// 1) when we want to restart
|
||||
// 2) when it is ask for by the user via restartConfig
|
||||
// 3) when it is not a substep
|
||||
if (!isRestart && (!restartConfig.getWriteRestartFile(reportStepNum, log) || substep))
|
||||
return;
|
||||
|
||||
// always output saturation of active phases
|
||||
|
@ -251,7 +251,7 @@ public:
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
int numElements = gridView.size(/*codim=*/0);
|
||||
bool log = collectToIORank_.isIORank();
|
||||
eclOutputModule_.allocBuffers(numElements, reportStepNum, isSubStep, log);
|
||||
eclOutputModule_.allocBuffers(numElements, reportStepNum, isSubStep, log, /*isRestart*/ false);
|
||||
|
||||
ElementContext elemCtx(simulator_);
|
||||
ElementIterator elemIt = gridView.template begin</*codim=*/0>();
|
||||
@ -326,7 +326,7 @@ public:
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
int numElements = gridView.size(/*codim=*/0);
|
||||
bool log = collectToIORank_.isIORank();
|
||||
eclOutputModule_.allocBuffers(numElements, reportStepNum, isSubStep, log);
|
||||
eclOutputModule_.allocBuffers(numElements, reportStepNum, isSubStep, log, /*isRestart*/ false);
|
||||
|
||||
ElementContext elemCtx(simulator_);
|
||||
ElementIterator elemIt = gridView.template begin</*codim=*/0>();
|
||||
@ -419,7 +419,7 @@ public:
|
||||
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
unsigned numElements = gridView.size(/*codim=*/0);
|
||||
eclOutputModule_.allocBuffers(numElements, restartStepIdx, /*isSubStep=*/false, /*log=*/false);
|
||||
eclOutputModule_.allocBuffers(numElements, restartStepIdx, /*isSubStep=*/false, /*log=*/false, /*isRestart*/ true);
|
||||
|
||||
{
|
||||
Opm::SummaryState& summaryState = simulator_.vanguard().summaryState();
|
||||
|
Loading…
Reference in New Issue
Block a user