Merge branch 'feature-keep-sampled-pids' into 'develop'

Feature keep sampled pids

Rebased version of merge request !58, following ticket closure for issue #104 .

See merge request !75
This commit is contained in:
Mark Olesen
2016-11-09 14:58:42 +00:00
93 changed files with 1088 additions and 631 deletions

View File

@ -13,7 +13,6 @@ LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsurfMesh \
-lfileFormats \
-ltriSurface \
-llagrangian \
-ldynamicMesh \

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -193,6 +193,12 @@ public:
return facesPtr_;
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area vectors
virtual const vectorField& Sf() const
{
@ -212,6 +218,7 @@ public:
}
//- The underlying surface
const triSurface& surface() const
{
if (cell_)

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -199,6 +199,12 @@ public:
return facesPtr_;
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area magnitudes
virtual const vectorField& Sf() const
{

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -168,6 +168,12 @@ public:
return facesPtr_;
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area magnitudes
virtual const vectorField& Sf() const
{

View File

@ -333,7 +333,7 @@ const Foam::meshedSurface& Foam::ensightSurfaceReader::geometry()
Info<< "binary" << endl;
}
}
ensightReadFile is(baseDir_/meshFileName_, streamFormat_);
@ -343,7 +343,7 @@ const Foam::meshedSurface& Foam::ensightSurfaceReader::geometry()
}
readGeometryHeader(is);
label nPoints;
is.read(nPoints);

View File

