mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Enabled valueOutput for surfaces in fieldValues
This commit is contained in:
@ -31,6 +31,7 @@ License
|
||||
#include "sampledSurface.H"
|
||||
#include "mergePoints.H"
|
||||
#include "indirectPrimitivePatch.H"
|
||||
#include "PatchTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -224,7 +225,7 @@ void Foam::fieldValues::faceSource::sampledSurfaceFaces(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
void Foam::fieldValues::faceSource::combineSurfaceGeometry
|
||||
void Foam::fieldValues::faceSource::combineMeshGeometry
|
||||
(
|
||||
faceList& faces,
|
||||
pointField& points
|
||||
@ -345,6 +346,45 @@ void Foam::fieldValues::faceSource::combineSurfaceGeometry
|
||||
}
|
||||
|
||||
|
||||
void Foam::fieldValues::faceSource::combineSurfaceGeometry
|
||||
(
|
||||
faceList& faces,
|
||||
pointField& points
|
||||
) const
|
||||
{
|
||||
if (surfacePtr_.valid())
|
||||
{
|
||||
const sampledSurface& s = surfacePtr_();
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// dimension as fraction of mesh bounding box
|
||||
scalar mergeDim = 1e-10*mesh().bounds().mag();
|
||||
|
||||
labelList pointsMap;
|
||||
|
||||
PatchTools::gatherAndMerge
|
||||
(
|
||||
mergeDim,
|
||||
primitivePatch
|
||||
(
|
||||
SubList<face>(s.faces(), s.faces().size()),
|
||||
s.points()
|
||||
),
|
||||
points,
|
||||
faces,
|
||||
pointsMap
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
faces = s.faces();
|
||||
points = s.points();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
|
||||
|
||||
@ -204,7 +204,14 @@ private:
|
||||
//- Set faces according to sampledSurface
|
||||
void sampledSurfaceFaces(const dictionary&);
|
||||
|
||||
//- Combine faces and points from multiple processors
|
||||
//- Combine mesh faces and points from multiple processors
|
||||
void combineMeshGeometry
|
||||
(
|
||||
faceList& faces,
|
||||
pointField& points
|
||||
) const;
|
||||
|
||||
//- Combine surface faces and points from multiple processors
|
||||
void combineSurfaceGeometry
|
||||
(
|
||||
faceList& faces,
|
||||
|
||||
@ -259,7 +259,15 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
|
||||
{
|
||||
faceList faces;
|
||||
pointField points;
|
||||
|
||||
if (surfacePtr_.valid())
|
||||
{
|
||||
combineSurfaceGeometry(faces, points);
|
||||
}
|
||||
else
|
||||
{
|
||||
combineMeshGeometry(faces, points);
|
||||
}
|
||||
|
||||
fileName outputDir;
|
||||
if (Pstream::parRun())
|
||||
|
||||
Reference in New Issue
Block a user