Some cleanup concerning spaces, const, simplified logic.

This commit is contained in:
Markus Blatt 2017-06-20 15:27:05 +02:00
parent e5b8cddfa8
commit 75561a0da7
2 changed files with 7 additions and 8 deletions

View File

@ -241,7 +241,7 @@ namespace Opm
// Throws std::runtime_error if failed to create (if requested) output dir.
void setupOutput()
{
std::string output = param_.getDefault("output", std::string("all"));
const std::string output = param_.getDefault("output", std::string("all"));
static std::map<std::string, FileOutputValue> string2OutputEnum =
{ {"none", OUTPUT_NONE },
{"false", OUTPUT_LOG_ONLY },
@ -255,7 +255,9 @@ namespace Opm
}
else
{
std::cerr<<"Value "<<output<<" passed to option output was invalid. Using \"all\" instead"<<std::endl;
std::cerr << "Value " << output <<
" passed to option output was invalid. Using \"all\" instead."
<< std::endl;
}
output_to_files_ = output_cout_ && output_ > OUTPUT_NONE;

View File

@ -340,12 +340,9 @@ namespace Opm
const Opm::PhaseUsage &phaseUsage)
: output_( [&param](){
// If output parameter is true or all, then we do output
std::string outputString = param.getDefault("output", std::string("all"));
if ( outputString == "all" || outputString == "true" )
{
return true;
}
return false;}()
const std::string outputString = param.getDefault("output", std::string("all"));
return ( outputString == "all" || outputString == "true" );
}()
),
parallelOutput_( output_ ? new ParallelDebugOutput< Grid >( grid, eclipseState, phaseUsage.num_phases, phaseUsage ) : 0 ),
outputDir_( eclipseState.getIOConfig().getOutputDir() ),