STYLE: change MeshedSurface 'faces' access to 'surfFaces' (related to issue #104)

- use surfFaces() to return the templated list of faces.
  This frees up the method 'faces()' to be used as a virtual method,
  which will be needed at a later stage.
This commit is contained in:
Mark Olesen
2016-08-10 10:03:51 +02:00
parent c7d7cbca28
commit 3dffee8a6a
36 changed files with 70 additions and 77 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -785,7 +785,7 @@ int main(int argc, char *argv[])
if (flipNormals)
{
Info<< "Flipping faces." << nl << endl;
faceList& faces = const_cast<faceList&>(fMesh.faces());
faceList& faces = const_cast<faceList&>(fMesh.surfFaces());
forAll(faces, i)
{
faces[i] = fMesh[i].reverseFace();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -172,7 +172,7 @@ void Foam::patchToPoly2DMesh::addPatchFacesToFaces()
void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
{
const label nInternalEdges = patch_.nInternalEdges();
const faceList& faces = patch_.faces();
const faceList& faces = patch_.surfFaces();
const label nExternalEdges = patch_.edges().size() - nInternalEdges;
const labelList& meshPoints = patch_.meshPoints();

View File

@ -232,7 +232,7 @@ Foam::shortEdgeFilter2D::filter()
// These are global indices.
const pointField& points = ms_.points();
const edgeList& edges = ms_.edges();
const faceList& faces = ms_.faces();
const faceList& faces = ms_.surfFaces();
const labelList& meshPoints = ms_.meshPoints();
const labelList& boundaryPoints = ms_.boundaryPoints();

View File

@ -7,5 +7,4 @@ EXE_INC = \
LIB_LIBS = \
-ltriSurface \
-lmeshTools \
-lfileFormats \
-lsurfMesh

View File

@ -14,7 +14,6 @@ LIB_LIBS = \
-lfiniteVolume \
-llagrangian \
-lmeshTools \
-lfileFormats \
-ledgeMesh \
-lsurfMesh \
-ltriSurface \

View File

@ -5,5 +5,4 @@ EXE_INC = \
LIB_LIBS = \
-ltriSurface \
-lsurfMesh \
-lfileFormats
-lsurfMesh

View File

@ -7,5 +7,4 @@ EXE_INC = \
LIB_LIBS = \
-L$(FFTW_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) -lfftw3 \
-lfiniteVolume \
-lsampling \
-lsurfMesh
-lsampling

View File

@ -295,7 +295,7 @@ Foam::scalar surfaceNoise::writeSurfaceData
outDir,
fName,
surf.points(),
surf.faces(),
surf.surfFaces(),
title,
allData,
false
@ -318,7 +318,7 @@ Foam::scalar surfaceNoise::writeSurfaceData
outDir,
fName,
surf.points(),
surf.faces(),
surf.surfFaces(),
title,
data,
false

View File

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

View File

@ -177,7 +177,7 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return MeshStorage::faces();
return MeshStorage::surfFaces();
}
//- Face area vectors

View File

@ -137,7 +137,7 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return cuttingPlane::faces();
return cuttingPlane::surfFaces();
}
//- Face area magnitudes

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.

View File

@ -213,7 +213,7 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return MeshStorage::faces();
return MeshStorage::surfFaces();
}
//- Face area vectors

View File

@ -145,7 +145,7 @@ public:
//- Faces of surface
virtual const faceList& faces() const
{
return MeshStorage::faces();
return MeshStorage::surfFaces();
}
//- Face area vectors (normals)

View File

@ -209,7 +209,7 @@ Foam::MeshedSurface<Face>::MeshedSurface
const MeshedSurface<Face>& surf
)
:
ParentType(surf.faces(), surf.points()),
ParentType(surf.surfFaces(), surf.points()),
zones_(surf.surfZones())
{}
@ -225,7 +225,7 @@ Foam::MeshedSurface<Face>::MeshedSurface
labelList faceMap;
this->storedZones() = surf.sortedZones(faceMap);
const List<Face>& origFaces = surf.faces();
const List<Face>& origFaces = surf;
List<Face> newFaces(origFaces.size());
forAll(newFaces, facei)
@ -1167,7 +1167,7 @@ void Foam::MeshedSurface<Face>::operator=(const MeshedSurface& surf)
clear();
this->storedPoints() = surf.points();
this->storedFaces() = surf.faces();
this->storedFaces() = surf.surfFaces();
this->storedZones() = surf.surfZones();
}
@ -1178,7 +1178,7 @@ Foam::MeshedSurface<Face>::operator Foam::MeshedSurfaceProxy<Face>() const
return MeshedSurfaceProxy<Face>
(
this->points(),
this->faces(),
this->surfFaces(),
this->surfZones()
);
}

View File

@ -326,7 +326,7 @@ public:
}
//- 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);
}

View File

@ -47,7 +47,7 @@ Foam::Ostream& Foam::MeshedSurface<Face>::write(Ostream& os) const
{
os << this->surfZones()
<< this->points()
<< this->faces();
<< this->surfFaces();
os.check("MeshedSurface::write(Ostream&) const");
return os;

View File

@ -65,10 +65,10 @@ class MeshedSurfaceIOAllocator
// Private Member Functions
//- Disallow default bitwise copy construct
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&);
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&) = delete;
//- Disallow default bitwise assignment
void operator=(const MeshedSurfaceIOAllocator&);
void operator=(const MeshedSurfaceIOAllocator&) = delete;
public:

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -171,11 +171,11 @@ void Foam::MeshedSurfaceProxy<Face>::write
if (this->useFaceMap())
{
// 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
{
os << this->faces();
os << this->surfFaces();
}
io.writeEndDivider(os);

View File

@ -146,7 +146,7 @@ public:
}
//- Return const access to the faces
inline const List<Face>& faces() const
inline const List<Face>& surfFaces() const
{
return faces_;
}

