mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: regionSizeDistrubtion: optional coordinateSystem for vectorFields
This commit is contained in:
@ -368,6 +368,14 @@ void Foam::regionSizeDistribution::read(const dictionary& dict)
|
|||||||
|
|
||||||
word format(dict.lookup("setFormat"));
|
word format(dict.lookup("setFormat"));
|
||||||
formatterPtr_ = writer<scalar>::New(format);
|
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]];
|
const word& fldName = vectorNames[selected[i]];
|
||||||
Info<< "Vector field " << fldName << endl;
|
Info<< "Vector field " << fldName << endl;
|
||||||
|
|
||||||
const vectorField& fld = obr_.lookupObject
|
vectorField fld = obr_.lookupObject
|
||||||
<
|
<
|
||||||
volVectorField
|
volVectorField
|
||||||
>(fldName).internalField();
|
>(fldName).internalField();
|
||||||
|
|
||||||
|
if (coordSysPtr_.valid())
|
||||||
|
{
|
||||||
|
Info<< "Transforming vector field " << fldName
|
||||||
|
<< " with coordinate system "
|
||||||
|
<< coordSysPtr_().name()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
fld = coordSysPtr_().localVector(fld);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
|
|
||||||
|
|||||||
@ -69,6 +69,13 @@ Description
|
|||||||
maxDiameter 0.5e-4;
|
maxDiameter 0.5e-4;
|
||||||
minDiameter 0;
|
minDiameter 0;
|
||||||
setFormat gnuplot;
|
setFormat gnuplot;
|
||||||
|
coordinateSystem
|
||||||
|
{
|
||||||
|
type cartesian;
|
||||||
|
origin (0 0 0);
|
||||||
|
e3 (0 1 1);
|
||||||
|
e1 (1 0 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
@ -84,6 +91,7 @@ Description
|
|||||||
maxDiameter | maximum region equivalent diameter | yes |
|
maxDiameter | maximum region equivalent diameter | yes |
|
||||||
minDiameter | minimum region equivalent diameter | no | 0
|
minDiameter | minimum region equivalent diameter | no | 0
|
||||||
setFormat | writing format | yes |
|
setFormat | writing format | yes |
|
||||||
|
coordinateSystem | transformation for vector fields | no |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
SeeAlso
|
SeeAlso
|
||||||
@ -104,6 +112,7 @@ SourceFiles
|
|||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "wordReList.H"
|
#include "wordReList.H"
|
||||||
|
#include "coordinateSystem.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -159,6 +168,9 @@ class regionSizeDistribution
|
|||||||
//- Output formatter to write
|
//- Output formatter to write
|
||||||
autoPtr<writer<scalar> > formatterPtr_;
|
autoPtr<writer<scalar> > formatterPtr_;
|
||||||
|
|
||||||
|
//- Optional coordinate system
|
||||||
|
autoPtr<coordinateSystem> coordSysPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user