Newer
Older
file() << tab << totalArea_;
Henry Weller
committed
}
// Many operations use the Sf field
vectorField Sf;
if (usesSf())
{
if (regionType_ == stSurface)
{
const surfMesh& s = dynamicCast<const surfMesh>(obr());
Sf = s.Sf();
}
else if (surfacePtr_.valid())
{
Sf = surfacePtr_().Sf();
}
else
{
Andrew Heather
committed
Sf = filterField(mesh_.Sf());
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
}
}
// Faces and points for surface format (if specified)
faceList faces;
pointField points;
if (surfaceWriterPtr_.valid())
{
if (regionType_ == stSurface || surfacePtr_.valid())
{
combineSurfaceGeometry(faces, points);
}
else
{
combineMeshGeometry(faces, points);
}
}
meshedSurfRef surfToWrite(points, faces);
// Only a few weight types (scalar, vector)
Henry Weller
committed
if (weightFieldName_ != "none")
{
if (validField<scalar>(weightFieldName_))
{
scalarField weightField
Henry Weller
committed
(
Andrew Heather
committed
getFieldValues<scalar>(weightFieldName_, true)
Henry Weller
committed
);
// Process the fields
writeAll(Sf, weightField, surfToWrite);
}
else if (validField<vector>(weightFieldName_))
{
vectorField weightField
Andrew Heather
committed
getFieldValues<vector>(weightFieldName_, true)
// Process the fields
writeAll(Sf, weightField, surfToWrite);
}
else
FatalErrorInFunction
<< "weightField " << weightFieldName_
<< " not found or an unsupported type"
<< abort(FatalError);
Henry Weller
committed
}
else
{
// Default is a zero-size scalar weight field (ie, weight = 1)
scalarField weightField;
// Process the fields
writeAll(Sf, weightField, surfToWrite);
}
if (operation_ != opNone && Pstream::master())
Henry Weller
committed
{
file() << endl;
Henry Weller
committed
Log << endl;
return true;
}
// ************************************************************************* //