ParallelDebugOutput: fix initialization of wells for the I/O rank.

This commit is contained in:
Robert Kloefkorn 2015-09-21 14:05:35 +02:00
parent 04ec4eb2bf
commit 299b0aa3cf
4 changed files with 14 additions and 12 deletions

View File

@ -348,7 +348,7 @@ try
// create output writer after grid is distributed, otherwise the parallel output
// won't work correctly since we need to create a mapping from the distributed to
// the global view
Opm::BlackoilOutputWriter outputWriter(grid, param, eclipseState, pu );
Opm::BlackoilOutputWriter outputWriter(grid, param, eclipseState, pu, new_props.permeability() );
// Solver for Newton iterations.
std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver;

View File

@ -358,7 +358,7 @@ try
// create output writer after grid is distributed, otherwise the parallel output
// won't work correctly since we need to create a mapping from the distributed to
// the global view
Opm::BlackoilOutputWriter outputWriter(grid, param, eclipseState, pu );
Opm::BlackoilOutputWriter outputWriter(grid, param, eclipseState, pu, new_props.permeability() );
// Solver for Newton iterations.
std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver;

View File

@ -65,7 +65,8 @@ namespace Opm
public:
ParallelDebugOutput ( const GridImpl& grid,
Opm::EclipseStateConstPtr /* eclipseState */,
const int )
const int,
const double* )
: grid_( grid ) {}
// gather solution to rank 0 for EclipseWriter
@ -218,7 +219,8 @@ namespace Opm
ParallelDebugOutput( const Dune::CpGrid& otherGrid,
Opm::EclipseStateConstPtr eclipseState,
const int numPhases )
const int numPhases,
const double* permeability )
: toIORankComm_( otherGrid.comm() ),
isIORank_( otherGrid.comm().rank() == ioRank )
{
@ -236,7 +238,6 @@ namespace Opm
globalReservoirState_.init( globalGrid.numCells(), globalGrid.numFaces(), numPhases );
// TODO init well state
/*
// Create wells and well state.
WellsManager wells_manager(eclipseState,
0,
@ -246,12 +247,11 @@ namespace Opm
Opm::UgGridHelpers::dimensions( globalGrid ),
Opm::UgGridHelpers::cell2Faces( globalGrid ),
Opm::UgGridHelpers::beginFaceCentroids( globalGrid ),
0,
permeability,
false);
const Wells* wells = wells_manager.c_wells();
globalWellState_.init(wells, globalReservoirState_, globalWellState_ );
*/
// copy global cartesian index
globalIndex_ = globalGrid.globalCell();
@ -381,7 +381,7 @@ namespace Opm
}
// write all data from local well state to buffer
// writeWells( buffer );
writeWells( buffer );
}
void doUnpack( const IndexMapType& indexMap, MessageBufferType& buffer )
@ -403,7 +403,7 @@ namespace Opm
}
// read well data from buffer
// readWells( buffer );
readWells( buffer );
}
// unpack all data associated with link

View File

@ -200,7 +200,8 @@ namespace Opm
BlackoilOutputWriter(const Grid& grid,
const parameter::ParameterGroup& param,
Opm::EclipseStateConstPtr eclipseState,
const Opm::PhaseUsage &phaseUsage);
const Opm::PhaseUsage &phaseUsage,
const double* permeability );
/** \copydoc Opm::OutputWriter::writeInit */
void writeInit(const SimulatorTimerInterface &timer);
@ -251,9 +252,10 @@ namespace Opm
BlackoilOutputWriter(const Grid& grid,
const parameter::ParameterGroup& param,
Opm::EclipseStateConstPtr eclipseState,
const Opm::PhaseUsage &phaseUsage )
const Opm::PhaseUsage &phaseUsage,
const double* permeability )
: output_( param.getDefault("output", true) ),
parallelOutput_( output_ ? new ParallelDebugOutput< Grid >( grid, eclipseState, phaseUsage.num_phases ) : 0 ),
parallelOutput_( output_ ? new ParallelDebugOutput< Grid >( grid, eclipseState, phaseUsage.num_phases, permeability ) : 0 ),
outputDir_( output_ ? param.getDefault("output_dir", std::string("output")) : "." ),
output_interval_( output_ ? param.getDefault("output_interval", 1): 0 ),
lastBackupReportStep_( -1 ),