mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects::volRegion: Cache integral properties for writeFileHeader
This commit is contained in:
@ -124,7 +124,7 @@ void Foam::functionObjects::writeFile::writeCommented
|
||||
) const
|
||||
{
|
||||
os << setw(1) << "#" << setw(1) << ' '
|
||||
<< setw(charWidth() - 2) << str.c_str();
|
||||
<< setf(ios_base::left) << setw(charWidth() - 2) << str.c_str();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ void Foam::functionObjects::writeFile::writeHeaderValue
|
||||
) const
|
||||
{
|
||||
os << setw(1) << '#' << setw(1) << ' '
|
||||
<< setw(charWidth() - 2) << setf(ios_base::left) << property.c_str()
|
||||
<< setf(ios_base::left) << setw(charWidth() - 2) << property.c_str()
|
||||
<< setw(1) << ':' << setw(1) << ' ' << value << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -60,10 +60,11 @@ void Foam::functionObjects::volRegion::writeFileHeader
|
||||
Ostream& file
|
||||
)
|
||||
{
|
||||
wf.writeCommented(file, "Region : ");
|
||||
file << regionTypeNames_[regionType_] << " " << regionName_ << endl;
|
||||
wf.writeHeaderValue(file, "Cells", nCells());
|
||||
wf.writeHeaderValue(file, "Volume", V());
|
||||
wf.writeCommented(file, "Region");
|
||||
file<< setw(1) << ':' << setw(1) << ' '
|
||||
<< regionTypeNames_[regionType_] << " " << regionName_ << endl;
|
||||
wf.writeHeaderValue(file, "Cells", nCells_);
|
||||
wf.writeHeaderValue(file, "Volume", V_);
|
||||
}
|
||||
|
||||
|
||||
@ -85,6 +86,10 @@ Foam::functionObjects::volRegion::volRegion
|
||||
regionID_(-1)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
// Cache integral properties of the region for writeFileHeader
|
||||
nCells_ = nCells();
|
||||
V_ = V();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -94,6 +94,10 @@ class volRegion
|
||||
|
||||
const fvMesh& mesh_;
|
||||
|
||||
// Cache integral properties of the region for writeFileHeader
|
||||
label nCells_;
|
||||
scalar V_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user