Skip to content
Snippets Groups Projects
Commit c969be87 authored by mattijs's avatar mattijs
Browse files

ENH: regionSizeDistrubtion: optional coordinateSystem for vectorFields

parent 670476dd
No related merge requests found
......@@ -368,6 +368,14 @@ void Foam::regionSizeDistribution::read(const dictionary& dict)
word format(dict.lookup("setFormat"));
formatterPtr_ = writer<scalar>::New(format);
if (dict.found("coordinateSystem"))
{
coordSysPtr_.reset(new coordinateSystem(obr_, dict));
Info<< "Transforming all vectorFields with coordinate system "
<< coordSysPtr_().name() << endl;
}
}
}
......@@ -797,11 +805,21 @@ void Foam::regionSizeDistribution::write()
const word& fldName = vectorNames[selected[i]];
Info<< "Vector field " << fldName << endl;
const vectorField& fld = obr_.lookupObject
vectorField fld = obr_.lookupObject
<
volVectorField
>(fldName).internalField();
if (coordSysPtr_.valid())
{
Info<< "Transforming vector field " << fldName
<< " with coordinate system "
<< coordSysPtr_().name()
<< endl;
fld = coordSysPtr_().localVector(fld);
}
// Components
......
......@@ -69,6 +69,13 @@ Description
maxDiameter 0.5e-4;
minDiameter 0;
setFormat gnuplot;
coordinateSystem
{
type cartesian;
origin (0 0 0);
e3 (0 1 1);
e1 (1 0 0);
}
}
\endverbatim
......@@ -84,6 +91,7 @@ Description
maxDiameter | maximum region equivalent diameter | yes |
minDiameter | minimum region equivalent diameter | no | 0
setFormat | writing format | yes |
coordinateSystem | transformation for vector fields | no |
\endtable
SeeAlso
......@@ -104,6 +112,7 @@ SourceFiles
#include "Map.H"
#include "volFieldsFwd.H"
#include "wordReList.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -159,6 +168,9 @@ class regionSizeDistribution
//- Output formatter to write
autoPtr<writer<scalar> > formatterPtr_;
//- Optional coordinate system
autoPtr<coordinateSystem> coordSysPtr_;
// Private Member Functions
......
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