Merge pull request #2680 from joakim-hove/output-width

Ensure that normal keywords are not split on output
This commit is contained in:
Joakim Hove 2021-09-13 17:25:46 +02:00 committed by GitHub
commit 7ad1f360bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -42,7 +42,7 @@ namespace Opm {
void start_record( );
void end_record( );
void start_keyword(const std::string& kw);
void start_keyword(const std::string& kw, bool split_line);
void end_keyword(bool add_slash);
void endl();

View File

@ -292,7 +292,7 @@ namespace Opm {
}
void DeckKeyword::write_TITLE( DeckOutput& output ) const {
output.start_keyword( this->name( ) );
output.start_keyword( this->name( ), false );
{
const auto& record = this->getRecord(0);
output.write_string(" ");
@ -305,7 +305,11 @@ namespace Opm {
if (this->name() == "TITLE")
this->write_TITLE( output );
else {
output.start_keyword( this->name( ) );
bool split_line = this->isDataKeyword();
if (this->name() == "VFPPROD" || this->name() == "VFPINJ")
split_line = true;
output.start_keyword( this->name( ), split_line );
this->write_data( output );
output.end_keyword( this->m_slashTerminated );
}

View File

@ -104,11 +104,9 @@ namespace Opm {
}
void DeckOutput::start_keyword(const std::string& kw) {
void DeckOutput::start_keyword(const std::string& kw, bool split_line_arg) {
this->os << kw << std::endl;
this->split_line = true;
if (kw == "UDQ" || kw == "ACTIONX")
this->split_line = false;
this->split_line = split_line_arg;
}

View File

@ -563,7 +563,7 @@ ABC";
out.fmt.columns = 2;
out.fmt.keyword_sep = "ABC";
out.start_keyword("KEYWORD");
out.start_keyword("KEYWORD", true);
out.start_record();
out.write<int>(1);
out.write<int>(2);