View File

@ -202,7 +202,7 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
ParentType
(
xferCopy(surf.points()),
xferCopy(surf.faces())
xferCopy(surf.surfFaces())
),
zoneIds_(surf.zoneIds()),
zoneToc_(surf.zoneToc())
@ -218,7 +218,7 @@ Foam::UnsortedMeshedSurface<Face>::UnsortedMeshedSurface
ParentType
(
xferCopy(surf.points()),
xferCopy(surf.faces())
xferCopy(surf.surfFaces())
)
{
setZones(surf.surfZones());
@ -456,7 +456,7 @@ Foam::Ostream& Foam::UnsortedMeshedSurface<Face>::write(Ostream& os) const
{
os << this->zoneIds()
<< this->points()
<< this->faces();
<< this->surfFaces();
os.check("UnsortedMeshedSurface::write(Ostream&) const");
return os;
@ -777,7 +777,7 @@ void Foam::UnsortedMeshedSurface<Face>::operator=
clear();
this->storedPoints() = surf.points();
this->storedFaces() = surf.faces();
this->storedFaces() = surf.surfFaces();
zoneIds_ = surf.zoneIds_;
zoneToc_ = surf.zoneToc_;
}
@ -793,7 +793,7 @@ Foam::MeshedSurfaceProxy<Face>() const
return MeshedSurfaceProxy<Face>
(
this->points(),
this->faces(),
this->surfFaces(),
zoneLst,
faceMap
);

View File

@ -126,7 +126,7 @@ protected:
// Protected Member functions
//- Return non-const access to the zone Ids
List<label>& storedZoneIds()
labelList& storedZoneIds()
{
return zoneIds_;
}
@ -289,7 +289,7 @@ public:
void setSize(const label);
//- Return const access to the zone ids
const List<label>& zoneIds() const
virtual const labelList& zoneIds() const
{
return zoneIds_;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -261,7 +261,7 @@ void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<surfZone>& zones =
(
@ -358,7 +358,7 @@ void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
MeshedSurfaceProxy<Face>
(
surf.points(),
surf.faces(),
surf.surfFaces(),
zoneLst
)
);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -216,7 +216,7 @@ void Foam::fileFormats::GTSsurfaceFormat<Face>::write
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<surfZone>& zones =
(
@ -323,7 +323,7 @@ void Foam::fileFormats::GTSsurfaceFormat<Face>::write
)
{
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<surfZoneIdentifier>& zoneToc = surf.zoneToc();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -215,7 +215,7 @@ void Foam::fileFormats::OBJsurfaceFormat<Face>::write
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<label>& faceMap = surf.faceMap();
// for no zones, suppress the group name

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -149,7 +149,7 @@ void Foam::fileFormats::OFFsurfaceFormat<Face>::write
)
{
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<surfZone>& zoneLst = surf.surfZones();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -193,7 +193,7 @@ void Foam::fileFormats::OFSsurfaceFormat<Face>::write
const MeshedSurfaceProxy<Face>& surf
)
{
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<label>& faceMap = surf.faceMap();
OFstream os(filename);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,7 +46,7 @@ void Foam::fileFormats::SMESHsurfaceFormat<Face>::write
)
{
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<surfZone>& zones =

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -247,7 +247,7 @@ void Foam::fileFormats::STARCDsurfaceFormat<Face>::write
)
{
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<surfZone>& zones =

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -203,7 +203,7 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii
}
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<surfZone>& zones =
@ -258,9 +258,8 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBinary
<< exit(FatalError);
}
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<surfZone>& zones =
@ -340,12 +339,12 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii
<< exit(FatalError);
}
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.surfFaces();
// a single zone - we can skip sorting
if (surf.zoneToc().size() == 1)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
os << "solid " << surf.zoneToc()[0].name() << endl;
forAll(faceLst, facei)
{
@ -363,8 +362,8 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeAscii
filename,
MeshedSurfaceProxy<Face>
(
surf.points(),
surf.faces(),
pointLst,
faceLst,
zoneLst,
faceMap
)
@ -389,7 +388,7 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBinary
}
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<label>& zoneIds = surf.zoneIds();
unsigned int nTris = 0;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -133,7 +133,7 @@ void Foam::fileFormats::TRIsurfaceFormat<Face>::write
)
{
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<surfZone>& zones =
@ -186,7 +186,7 @@ void Foam::fileFormats::TRIsurfaceFormat<Face>::write
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
OFstream os(filename);
if (!os.good())

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -223,7 +223,7 @@ void Foam::fileFormats::VTKsurfaceFormat<Face>::write
)
{
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<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());
writeHeaderPolygons(os, faceLst);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,7 +46,7 @@ void Foam::fileFormats::WRLsurfaceFormat<Face>::write
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<label>& faceMap = surf.faceMap();
// for no zones, suppress the group name

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -48,7 +48,7 @@ void Foam::fileFormats::X3DsurfaceFormat<Face>::write
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<Face>& faceLst = surf.surfFaces();
const List<label>& faceMap = surf.faceMap();
// for no zones, suppress the group name

View File

@ -3,5 +3,4 @@ EXE_INC = \
-I$(LIB_SRC)/surfMesh/lnInclude
LIB_LIBS = \
-lfileFormats \
-lsurfMesh

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,7 +38,7 @@ bool Foam::triSurface::readVTK(const fileName& fName)
// Read (and triangulate) point, faces, zone info
fileFormats::VTKsurfaceFormat<triFace> surf(fName);
List<labelledTri> tris(surf.faces().size());
List<labelledTri> tris(surf.size());
forAll(tris, i)
{
const triFace& f = surf[i];