Commit aa965f66 authored by Henry's avatar Henry
Browse files

faceSource: Changed option to write faceSource area to 'writeArea'

parent 8b058bf9
......@@ -399,6 +399,8 @@ Foam::scalar Foam::fieldValues::faceSource::totalArea() const
void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
{
dict.lookup("sourceName") >> sourceName_;
switch (source_)
{
case stFaceZone:
......@@ -533,9 +535,9 @@ void Foam::fieldValues::faceSource::writeFileHeader(const label i)
file() << nFaces_ << endl;
writeCommented(file(), "Area : ");
file() << totalArea() << endl;
writeCommented(file(), "Time");
if (writeTotalArea_)
writeCommented(file(), "Time");
if (writeArea_)
{
file() << tab << "Area";
}
......@@ -639,13 +641,13 @@ Foam::fieldValues::faceSource::faceSource
:
fieldValue(name, obr, dict, typeName, loadFromFiles),
surfaceWriterPtr_(NULL),
writeTotalArea_(dict.lookupOrDefault("writeTotalArea", false)),
source_(sourceTypeNames_.read(dict.lookup("source"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
weightFieldName_("none"),
orientWeightField_(false),
orientedFieldsStart_(labelMax),
scaleFactor_(1.0),
writeArea_(dict.lookupOrDefault("writeArea", false)),
nFaces_(0),
faceId_(),
facePatchId_(),
......@@ -690,7 +692,7 @@ void Foam::fieldValues::faceSource::write()
file() << obr_.time().value();
}
if (writeTotalArea_)
if (writeArea_)
{
if (Pstream::master())
{
......
......@@ -66,6 +66,7 @@ Description
type | type name: faceSource | yes |
log | write data to standard output | no | no
valueOutput | write the output values | yes |
writeArea | Write the area of the faceSource | no |
surfaceFormat | output value format | no |
source | face source: see below | yes |
sourceName | name of face source if required | no |
......@@ -239,9 +240,6 @@ protected:
//- Surface writer
autoPtr<surfaceWriter> surfaceWriterPtr_;
//- Optionally write the totalArea
bool writeTotalArea_;
//- Source type
sourceType source_;
......@@ -260,6 +258,9 @@ protected:
//- Scale factor - optional
scalar scaleFactor_;
//- Optionally write the area of the faceSource
bool writeArea_;
//- Global number of faces
label nFaces_;
......
......@@ -354,7 +354,7 @@ bool Foam::fieldValues::faceSource::writeValues
file()<< tab << result;
Info(log_)<< " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") for " << fieldName
<< "(" << sourceName_ << ") of " << fieldName
<< " = " << result << endl;
}
}
......@@ -447,4 +447,3 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::filterField
// ************************************************************************* //
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment