Removed ternary operator in inline initialization.

This made the code rather hard to read. Now we do the initialization
in the constructor body if needed.
This commit is contained in:
Markus Blatt 2016-11-10 13:28:21 +01:00
parent 3eba3353d0
commit 747c93e898

View File

@ -338,20 +338,28 @@ namespace Opm
output_interval_( output_ ? param.getDefault("output_interval", 1): 0 ),
lastBackupReportStep_( -1 ),
phaseUsage_( phaseUsage ),
vtkWriter_( output_ && param.getDefault("output_vtk",false) ?
new BlackoilVTKWriter< Grid >( grid, outputDir_ ) : 0 ),
matlabWriter_( output_ && parallelOutput_->isIORank() &&
param.getDefault("output_matlab", false) ?
new BlackoilMatlabWriter< Grid >( grid, outputDir_ ) : 0 ),
eclWriter_( output_ && parallelOutput_->isIORank() &&
param.getDefault("output_ecl", true) ?
std::move(eclWriter)
: std::move(std::unique_ptr<EclipseWriter>()) ),
eclipseState_(eclipseState),
asyncOutput_()
{
// For output.
if (output_ && parallelOutput_->isIORank() ) {
if ( output_ )
{
if ( param.getDefault("output_vtk",false) )
{
vtkWriter_
.reset(new BlackoilVTKWriter< Grid >( grid, outputDir_ ));
}
if( parallelOutput_->isIORank() ) {
if ( param.getDefault("output_matlab", false ) )
{
matlabWriter_
.reset(new BlackoilMatlabWriter< Grid >( grid, outputDir_ ));
}
eclWriter_ = std::move(eclWriter);
// Ensure that output dir exists
boost::filesystem::path fpath(outputDir_);
try {
@ -384,6 +392,7 @@ namespace Opm
}
}
}
}
template <class Grid>