mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added helper function for writing entries if not default
This commit is contained in:
@ -244,6 +244,23 @@ void Foam::fvPatchField<Type>::write(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
template<class EntryType>
|
||||
void Foam::fvPatchField<Type>::writeEntryIfDifferent
|
||||
(
|
||||
Ostream& os,
|
||||
const word& entryName,
|
||||
const EntryType& value1,
|
||||
const EntryType& value2
|
||||
) const
|
||||
{
|
||||
if (value1 != value2)
|
||||
{
|
||||
os.writeKeyword(entryName) << value2 << token::END_STATEMENT << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -414,8 +414,21 @@ public:
|
||||
virtual void manipulateMatrix(fvMatrix<Type>& matrix);
|
||||
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
// I-O
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
//- Helper function to write the keyword and entry only if the
|
||||
// values are not equal. The value is then output as value2
|
||||
template<class EntryType>
|
||||
void writeEntryIfDifferent
|
||||
(
|
||||
Ostream& os,
|
||||
const word& entryName,
|
||||
const EntryType& value1,
|
||||
const EntryType& value2
|
||||
) const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
Reference in New Issue
Block a user