mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -785,7 +785,7 @@ int main(int argc, char *argv[])
|
|||||||
if (flipNormals)
|
if (flipNormals)
|
||||||
{
|
{
|
||||||
Info<< "Flipping faces." << nl << endl;
|
Info<< "Flipping faces." << nl << endl;
|
||||||
faceList& faces = const_cast<faceList&>(fMesh.faces());
|
faceList& faces = const_cast<faceList&>(fMesh.surfFaces());
|
||||||
forAll(faces, i)
|
forAll(faces, i)
|
||||||
{
|
{
|
||||||
faces[i] = fMesh[i].reverseFace();
|
faces[i] = fMesh[i].reverseFace();
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -172,7 +172,7 @@ void Foam::patchToPoly2DMesh::addPatchFacesToFaces()
|
|||||||
void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
|
void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
|
||||||
{
|
{
|
||||||
const label nInternalEdges = patch_.nInternalEdges();
|
const label nInternalEdges = patch_.nInternalEdges();
|
||||||
const faceList& faces = patch_.faces();
|
const faceList& faces = patch_.surfFaces();
|
||||||
const label nExternalEdges = patch_.edges().size() - nInternalEdges;
|
const label nExternalEdges = patch_.edges().size() - nInternalEdges;
|
||||||
const labelList& meshPoints = patch_.meshPoints();
|
const labelList& meshPoints = patch_.meshPoints();
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -289,8 +289,11 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::automatic::load()
|
|||||||
(
|
(
|
||||||
surface_.searchableSurface::time().constant()/"triSurface",
|
surface_.searchableSurface::time().constant()/"triSurface",
|
||||||
surfaceName_.lessExt().name(),
|
surfaceName_.lessExt().name(),
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surface_.points(),
|
surface_.points(),
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
"cellSize",
|
"cellSize",
|
||||||
pointCellSize,
|
pointCellSize,
|
||||||
true,
|
true,
|
||||||
|
|||||||
@ -232,7 +232,7 @@ Foam::shortEdgeFilter2D::filter()
|
|||||||
// These are global indices.
|
// These are global indices.
|
||||||
const pointField& points = ms_.points();
|
const pointField& points = ms_.points();
|
||||||
const edgeList& edges = ms_.edges();
|
const edgeList& edges = ms_.edges();
|
||||||
const faceList& faces = ms_.faces();
|
const faceList& faces = ms_.surfFaces();
|
||||||
const labelList& meshPoints = ms_.meshPoints();
|
const labelList& meshPoints = ms_.meshPoints();
|
||||||
const labelList& boundaryPoints = ms_.boundaryPoints();
|
const labelList& boundaryPoints = ms_.boundaryPoints();
|
||||||
|
|
||||||
|
|||||||
@ -9,5 +9,4 @@ EXE_INC = \
|
|||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lsurfMesh \
|
|
||||||
-ldynamicMesh
|
-ldynamicMesh
|
||||||
|
|||||||
@ -1019,8 +1019,11 @@ Foam::label Foam::checkGeometry
|
|||||||
(
|
(
|
||||||
"postProcessing",
|
"postProcessing",
|
||||||
"src_" + tmName,
|
"src_" + tmName,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
mergedPoints,
|
mergedPoints,
|
||||||
mergedFaces,
|
mergedFaces
|
||||||
|
),
|
||||||
"weightsSum",
|
"weightsSum",
|
||||||
mergedWeights,
|
mergedWeights,
|
||||||
false
|
false
|
||||||
@ -1066,8 +1069,11 @@ Foam::label Foam::checkGeometry
|
|||||||
(
|
(
|
||||||
"postProcessing",
|
"postProcessing",
|
||||||
"tgt_" + tmName,
|
"tgt_" + tmName,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
mergedPoints,
|
mergedPoints,
|
||||||
mergedFaces,
|
mergedFaces
|
||||||
|
),
|
||||||
"weightsSum",
|
"weightsSum",
|
||||||
mergedWeights,
|
mergedWeights,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,6 +42,7 @@ License
|
|||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "PatchTools.H"
|
#include "PatchTools.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||||
{
|
{
|
||||||
@ -238,7 +239,16 @@ void Foam::mergeAndWrite
|
|||||||
// Write
|
// Write
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writer.write(outputDir, name, mergedPoints, mergedFaces);
|
writer.write
|
||||||
|
(
|
||||||
|
outputDir,
|
||||||
|
name,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
|
mergedPoints,
|
||||||
|
mergedFaces
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -247,8 +257,11 @@ void Foam::mergeAndWrite
|
|||||||
(
|
(
|
||||||
outputDir,
|
outputDir,
|
||||||
name,
|
name,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
setPatch.localPoints(),
|
setPatch.localPoints(),
|
||||||
setPatch.localFaces()
|
setPatch.localFaces()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -95,8 +95,11 @@ void writeWeights
|
|||||||
(
|
(
|
||||||
directory,
|
directory,
|
||||||
prefix + "_" + timeName,
|
prefix + "_" + timeName,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
mergedPoints,
|
mergedPoints,
|
||||||
mergedFaces,
|
mergedFaces
|
||||||
|
),
|
||||||
"weightsSum",
|
"weightsSum",
|
||||||
mergedWeights,
|
mergedWeights,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -7,5 +7,4 @@ EXE_INC = \
|
|||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-lsurfMesh \
|
|
||||||
-lmeshTools
|
-lmeshTools
|
||||||
|
|||||||
@ -228,8 +228,11 @@ void writeZoning
|
|||||||
(
|
(
|
||||||
surfFilePath,
|
surfFilePath,
|
||||||
surfFileNameBase,
|
surfFileNameBase,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
fieldName,
|
fieldName,
|
||||||
scalarFaceZone,
|
scalarFaceZone,
|
||||||
false // face based data
|
false // face based data
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -1643,8 +1643,11 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
runTime.constantPath()/"triSurface",// outputDir
|
runTime.constantPath()/"triSurface",// outputDir
|
||||||
sFeatFileName, // surfaceName
|
sFeatFileName, // surfaceName
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
"internalCloseness", // fieldName
|
"internalCloseness", // fieldName
|
||||||
internalCloseness,
|
internalCloseness,
|
||||||
false, // isNodeValues
|
false, // isNodeValues
|
||||||
@ -1655,8 +1658,11 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
runTime.constantPath()/"triSurface",// outputDir
|
runTime.constantPath()/"triSurface",// outputDir
|
||||||
sFeatFileName, // surfaceName
|
sFeatFileName, // surfaceName
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
"externalCloseness", // fieldName
|
"externalCloseness", // fieldName
|
||||||
externalCloseness,
|
externalCloseness,
|
||||||
false, // isNodeValues
|
false, // isNodeValues
|
||||||
@ -1691,8 +1697,11 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
runTime.constantPath()/"triSurface",// outputDir
|
runTime.constantPath()/"triSurface",// outputDir
|
||||||
sFeatFileName, // surfaceName
|
sFeatFileName, // surfaceName
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
"curvature", // fieldName
|
"curvature", // fieldName
|
||||||
k,
|
k,
|
||||||
true, // isNodeValues
|
true, // isNodeValues
|
||||||
@ -1769,8 +1778,11 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
runTime.constantPath()/"triSurface",// outputDir
|
runTime.constantPath()/"triSurface",// outputDir
|
||||||
sFeatFileName, // surfaceName
|
sFeatFileName, // surfaceName
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
"featureProximity", // fieldName
|
"featureProximity", // fieldName
|
||||||
featureProximity,
|
featureProximity,
|
||||||
false, // isNodeValues
|
false, // isNodeValues
|
||||||
|
|||||||
@ -7,5 +7,4 @@ EXE_INC = \
|
|||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfileFormats \
|
|
||||||
-lsurfMesh
|
-lsurfMesh
|
||||||
|
|||||||
@ -328,8 +328,11 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
|||||||
(
|
(
|
||||||
outputDir(),
|
outputDir(),
|
||||||
regionTypeNames_[regionType_] + ("_" + regionName_),
|
regionTypeNames_[regionType_] + ("_" + regionName_),
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
points,
|
points,
|
||||||
faces,
|
faces
|
||||||
|
),
|
||||||
fieldName,
|
fieldName,
|
||||||
allValues,
|
allValues,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -17,6 +17,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -204,8 +204,7 @@ void Foam::FacePostProcessing<CloudType>::write()
|
|||||||
(
|
(
|
||||||
this->writeTimeDir(),
|
this->writeTimeDir(),
|
||||||
fZone.name(),
|
fZone.name(),
|
||||||
allPoints,
|
meshedSurfRef(allPoints, allFaces),
|
||||||
allFaces,
|
|
||||||
"massTotal",
|
"massTotal",
|
||||||
zoneMassTotal[zoneI],
|
zoneMassTotal[zoneI],
|
||||||
false
|
false
|
||||||
@ -215,8 +214,7 @@ void Foam::FacePostProcessing<CloudType>::write()
|
|||||||
(
|
(
|
||||||
this->writeTimeDir(),
|
this->writeTimeDir(),
|
||||||
fZone.name(),
|
fZone.name(),
|
||||||
allPoints,
|
meshedSurfRef(allPoints, allFaces),
|
||||||
allFaces,
|
|
||||||
"massFlowRate",
|
"massFlowRate",
|
||||||
zoneMassFlowRate[zoneI],
|
zoneMassFlowRate[zoneI],
|
||||||
false
|
false
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -409,10 +409,10 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
|
|
||||||
Info<< type() << " output:" << nl;
|
Info<< type() << " output:" << nl;
|
||||||
|
|
||||||
Field<scalar> faceMassTotal(mass_.size(), 0.0);
|
Field<scalar> faceMassTotal(mass_.size(), Zero);
|
||||||
this->getModelProperty("massTotal", faceMassTotal);
|
this->getModelProperty("massTotal", faceMassTotal);
|
||||||
|
|
||||||
Field<scalar> faceMassFlowRate(massFlowRate_.size(), 0.0);
|
Field<scalar> faceMassFlowRate(massFlowRate_.size(), Zero);
|
||||||
this->getModelProperty("massFlowRate", faceMassFlowRate);
|
this->getModelProperty("massFlowRate", faceMassFlowRate);
|
||||||
|
|
||||||
|
|
||||||
@ -467,8 +467,7 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
(
|
(
|
||||||
this->writeTimeDir(),
|
this->writeTimeDir(),
|
||||||
"collector",
|
"collector",
|
||||||
points_,
|
meshedSurfRef(points_, faces_),
|
||||||
faces_,
|
|
||||||
"massTotal",
|
"massTotal",
|
||||||
faceMassTotal,
|
faceMassTotal,
|
||||||
false
|
false
|
||||||
@ -478,8 +477,7 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
(
|
(
|
||||||
this->writeTimeDir(),
|
this->writeTimeDir(),
|
||||||
"collector",
|
"collector",
|
||||||
points_,
|
meshedSurfRef(points_, faces_),
|
||||||
faces_,
|
|
||||||
"massFlowRate",
|
"massFlowRate",
|
||||||
faceMassFlowRate,
|
faceMassFlowRate,
|
||||||
false
|
false
|
||||||
@ -490,7 +488,7 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
|
|
||||||
if (resetOnWrite_)
|
if (resetOnWrite_)
|
||||||
{
|
{
|
||||||
Field<scalar> dummy(faceMassTotal.size(), 0.0);
|
Field<scalar> dummy(faceMassTotal.size(), Zero);
|
||||||
this->setModelProperty("massTotal", dummy);
|
this->setModelProperty("massTotal", dummy);
|
||||||
this->setModelProperty("massFlowRate", dummy);
|
this->setModelProperty("massFlowRate", dummy);
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ LIB_LIBS = \
|
|||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfileFormats \
|
|
||||||
-ledgeMesh \
|
-ledgeMesh \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
|
|||||||
@ -5,5 +5,4 @@ EXE_INC = \
|
|||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-lsurfMesh \
|
-lsurfMesh
|
||||||
-lfileFormats
|
|
||||||
|
|||||||
@ -7,5 +7,4 @@ EXE_INC = \
|
|||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-L$(FFTW_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) -lfftw3 \
|
-L$(FFTW_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) -lfftw3 \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lsampling \
|
-lsampling
|
||||||
-lsurfMesh
|
|
||||||
|
|||||||
@ -290,12 +290,16 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// could also have meshedSurface implement meshedSurf
|
||||||
fileName outFileName = writerPtr_->write
|
fileName outFileName = writerPtr_->write
|
||||||
(
|
(
|
||||||
outDir,
|
outDir,
|
||||||
fName,
|
fName,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
surf.faces(),
|
surf.surfFaces()
|
||||||
|
),
|
||||||
title,
|
title,
|
||||||
allData,
|
allData,
|
||||||
false
|
false
|
||||||
@ -313,12 +317,16 @@ Foam::scalar surfaceNoise::writeSurfaceData
|
|||||||
{
|
{
|
||||||
const meshedSurface& surf = readerPtr_->geometry();
|
const meshedSurface& surf = readerPtr_->geometry();
|
||||||
|
|
||||||
|
// could also have meshedSurface implement meshedSurf
|
||||||
writerPtr_->write
|
writerPtr_->write
|
||||||
(
|
(
|
||||||
outDir,
|
outDir,
|
||||||
fName,
|
fName,
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
surf.faces(),
|
surf.surfFaces()
|
||||||
|
),
|
||||||
title,
|
title,
|
||||||
data,
|
data,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -13,7 +13,6 @@ LIB_LIBS = \
|
|||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-lfileFormats \
|
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -193,6 +193,12 @@ public:
|
|||||||
return facesPtr_;
|
return facesPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const
|
||||||
|
{
|
||||||
|
return Foam::emptyLabelList;
|
||||||
|
}
|
||||||
|
|
||||||
//- Face area vectors
|
//- Face area vectors
|
||||||
virtual const vectorField& Sf() const
|
virtual const vectorField& Sf() const
|
||||||
{
|
{
|
||||||
@ -212,6 +218,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- The underlying surface
|
||||||
const triSurface& surface() const
|
const triSurface& surface() const
|
||||||
{
|
{
|
||||||
if (cell_)
|
if (cell_)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -199,6 +199,12 @@ public:
|
|||||||
return facesPtr_;
|
return facesPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const
|
||||||
|
{
|
||||||
|
return Foam::emptyLabelList;
|
||||||
|
}
|
||||||
|
|
||||||
//- Face area magnitudes
|
//- Face area magnitudes
|
||||||
virtual const vectorField& Sf() const
|
virtual const vectorField& Sf() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -168,6 +168,12 @@ public:
|
|||||||
return facesPtr_;
|
return facesPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const
|
||||||
|
{
|
||||||
|
return Foam::emptyLabelList;
|
||||||
|
}
|
||||||
|
|
||||||
//- Face area magnitudes
|
//- Face area magnitudes
|
||||||
virtual const vectorField& Sf() const
|
virtual const vectorField& Sf() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -182,6 +182,12 @@ public:
|
|||||||
return facesPtr_;
|
return facesPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const
|
||||||
|
{
|
||||||
|
return Foam::emptyLabelList;
|
||||||
|
}
|
||||||
|
|
||||||
//- Face area magnitudes
|
//- Face area magnitudes
|
||||||
virtual const vectorField& Sf() const
|
virtual const vectorField& Sf() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -177,7 +177,13 @@ public:
|
|||||||
//- Faces of surface
|
//- Faces of surface
|
||||||
virtual const faceList& faces() const
|
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
|
//- Face area vectors
|
||||||
|
|||||||
@ -137,7 +137,14 @@ public:
|
|||||||
//- Faces of surface
|
//- Faces of surface
|
||||||
virtual const faceList& faces() const
|
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
|
//- Face area magnitudes
|
||||||
|
|||||||
@ -52,7 +52,7 @@ SourceFiles
|
|||||||
#ifndef sampledSurface_H
|
#ifndef sampledSurface_H
|
||||||
#define sampledSurface_H
|
#define sampledSurface_H
|
||||||
|
|
||||||
#include "pointField.H"
|
#include "meshedSurf.H"
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "faceList.H"
|
#include "faceList.H"
|
||||||
@ -83,6 +83,8 @@ Ostream& operator<<(Ostream&, const sampledSurface&);
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class sampledSurface
|
class sampledSurface
|
||||||
|
:
|
||||||
|
public meshedSurf
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
|||||||
@ -66,26 +66,19 @@ void Foam::sampledSurfaces::writeGeometry() const
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
if (Pstream::master() && mergeList_[surfI].faces.size())
|
if (Pstream::master() && mergedList_[surfI].size())
|
||||||
{
|
{
|
||||||
formatter_->write
|
formatter_->write
|
||||||
(
|
(
|
||||||
outputDir,
|
outputDir,
|
||||||
s.name(),
|
s.name(),
|
||||||
mergeList_[surfI].points,
|
mergedList_[surfI]
|
||||||
mergeList_[surfI].faces
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (s.faces().size())
|
else if (s.faces().size())
|
||||||
{
|
{
|
||||||
formatter_->write
|
formatter_->write(outputDir, s.name(), s);
|
||||||
(
|
|
||||||
outputDir,
|
|
||||||
s.name(),
|
|
||||||
s.points(),
|
|
||||||
s.faces()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +100,7 @@ Foam::sampledSurfaces::sampledSurfaces
|
|||||||
outputPath_(fileName::null),
|
outputPath_(fileName::null),
|
||||||
fieldSelection_(),
|
fieldSelection_(),
|
||||||
interpolationScheme_(word::null),
|
interpolationScheme_(word::null),
|
||||||
mergeList_(),
|
mergedList_(),
|
||||||
formatter_(nullptr)
|
formatter_(nullptr)
|
||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
@ -138,7 +131,7 @@ Foam::sampledSurfaces::sampledSurfaces
|
|||||||
outputPath_(fileName::null),
|
outputPath_(fileName::null),
|
||||||
fieldSelection_(),
|
fieldSelection_(),
|
||||||
interpolationScheme_(word::null),
|
interpolationScheme_(word::null),
|
||||||
mergeList_(),
|
mergedList_(),
|
||||||
formatter_(nullptr)
|
formatter_(nullptr)
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
@ -239,7 +232,7 @@ bool Foam::sampledSurfaces::read(const dictionary& dict)
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
mergeList_.setSize(size());
|
mergedList_.setSize(size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure all surfaces and merge information are expired
|
// Ensure all surfaces and merge information are expired
|
||||||
@ -329,7 +322,7 @@ bool Foam::sampledSurfaces::expire()
|
|||||||
// Clear merge information
|
// Clear merge information
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
mergeList_[surfI].clear();
|
mergedList_[surfI].clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,24 +370,8 @@ bool Foam::sampledSurfaces::update()
|
|||||||
if (s.update())
|
if (s.update())
|
||||||
{
|
{
|
||||||
updated = true;
|
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;
|
return updated;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -40,6 +40,7 @@ SourceFiles
|
|||||||
#include "regionFunctionObject.H"
|
#include "regionFunctionObject.H"
|
||||||
#include "sampledSurface.H"
|
#include "sampledSurface.H"
|
||||||
#include "surfaceWriter.H"
|
#include "surfaceWriter.H"
|
||||||
|
#include "mergedSurf.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "surfaceFieldsFwd.H"
|
#include "surfaceFieldsFwd.H"
|
||||||
#include "wordReList.H"
|
#include "wordReList.H"
|
||||||
@ -64,26 +65,6 @@ class sampledSurfaces
|
|||||||
public functionObjects::regionFunctionObject,
|
public functionObjects::regionFunctionObject,
|
||||||
public PtrList<sampledSurface>
|
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
|
// Static data members
|
||||||
|
|
||||||
//- Output verbosity
|
//- Output verbosity
|
||||||
@ -116,8 +97,8 @@ class sampledSurfaces
|
|||||||
|
|
||||||
// surfaces
|
// surfaces
|
||||||
|
|
||||||
//- Information for merging surfaces
|
//- Merged meshed surfaces (parallel only)
|
||||||
List<mergeInfo> mergeList_;
|
List<mergedSurf> mergedList_;
|
||||||
|
|
||||||
|
|
||||||
// Calculated
|
// Calculated
|
||||||
|
|||||||
@ -65,22 +65,21 @@ void Foam::sampledSurfaces::writeSurface
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Renumber (point data) to correspond to merged points
|
// 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);
|
inplaceReorder(mergedList_[surfI].pointsMap(), allValues);
|
||||||
allValues.setSize(mergeList_[surfI].points.size());
|
allValues.setSize(mergedList_[surfI].points().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write to time directory under outputPath_
|
// Write to time directory under outputPath_
|
||||||
// skip surface without faces (eg, a failed cut-plane)
|
// skip surface without faces (eg, a failed cut-plane)
|
||||||
if (mergeList_[surfI].faces.size())
|
if (mergedList_[surfI].size())
|
||||||
{
|
{
|
||||||
sampleFile = formatter_->write
|
sampleFile = formatter_->write
|
||||||
(
|
(
|
||||||
outputDir,
|
outputDir,
|
||||||
s.name(),
|
s.name(),
|
||||||
mergeList_[surfI].points,
|
mergedList_[surfI],
|
||||||
mergeList_[surfI].faces,
|
|
||||||
fieldName,
|
fieldName,
|
||||||
allValues,
|
allValues,
|
||||||
s.interpolate()
|
s.interpolate()
|
||||||
@ -106,8 +105,7 @@ void Foam::sampledSurfaces::writeSurface
|
|||||||
(
|
(
|
||||||
outputDir,
|
outputDir,
|
||||||
s.name(),
|
s.name(),
|
||||||
s.points(),
|
s,
|
||||||
s.faces(),
|
|
||||||
fieldName,
|
fieldName,
|
||||||
values,
|
values,
|
||||||
s.interpolate()
|
s.interpolate()
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -305,9 +305,13 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
|||||||
// Create faces and points for subsetted surface
|
// Create faces and points for subsetted surface
|
||||||
faceList& faces = this->storedFaces();
|
faceList& faces = this->storedFaces();
|
||||||
faces.setSize(faceMap.size());
|
faces.setSize(faceMap.size());
|
||||||
|
|
||||||
|
labelList& zoneIds = this->storedZoneIds();
|
||||||
|
zoneIds.setSize(faceMap.size());
|
||||||
|
|
||||||
forAll(faceMap, i)
|
forAll(faceMap, i)
|
||||||
{
|
{
|
||||||
const triFace& f = s[faceMap[i]];
|
const labelledTri& f = s[faceMap[i]];
|
||||||
triFace newF
|
triFace newF
|
||||||
(
|
(
|
||||||
reversePointMap[f[0]],
|
reversePointMap[f[0]],
|
||||||
@ -315,6 +319,7 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
|||||||
reversePointMap[f[2]]
|
reversePointMap[f[2]]
|
||||||
);
|
);
|
||||||
faces[i] = newF.triFaceFace();
|
faces[i] = newF.triFaceFace();
|
||||||
|
zoneIds[i] = f.region(); // preserve zone information
|
||||||
|
|
||||||
forAll(newF, fp)
|
forAll(newF, fp)
|
||||||
{
|
{
|
||||||
@ -775,7 +780,8 @@ void Foam::sampledTriSurfaceMesh::print(Ostream& os) const
|
|||||||
os << "sampledTriSurfaceMesh: " << name() << " :"
|
os << "sampledTriSurfaceMesh: " << name() << " :"
|
||||||
<< " surface:" << surface_.objectRegistry::name()
|
<< " surface:" << surface_.objectRegistry::name()
|
||||||
<< " faces:" << faces().size()
|
<< " faces:" << faces().size()
|
||||||
<< " points:" << points().size();
|
<< " points:" << points().size()
|
||||||
|
<< " zoneids:" << zoneIds().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class meshSearch;
|
|||||||
class sampledTriSurfaceMesh
|
class sampledTriSurfaceMesh
|
||||||
:
|
:
|
||||||
public sampledSurface,
|
public sampledSurface,
|
||||||
public MeshedSurface<face>
|
public UnsortedMeshedSurface<face>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//- Types of communications
|
//- Types of communications
|
||||||
@ -101,7 +101,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
//- Private typedefs for convenience
|
//- Private typedefs for convenience
|
||||||
typedef MeshedSurface<face> MeshStorage;
|
typedef UnsortedMeshedSurface<face> MeshStorage;
|
||||||
|
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -213,7 +213,13 @@ public:
|
|||||||
//- Faces of surface
|
//- Faces of surface
|
||||||
virtual const faceList& faces() const
|
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
|
//- Face area vectors
|
||||||
|
|||||||
@ -145,7 +145,13 @@ public:
|
|||||||
//- Faces of surface
|
//- Faces of surface
|
||||||
virtual const faceList& faces() const
|
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)
|
//- Face area vectors (normals)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -53,14 +53,14 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const fileName baseDir(outputDir.path()/surfaceName);
|
const fileName baseDir(outputDir.path()/surfaceName);
|
||||||
const fileName timeName(outputDir.name());
|
const fileName timeName(outputDir.name());
|
||||||
|
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
|
||||||
// Construct dummy time to use as an objectRegistry
|
// Construct dummy time to use as an objectRegistry
|
||||||
const fileName caseDir(getEnv("FOAM_CASE"));
|
const fileName caseDir(getEnv("FOAM_CASE"));
|
||||||
@ -110,6 +110,8 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// create write methods
|
// create write methods
|
||||||
defineSurfaceWriterWriteFields(Foam::boundaryDataSurfaceWriter);
|
defineSurfaceWriterWriteFields(Foam::boundaryDataSurfaceWriter);
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -98,8 +98,7 @@ class boundaryDataSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -130,10 +129,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
@ -142,13 +140,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -156,13 +153,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -170,13 +166,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -184,13 +179,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -198,13 +192,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,7 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -48,6 +47,9 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::writeTemplate
|
|||||||
const fileName baseDir(outputDir.path()/surfaceName);
|
const fileName baseDir(outputDir.path()/surfaceName);
|
||||||
const fileName timeName(outputDir.name());
|
const fileName timeName(outputDir.name());
|
||||||
|
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
|
||||||
|
|
||||||
// Construct dummy time to use as an objectRegistry
|
// Construct dummy time to use as an objectRegistry
|
||||||
const fileName caseDir(getEnv("FOAM_CASE"));
|
const fileName caseDir(getEnv("FOAM_CASE"));
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -39,10 +39,12 @@ namespace Foam
|
|||||||
void Foam::dxSurfaceWriter::writeGeometry
|
void Foam::dxSurfaceWriter::writeGeometry
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const pointField& points,
|
const meshedSurf& surf
|
||||||
const faceList& faces
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
|
||||||
// Write vertex coordinates
|
// Write vertex coordinates
|
||||||
|
|
||||||
os << "# The irregular positions" << nl
|
os << "# The irregular positions" << nl
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -53,7 +53,7 @@ class dxSurfaceWriter
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
static void writeGeometry(Ostream&, const pointField&, const faceList&);
|
static void writeGeometry(Ostream&, const meshedSurf&);
|
||||||
static void writeTrailer(Ostream&, const bool isNodeValues);
|
static void writeTrailer(Ostream&, const bool isNodeValues);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -65,8 +65,7 @@ class dxSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -98,13 +97,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -112,13 +110,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -126,13 +123,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -140,13 +136,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -154,13 +149,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -50,8 +50,7 @@ Foam::fileName Foam::dxSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -70,7 +69,7 @@ Foam::fileName Foam::dxSurfaceWriter::writeTemplate
|
|||||||
Info<< "Writing field " << fieldName << " to " << os.name() << endl;
|
Info<< "Writing field " << fieldName << " to " << os.name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeGeometry(os, points, faces);
|
writeGeometry(os, surf);
|
||||||
writeData(os, values);
|
writeData(os, values);
|
||||||
writeTrailer(os, isNodeValues);
|
writeTrailer(os, isNodeValues);
|
||||||
|
|
||||||
|
|||||||
@ -84,11 +84,12 @@ Foam::fileName Foam::ensightSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
const ensight::FileName surfName(surfaceName);
|
const ensight::FileName surfName(surfaceName);
|
||||||
|
|
||||||
if (!isDir(outputDir))
|
if (!isDir(outputDir))
|
||||||
|
|||||||
@ -67,8 +67,7 @@ class ensightSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -81,8 +80,7 @@ class ensightSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -95,8 +93,7 @@ class ensightSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -135,10 +132,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
@ -147,13 +143,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -161,13 +156,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -175,13 +169,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -189,13 +182,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -203,13 +195,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,8 +40,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeUncollated
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -117,7 +116,14 @@ Foam::fileName Foam::ensightSurfaceWriter::writeUncollated
|
|||||||
<< " " << timeValue
|
<< " " << timeValue
|
||||||
<< nl << nl << "# end" << nl;
|
<< 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;
|
osGeom << ensPart;
|
||||||
|
|
||||||
// Write field
|
// Write field
|
||||||
@ -139,8 +145,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -310,7 +315,14 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
|
|||||||
|
|
||||||
|
|
||||||
// Write geometry
|
// 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 (!exists(meshFile))
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
@ -377,8 +389,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -391,8 +402,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
outputDir,
|
outputDir,
|
||||||
surfaceName,
|
surfaceName,
|
||||||
points,
|
surf,
|
||||||
faces,
|
|
||||||
fieldName,
|
fieldName,
|
||||||
values,
|
values,
|
||||||
isNodeValues,
|
isNodeValues,
|
||||||
@ -405,8 +415,7 @@ Foam::fileName Foam::ensightSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
outputDir,
|
outputDir,
|
||||||
surfaceName,
|
surfaceName,
|
||||||
points,
|
surf,
|
||||||
faces,
|
|
||||||
fieldName,
|
fieldName,
|
||||||
values,
|
values,
|
||||||
isNodeValues,
|
isNodeValues,
|
||||||
|
|||||||
@ -24,10 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "foamSurfaceWriter.H"
|
#include "foamSurfaceWriter.H"
|
||||||
|
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "OSspecific.H"
|
|
||||||
|
|
||||||
#include "makeSurfaceWriterMethods.H"
|
#include "makeSurfaceWriterMethods.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -58,11 +55,13 @@ Foam::fileName Foam::foamSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
|
||||||
fileName surfaceDir(outputDir/surfaceName);
|
fileName surfaceDir(outputDir/surfaceName);
|
||||||
|
|
||||||
if (!isDir(surfaceDir))
|
if (!isDir(surfaceDir))
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,8 +58,7 @@ class foamSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -97,10 +96,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
@ -109,13 +107,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -123,13 +120,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -137,13 +133,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -151,13 +146,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -165,13 +159,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,8 +33,7 @@ Foam::fileName Foam::foamSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,8 +51,7 @@ namespace Foam
|
|||||||
( \
|
( \
|
||||||
const fileName& outputDir, \
|
const fileName& outputDir, \
|
||||||
const fileName& surfaceName, \
|
const fileName& surfaceName, \
|
||||||
const pointField& points, \
|
const meshedSurf& surf, \
|
||||||
const faceList& faces, \
|
|
||||||
const word& fieldName, \
|
const word& fieldName, \
|
||||||
const Field<FieldType>& values, \
|
const Field<FieldType>& values, \
|
||||||
const bool isNodeValues, \
|
const bool isNodeValues, \
|
||||||
@ -63,8 +62,7 @@ namespace Foam
|
|||||||
( \
|
( \
|
||||||
outputDir, \
|
outputDir, \
|
||||||
surfaceName, \
|
surfaceName, \
|
||||||
points, \
|
surf, \
|
||||||
faces, \
|
|
||||||
fieldName, \
|
fieldName, \
|
||||||
values, \
|
values, \
|
||||||
isNodeValues, \
|
isNodeValues, \
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,7 +25,8 @@ License
|
|||||||
|
|
||||||
#include "nastranSurfaceWriter.H"
|
#include "nastranSurfaceWriter.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "Tuple2.H"
|
#include "Pair.H"
|
||||||
|
#include "HashSet.H"
|
||||||
#include "makeSurfaceWriterMethods.H"
|
#include "makeSurfaceWriterMethods.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -64,7 +65,7 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::nastranSurfaceWriter::formatOS(OFstream& os) const
|
void Foam::nastranSurfaceWriter::formatOS(Ostream& os) const
|
||||||
{
|
{
|
||||||
os.setf(ios_base::scientific);
|
os.setf(ios_base::scientific);
|
||||||
|
|
||||||
@ -75,19 +76,23 @@ void Foam::nastranSurfaceWriter::formatOS(OFstream& os) const
|
|||||||
label offset = 7;
|
label offset = 7;
|
||||||
switch (writeFormat_)
|
switch (writeFormat_)
|
||||||
{
|
{
|
||||||
case (wfShort):
|
case wfShort:
|
||||||
{
|
{
|
||||||
prec = 8 - offset;
|
prec = 8 - offset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (wfFree):
|
|
||||||
case (wfLong):
|
case wfFree:
|
||||||
|
case wfLong:
|
||||||
{
|
{
|
||||||
prec = 16 - offset;
|
prec = 16 - offset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
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
|
) const
|
||||||
{
|
{
|
||||||
os.setf(ios_base::left);
|
os.setf(ios_base::left);
|
||||||
@ -110,11 +115,13 @@ void Foam::nastranSurfaceWriter::writeKeyword
|
|||||||
os << setw(8) << keyword;
|
os << setw(8) << keyword;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case wfLong:
|
case wfLong:
|
||||||
{
|
{
|
||||||
os << setw(8) << word(keyword + '*');
|
os << setw(8) << word(keyword + '*');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case wfFree:
|
case wfFree:
|
||||||
{
|
{
|
||||||
os << keyword;
|
os << keyword;
|
||||||
@ -123,14 +130,16 @@ void Foam::nastranSurfaceWriter::writeKeyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
os.unsetf(ios_base::left);
|
os.unsetf(ios_base::left);
|
||||||
|
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::nastranSurfaceWriter::writeCoord
|
void Foam::nastranSurfaceWriter::writeCoord
|
||||||
(
|
(
|
||||||
|
Ostream& os,
|
||||||
const point& p,
|
const point& p,
|
||||||
const label pointi,
|
const label pointI
|
||||||
OFstream& os
|
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Fixed short/long formats:
|
// Fixed short/long formats:
|
||||||
@ -144,21 +153,14 @@ void Foam::nastranSurfaceWriter::writeCoord
|
|||||||
// 8 PS : single point constraints (blank)
|
// 8 PS : single point constraints (blank)
|
||||||
// 9 SEID : super-element ID
|
// 9 SEID : super-element ID
|
||||||
|
|
||||||
|
writeKeyword(os, "GRID") << separator_;
|
||||||
writeKeyword("GRID", os);
|
|
||||||
|
|
||||||
os << separator_;
|
|
||||||
|
|
||||||
os.setf(ios_base::right);
|
os.setf(ios_base::right);
|
||||||
|
|
||||||
writeValue(pointi + 1, os);
|
writeValue(os, pointI+1) << separator_;
|
||||||
os << separator_;
|
writeValue(os, "") << separator_;
|
||||||
writeValue("", os);
|
writeValue(os, p.x()) << separator_;
|
||||||
os << separator_;
|
writeValue(os, p.y()) << separator_;
|
||||||
writeValue(p.x(), os);
|
|
||||||
os << separator_;
|
|
||||||
writeValue(p.y(), os);
|
|
||||||
os << separator_;
|
|
||||||
|
|
||||||
switch (writeFormat_)
|
switch (writeFormat_)
|
||||||
{
|
{
|
||||||
@ -167,27 +169,26 @@ void Foam::nastranSurfaceWriter::writeCoord
|
|||||||
os << setw(8) << p.z()
|
os << setw(8) << p.z()
|
||||||
<< nl;
|
<< nl;
|
||||||
os.unsetf(ios_base::right);
|
os.unsetf(ios_base::right);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case wfLong:
|
case wfLong:
|
||||||
{
|
{
|
||||||
os << nl;
|
os << nl;
|
||||||
os.unsetf(ios_base::right);
|
os.unsetf(ios_base::right);
|
||||||
writeKeyword("", os);
|
writeKeyword(os, "");
|
||||||
os.setf(ios_base::right);
|
os.setf(ios_base::right);
|
||||||
writeValue(p.z(), os);
|
|
||||||
os << nl;
|
|
||||||
|
|
||||||
|
writeValue(os, p.z()) << nl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case wfFree:
|
case wfFree:
|
||||||
{
|
{
|
||||||
writeValue(p.z(), os);
|
writeValue(os, p.z()) << nl;
|
||||||
os << nl;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -201,10 +202,11 @@ void Foam::nastranSurfaceWriter::writeCoord
|
|||||||
|
|
||||||
void Foam::nastranSurfaceWriter::writeFace
|
void Foam::nastranSurfaceWriter::writeFace
|
||||||
(
|
(
|
||||||
|
Ostream& os,
|
||||||
const word& faceType,
|
const word& faceType,
|
||||||
const labelList& facePts,
|
const labelUList& facePts,
|
||||||
label& nFace,
|
const label nFace,
|
||||||
OFstream& os
|
const label PID
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Only valid surface elements are CTRIA3 and CQUAD4
|
// 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
|
// For CTRIA3 elements, cols 7 onwards are not used
|
||||||
|
|
||||||
label PID = 1;
|
writeKeyword(os, faceType) << separator_;
|
||||||
|
|
||||||
writeKeyword(faceType, os);
|
|
||||||
|
|
||||||
os << separator_;
|
|
||||||
|
|
||||||
os.setf(ios_base::right);
|
os.setf(ios_base::right);
|
||||||
|
|
||||||
writeValue(nFace++, os);
|
writeValue(os, nFace) << separator_;
|
||||||
|
writeValue(os, PID);
|
||||||
os << separator_;
|
|
||||||
|
|
||||||
writeValue(PID, os);
|
|
||||||
|
|
||||||
switch (writeFormat_)
|
switch (writeFormat_)
|
||||||
{
|
{
|
||||||
@ -241,7 +236,7 @@ void Foam::nastranSurfaceWriter::writeFace
|
|||||||
{
|
{
|
||||||
forAll(facePts, i)
|
forAll(facePts, i)
|
||||||
{
|
{
|
||||||
writeValue(facePts[i] + 1, os);
|
writeValue(os, facePts[i] + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -250,12 +245,12 @@ void Foam::nastranSurfaceWriter::writeFace
|
|||||||
{
|
{
|
||||||
forAll(facePts, i)
|
forAll(facePts, i)
|
||||||
{
|
{
|
||||||
writeValue(facePts[i] + 1, os);
|
writeValue(os, facePts[i] + 1);
|
||||||
if (i == 1)
|
if (i == 1)
|
||||||
{
|
{
|
||||||
os << nl;
|
os << nl;
|
||||||
os.unsetf(ios_base::right);
|
os.unsetf(ios_base::right);
|
||||||
writeKeyword("", os);
|
writeKeyword(os, "");
|
||||||
os.setf(ios_base::right);
|
os.setf(ios_base::right);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,7 +262,7 @@ void Foam::nastranSurfaceWriter::writeFace
|
|||||||
forAll(facePts, i)
|
forAll(facePts, i)
|
||||||
{
|
{
|
||||||
os << separator_;
|
os << separator_;
|
||||||
writeValue(facePts[i] + 1, os);
|
writeValue(os, facePts[i] + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -286,12 +281,15 @@ void Foam::nastranSurfaceWriter::writeFace
|
|||||||
|
|
||||||
void Foam::nastranSurfaceWriter::writeGeometry
|
void Foam::nastranSurfaceWriter::writeGeometry
|
||||||
(
|
(
|
||||||
const pointField& points,
|
Ostream& os,
|
||||||
const faceList& faces,
|
const meshedSurf& surf,
|
||||||
List<DynamicList<face>>& decomposedFaces,
|
List<DynamicList<face>>& decomposedFaces
|
||||||
OFstream& os
|
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
const labelList& zones = surf.zoneIds();
|
||||||
|
|
||||||
// Write points
|
// Write points
|
||||||
|
|
||||||
os << "$" << nl
|
os << "$" << nl
|
||||||
@ -300,31 +298,33 @@ void Foam::nastranSurfaceWriter::writeGeometry
|
|||||||
|
|
||||||
forAll(points, pointi)
|
forAll(points, pointi)
|
||||||
{
|
{
|
||||||
writeCoord(points[pointi], pointi, os);
|
writeCoord(os, points[pointi], pointi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Write faces
|
// Write faces
|
||||||
|
decomposedFaces.clear();
|
||||||
|
decomposedFaces.setSize(faces.size());
|
||||||
|
|
||||||
os << "$" << nl
|
os << "$" << nl
|
||||||
<< "$ Faces" << nl
|
<< "$ Faces" << nl
|
||||||
<< "$" << nl;
|
<< "$" << nl;
|
||||||
|
|
||||||
label nFace = 1;
|
label nFace = 0; // the element-id
|
||||||
|
|
||||||
forAll(faces, facei)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
const face& f = 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)
|
if (f.size() == 3)
|
||||||
{
|
{
|
||||||
writeFace("CTRIA3", faces[facei], nFace, os);
|
writeFace(os, "CTRIA3", f, ++nFace, PID);
|
||||||
decomposedFaces[facei].append(faces[facei]);
|
decomposedFaces[facei].append(f);
|
||||||
}
|
}
|
||||||
else if (f.size() == 4)
|
else if (f.size() == 4)
|
||||||
{
|
{
|
||||||
writeFace("CQUAD4", faces[facei], nFace, os);
|
writeFace(os, "CQUAD4", f, ++nFace, PID);
|
||||||
decomposedFaces[facei].append(faces[facei]);
|
decomposedFaces[facei].append(f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -335,7 +335,7 @@ void Foam::nastranSurfaceWriter::writeGeometry
|
|||||||
|
|
||||||
forAll(triFaces, trii)
|
forAll(triFaces, trii)
|
||||||
{
|
{
|
||||||
writeFace("CTRIA3", triFaces[trii], nFace, os);
|
writeFace(os, "CTRIA3", triFaces[trii], ++nFace, PID);
|
||||||
decomposedFaces[facei].append(triFaces[trii]);
|
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);
|
labelList pidsUsed = labelHashSet(surf.zoneIds()).sortedToc();
|
||||||
|
if (pidsUsed.empty())
|
||||||
|
{
|
||||||
|
pidsUsed.setSize(1, Zero); // fallback
|
||||||
|
}
|
||||||
|
|
||||||
os << separator_;
|
for (auto pid : pidsUsed)
|
||||||
|
{
|
||||||
|
writeKeyword(os, "PSHELL") << separator_;
|
||||||
|
writeValue(os, pid+1); // 1-offset for PID
|
||||||
|
|
||||||
writeValue(PID, os);
|
for (label i = 0; i < 7; ++i)
|
||||||
|
|
||||||
for (label i = 0; i < 7; i++)
|
|
||||||
{
|
{
|
||||||
// Dummy values
|
// Dummy values
|
||||||
os << separator_;
|
os << separator_;
|
||||||
writeValue(1, os);
|
writeValue(os, 1);
|
||||||
|
}
|
||||||
|
os << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
os << nl;
|
|
||||||
writeKeyword("MAT1", os);
|
// use single material ID
|
||||||
os << separator_;
|
|
||||||
|
|
||||||
label MID = 1;
|
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
|
// Dummy values
|
||||||
os << separator_;
|
os << separator_;
|
||||||
writeValue("", os);
|
writeValue(os, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
os << nl;
|
os << nl;
|
||||||
|
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -400,7 +412,10 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
|
|||||||
{
|
{
|
||||||
if (options.found("format"))
|
if (options.found("format"))
|
||||||
{
|
{
|
||||||
writeFormat_ = writeFormatNames_.read(options.lookup("format"));
|
writeFormat_ = writeFormatNames_.read
|
||||||
|
(
|
||||||
|
options.lookup("format")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (writeFormat_ == wfFree)
|
if (writeFormat_ == wfFree)
|
||||||
@ -408,7 +423,7 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
|
|||||||
separator_ = ",";
|
separator_ = ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Tuple2<word, word>> fieldSet(options.lookup("fields"));
|
List<Pair<word>> fieldSet(options.lookup("fields"));
|
||||||
|
|
||||||
forAll(fieldSet, i)
|
forAll(fieldSet, i)
|
||||||
{
|
{
|
||||||
@ -431,8 +446,7 @@ Foam::fileName Foam::nastranSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -449,22 +463,16 @@ Foam::fileName Foam::nastranSurfaceWriter::write
|
|||||||
Info<< "Writing nastran file to " << os.name() << endl;
|
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
|
<< "$" << nl
|
||||||
<< "BEGIN BULK" << nl;
|
<< "BEGIN BULK" << nl;
|
||||||
|
|
||||||
List<DynamicList<face>> decomposedFaces(faces.size());
|
List<DynamicList<face>> decomposedFaces;
|
||||||
|
writeGeometry(os, surf, decomposedFaces);
|
||||||
|
|
||||||
writeGeometry(points, faces, decomposedFaces, os);
|
writeFooter(os, surf)
|
||||||
|
<< "ENDDATA" << endl;
|
||||||
if (!isDir(outputDir))
|
|
||||||
{
|
|
||||||
mkDir(outputDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
writeFooter(os);
|
|
||||||
|
|
||||||
os << "ENDDATA" << endl;
|
|
||||||
|
|
||||||
return os.name();
|
return os.name();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,6 +27,7 @@ Class
|
|||||||
Description
|
Description
|
||||||
A surface writer for the Nastran file format - both surface mesh and fields
|
A surface writer for the Nastran file format - both surface mesh and fields
|
||||||
|
|
||||||
|
\verbatim
|
||||||
formatOptions
|
formatOptions
|
||||||
{
|
{
|
||||||
nastran
|
nastran
|
||||||
@ -43,6 +44,7 @@ Description
|
|||||||
format free; //short, long, free
|
format free; //short, long, free
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
nastranSurfaceWriter.C
|
nastranSurfaceWriter.C
|
||||||
@ -80,26 +82,25 @@ public:
|
|||||||
wfFree
|
wfFree
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NamedEnum<writeFormat, 3> writeFormatNames_;
|
|
||||||
|
|
||||||
enum dataFormat
|
enum dataFormat
|
||||||
{
|
{
|
||||||
dfPLOAD2,
|
dfPLOAD2,
|
||||||
dfPLOAD4
|
dfPLOAD4
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NamedEnum<dataFormat, 2> dataFormatNames_;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
static const NamedEnum<writeFormat, 3> writeFormatNames_;
|
||||||
|
static const NamedEnum<dataFormat, 2> dataFormatNames_;
|
||||||
|
|
||||||
//- Write option
|
//- Write option
|
||||||
writeFormat writeFormat_;
|
writeFormat writeFormat_;
|
||||||
|
|
||||||
//- Mapping from field name to data format enumeration
|
//- Mapping from field name to data format enumeration
|
||||||
HashTable<dataFormat, word> fieldMap_;
|
HashTable<dataFormat> fieldMap_;
|
||||||
|
|
||||||
//- Scale to apply to values (default = 1.0)
|
//- Scale to apply to values (default = 1.0)
|
||||||
scalar scale_;
|
scalar scale_;
|
||||||
@ -110,71 +111,67 @@ private:
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Initialise the output stream format params
|
//- Initialise the output stream format parameters
|
||||||
void formatOS(OFstream& os) const;
|
void formatOS(Ostream& os) const;
|
||||||
|
|
||||||
//- Write a co-ordinate
|
//- Write a coordinate
|
||||||
void writeCoord
|
void writeCoord
|
||||||
(
|
(
|
||||||
|
Ostream& os,
|
||||||
const point& p,
|
const point& p,
|
||||||
const label pointi,
|
const label pointI //!< 0-based Point Id
|
||||||
OFstream& os
|
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Write a face element (CTRIA3 or CQUAD4)
|
//- Write a face element (CTRIA3 or CQUAD4)
|
||||||
void writeFace
|
void writeFace
|
||||||
(
|
(
|
||||||
|
Ostream& os,
|
||||||
const word& faceType,
|
const word& faceType,
|
||||||
const labelList& facePts,
|
const labelUList& facePts,
|
||||||
label& nFace,
|
const label EID, //!< 1-based Element Id
|
||||||
OFstream& os
|
const label PID //!< 1-based Property Id
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Main driver to write the surface mesh geometry
|
//- Main driver to write the surface mesh geometry
|
||||||
void writeGeometry
|
void writeGeometry
|
||||||
(
|
(
|
||||||
const pointField& points,
|
Ostream& os,
|
||||||
const faceList& faces,
|
const meshedSurf& surf,
|
||||||
List<DynamicList<face>>& decomposedFaces,
|
List<DynamicList<face>>& decomposedFaces
|
||||||
OFstream& os
|
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Write the formatted keyword to the output stream
|
//- Write the formatted keyword to the output stream
|
||||||
void writeKeyword
|
Ostream& writeKeyword
|
||||||
(
|
(
|
||||||
const word& keyword,
|
Ostream& os,
|
||||||
Ostream& os
|
const word& keyword
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Write the footer information
|
//- 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
|
//- Write a formatted value to the output stream
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void writeValue
|
Ostream& writeValue(Ostream& os, const Type& value) const;
|
||||||
(
|
|
||||||
const Type& value,
|
|
||||||
Ostream& os
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Write a face-based value
|
//- Write a face-based value
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void writeFaceValue
|
Ostream& writeFaceValue
|
||||||
(
|
(
|
||||||
|
Ostream& os,
|
||||||
const dataFormat& format,
|
const dataFormat& format,
|
||||||
const Type& value,
|
const Type& value,
|
||||||
const label EID,
|
const label EID //!< 1-based Element Id
|
||||||
Ostream& os
|
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
//- Templated write operation
|
//- Templated write operation
|
||||||
template<class Type>
|
template<class Type>
|
||||||
fileName writeTemplate
|
fileName writeTemplate
|
||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -215,10 +212,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -226,13 +222,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -240,13 +235,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -254,13 +248,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -268,13 +261,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -282,13 +274,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -30,10 +30,10 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::nastranSurfaceWriter::writeValue
|
Foam::Ostream& Foam::nastranSurfaceWriter::writeValue
|
||||||
(
|
(
|
||||||
const Type& value,
|
Ostream& os,
|
||||||
Ostream& os
|
const Type& value
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
switch (writeFormat_)
|
switch (writeFormat_)
|
||||||
@ -54,16 +54,18 @@ void Foam::nastranSurfaceWriter::writeValue
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::nastranSurfaceWriter::writeFaceValue
|
Foam::Ostream& Foam::nastranSurfaceWriter::writeFaceValue
|
||||||
(
|
(
|
||||||
|
Ostream& os,
|
||||||
const dataFormat& format,
|
const dataFormat& format,
|
||||||
const Type& value,
|
const Type& value,
|
||||||
const label EID,
|
const label EID
|
||||||
Ostream& os
|
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Fixed short/long formats supporting PLOAD2 and PLOAD4:
|
// Fixed short/long formats supporting PLOAD2 and PLOAD4:
|
||||||
@ -84,16 +86,13 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
|||||||
|
|
||||||
Type scaledValue = scale_*value;
|
Type scaledValue = scale_*value;
|
||||||
|
|
||||||
// Write Keyword
|
// Write keyword
|
||||||
writeKeyword(dataFormatNames_[format], os);
|
writeKeyword(os, dataFormatNames_[format]) << separator_;
|
||||||
|
|
||||||
os << separator_;
|
|
||||||
|
|
||||||
// Write load set ID
|
// Write load set ID
|
||||||
os.setf(ios_base::right);
|
os.setf(ios_base::right);
|
||||||
writeValue(SID, os);
|
|
||||||
|
|
||||||
os << separator_;
|
writeValue(os, SID) << separator_;
|
||||||
|
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
@ -101,7 +100,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
|||||||
{
|
{
|
||||||
if (pTraits<Type>::nComponents == 1)
|
if (pTraits<Type>::nComponents == 1)
|
||||||
{
|
{
|
||||||
writeValue(scaledValue, os);
|
writeValue(os, scaledValue) << separator_;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -110,25 +109,25 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
|||||||
<< "and cannot be used for higher rank values"
|
<< "and cannot be used for higher rank values"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
writeValue(scalar(0), os);
|
writeValue(os, scalar(0)) << separator_;
|
||||||
}
|
}
|
||||||
|
|
||||||
os << separator_;
|
writeValue(os, EID);
|
||||||
writeValue(EID, os);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case dfPLOAD4:
|
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_;
|
os << separator_;
|
||||||
writeValue(component(scaledValue, dirI), os);
|
writeValue(os, component(scaledValue, dirI));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -140,6 +139,8 @@ void Foam::nastranSurfaceWriter::writeFaceValue
|
|||||||
os.unsetf(ios_base::right);
|
os.unsetf(ios_base::right);
|
||||||
|
|
||||||
os << nl;
|
os << nl;
|
||||||
|
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -148,8 +149,7 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -185,17 +185,15 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
|||||||
Info<< "Writing nastran file to " << os.name() << endl;
|
Info<< "Writing nastran file to " << os.name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
os << "TITLE=OpenFOAM " << surfaceName.c_str() << " " << fieldName
|
os << "TITLE=OpenFOAM " << surfaceName.c_str()
|
||||||
<< " data" << nl
|
<< " " << fieldName << " data" << nl
|
||||||
<< "$" << nl
|
<< "$" << nl
|
||||||
<< "TIME " << timeValue << nl
|
<< "TIME " << timeValue << nl
|
||||||
<< "$" << nl
|
<< "$" << nl
|
||||||
<< "BEGIN BULK" << nl;
|
<< "BEGIN BULK" << nl;
|
||||||
|
|
||||||
List<DynamicList<face>> decomposedFaces(faces.size());
|
List<DynamicList<face>> decomposedFaces;
|
||||||
|
writeGeometry(os, surf, decomposedFaces);
|
||||||
writeGeometry(points, faces, decomposedFaces, os);
|
|
||||||
|
|
||||||
|
|
||||||
os << "$" << nl
|
os << "$" << nl
|
||||||
<< "$ Field data" << nl
|
<< "$ Field data" << nl
|
||||||
@ -203,7 +201,7 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
|||||||
|
|
||||||
if (isNodeValues)
|
if (isNodeValues)
|
||||||
{
|
{
|
||||||
label n = 0;
|
label elemId = 0;
|
||||||
|
|
||||||
forAll(decomposedFaces, i)
|
forAll(decomposedFaces, i)
|
||||||
{
|
{
|
||||||
@ -219,28 +217,26 @@ Foam::fileName Foam::nastranSurfaceWriter::writeTemplate
|
|||||||
}
|
}
|
||||||
v /= f.size();
|
v /= f.size();
|
||||||
|
|
||||||
writeFaceValue(format, v, ++n, os);
|
writeFaceValue(os, format, v, ++elemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label n = 0;
|
label elemId = 0;
|
||||||
|
|
||||||
forAll(decomposedFaces, i)
|
forAll(decomposedFaces, i)
|
||||||
{
|
{
|
||||||
const DynamicList<face>& dFaces = decomposedFaces[i];
|
const DynamicList<face>& dFaces = decomposedFaces[i];
|
||||||
|
|
||||||
forAll(dFaces, facei)
|
forAll(dFaces, facei)
|
||||||
{
|
{
|
||||||
writeFaceValue(format, values[facei], ++n, os);
|
writeFaceValue(os, format, values[facei], ++elemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writeFooter(os);
|
writeFooter(os, surf)
|
||||||
|
<< "ENDDATA" << endl;
|
||||||
os << "ENDDATA" << endl;
|
|
||||||
|
|
||||||
return os.name();
|
return os.name();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -60,8 +60,7 @@ Foam::fileName Foam::proxySurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -83,7 +82,7 @@ Foam::fileName Foam::proxySurfaceWriter::write
|
|||||||
Info<< "Writing geometry to " << outName << endl;
|
Info<< "Writing geometry to " << outName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshedSurfaceProxy<face>(points, faces).write(outName);
|
MeshedSurfaceProxy<face>(surf.points(), surf.faces()).write(outName);
|
||||||
|
|
||||||
return outName;
|
return outName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -89,10 +89,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -40,11 +40,9 @@ namespace Foam
|
|||||||
inline void Foam::rawSurfaceWriter::writeLocation
|
inline void Foam::rawSurfaceWriter::writeLocation
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const pointField& points,
|
const point& pt
|
||||||
const label pointi
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const point& pt = points[pointi];
|
|
||||||
os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << ' ';
|
os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,12 +51,10 @@ inline void Foam::rawSurfaceWriter::writeLocation
|
|||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
const faceList& faces,
|
const face& f
|
||||||
const label facei
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const point& ct = faces[facei].centre(points);
|
writeLocation(os, f.centre(points));
|
||||||
os << ct.x() << ' ' << ct.y() << ' ' << ct.z() << ' ';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -238,11 +234,13 @@ Foam::fileName Foam::rawSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
|
||||||
if (!isDir(outputDir))
|
if (!isDir(outputDir))
|
||||||
{
|
{
|
||||||
mkDir(outputDir);
|
mkDir(outputDir);
|
||||||
@ -269,7 +267,7 @@ Foam::fileName Foam::rawSurfaceWriter::write
|
|||||||
// Write faces centres
|
// Write faces centres
|
||||||
forAll(faces, elemI)
|
forAll(faces, elemI)
|
||||||
{
|
{
|
||||||
writeLocation(os, points, faces, elemI);
|
writeLocation(os, points, faces[elemI]);
|
||||||
os << nl;
|
os << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -59,19 +59,13 @@ class rawSurfaceWriter
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
static inline void writeLocation
|
static inline void writeLocation(Ostream&, const point&);
|
||||||
(
|
|
||||||
Ostream&,
|
|
||||||
const pointField&,
|
|
||||||
const label pointi
|
|
||||||
);
|
|
||||||
|
|
||||||
static inline void writeLocation
|
static inline void writeLocation
|
||||||
(
|
(
|
||||||
Ostream&,
|
Ostream&,
|
||||||
const pointField&,
|
const pointField&,
|
||||||
const faceList&,
|
const face&
|
||||||
const label facei
|
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -92,8 +86,7 @@ class rawSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -127,10 +120,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
@ -139,13 +131,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -153,13 +144,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -167,13 +157,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -181,13 +170,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -195,13 +183,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,14 +34,16 @@ Foam::fileName Foam::rawSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
|
||||||
if (!isDir(outputDir))
|
if (!isDir(outputDir))
|
||||||
{
|
{
|
||||||
mkDir(outputDir);
|
mkDir(outputDir);
|
||||||
@ -73,7 +75,7 @@ Foam::fileName Foam::rawSurfaceWriter::writeTemplate
|
|||||||
{
|
{
|
||||||
forAll(values, elemI)
|
forAll(values, elemI)
|
||||||
{
|
{
|
||||||
writeLocation(os, points, elemI);
|
writeLocation(os, points[elemI]);
|
||||||
writeData(os, values[elemI]);
|
writeData(os, values[elemI]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +83,7 @@ Foam::fileName Foam::rawSurfaceWriter::writeTemplate
|
|||||||
{
|
{
|
||||||
forAll(values, elemI)
|
forAll(values, elemI)
|
||||||
{
|
{
|
||||||
writeLocation(os, points, faces, elemI);
|
writeLocation(os, points, faces[elemI]);
|
||||||
writeData(os, values[elemI]);
|
writeData(os, values[elemI]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -94,8 +94,7 @@ Foam::fileName Foam::starcdSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -111,7 +110,7 @@ Foam::fileName Foam::starcdSurfaceWriter::write
|
|||||||
Info<< "Writing geometry to " << outName << endl;
|
Info<< "Writing geometry to " << outName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshedSurfaceProxy<face>(points, faces).write(outName);
|
MeshedSurfaceProxy<face>(surf.points(), surf.faces()).write(outName);
|
||||||
|
|
||||||
return outName;
|
return outName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -81,8 +81,7 @@ class starcdSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -119,11 +118,10 @@ public:
|
|||||||
virtual fileName write
|
virtual fileName write
|
||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -131,13 +129,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -145,13 +142,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -159,13 +155,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,8 +42,7 @@ Foam::fileName Foam::starcdSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf&,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -37,10 +37,8 @@ SourceFiles
|
|||||||
|
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "pointField.H"
|
|
||||||
#include "faceList.H"
|
|
||||||
#include "fileName.H"
|
#include "fileName.H"
|
||||||
|
#include "meshedSurfRef.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -120,8 +118,7 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -134,8 +131,7 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -151,8 +147,7 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -168,8 +163,7 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -185,8 +179,7 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -202,8 +195,7 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
|
|||||||
@ -40,10 +40,12 @@ namespace Foam
|
|||||||
void Foam::vtkSurfaceWriter::writeGeometry
|
void Foam::vtkSurfaceWriter::writeGeometry
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const pointField& points,
|
const meshedSurf& surf
|
||||||
const faceList& faces
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
const pointField& points = surf.points();
|
||||||
|
const faceList& faces = surf.faces();
|
||||||
|
|
||||||
// header
|
// header
|
||||||
os
|
os
|
||||||
<< "# vtk DataFile Version 2.0" << nl
|
<< "# vtk DataFile Version 2.0" << nl
|
||||||
@ -131,8 +133,9 @@ namespace Foam
|
|||||||
forAll(values, elemI)
|
forAll(values, elemI)
|
||||||
{
|
{
|
||||||
const vector& v = values[elemI];
|
const vector& v = values[elemI];
|
||||||
os << float(v[0]) << ' ' << float(v[1]) << ' ' << float(v[2])
|
os << float(v[0]) << ' '
|
||||||
<< nl;
|
<< float(v[1]) << ' '
|
||||||
|
<< float(v[2]) << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,8 +237,7 @@ Foam::fileName Foam::vtkSurfaceWriter::write
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose
|
const bool verbose
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -252,7 +254,7 @@ Foam::fileName Foam::vtkSurfaceWriter::write
|
|||||||
Info<< "Writing geometry to " << os.name() << endl;
|
Info<< "Writing geometry to " << os.name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeGeometry(os, points, faces);
|
writeGeometry(os, surf);
|
||||||
|
|
||||||
return os.name();
|
return os.name();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class vtkSurfaceWriter
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
static void writeGeometry(Ostream&, const pointField&, const faceList&);
|
static void writeGeometry(Ostream&, const meshedSurf&);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
static void writeData(Ostream&, const Field<Type>&);
|
static void writeData(Ostream&, const Field<Type>&);
|
||||||
@ -69,8 +69,7 @@ class vtkSurfaceWriter
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -104,10 +103,9 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
|
|
||||||
//- Write scalarField for a single surface to file.
|
//- Write scalarField for a single surface to file.
|
||||||
@ -116,13 +114,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<scalar>& values,
|
const Field<scalar>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write vectorField for a single surface to file.
|
//- Write vectorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -130,13 +127,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<vector>& values,
|
const Field<vector>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write sphericalTensorField for a single surface to file.
|
//- Write sphericalTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -144,13 +140,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<sphericalTensor>& values,
|
const Field<sphericalTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write symmTensorField for a single surface to file.
|
//- Write symmTensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -158,13 +153,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<symmTensor>& values,
|
const Field<symmTensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
//- Write tensorField for a single surface to file.
|
//- Write tensorField for a single surface to file.
|
||||||
// One value per face or vertex (isNodeValues = true)
|
// One value per face or vertex (isNodeValues = true)
|
||||||
@ -172,13 +166,12 @@ public:
|
|||||||
(
|
(
|
||||||
const fileName& outputDir, // <case>/surface/TIME
|
const fileName& outputDir, // <case>/surface/TIME
|
||||||
const fileName& surfaceName, // name of surface
|
const fileName& surfaceName, // name of surface
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName, // name of field
|
const word& fieldName, // name of field
|
||||||
const Field<tensor>& values,
|
const Field<tensor>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
const bool verbose = false
|
const bool verbose = false
|
||||||
) const;
|
) const; // override
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,8 +49,7 @@ Foam::fileName Foam::vtkSurfaceWriter::writeTemplate
|
|||||||
(
|
(
|
||||||
const fileName& outputDir,
|
const fileName& outputDir,
|
||||||
const fileName& surfaceName,
|
const fileName& surfaceName,
|
||||||
const pointField& points,
|
const meshedSurf& surf,
|
||||||
const faceList& faces,
|
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const Field<Type>& values,
|
const Field<Type>& values,
|
||||||
const bool isNodeValues,
|
const bool isNodeValues,
|
||||||
@ -70,7 +69,7 @@ Foam::fileName Foam::vtkSurfaceWriter::writeTemplate
|
|||||||
Info<< "Writing field " << fieldName << " to " << os.name() << endl;
|
Info<< "Writing field " << fieldName << " to " << os.name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeGeometry(os, points, faces);
|
writeGeometry(os, surf);
|
||||||
|
|
||||||
// start writing data
|
// start writing data
|
||||||
if (isNodeValues)
|
if (isNodeValues)
|
||||||
|
|||||||
@ -10,6 +10,8 @@ UnsortedMeshedSurface/UnsortedMeshedSurfaces.C
|
|||||||
|
|
||||||
MeshedSurfaceProxy/MeshedSurfaceProxyCore.C
|
MeshedSurfaceProxy/MeshedSurfaceProxyCore.C
|
||||||
|
|
||||||
|
mergedSurf/mergedSurf.C
|
||||||
|
|
||||||
surfaceRegistry/surfaceRegistry.C
|
surfaceRegistry/surfaceRegistry.C
|
||||||
surfMesh/surfMesh.C
|
surfMesh/surfMesh.C
|
||||||
surfMesh/surfMeshClear.C
|
surfMesh/surfMeshClear.C
|
||||||
|
|||||||
@ -209,7 +209,7 @@ Foam::MeshedSurface<Face>::MeshedSurface
|
|||||||
const MeshedSurface<Face>& surf
|
const MeshedSurface<Face>& surf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
ParentType(surf.faces(), surf.points()),
|
ParentType(surf.surfFaces(), surf.points()),
|
||||||
zones_(surf.surfZones())
|
zones_(surf.surfZones())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ Foam::MeshedSurface<Face>::MeshedSurface
|
|||||||
labelList faceMap;
|
labelList faceMap;
|
||||||
this->storedZones() = surf.sortedZones(faceMap);
|
this->storedZones() = surf.sortedZones(faceMap);
|
||||||
|
|
||||||
const List<Face>& origFaces = surf.faces();
|
const List<Face>& origFaces = surf;
|
||||||
List<Face> newFaces(origFaces.size());
|
List<Face> newFaces(origFaces.size());
|
||||||
|
|
||||||
forAll(newFaces, facei)
|
forAll(newFaces, facei)
|
||||||
@ -1167,7 +1167,7 @@ void Foam::MeshedSurface<Face>::operator=(const MeshedSurface& surf)
|
|||||||
clear();
|
clear();
|
||||||
|
|
||||||
this->storedPoints() = surf.points();
|
this->storedPoints() = surf.points();
|
||||||
this->storedFaces() = surf.faces();
|
this->storedFaces() = surf.surfFaces();
|
||||||
this->storedZones() = surf.surfZones();
|
this->storedZones() = surf.surfZones();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,7 +1178,7 @@ Foam::MeshedSurface<Face>::operator Foam::MeshedSurfaceProxy<Face>() const
|
|||||||
return MeshedSurfaceProxy<Face>
|
return MeshedSurfaceProxy<Face>
|
||||||
(
|
(
|
||||||
this->points(),
|
this->points(),
|
||||||
this->faces(),
|
this->surfFaces(),
|
||||||
this->surfZones()
|
this->surfZones()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -326,7 +326,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return const access to the faces
|
//- Return const access to the faces
|
||||||
inline const List<Face>& faces() const
|
inline const List<Face>& surfFaces() const
|
||||||
{
|
{
|
||||||
return static_cast<const List<Face>&>(*this);
|
return static_cast<const List<Face>&>(*this);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ Foam::Ostream& Foam::MeshedSurface<Face>::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
os << this->surfZones()
|
os << this->surfZones()
|
||||||
<< this->points()
|
<< this->points()
|
||||||
<< this->faces();
|
<< this->surfFaces();
|
||||||
|
|
||||||
os.check("MeshedSurface::write(Ostream&) const");
|
os.check("MeshedSurface::write(Ostream&) const");
|
||||||
return os;
|
return os;
|
||||||
|
|||||||
@ -65,10 +65,10 @@ class MeshedSurfaceIOAllocator
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&);
|
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&) = delete;
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const MeshedSurfaceIOAllocator&);
|
void operator=(const MeshedSurfaceIOAllocator&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -171,11 +171,11 @@ void Foam::MeshedSurfaceProxy<Face>::write
|
|||||||
if (this->useFaceMap())
|
if (this->useFaceMap())
|
||||||
{
|
{
|
||||||
// this is really a bit annoying (and wasteful) but no other way
|
// this is really a bit annoying (and wasteful) but no other way
|
||||||
os << reorder(this->faceMap(), this->faces());
|
os << reorder(this->faceMap(), this->surfFaces());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
os << this->faces();
|
os << this->surfFaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
io.writeEndDivider(os);
|
io.writeEndDivider(os);
|
||||||
|
|||||||
@ -146,7 +146,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return const access to the faces
|
//- Return const access to the faces
|
||||||
inline const List<Face>& faces() const
|
inline const List<Face>& surfFaces() const
|
||||||
{
|
{
|
||||||
return faces_;
|
return faces_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,7 +202,7 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
|
|||||||
ParentType
|
ParentType
|
||||||
(
|
(
|
||||||
xferCopy(surf.points()),
|
xferCopy(surf.points()),
|
||||||
xferCopy(surf.faces())
|
xferCopy(surf.surfFaces())
|
||||||
),
|
),
|
||||||
zoneIds_(surf.zoneIds()),
|
zoneIds_(surf.zoneIds()),
|
||||||
zoneToc_(surf.zoneToc())
|
zoneToc_(surf.zoneToc())
|
||||||
@ -218,7 +218,7 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
|
|||||||
ParentType
|
ParentType
|
||||||
(
|
(
|
||||||
xferCopy(surf.points()),
|
xferCopy(surf.points()),
|
||||||
xferCopy(surf.faces())
|
xferCopy(surf.surfFaces())
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
setZones(surf.surfZones());
|
setZones(surf.surfZones());
|
||||||
@ -456,7 +456,7 @@ Foam::Ostream& Foam::UnsortedMeshedSurface<Face>::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
os << this->zoneIds()
|
os << this->zoneIds()
|
||||||
<< this->points()
|
<< this->points()
|
||||||
<< this->faces();
|
<< this->surfFaces();
|
||||||
|
|
||||||
os.check("UnsortedMeshedSurface::write(Ostream&) const");
|
os.check("UnsortedMeshedSurface::write(Ostream&) const");
|
||||||
return os;
|
return os;
|
||||||
@ -777,7 +777,7 @@ void Foam::UnsortedMeshedSurface<Face>::operator=
|
|||||||
clear();
|
clear();
|
||||||
|
|
||||||
this->storedPoints() = surf.points();
|
this->storedPoints() = surf.points();
|
||||||
this->storedFaces() = surf.faces();
|
this->storedFaces() = surf.surfFaces();
|
||||||
zoneIds_ = surf.zoneIds_;
|
zoneIds_ = surf.zoneIds_;
|
||||||
zoneToc_ = surf.zoneToc_;
|
zoneToc_ = surf.zoneToc_;
|
||||||
}
|
}
|
||||||
@ -793,7 +793,7 @@ Foam::MeshedSurfaceProxy<Face>() const
|
|||||||
return MeshedSurfaceProxy<Face>
|
return MeshedSurfaceProxy<Face>
|
||||||
(
|
(
|
||||||
this->points(),
|
this->points(),
|
||||||
this->faces(),
|
this->surfFaces(),
|
||||||
zoneLst,
|
zoneLst,
|
||||||
faceMap
|
faceMap
|
||||||
);
|
);
|
||||||
|
|||||||
@ -126,7 +126,7 @@ protected:
|
|||||||
// Protected Member functions
|
// Protected Member functions
|
||||||
|
|
||||||
//- Return non-const access to the zone Ids
|
//- Return non-const access to the zone Ids
|
||||||
List<label>& storedZoneIds()
|
labelList& storedZoneIds()
|
||||||
{
|
{
|
||||||
return zoneIds_;
|
return zoneIds_;
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ public:
|
|||||||
void setSize(const label);
|
void setSize(const label);
|
||||||
|
|
||||||
//- Return const access to the zone ids
|
//- Return const access to the zone ids
|
||||||
const List<label>& zoneIds() const
|
virtual const labelList& zoneIds() const
|
||||||
{
|
{
|
||||||
return zoneIds_;
|
return zoneIds_;
|
||||||
}
|
}
|
||||||
|
|||||||
122
src/surfMesh/mergedSurf/mergedSurf.C
Normal file
122
src/surfMesh/mergedSurf/mergedSurf.C
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "mergedSurf.H"
|
||||||
|
#include "PatchTools.H"
|
||||||
|
#include "ListListOps.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::mergedSurf::mergedSurf()
|
||||||
|
:
|
||||||
|
points_(),
|
||||||
|
faces_(),
|
||||||
|
zones_(),
|
||||||
|
pointsMap_()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::mergedSurf::mergedSurf
|
||||||
|
(
|
||||||
|
const meshedSurf& surf,
|
||||||
|
const scalar mergeDim
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mergedSurf()
|
||||||
|
{
|
||||||
|
merge(surf, mergeDim);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::mergedSurf::~mergedSurf()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::mergedSurf::use()
|
||||||
|
{
|
||||||
|
return Pstream::parRun();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::mergedSurf::clear()
|
||||||
|
{
|
||||||
|
points_.clear();
|
||||||
|
faces_.clear();
|
||||||
|
zones_.clear();
|
||||||
|
pointsMap_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::mergedSurf::merge
|
||||||
|
(
|
||||||
|
const meshedSurf& surf,
|
||||||
|
const scalar mergeDim
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// needed for extra safety?
|
||||||
|
// clear();
|
||||||
|
|
||||||
|
if (!use())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PatchTools::gatherAndMerge
|
||||||
|
(
|
||||||
|
mergeDim,
|
||||||
|
primitivePatch
|
||||||
|
(
|
||||||
|
SubList<face>(surf.faces(), surf.faces().size()),
|
||||||
|
surf.points()
|
||||||
|
),
|
||||||
|
points_,
|
||||||
|
faces_,
|
||||||
|
pointsMap_
|
||||||
|
);
|
||||||
|
|
||||||
|
// Now handle zone/region information
|
||||||
|
List<labelList> allZones(Pstream::nProcs());
|
||||||
|
allZones[Pstream::myProcNo()] = surf.zoneIds();
|
||||||
|
Pstream::gatherList(allZones);
|
||||||
|
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
zones_ = ListListOps::combine<labelList>
|
||||||
|
(
|
||||||
|
allZones,
|
||||||
|
accessOp<labelList>()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
allZones.clear();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
133
src/surfMesh/mergedSurf/mergedSurf.H
Normal file
133
src/surfMesh/mergedSurf/mergedSurf.H
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::mergedSurf
|
||||||
|
|
||||||
|
Description
|
||||||
|
Simple class to manage surface merging information
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
mergedSurf.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef mergedSurf_H
|
||||||
|
#define mergedSurf_H
|
||||||
|
|
||||||
|
#include "meshedSurf.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class mergedSurf Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class mergedSurf
|
||||||
|
:
|
||||||
|
public meshedSurf
|
||||||
|
{
|
||||||
|
pointField points_;
|
||||||
|
faceList faces_;
|
||||||
|
labelList zones_;
|
||||||
|
labelList pointsMap_;
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
mergedSurf(const mergedSurf&) = delete;
|
||||||
|
|
||||||
|
// Assignment is needed for lists
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
mergedSurf();
|
||||||
|
|
||||||
|
//- Construct and merge meshed surfaces immediately (in parallel only).
|
||||||
|
mergedSurf(const meshedSurf&, const scalar mergeDim);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~mergedSurf();
|
||||||
|
|
||||||
|
|
||||||
|
// Access Member Functions
|
||||||
|
|
||||||
|
//- Can use (parallel only)
|
||||||
|
static bool use();
|
||||||
|
|
||||||
|
//- Number of faces
|
||||||
|
label size() const
|
||||||
|
{
|
||||||
|
return faces_.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Const access to (global) points used for the surface
|
||||||
|
virtual const pointField& points() const
|
||||||
|
{
|
||||||
|
return points_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Const access to the surface faces
|
||||||
|
virtual const faceList& faces() const
|
||||||
|
{
|
||||||
|
return faces_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const
|
||||||
|
{
|
||||||
|
return zones_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Map for reordered points (old-to-new)
|
||||||
|
const labelList& pointsMap() const
|
||||||
|
{
|
||||||
|
return pointsMap_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Edit
|
||||||
|
|
||||||
|
//- Clear all storage
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
//- Merge meshed surfaces (in parallel only).
|
||||||
|
bool merge(const meshedSurf&, const scalar mergeDim);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
85
src/surfMesh/meshedSurf/meshedSurf.H
Normal file
85
src/surfMesh/meshedSurf/meshedSurf.H
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::meshedSurf
|
||||||
|
|
||||||
|
Description
|
||||||
|
Abstract definition of a meshed surface defined by faces and points.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef meshedSurf_H
|
||||||
|
#define meshedSurf_H
|
||||||
|
|
||||||
|
#include "pointField.H"
|
||||||
|
#include "faceList.H"
|
||||||
|
#include "ListOps.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class meshedSurf Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class meshedSurf
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
meshedSurf()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~meshedSurf()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Access Member Functions
|
||||||
|
|
||||||
|
//- Const access to (global) points used for the surface
|
||||||
|
virtual const pointField& points() const = 0;
|
||||||
|
|
||||||
|
//- Const access to the surface faces
|
||||||
|
virtual const faceList& faces() const = 0;
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
119
src/surfMesh/meshedSurf/meshedSurfRef.H
Normal file
119
src/surfMesh/meshedSurf/meshedSurfRef.H
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::meshedSurfRef
|
||||||
|
|
||||||
|
Description
|
||||||
|
Implements a meshed surface by referencing existing faces and points.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef meshedSurfRef_H
|
||||||
|
#define meshedSurfRef_H
|
||||||
|
|
||||||
|
#include "meshedSurf.H"
|
||||||
|
#include "labelList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class meshedSurfRef Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class meshedSurfRef
|
||||||
|
:
|
||||||
|
public meshedSurf
|
||||||
|
{
|
||||||
|
const pointField& points_;
|
||||||
|
const faceList& faces_;
|
||||||
|
const labelList& zoneIds_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow construct as copy
|
||||||
|
meshedSurfRef(const meshedSurfRef&) = delete;
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const meshedSurfRef&) = delete;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public Member Functions
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
meshedSurfRef
|
||||||
|
(
|
||||||
|
const pointField& pts,
|
||||||
|
const faceList& faces,
|
||||||
|
const labelList& ids = Foam::emptyLabelList
|
||||||
|
)
|
||||||
|
:
|
||||||
|
points_(pts),
|
||||||
|
faces_(faces),
|
||||||
|
zoneIds_(ids)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~meshedSurfRef()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Access Member Functions
|
||||||
|
|
||||||
|
//- Const access to (global) points used for the surface
|
||||||
|
virtual const pointField& points() const
|
||||||
|
{
|
||||||
|
return points_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Const access to the surface faces
|
||||||
|
virtual const faceList& faces() const
|
||||||
|
{
|
||||||
|
return faces_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Const access to per-face zone/region information
|
||||||
|
virtual const labelList& zoneIds() const
|
||||||
|
{
|
||||||
|
return zoneIds_;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -261,7 +261,7 @@ void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
(
|
(
|
||||||
@ -358,7 +358,7 @@ void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
|
|||||||
MeshedSurfaceProxy<Face>
|
MeshedSurfaceProxy<Face>
|
||||||
(
|
(
|
||||||
surf.points(),
|
surf.points(),
|
||||||
surf.faces(),
|
surf.surfFaces(),
|
||||||
zoneLst
|
zoneLst
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -216,7 +216,7 @@ void Foam::fileFormats::GTSsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
(
|
(
|
||||||
@ -323,7 +323,7 @@ void Foam::fileFormats::GTSsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& zoneIds = surf.zoneIds();
|
const List<label>& zoneIds = surf.zoneIds();
|
||||||
const List<surfZoneIdentifier>& zoneToc = surf.zoneToc();
|
const List<surfZoneIdentifier>& zoneToc = surf.zoneToc();
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -215,7 +215,7 @@ void Foam::fileFormats::OBJsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
// for no zones, suppress the group name
|
// for no zones, suppress the group name
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -149,7 +149,7 @@ void Foam::fileFormats::OFFsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
const List<surfZone>& zoneLst = surf.surfZones();
|
const List<surfZone>& zoneLst = surf.surfZones();
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -193,7 +193,7 @@ void Foam::fileFormats::OFSsurfaceFormat<Face>::write
|
|||||||
const MeshedSurfaceProxy<Face>& surf
|
const MeshedSurfaceProxy<Face>& surf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
OFstream os(filename);
|
OFstream os(filename);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -46,7 +46,7 @@ void Foam::fileFormats::SMESHsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -247,7 +247,7 @@ void Foam::fileFormats::STARCDsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -203,7 +203,7 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
@ -258,9 +258,8 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBinary
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
@ -340,12 +339,12 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pointField& pointLst = surf.points();
|
||||||
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
|
|
||||||
// a single zone - we can skip sorting
|
// a single zone - we can skip sorting
|
||||||
if (surf.zoneToc().size() == 1)
|
if (surf.zoneToc().size() == 1)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
|
||||||
const List<Face>& faceLst = surf.faces();
|
|
||||||
|
|
||||||
os << "solid " << surf.zoneToc()[0].name() << endl;
|
os << "solid " << surf.zoneToc()[0].name() << endl;
|
||||||
forAll(faceLst, facei)
|
forAll(faceLst, facei)
|
||||||
{
|
{
|
||||||
@ -363,8 +362,8 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii
|
|||||||
filename,
|
filename,
|
||||||
MeshedSurfaceProxy<Face>
|
MeshedSurfaceProxy<Face>
|
||||||
(
|
(
|
||||||
surf.points(),
|
pointLst,
|
||||||
surf.faces(),
|
faceLst,
|
||||||
zoneLst,
|
zoneLst,
|
||||||
faceMap
|
faceMap
|
||||||
)
|
)
|
||||||
@ -389,7 +388,7 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBinary
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& zoneIds = surf.zoneIds();
|
const List<label>& zoneIds = surf.zoneIds();
|
||||||
|
|
||||||
unsigned int nTris = 0;
|
unsigned int nTris = 0;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -133,7 +133,7 @@ void Foam::fileFormats::TRIsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
@ -186,7 +186,7 @@ void Foam::fileFormats::TRIsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
|
|
||||||
OFstream os(filename);
|
OFstream os(filename);
|
||||||
if (!os.good())
|
if (!os.good())
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -223,7 +223,7 @@ void Foam::fileFormats::VTKsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
const List<surfZone>& zones =
|
const List<surfZone>& zones =
|
||||||
@ -302,7 +302,7 @@ void Foam::fileFormats::VTKsurfaceFormat<Face>::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
|
|
||||||
writeHeader(os, surf.points());
|
writeHeader(os, surf.points());
|
||||||
writeHeaderPolygons(os, faceLst);
|
writeHeaderPolygons(os, faceLst);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -46,7 +46,7 @@ void Foam::fileFormats::WRLsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
// for no zones, suppress the group name
|
// for no zones, suppress the group name
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -48,7 +48,7 @@ void Foam::fileFormats::X3DsurfaceFormat<Face>::write
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const pointField& pointLst = surf.points();
|
const pointField& pointLst = surf.points();
|
||||||
const List<Face>& faceLst = surf.faces();
|
const List<Face>& faceLst = surf.surfFaces();
|
||||||
const List<label>& faceMap = surf.faceMap();
|
const List<label>& faceMap = surf.faceMap();
|
||||||
|
|
||||||
// for no zones, suppress the group name
|
// for no zones, suppress the group name
|
||||||
|
|||||||
@ -3,5 +3,4 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/surfMesh/lnInclude
|
-I$(LIB_SRC)/surfMesh/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lfileFormats \
|
|
||||||
-lsurfMesh
|
-lsurfMesh
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -38,7 +38,7 @@ bool Foam::triSurface::readVTK(const fileName& fName)
|
|||||||
// Read (and triangulate) point, faces, zone info
|
// Read (and triangulate) point, faces, zone info
|
||||||
fileFormats::VTKsurfaceFormat<triFace> surf(fName);
|
fileFormats::VTKsurfaceFormat<triFace> surf(fName);
|
||||||
|
|
||||||
List<labelledTri> tris(surf.faces().size());
|
List<labelledTri> tris(surf.size());
|
||||||
forAll(tris, i)
|
forAll(tris, i)
|
||||||
{
|
{
|
||||||
const triFace& f = surf[i];
|
const triFace& f = surf[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user