faceZones: New class to replace the original typedef

The faceZone specific functionality from Zones moved to the faceZones class.
This commit is contained in:
Henry Weller
2024-03-26 22:42:36 +00:00
parent 5292cbdb5b
commit fa36bc75cc
20 changed files with 199 additions and 265 deletions

View File

@ -58,12 +58,8 @@ void printMesh(const Time& runTime, const polyMesh& mesh)
}
template<class ZoneType>
void removeZone
(
Zones<ZoneType, polyMesh>& zones,
const word& setName
)
template<class ZonesType>
void removeZone(ZonesType& zones, const word& setName)
{
label zoneID = zones.findIndex(setName);

View File

@ -363,10 +363,10 @@ class vtkPVFoam
wordList getZoneNames(const word& zoneType) const;
//- Get non-empty zone names from mesh info
template<class ZoneType>
template<class ZoneType, class ZonesType>
wordList getZoneNames
(
const Zones<ZoneType, polyMesh>&
const Zones<ZoneType, ZonesType, polyMesh>&
) const;
//- Add objects of Type to paraview array selection

View File

@ -81,10 +81,10 @@ public:
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ZoneType>
template<class ZoneType, class ZonesType>
Foam::wordList Foam::vtkPVFoam::getZoneNames
(
const Zones<ZoneType, polyMesh>& zmesh
const Zones<ZoneType, ZonesType, polyMesh>& zmesh
) const
{
wordList names(zmesh.size());

View File

@ -471,6 +471,11 @@ meshes/Identifiers/patch/coupleGroupIdentifier.C
meshes/meshObjects/meshObjects.C
meshes/zones/pointZones/pointZone.C
meshes/zones/cellZones/cellZone.C
meshes/zones/faceZones/faceZone.C
meshes/zones/faceZones/faceZones.C
polyMesh = meshes/polyMesh
polyPatches = $(polyMesh)/polyPatches
@ -510,17 +515,6 @@ $(polyMesh)/syncTools/syncTools.C
$(polyMesh)/polyMeshTetDecomposition/polyMeshTetDecomposition.C
$(polyMesh)/polyMeshTetDecomposition/tetIndices.C
zone = $(polyMesh)/zones/zone
cellZone = $(polyMesh)/zones/cellZone
$(cellZone)/cellZone.C
faceZone = $(polyMesh)/zones/faceZone
$(faceZone)/faceZone.C
pointZone = $(polyMesh)/zones/pointZone
$(pointZone)/pointZone.C
$(polyMesh)/polyMesh.C
$(polyMesh)/polyMeshFromShapeMesh.C
$(polyMesh)/polyMeshIO.C

View File

@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ 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/>.
Description
Foam::cellZones
\*---------------------------------------------------------------------------*/
#ifndef cellZones_H
#define cellZones_H
#include "Zones.H"
#include "cellZone.H"
#include "cellZonesFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ 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/>.
Description
Foam::pointZones
\*---------------------------------------------------------------------------*/
#ifndef pointZones_H
#define pointZones_H
#include "Zones.H"
#include "pointZone.H"
#include "pointZonesFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -29,8 +29,8 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ZoneType, class MeshType>
bool Foam::Zones<ZoneType, MeshType>::read()
template<class ZoneType, class ZonesType, class MeshType>
bool Foam::Zones<ZoneType, ZonesType, MeshType>::read()
{
if
(
@ -64,7 +64,7 @@ bool Foam::Zones<ZoneType, MeshType>::read()
(
patchEntries[zi].keyword(),
patchEntries[zi].dict(),
*this
static_cast<const ZonesType&>(*this)
)
);
}
@ -90,8 +90,8 @@ bool Foam::Zones<ZoneType, MeshType>::read()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ZoneType, class MeshType>
Foam::Zones<ZoneType, MeshType>::Zones
template<class ZoneType, class ZonesType, class MeshType>
Foam::Zones<ZoneType, ZonesType, MeshType>::Zones
(
const IOobject& io,
const MeshType& mesh
@ -105,8 +105,8 @@ Foam::Zones<ZoneType, MeshType>::Zones
}
template<class ZoneType, class MeshType>
Foam::Zones<ZoneType, MeshType>::Zones
template<class ZoneType, class ZonesType, class MeshType>
Foam::Zones<ZoneType, ZonesType, MeshType>::Zones
(
const IOobject& io,
const MeshType& mesh,
@ -122,8 +122,8 @@ Foam::Zones<ZoneType, MeshType>::Zones
}
template<class ZoneType, class MeshType>
Foam::Zones<ZoneType, MeshType>::Zones
template<class ZoneType, class ZonesType, class MeshType>
Foam::Zones<ZoneType, ZonesType, MeshType>::Zones
(
const IOobject& io,
const MeshType& mesh,
@ -141,7 +141,10 @@ Foam::Zones<ZoneType, MeshType>::Zones
zones.setSize(mpz.size());
forAll(zones, zi)
{
zones.set(zi, mpz[zi].clone(*this).ptr());
zones.set(zi, mpz[zi].clone
(
static_cast<const ZonesType&>(*this)
).ptr());
}
}
}
@ -149,8 +152,8 @@ Foam::Zones<ZoneType, MeshType>::Zones
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ZoneType, class MeshType>
Foam::Zones<ZoneType, MeshType>::~Zones()
template<class ZoneType, class ZonesType, class MeshType>
Foam::Zones<ZoneType, ZonesType, MeshType>::~Zones()
{
clearAddressing();
}
@ -158,8 +161,11 @@ Foam::Zones<ZoneType, MeshType>::~Zones()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ZoneType, class MeshType>
bool Foam::Zones<ZoneType, MeshType>::found(const label objectIndex) const
template<class ZoneType, class ZonesType, class MeshType>
bool Foam::Zones<ZoneType, ZonesType, MeshType>::found
(
const label objectIndex
) const
{
forAll(*this, zi)
{
@ -173,8 +179,8 @@ bool Foam::Zones<ZoneType, MeshType>::found(const label objectIndex) const
}
template<class ZoneType, class MeshType>
Foam::labelList Foam::Zones<ZoneType, MeshType>::whichZones
template<class ZoneType, class ZonesType, class MeshType>
Foam::labelList Foam::Zones<ZoneType, ZonesType, MeshType>::whichZones
(
const label objectIndex
) const
@ -193,28 +199,8 @@ Foam::labelList Foam::Zones<ZoneType, MeshType>::whichZones
}
template<class ZoneType, class MeshType>
Foam::boolList Foam::Zones<ZoneType, MeshType>::zonesFlipFace
(
const label facei,
const labelList& faceiZones
)
{
labelList zones(whichZones(facei));
boolList flipFaces(zones.size());
forAll(zones, zi)
{
const ZoneType& fz = this->operator[](zi);
flipFaces[zi] = fz.flipMap()[fz.localIndex(facei)];
}
return flipFaces;
}
template<class ZoneType, class MeshType>
Foam::wordList Foam::Zones<ZoneType, MeshType>::types() const
template<class ZoneType, class ZonesType, class MeshType>
Foam::wordList Foam::Zones<ZoneType, ZonesType, MeshType>::types() const
{
const PtrList<ZoneType>& zones = *this;
@ -229,8 +215,8 @@ Foam::wordList Foam::Zones<ZoneType, MeshType>::types() const
}
template<class ZoneType, class MeshType>
Foam::wordList Foam::Zones<ZoneType, MeshType>::names() const
template<class ZoneType, class ZonesType, class MeshType>
Foam::wordList Foam::Zones<ZoneType, ZonesType, MeshType>::names() const
{
const PtrList<ZoneType>& zones = *this;
@ -245,8 +231,8 @@ Foam::wordList Foam::Zones<ZoneType, MeshType>::names() const
}
template<class ZoneType, class MeshType>
bool Foam::Zones<ZoneType, MeshType>::found
template<class ZoneType, class ZonesType, class MeshType>
bool Foam::Zones<ZoneType, ZonesType, MeshType>::found
(
const word& zoneName
) const
@ -267,8 +253,8 @@ bool Foam::Zones<ZoneType, MeshType>::found
}
template<class ZoneType, class MeshType>
Foam::label Foam::Zones<ZoneType, MeshType>::findIndex
template<class ZoneType, class ZonesType, class MeshType>
Foam::label Foam::Zones<ZoneType, ZonesType, MeshType>::findIndex
(
const word& zoneName
) const
@ -296,8 +282,8 @@ Foam::label Foam::Zones<ZoneType, MeshType>::findIndex
}
template<class ZoneType, class MeshType>
Foam::labelList Foam::Zones<ZoneType, MeshType>::findIndices
template<class ZoneType, class ZonesType, class MeshType>
Foam::labelList Foam::Zones<ZoneType, ZonesType, MeshType>::findIndices
(
const wordRe& key
) const
@ -329,8 +315,8 @@ Foam::labelList Foam::Zones<ZoneType, MeshType>::findIndices
}
template<class ZoneType, class MeshType>
Foam::PackedBoolList Foam::Zones<ZoneType, MeshType>::findMatching
template<class ZoneType, class ZonesType, class MeshType>
Foam::PackedBoolList Foam::Zones<ZoneType, ZonesType, MeshType>::findMatching
(
const wordRe& key
) const
@ -347,11 +333,11 @@ Foam::PackedBoolList Foam::Zones<ZoneType, MeshType>::findMatching
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::append(ZoneType* zonePtr) const
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::append(ZoneType* zonePtr) const
{
Zones<ZoneType, MeshType>& zones =
const_cast<Zones<ZoneType, MeshType>&>(*this);
Zones<ZoneType, ZonesType, MeshType>& zones =
const_cast<Zones<ZoneType, ZonesType, MeshType>&>(*this);
if (found(zonePtr->name()))
{
@ -365,11 +351,14 @@ void Foam::Zones<ZoneType, MeshType>::append(ZoneType* zonePtr) const
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::append(const ZoneType& zone) const
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::append
(
const ZoneType& zone
) const
{
Zones<ZoneType, MeshType>& zones =
const_cast<Zones<ZoneType, MeshType>&>(*this);
Zones<ZoneType, ZonesType, MeshType>& zones =
const_cast<Zones<ZoneType, ZonesType, MeshType>&>(*this);
if (found(zone.name()))
{
@ -382,8 +371,8 @@ void Foam::Zones<ZoneType, MeshType>::append(const ZoneType& zone) const
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::clearAddressing()
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::clearAddressing()
{
PtrList<ZoneType>& zones = *this;
@ -394,16 +383,16 @@ void Foam::Zones<ZoneType, MeshType>::clearAddressing()
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::clear()
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::clear()
{
clearAddressing();
PtrList<ZoneType>::clear();
}
template<class ZoneType, class MeshType>
bool Foam::Zones<ZoneType, MeshType>::checkDefinition
template<class ZoneType, class ZonesType, class MeshType>
bool Foam::Zones<ZoneType, ZonesType, MeshType>::checkDefinition
(
const bool report
) const
@ -420,8 +409,8 @@ bool Foam::Zones<ZoneType, MeshType>::checkDefinition
}
template<class ZoneType, class MeshType>
bool Foam::Zones<ZoneType, MeshType>::checkParallelSync
template<class ZoneType, class ZonesType, class MeshType>
bool Foam::Zones<ZoneType, ZonesType, MeshType>::checkParallelSync
(
const bool report
) const
@ -498,8 +487,8 @@ bool Foam::Zones<ZoneType, MeshType>::checkParallelSync
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::movePoints(const pointField& p)
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::movePoints(const pointField& p)
{
PtrList<ZoneType>& zones = *this;
@ -510,8 +499,8 @@ void Foam::Zones<ZoneType, MeshType>::movePoints(const pointField& p)
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::topoChange
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::topoChange
(
const polyTopoChangeMap& map
)
@ -525,8 +514,8 @@ void Foam::Zones<ZoneType, MeshType>::topoChange
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::mapMesh(const polyMeshMap& map)
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::mapMesh(const polyMeshMap& map)
{
PtrList<ZoneType>& zones = *this;
@ -537,8 +526,8 @@ void Foam::Zones<ZoneType, MeshType>::mapMesh(const polyMeshMap& map)
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::distribute
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::distribute
(
const polyDistributionMap& map
)
@ -552,8 +541,8 @@ void Foam::Zones<ZoneType, MeshType>::distribute
}
template<class ZoneType, class MeshType>
void Foam::Zones<ZoneType, MeshType>::swap(Zones& otherZones)
template<class ZoneType, class ZonesType, class MeshType>
void Foam::Zones<ZoneType, ZonesType, MeshType>::swap(ZonesType& otherZones)
{
clearAddressing();
otherZones.clearAddressing();
@ -578,7 +567,10 @@ void Foam::Zones<ZoneType, MeshType>::swap(Zones& otherZones)
if (zi < 0)
{
zones.append(otherZones[ozi].clone(*this));
zones.append(otherZones[ozi].clone
(
static_cast<const ZonesType&>(*this))
);
otherZones.set(ozi, nullptr);
}
else
@ -601,8 +593,8 @@ void Foam::Zones<ZoneType, MeshType>::swap(Zones& otherZones)
}
template<class ZoneType, class MeshType>
bool Foam::Zones<ZoneType, MeshType>::writeData(Ostream& os) const
template<class ZoneType, class ZonesType, class MeshType>
bool Foam::Zones<ZoneType, ZonesType, MeshType>::writeData(Ostream& os) const
{
os << *this;
return os.good();
@ -611,8 +603,8 @@ bool Foam::Zones<ZoneType, MeshType>::writeData(Ostream& os) const
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class ZoneType, class MeshType>
const ZoneType& Foam::Zones<ZoneType, MeshType>::operator[]
template<class ZoneType, class ZonesType, class MeshType>
const ZoneType& Foam::Zones<ZoneType, ZonesType, MeshType>::operator[]
(
const word& zoneName
) const
@ -631,8 +623,8 @@ const ZoneType& Foam::Zones<ZoneType, MeshType>::operator[]
}
template<class ZoneType, class MeshType>
ZoneType& Foam::Zones<ZoneType, MeshType>::operator[]
template<class ZoneType, class ZonesType, class MeshType>
ZoneType& Foam::Zones<ZoneType, ZonesType, MeshType>::operator[]
(
const word& zoneName
)
@ -653,11 +645,11 @@ ZoneType& Foam::Zones<ZoneType, MeshType>::operator[]
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class ZoneType, class MeshType>
template<class ZoneType, class ZonesType, class MeshType>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const Zones<ZoneType, MeshType>& zones
const Zones<ZoneType, ZonesType, MeshType>& zones
)
{
os << zones.size() << nl << token::BEGIN_LIST;

View File

@ -36,7 +36,7 @@ SourceFiles
#define Zones_H
#include "regIOobject.H"
#include "pointField.H"
#include "pointFieldFwd.H"
#include "Map.H"
#include "boolList.H"
#include "PackedBoolList.H"
@ -54,16 +54,16 @@ class polyTopoChangeMap;
class polyMeshMap;
class polyDistributionMap;
template<class ZoneType, class MeshType> class Zones;
template<class ZoneType, class ZonesType, class MeshType> class Zones;
template<class ZoneType, class MeshType>
Ostream& operator<<(Ostream&, const Zones<ZoneType, MeshType>&);
template<class ZoneType, class ZonesType, class MeshType>
Ostream& operator<<(Ostream&, const Zones<ZoneType, ZonesType, MeshType>&);
/*---------------------------------------------------------------------------*\
Class Zones Declaration
\*---------------------------------------------------------------------------*/
template<class ZoneType, class MeshType>
template<class ZoneType, class ZonesType, class MeshType>
class Zones
:
public PtrList<ZoneType>,
@ -133,14 +133,6 @@ public:
//- Given a global object index, return the list of zones it is in
labelList whichZones(const label objectIndex) const;
//- Return the list of flips for the facei
// for each of the face zones in faceiZones
boolList zonesFlipFace
(
const label facei,
const labelList& faceiZones
);
//- Return a list of zone types
wordList types() const;
@ -192,7 +184,7 @@ public:
//- Swap zones
// For run-time mesh replacement and mesh to mesh mapping
void swap(Zones&);
void swap(ZonesType&);
//- writeData member function required by regIOobject
bool writeData(Ostream&) const;
@ -210,15 +202,15 @@ public:
ZoneType& operator[](const word&);
//- Disallow default bitwise assignment
void operator=(const Zones<ZoneType, MeshType>&) = delete;
void operator=(const Zones<ZoneType, ZonesType, MeshType>&) = delete;
// Ostream operator
friend Ostream& operator<< <ZoneType, MeshType>
friend Ostream& operator<< <ZoneType, ZonesType, MeshType>
(
Ostream&,
const Zones<ZoneType, MeshType>&
const Zones<ZoneType, ZonesType, MeshType>&
);
};

View File

@ -34,7 +34,6 @@ Description
SourceFiles
cellZone.C
cellZoneNew.C
\*---------------------------------------------------------------------------*/
@ -42,13 +41,14 @@ SourceFiles
#define cellZone_H
#include "Zone.H"
#include "cellZonesFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class cellZones;
/*---------------------------------------------------------------------------*\
Class cellZone Declaration
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -21,29 +21,41 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::faceZones
Description
A Zones with the type faceZone
Foam::cellZones
\*---------------------------------------------------------------------------*/
#ifndef faceZonesFwd_H
#define faceZonesFwd_H
#ifndef cellZones_H
#define cellZones_H
#include "cellZone.H"
#include "Zones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Zone, class MeshType> class Zones;
class faceZone;
class polyMesh;
typedef Zones<faceZone, polyMesh> faceZones;
}
class polyMesh;
/*---------------------------------------------------------------------------*\
Class cellZones Declaration
\*---------------------------------------------------------------------------*/
class cellZones
:
public Zones<cellZone, cellZones, polyMesh>
{
public:
using Zones<cellZone, cellZones, polyMesh>::Zones;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -33,7 +33,6 @@ Description
SourceFiles
faceZone.C
faceZoneNew.C
\*---------------------------------------------------------------------------*/
@ -41,7 +40,6 @@ SourceFiles
#define faceZone_H
#include "Zone.H"
#include "faceZonesFwd.H"
#include "boolList.H"
#include "primitiveFacePatch.H"
@ -50,11 +48,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
class faceZone;
Ostream& operator<<(Ostream&, const faceZone&);
class faceZones;
/*---------------------------------------------------------------------------*\
Class faceZone Declaration

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -21,30 +21,29 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::cellZones
Description
A Zones with the type cellZone
\*---------------------------------------------------------------------------*/
#ifndef cellZonesFwd_H
#define cellZonesFwd_H
#include "faceZones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
namespace Foam
Foam::boolList Foam::faceZones::zonesFlipFace
(
const label facei,
const labelList& faceiZones
)
{
template<class Zone, class MeshType> class Zones;
class cellZone;
class polyMesh;
labelList zones(whichZones(facei));
boolList flipFaces(zones.size());
typedef Zones<cellZone, polyMesh> cellZones;
forAll(zones, zi)
{
const faceZone& fz = this->operator[](zi);
flipFaces[zi] = fz.flipMap()[fz.localIndex(facei)];
}
return flipFaces;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,23 +29,44 @@ Description
#ifndef faceZones_H
#define faceZones_H
#include "Zones.H"
#include "faceZone.H"
#include "faceZonesFwd.H"
#include "Zones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// class faceZones
// :
// public Zones<faceZone, polyMesh>
// {
// public:
// using Zones<faceZone, polyMesh>::Zones;
// };
}
class polyMesh;
/*---------------------------------------------------------------------------*\
Class cellZones Declaration
\*---------------------------------------------------------------------------*/
class faceZones
:
public Zones<faceZone, faceZones, polyMesh>
{
public:
using Zones<faceZone, faceZones, polyMesh>::Zones;
// Member Functions
//- Return the list of flips for the facei
// for each of the face zones in faceiZones
boolList zonesFlipFace
(
const label facei,
const labelList& faceiZones
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -35,7 +35,6 @@ Description
SourceFiles
pointZone.C
pointZoneNew.C
\*---------------------------------------------------------------------------*/
@ -43,13 +42,14 @@ SourceFiles
#define pointZone_H
#include "Zone.H"
#include "pointZonesFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class pointZones;
/*---------------------------------------------------------------------------*\
Class pointZone Declaration
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -21,27 +21,41 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::pointZones
Description
A Zones with the type pointZone
Foam::pointZones
\*---------------------------------------------------------------------------*/
#ifndef pointZonesFwd_H
#define pointZonesFwd_H
#ifndef pointZones_H
#define pointZones_H
#include "pointZone.H"
#include "Zones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Zone, class MeshType> class Zones;
class pointZone;
class polyMesh;
typedef Zones<pointZone, polyMesh> pointZones;
}
class polyMesh;
/*---------------------------------------------------------------------------*\
Class pointZones Declaration
\*---------------------------------------------------------------------------*/
class pointZones
:
public Zones<pointZone, pointZones, polyMesh>
{
public:
using Zones<pointZone, pointZones, polyMesh>::Zones;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //