/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 .
\*---------------------------------------------------------------------------*/
#include "polyPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "polyBoundaryMesh.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "SubField.H"
#include "entry.H"
#include "dictionary.H"
#include "pointPatchField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(polyPatch, 0);
int polyPatch::disallowGenericPolyPatch
(
debug::debugSwitch("disallowGenericPolyPatch", 0)
);
defineRunTimeSelectionTable(polyPatch, word);
defineRunTimeSelectionTable(polyPatch, dictionary);
addToRunTimeSelectionTable(polyPatch, polyPatch, word);
addToRunTimeSelectionTable(polyPatch, polyPatch, dictionary);
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::polyPatch::movePoints(PstreamBuffers&, const pointField& p)
{
primitivePatch::movePoints(p);
}
void Foam::polyPatch::updateMesh(PstreamBuffers&)
{
primitivePatch::clearGeom();
clearAddressing();
}
void Foam::polyPatch::clearGeom()
{
primitivePatch::clearGeom();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::polyPatch::polyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
patchIdentifier(name, index),
primitivePatch
(
SubList(bm.mesh().faces(), size, start),
bm.mesh().points()
),
start_(start),
boundaryMesh_(bm)
{
if (constraintType(patchType))
{
addGroup(patchType);
}
}
Foam::polyPatch::polyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& physicalType,
const wordList& inGroups
)
:
patchIdentifier(name, index, physicalType, inGroups),
primitivePatch
(
SubList(bm.mesh().faces(), size, start),
bm.mesh().points()
),
start_(start),
boundaryMesh_(bm)
{}
Foam::polyPatch::polyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
patchIdentifier(name, dict, index),
primitivePatch
(
SubList
(
bm.mesh().faces(),
dict.get