@ -88,7 +88,7 @@ Foam::tmp<Foam::Field<Type> > Foam::ensightSurfaceReader::readField
const word indexStr = oss.str();
fieldFileName.replace(maskStr, indexStr);
ensightReadFile is(baseDir_/fieldFileName, streamFormat_);
if (!is.good())
@ -102,7 +102,7 @@ Foam::tmp<Foam::Field<Type> > Foam::ensightSurfaceReader::readField
// Check that data type is as expected
string primitiveType;
is.read(primitiveType);
if (debug)
{

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -182,6 +182,12 @@ public:
return facesPtr_;
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area magnitudes
virtual const vectorField& Sf() const
{

View File

@ -177,7 +177,13 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return MeshStorage::faces();
return MeshStorage::surfFaces();
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area vectors

View File

@ -137,7 +137,14 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return cuttingPlane::faces();
return cuttingPlane::surfFaces();
}
//- Const access to per-face zone/region information
// Could instead return meshCells or cellZoneId of the meshCells.
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area magnitudes

View File

@ -52,7 +52,7 @@ SourceFiles
#ifndef sampledSurface_H
#define sampledSurface_H
#include "pointField.H"
#include "meshedSurf.H"
#include "word.H"
#include "labelList.H"
#include "faceList.H"
@ -83,6 +83,8 @@ Ostream& operator<<(Ostream&, const sampledSurface&);
\*---------------------------------------------------------------------------*/
class sampledSurface
:
public meshedSurf
{
// Private data

View File

@ -66,26 +66,19 @@ void Foam::sampledSurfaces::writeGeometry() const
if (Pstream::parRun())
{
if (Pstream::master() && mergeList_[surfI].faces.size())
if (Pstream::master() && mergedList_[surfI].size())
{
formatter_->write
(
outputDir,
s.name(),
mergeList_[surfI].points,
mergeList_[surfI].faces
mergedList_[surfI]
);
}
}
else if (s.faces().size())
{
formatter_->write
(
outputDir,
s.name(),
s.points(),
s.faces()
);
formatter_->write(outputDir, s.name(), s);
}
}
}
@ -107,7 +100,7 @@ Foam::sampledSurfaces::sampledSurfaces
outputPath_(fileName::null),
fieldSelection_(),
interpolationScheme_(word::null),
mergeList_(),
mergedList_(),
formatter_(nullptr)
{
if (Pstream::parRun())
@ -138,7 +131,7 @@ Foam::sampledSurfaces::sampledSurfaces
outputPath_(fileName::null),
fieldSelection_(),
interpolationScheme_(word::null),
mergeList_(),
mergedList_(),
formatter_(nullptr)
{
read(dict);
@ -239,7 +232,7 @@ bool Foam::sampledSurfaces::read(const dictionary& dict)
if (Pstream::parRun())
{
mergeList_.setSize(size());
mergedList_.setSize(size());
}
// Ensure all surfaces and merge information are expired
@ -329,7 +322,7 @@ bool Foam::sampledSurfaces::expire()
// Clear merge information
if (Pstream::parRun())
{
mergeList_[surfI].clear();
mergedList_[surfI].clear();
}
}
@ -377,24 +370,8 @@ bool Foam::sampledSurfaces::update()
if (s.update())
{
updated = true;
mergedList_[surfI].merge(s, mergeDim);
}
else
{
continue;
}
PatchTools::gatherAndMerge
(
mergeDim,
primitivePatch
(
SubList<face>(s.faces(), s.faces().size()),
s.points()
),
mergeList_[surfI].points,
mergeList_[surfI].faces,
mergeList_[surfI].pointsMap
);
}
return updated;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,6 +40,7 @@ SourceFiles
#include "regionFunctionObject.H"
#include "sampledSurface.H"
#include "surfaceWriter.H"
#include "mergedSurf.H"
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
#include "wordReList.H"
@ -64,26 +65,6 @@ class sampledSurfaces
public functionObjects::regionFunctionObject,
public PtrList<sampledSurface>
{
// Private classes
//- Class used for surface merging information
class mergeInfo
{
public:
pointField points;
faceList faces;
labelList pointsMap;
//- Clear all storage
void clear()
{
points.clear();
faces.clear();
pointsMap.clear();
}
};
// Static data members
//- Output verbosity
@ -116,8 +97,8 @@ class sampledSurfaces
// surfaces
//- Information for merging surfaces
List<mergeInfo> mergeList_;
//- Merged meshed surfaces (parallel only)
List<mergedSurf> mergedList_;
// Calculated

View File

@ -65,22 +65,21 @@ void Foam::sampledSurfaces::writeSurface
);
// Renumber (point data) to correspond to merged points
if (mergeList_[surfI].pointsMap.size() == allValues.size())
if (mergedList_[surfI].pointsMap().size() == allValues.size())
{
inplaceReorder(mergeList_[surfI].pointsMap, allValues);
allValues.setSize(mergeList_[surfI].points.size());
inplaceReorder(mergedList_[surfI].pointsMap(), allValues);
allValues.setSize(mergedList_[surfI].points().size());
}
// Write to time directory under outputPath_
// skip surface without faces (eg, a failed cut-plane)
if (mergeList_[surfI].faces.size())
if (mergedList_[surfI].size())
{
sampleFile = formatter_->write
(
outputDir,
s.name(),
mergeList_[surfI].points,
mergeList_[surfI].faces,
mergedList_[surfI],
fieldName,
allValues,
s.interpolate()
@ -106,8 +105,7 @@ void Foam::sampledSurfaces::writeSurface
(
outputDir,
s.name(),
s.points(),
s.faces(),
s,
fieldName,
values,
s.interpolate()

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -305,16 +305,21 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
// Create faces and points for subsetted surface
faceList& faces = this->storedFaces();
faces.setSize(faceMap.size());
labelList& zoneIds = this->storedZoneIds();
zoneIds.setSize(faceMap.size());
forAll(faceMap, i)
{
const triFace& f = s[faceMap[i]];
const labelledTri& f = s[faceMap[i]];
triFace newF
(
reversePointMap[f[0]],
reversePointMap[f[1]],
reversePointMap[f[2]]
);
faces[i] = newF.triFaceFace();
faces[i] = newF.triFaceFace();
zoneIds[i] = f.region(); // preserve zone information
forAll(newF, fp)
{
@ -773,9 +778,10 @@ Foam::tmp<Foam::tensorField> Foam::sampledTriSurfaceMesh::interpolate
void Foam::sampledTriSurfaceMesh::print(Ostream& os) const
{
os << "sampledTriSurfaceMesh: " << name() << " :"
<< " surface:" << surface_.objectRegistry::name()
<< " faces:" << faces().size()
<< " points:" << points().size();
<< " surface:" << surface_.objectRegistry::name()
<< " faces:" << faces().size()
<< " points:" << points().size()
<< " zoneids:" << zoneIds().size();
}

View File

@ -87,7 +87,7 @@ class meshSearch;
class sampledTriSurfaceMesh
:
public sampledSurface,
public MeshedSurface<face>
public UnsortedMeshedSurface<face>
{
public:
//- Types of communications
@ -101,7 +101,7 @@ public:
private:
//- Private typedefs for convenience
typedef MeshedSurface<face> MeshStorage;
typedef UnsortedMeshedSurface<face> MeshStorage;
// Private data
@ -213,7 +213,13 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return MeshStorage::faces();
return MeshStorage::surfFaces();
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return MeshStorage::zoneIds();
}
//- Face area vectors

View File

@ -145,7 +145,13 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return MeshStorage::faces();
return MeshStorage::surfFaces();
}
//- Const access to per-face zone/region information
virtual const labelList& zoneIds() const
{
return Foam::emptyLabelList;
}
//- Face area vectors (normals)

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -53,14 +53,14 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
const fileName baseDir(outputDir.path()/surfaceName);
const fileName timeName(outputDir.name());
const pointField& points = surf.points();
// Construct dummy time to use as an objectRegistry
const fileName caseDir(getEnv("FOAM_CASE"));
@ -110,6 +110,8 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::write
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// create write methods
defineSurfaceWriterWriteFields(Foam::boundaryDataSurfaceWriter);

View File

@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -98,8 +98,7 @@ class boundaryDataSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -130,10 +129,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
@ -142,13 +140,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -156,13 +153,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -170,13 +166,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -184,13 +179,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -198,13 +192,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -37,8 +37,7 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -48,6 +47,9 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::writeTemplate
const fileName baseDir(outputDir.path()/surfaceName);
const fileName timeName(outputDir.name());
const pointField& points = surf.points();
const faceList& faces = surf.faces();
// Construct dummy time to use as an objectRegistry
const fileName caseDir(getEnv("FOAM_CASE"));

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,10 +39,12 @@ namespace Foam
void Foam::dxSurfaceWriter::writeGeometry
(
Ostream& os,
const pointField& points,
const faceList& faces
const meshedSurf& surf
)
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
// Write vertex coordinates
os << "# The irregular positions" << nl

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -53,7 +53,7 @@ class dxSurfaceWriter
// Private Member Functions
static void writeGeometry(Ostream&, const pointField&, const faceList&);
static void writeGeometry(Ostream&, const meshedSurf&);
static void writeTrailer(Ostream&, const bool isNodeValues);
template<class Type>
@ -65,8 +65,7 @@ class dxSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -98,13 +97,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -112,13 +110,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -126,13 +123,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -140,13 +136,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -154,13 +149,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,8 +50,7 @@ Foam::fileName Foam::dxSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -70,7 +69,7 @@ Foam::fileName Foam::dxSurfaceWriter::writeTemplate
Info<< "Writing field " << fieldName << " to " << os.name() << endl;
}
writeGeometry(os, points, faces);
writeGeometry(os, surf);
writeData(os, values);
writeTrailer(os, isNodeValues);

View File

@ -84,11 +84,12 @@ Foam::fileName Foam::ensightSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
const ensight::FileName surfName(surfaceName);
if (!isDir(outputDir))

View File

@ -67,8 +67,7 @@ class ensightSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -81,8 +80,7 @@ class ensightSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -95,8 +93,7 @@ class ensightSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -135,10 +132,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
@ -147,13 +143,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -161,13 +156,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -175,13 +169,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -189,13 +182,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -203,13 +195,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -40,8 +40,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeUncollated
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -117,7 +116,14 @@ Foam::fileName Foam::ensightSurfaceWriter::writeUncollated
<< " " << timeValue
<< nl << nl << "# end" << nl;
ensightPartFaces ensPart(0, osGeom.name().name(), points, faces, true);
ensightPartFaces ensPart
(
0,
osGeom.name().name(),
surf.points(),
surf.faces(),
true // contiguous points
);
osGeom << ensPart;
// Write field
@ -139,8 +145,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -310,7 +315,14 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
// Write geometry
ensightPartFaces ensPart(0, meshFile.name(), points, faces, true);
ensightPartFaces ensPart
(
0,
meshFile.name(),
surf.points(),
surf.faces(),
true // contiguous points
);
if (!exists(meshFile))
{
if (verbose)
@ -377,8 +389,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -391,8 +402,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeTemplate
(
outputDir,
surfaceName,
points,
faces,
surf,
fieldName,
values,
isNodeValues,
@ -405,8 +415,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeTemplate
(
outputDir,
surfaceName,
points,
faces,
surf,
fieldName,
values,
isNodeValues,

View File

@ -24,10 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "foamSurfaceWriter.H"
#include "OFstream.H"
#include "OSspecific.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -58,11 +55,13 @@ Foam::fileName Foam::foamSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
fileName surfaceDir(outputDir/surfaceName);
if (!isDir(surfaceDir))

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,7 +43,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class foamSurfaceWriter Declaration
Class foamSurfaceWriter Declaration
\*---------------------------------------------------------------------------*/
class foamSurfaceWriter
@ -58,8 +58,7 @@ class foamSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -97,10 +96,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
@ -109,13 +107,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -123,13 +120,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -137,13 +133,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -151,13 +146,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -165,13 +159,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -33,8 +33,7 @@ Foam::fileName Foam::foamSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,20 +51,18 @@ namespace Foam
( \
const fileName& outputDir, \
const fileName& surfaceName, \
const pointField& points, \
const faceList& faces, \
const meshedSurf& surf, \
const word& fieldName, \
const Field<FieldType>& values, \
const bool isNodeValues, \
const bool verbose \
) const \
{ \
return writeTemplate \
return writeTemplate \
( \
outputDir, \
surfaceName, \
points, \
faces, \
surf, \
fieldName, \
values, \
isNodeValues, \

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -25,7 +25,8 @@ License
#include "nastranSurfaceWriter.H"
#include "IOmanip.H"
#include "Tuple2.H"
#include "Pair.H"
#include "HashSet.H"
#include "makeSurfaceWriterMethods.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -64,7 +65,7 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::nastranSurfaceWriter::formatOS(OFstream& os) const
void Foam::nastranSurfaceWriter::formatOS(Ostream& os) const
{
os.setf(ios_base::scientific);
@ -75,19 +76,23 @@ void Foam::nastranSurfaceWriter::formatOS(OFstream& os) const
label offset = 7;
switch (writeFormat_)
{
case (wfShort):
case wfShort:
{
prec = 8 - offset;
break;
}
case (wfFree):
case (wfLong):
case wfFree:
case wfLong:
{
prec = 16 - offset;
break;
}
default:
{
FatalErrorInFunction
<< "Unknown writeFormat enumeration" << abort(FatalError);
}
}
@ -95,10 +100,10 @@ void Foam::nastranSurfaceWriter::formatOS(OFstream& os) const
}
void Foam::nastranSurfaceWriter::writeKeyword
Foam::Ostream& Foam::nastranSurfaceWriter::writeKeyword
(
const word& keyword,
Ostream& os
Ostream& os,
const word& keyword
) const
{
os.setf(ios_base::left);
@ -110,11 +115,13 @@ void Foam::nastranSurfaceWriter::writeKeyword
os << setw(8) << keyword;
break;
}
case wfLong:
{
os << setw(8) << word(keyword + '*');
break;
}
case wfFree:
{
os << keyword;
@ -123,14 +130,16 @@ void Foam::nastranSurfaceWriter::writeKeyword
}
os.unsetf(ios_base::left);
return os;
}
void Foam::nastranSurfaceWriter::writeCoord
(
Ostream& os,
const point& p,
const label pointi,
OFstream& os
const label pointI
) const
{
// Fixed short/long formats:
@ -144,21 +153,14 @@ void Foam::nastranSurfaceWriter::writeCoord
// 8 PS : single point constraints (blank)
// 9 SEID : super-element ID
writeKeyword("GRID", os);
os << separator_;
writeKeyword(os, "GRID") << separator_;
os.setf(ios_base::right);
writeValue(pointi + 1, os);
os << separator_;
writeValue("", os);
os << separator_;
writeValue(p.x(), os);
os << separator_;
writeValue(p.y(), os);
os << separator_;
writeValue(os, pointI+1) << separator_;
writeValue(os, "") << separator_;
writeValue(os, p.x()) << separator_;
writeValue(os, p.y()) << separator_;
switch (writeFormat_)
{
@ -167,27 +169,26 @@ void Foam::nastranSurfaceWriter::writeCoord
os << setw(8) << p.z()
<< nl;
os.unsetf(ios_base::right);
break;
}
case wfLong:
{
os << nl;
os.unsetf(ios_base::right);
writeKeyword("", os);
writeKeyword(os, "");
os.setf(ios_base::right);
writeValue(p.z(), os);
os << nl;
writeValue(os, p.z()) << nl;
break;
}
case wfFree:
{
writeValue(p.z(), os);
os << nl;
writeValue(os, p.z()) << nl;
break;
}
default:
{
FatalErrorInFunction
@ -201,10 +202,11 @@ void Foam::nastranSurfaceWriter::writeCoord
void Foam::nastranSurfaceWriter::writeFace
(
Ostream& os,
const word& faceType,
const labelList& facePts,
label& nFace,
OFstream& os
const labelUList& facePts,
const label nFace,
const label PID
) const
{
// Only valid surface elements are CTRIA3 and CQUAD4
@ -221,19 +223,12 @@ void Foam::nastranSurfaceWriter::writeFace
// For CTRIA3 elements, cols 7 onwards are not used
label PID = 1;
writeKeyword(faceType, os);
os << separator_;
writeKeyword(os, faceType) << separator_;
os.setf(ios_base::right);
writeValue(nFace++, os);
os << separator_;
writeValue(PID, os);
writeValue(os, nFace) << separator_;
writeValue(os, PID);
switch (writeFormat_)
{
@ -241,7 +236,7 @@ void Foam::nastranSurfaceWriter::writeFace
{
forAll(facePts, i)
{
writeValue(facePts[i] + 1, os);
writeValue(os, facePts[i] + 1);
}
break;
@ -250,12 +245,12 @@ void Foam::nastranSurfaceWriter::writeFace
{
forAll(facePts, i)
{
writeValue(facePts[i] + 1, os);
writeValue(os, facePts[i] + 1);
if (i == 1)
{
os << nl;
os.unsetf(ios_base::right);
writeKeyword("", os);
writeKeyword(os, "");
os.setf(ios_base::right);
}
}
@ -267,7 +262,7 @@ void Foam::nastranSurfaceWriter::writeFace
forAll(facePts, i)
{
os << separator_;
writeValue(facePts[i] + 1, os);
writeValue(os, facePts[i] + 1);
}
break;
@ -286,12 +281,15 @@ void Foam::nastranSurfaceWriter::writeFace
void Foam::nastranSurfaceWriter::writeGeometry
(
const pointField& points,
const faceList& faces,
List<DynamicList<face>>& decomposedFaces,
OFstream& os
Ostream& os,
const meshedSurf& surf,
List<DynamicList<face>>& decomposedFaces
) const
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
const labelList& zones = surf.zoneIds();
// Write points
os << "$" << nl
@ -300,31 +298,33 @@ void Foam::nastranSurfaceWriter::writeGeometry
forAll(points, pointi)
{
writeCoord(points[pointi], pointi, os);
writeCoord(os, points[pointi], pointi);
}
// Write faces
decomposedFaces.clear();
decomposedFaces.setSize(faces.size());
os << "$" << nl
<< "$ Faces" << nl
<< "$" << nl;
label nFace = 1;
label nFace = 0; // the element-id
forAll(faces, facei)
{
const face& f = faces[facei];
// 1-offset for PID
const label PID = 1 + (facei < zones.size() ? zones[facei] : 0);
if (f.size() == 3)
{
writeFace("CTRIA3", faces[facei], nFace, os);
decomposedFaces[facei].append(faces[facei]);
writeFace(os, "CTRIA3", f, ++nFace, PID);
decomposedFaces[facei].append(f);
}
else if (f.size() == 4)
{
writeFace("CQUAD4", faces[facei], nFace, os);
decomposedFaces[facei].append(faces[facei]);
writeFace(os, "CQUAD4", f, ++nFace, PID);
decomposedFaces[facei].append(f);
}
else
{
@ -335,7 +335,7 @@ void Foam::nastranSurfaceWriter::writeGeometry
forAll(triFaces, trii)
{
writeFace("CTRIA3", triFaces[trii], nFace, os);
writeFace(os, "CTRIA3", triFaces[trii], ++nFace, PID);
decomposedFaces[facei].append(triFaces[trii]);
}
}
@ -343,39 +343,51 @@ void Foam::nastranSurfaceWriter::writeGeometry
}
void Foam::nastranSurfaceWriter::writeFooter(Ostream& os) const
Foam::Ostream& Foam::nastranSurfaceWriter::writeFooter
(
Ostream& os,
const meshedSurf& surf
) const
{
label PID = 1;
// zone id have been used for the PID. Find unique values.
writeKeyword("PSHELL", os);
os << separator_;
writeValue(PID, os);
for (label i = 0; i < 7; i++)
labelList pidsUsed = labelHashSet(surf.zoneIds()).sortedToc();
if (pidsUsed.empty())
{
// Dummy values
os << separator_;
writeValue(1, os);
pidsUsed.setSize(1, Zero); // fallback
}
os << nl;
writeKeyword("MAT1", os);
os << separator_;
for (auto pid : pidsUsed)
{
writeKeyword(os, "PSHELL") << separator_;
writeValue(os, pid+1); // 1-offset for PID
for (label i = 0; i < 7; ++i)
{
// Dummy values
os << separator_;
writeValue(os, 1);
}
os << nl;
}
// use single material ID
label MID = 1;
writeValue(MID, os);
writeKeyword(os, "MAT1") << separator_;
writeValue(os, MID);
for (label i = 0; i < 7; i++)
for (label i = 0; i < 7; ++i)
{
// Dummy values
os << separator_;
writeValue("", os);
writeValue(os, "");
}
os << nl;
return os;
}
@ -400,7 +412,10 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
{
if (options.found("format"))
{
writeFormat_ = writeFormatNames_.read(options.lookup("format"));
writeFormat_ = writeFormatNames_.read
(
options.lookup("format")
);
}
if (writeFormat_ == wfFree)
@ -408,7 +423,7 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
separator_ = ",";
}
List<Tuple2<word, word>> fieldSet(options.lookup("fields"));
List<Pair<word>> fieldSet(options.lookup("fields"));
forAll(fieldSet, i)
{
@ -431,8 +446,7 @@ Foam::fileName Foam::nastranSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
@ -449,22 +463,16 @@ Foam::fileName Foam::nastranSurfaceWriter::write
Info<< "Writing nastran file to " << os.name() << endl;
}
os << "TITLE=OpenFOAM " << surfaceName.c_str() << " mesh" << nl
os << "TITLE=OpenFOAM " << surfaceName.c_str()
<< " mesh" << nl
<< "$" << nl
<< "BEGIN BULK" << nl;
List<DynamicList<face>> decomposedFaces(faces.size());
List<DynamicList<face>> decomposedFaces;
writeGeometry(os, surf, decomposedFaces);
writeGeometry(points, faces, decomposedFaces, os);
if (!isDir(outputDir))
{
mkDir(outputDir);
}
writeFooter(os);
os << "ENDDATA" << endl;
writeFooter(os, surf)
<< "ENDDATA" << endl;
return os.name();
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,6 +27,7 @@ Class
Description
A surface writer for the Nastran file format - both surface mesh and fields
\verbatim
formatOptions
{
nastran
@ -43,6 +44,7 @@ Description
format free; //short, long, free
}
};
\endverbatim
SourceFiles
nastranSurfaceWriter.C
@ -80,26 +82,25 @@ public:
wfFree
};
static const NamedEnum<writeFormat, 3> writeFormatNames_;
enum dataFormat
{
dfPLOAD2,
dfPLOAD4
};
static const NamedEnum<dataFormat, 2> dataFormatNames_;
private:
// Private data
static const NamedEnum<writeFormat, 3> writeFormatNames_;
static const NamedEnum<dataFormat, 2> dataFormatNames_;
//- Write option
writeFormat writeFormat_;
//- Mapping from field name to data format enumeration
HashTable<dataFormat, word> fieldMap_;
HashTable<dataFormat> fieldMap_;
//- Scale to apply to values (default = 1.0)
scalar scale_;
@ -110,71 +111,67 @@ private:
// Private Member Functions
//- Initialise the output stream format params
void formatOS(OFstream& os) const;
//- Initialise the output stream format parameters
void formatOS(Ostream& os) const;
//- Write a co-ordinate
//- Write a coordinate
void writeCoord
(
Ostream& os,
const point& p,
const label pointi,
OFstream& os
const label pointI //!< 0-based Point Id
) const;
//- Write a face element (CTRIA3 or CQUAD4)
void writeFace
(
Ostream& os,
const word& faceType,
const labelList& facePts,
label& nFace,
OFstream& os
const labelUList& facePts,
const label EID, //!< 1-based Element Id
const label PID //!< 1-based Property Id
) const;
//- Main driver to write the surface mesh geometry
void writeGeometry
(
const pointField& points,
const faceList& faces,
List<DynamicList<face>>& decomposedFaces,
OFstream& os
Ostream& os,
const meshedSurf& surf,
List<DynamicList<face>>& decomposedFaces
) const;
//- Write the formatted keyword to the output stream
void writeKeyword
Ostream& writeKeyword
(
const word& keyword,
Ostream& os
Ostream& os,
const word& keyword
) const;
//- Write the footer information
void writeFooter(Ostream& os) const;
Ostream& writeFooter(Ostream& os, const meshedSurf& surf) const;
//- Write a formatted value to the output stream
template<class Type>
void writeValue
(
const Type& value,
Ostream& os
) const;
Ostream& writeValue(Ostream& os, const Type& value) const;
//- Write a face-based value
template<class Type>
void writeFaceValue
Ostream& writeFaceValue
(
Ostream& os,
const dataFormat& format,
const Type& value,
const label EID,
Ostream& os
const label EID //!< 1-based Element Id
) const;
//- Templated write operation
template<class Type>
fileName writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -215,10 +212,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -226,13 +222,12 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -240,13 +235,12 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -254,13 +248,12 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -268,13 +261,12 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -282,13 +274,12 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,10 +30,10 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::nastranSurfaceWriter::writeValue
Foam::Ostream& Foam::nastranSurfaceWriter::writeValue
(
const Type& value,
Ostream& os
Ostream& os,
const Type& value
) const
{
switch (writeFormat_)
@ -54,16 +54,18 @@ void Foam::nastranSurfaceWriter::writeValue
break;
}
}
return os;
}
template<class Type>
void Foam::nastranSurfaceWriter::writeFaceValue
Foam::Ostream& Foam::nastranSurfaceWriter::writeFaceValue
(
Ostream& os,
const dataFormat& format,
const Type& value,
const label EID,
Ostream& os
const label EID
) const
{
// Fixed short/long formats supporting PLOAD2 and PLOAD4:
@ -84,16 +86,13 @@ void Foam::nastranSurfaceWriter::writeFaceValue
Type scaledValue = scale_*value;
// Write Keyword
writeKeyword(dataFormatNames_[format], os);
os << separator_;
// Write keyword
writeKeyword(os, dataFormatNames_[format]) << separator_;
// Write load set ID
os.setf(ios_base::right);
writeValue(SID, os);
os << separator_;
writeValue(os, SID) << separator_;
switch (format)
{
@ -101,7 +100,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
{
if (pTraits<Type>::nComponents == 1)
{
writeValue(scaledValue, os);
writeValue(os, scaledValue) << separator_;
}
else
{
@ -110,25 +109,25 @@ void Foam::nastranSurfaceWriter::writeFaceValue
<< "and cannot be used for higher rank values"
<< endl;
writeValue(scalar(0), os);
writeValue(os, scalar(0)) << separator_;
}
os << separator_;
writeValue(EID, os);
writeValue(os, EID);
break;
}
case dfPLOAD4:
{
writeValue(EID, os);
writeValue(os, EID);
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; ++dirI)
{
os << separator_;
writeValue(component(scaledValue, dirI), os);
writeValue(os, component(scaledValue, dirI));
}
break;
}
default:
{
FatalErrorInFunction
@ -140,6 +139,8 @@ void Foam::nastranSurfaceWriter::writeFaceValue
os.unsetf(ios_base::right);
os << nl;
return os;
}
@ -148,8 +149,7 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -185,17 +185,15 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
Info<< "Writing nastran file to " << os.name() << endl;
}
os << "TITLE=OpenFOAM " << surfaceName.c_str() << " " << fieldName
<< " data" << nl
os << "TITLE=OpenFOAM " << surfaceName.c_str()
<< " " << fieldName << " data" << nl
<< "$" << nl
<< "TIME " << timeValue << nl
<< "$" << nl
<< "BEGIN BULK" << nl;
List<DynamicList<face>> decomposedFaces(faces.size());
writeGeometry(points, faces, decomposedFaces, os);
List<DynamicList<face>> decomposedFaces;
writeGeometry(os, surf, decomposedFaces);
os << "$" << nl
<< "$ Field data" << nl
@ -203,7 +201,7 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
if (isNodeValues)
{
label n = 0;
label elemId = 0;
forAll(decomposedFaces, i)
{
@ -219,28 +217,26 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
}
v /= f.size();
writeFaceValue(format, v, ++n, os);
writeFaceValue(os, format, v, ++elemId);
}
}
}
else
{
label n = 0;
label elemId = 0;
forAll(decomposedFaces, i)
{
const DynamicList<face>& dFaces = decomposedFaces[i];
forAll(dFaces, facei)
{
writeFaceValue(format, values[facei], ++n, os);
writeFaceValue(os, format, values[facei], ++elemId);
}
}
}
writeFooter(os);
os << "ENDDATA" << endl;
writeFooter(os, surf)
<< "ENDDATA" << endl;
return os.name();
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,8 +60,7 @@ Foam::fileName Foam::proxySurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
@ -83,7 +82,7 @@ Foam::fileName Foam::proxySurfaceWriter::write
Info<< "Writing geometry to " << outName << endl;
}
MeshedSurfaceProxy<face>(points, faces).write(outName);
MeshedSurfaceProxy<face>(surf.points(), surf.faces()).write(outName);
return outName;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -89,10 +89,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,11 +40,9 @@ namespace Foam
inline void Foam::rawSurfaceWriter::writeLocation
(
Ostream& os,
const pointField& points,
const label pointi
const point& pt
)
{
const point& pt = points[pointi];
os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << ' ';
}
@ -53,12 +51,10 @@ inline void Foam::rawSurfaceWriter::writeLocation
(
Ostream& os,
const pointField& points,
const faceList& faces,
const label facei
const face& f
)
{
const point& ct = faces[facei].centre(points);
os << ct.x() << ' ' << ct.y() << ' ' << ct.z() << ' ';
writeLocation(os, f.centre(points));
}
@ -238,11 +234,13 @@ Foam::fileName Foam::rawSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
if (!isDir(outputDir))
{
mkDir(outputDir);
@ -269,7 +267,7 @@ Foam::fileName Foam::rawSurfaceWriter::write
// Write faces centres
forAll(faces, elemI)
{
writeLocation(os, points, faces, elemI);
writeLocation(os, points, faces[elemI]);
os << nl;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -59,19 +59,13 @@ class rawSurfaceWriter
// Private Member Functions
static inline void writeLocation
(
Ostream&,
const pointField&,
const label pointi
);
static inline void writeLocation(Ostream&, const point&);
static inline void writeLocation
(
Ostream&,
const pointField&,
const faceList&,
const label facei
const face&
);
template<class Type>
@ -92,8 +86,7 @@ class rawSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -127,10 +120,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
@ -139,13 +131,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -153,13 +144,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -167,13 +157,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -181,13 +170,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -195,13 +183,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,14 +34,16 @@ Foam::fileName Foam::rawSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
const bool verbose
) const
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
if (!isDir(outputDir))
{
mkDir(outputDir);
@ -73,7 +75,7 @@ Foam::fileName Foam::rawSurfaceWriter::writeTemplate
{
forAll(values, elemI)
{
writeLocation(os, points, elemI);
writeLocation(os, points[elemI]);
writeData(os, values[elemI]);
}
}
@ -81,7 +83,7 @@ Foam::fileName Foam::rawSurfaceWriter::writeTemplate
{
forAll(values, elemI)
{
writeLocation(os, points, faces, elemI);
writeLocation(os, points, faces[elemI]);
writeData(os, values[elemI]);
}
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -94,8 +94,7 @@ Foam::fileName Foam::starcdSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
@ -111,7 +110,7 @@ Foam::fileName Foam::starcdSurfaceWriter::write
Info<< "Writing geometry to " << outName << endl;
}
MeshedSurfaceProxy<face>(points, faces).write(outName);
MeshedSurfaceProxy<face>(surf.points(), surf.faces()).write(outName);
return outName;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -81,8 +81,7 @@ class starcdSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -119,11 +118,10 @@ public:
virtual fileName write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const fileName& surfaceName, // name of surface
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -131,13 +129,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -145,13 +142,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -159,13 +155,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,8 +42,7 @@ Foam::fileName Foam::starcdSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf&,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -37,10 +37,8 @@ SourceFiles
#include "typeInfo.H"
#include "autoPtr.H"
#include "pointField.H"
#include "faceList.H"
#include "fileName.H"
#include "meshedSurfRef.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -120,8 +118,7 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const
{
@ -134,8 +131,7 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
@ -151,8 +147,7 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
@ -168,8 +163,7 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
@ -185,8 +179,7 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
@ -202,8 +195,7 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,

View File

@ -40,10 +40,12 @@ namespace Foam
void Foam::vtkSurfaceWriter::writeGeometry
(
Ostream& os,
const pointField& points,
const faceList& faces
const meshedSurf& surf
)
{
const pointField& points = surf.points();
const faceList& faces = surf.faces();
// header
os
<< "# vtk DataFile Version 2.0" << nl
@ -131,8 +133,9 @@ namespace Foam
forAll(values, elemI)
{
const vector& v = values[elemI];
os << float(v[0]) << ' ' << float(v[1]) << ' ' << float(v[2])
<< nl;
os << float(v[0]) << ' '
<< float(v[1]) << ' '
<< float(v[2]) << nl;
}
}
@ -234,8 +237,7 @@ Foam::fileName Foam::vtkSurfaceWriter::write
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose
) const
{
@ -252,7 +254,7 @@ Foam::fileName Foam::vtkSurfaceWriter::write
Info<< "Writing geometry to " << os.name() << endl;
}
writeGeometry(os, points, faces);
writeGeometry(os, surf);
return os.name();
}

View File

@ -57,7 +57,7 @@ class vtkSurfaceWriter
// Private Member Functions
static void writeGeometry(Ostream&, const pointField&, const faceList&);
static void writeGeometry(Ostream&, const meshedSurf&);
template<class Type>
static void writeData(Ostream&, const Field<Type>&);
@ -69,8 +69,7 @@ class vtkSurfaceWriter
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -104,10 +103,9 @@ public:
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const bool verbose = false
) const;
) const; // override
//- Write scalarField for a single surface to file.
@ -116,13 +114,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<scalar>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write vectorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -130,13 +127,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<vector>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write sphericalTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -144,13 +140,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<sphericalTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write symmTensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -158,13 +153,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<symmTensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
//- Write tensorField for a single surface to file.
// One value per face or vertex (isNodeValues = true)
@ -172,13 +166,12 @@ public:
(
const fileName& outputDir, // <case>/surface/TIME
const fileName& surfaceName, // name of surface
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName, // name of field
const Field<tensor>& values,
const bool isNodeValues,
const bool verbose = false
) const;
) const; // override
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,8 +49,7 @@ Foam::fileName Foam::vtkSurfaceWriter::writeTemplate
(
const fileName& outputDir,
const fileName& surfaceName,
const pointField& points,
const faceList& faces,
const meshedSurf& surf,
const word& fieldName,
const Field<Type>& values,
const bool isNodeValues,
@ -70,7 +69,7 @@ Foam::fileName Foam::vtkSurfaceWriter::writeTemplate
Info<< "Writing field " << fieldName << " to " << os.name() << endl;
}
writeGeometry(os, points, faces);
writeGeometry(os, surf);
// start writing data
if (isNodeValues)