/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020-2021 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 .
Class
Foam::faPatch
Description
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Author
Zeljko Tukovic, FMENA
Hrvoje Jasak, Wikki Ltd.
SourceFiles
faPatch.C
faPatchNew.C
faPatchTemplates.C
faPatchFaMeshTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef faPatch_H
#define faPatch_H
#include "patchIdentifier.H"
#include "labelList.H"
#include "pointField.H"
#include "typeInfo.H"
#include "faPatchFieldsFwd.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
class faBoundaryMesh;
class faPatch;
Ostream& operator<<(Ostream&, const faPatch&);
/*---------------------------------------------------------------------------*\
Class faPatch Declaration
\*---------------------------------------------------------------------------*/
class faPatch
:
public labelList,
public patchIdentifier
{
// Private Data
//- Neighbour polyPatch index
const label nbrPolyPatchId_;
//- Reference to boundary mesh
const faBoundaryMesh& boundaryMesh_;
// Demand-driven private data
//- Edge-face addressing
mutable labelList::subList* edgeFacesPtr_;
//- Local points labels
mutable labelList* pointLabelsPtr_;
//- Point-edge addressing
mutable labelListList* pointEdgesPtr_;
// Private Member Functions
//- No copy construct
faPatch(const faPatch&) = delete;
//- No copy assignment
void operator=(const faPatch&) = delete;
//- Clear out topological patch data
void clearOut();
protected:
// Protected Member Functions
//- The faPatch geometry initialisation is called by faBoundaryMesh
friend class faBoundaryMesh;
//- Calculate patch point labels
void calcPointLabels() const;
//- Calculate patch point-edge addressing
void calcPointEdges() const;
//- Initialise the calculation of the patch geometry
virtual void initGeometry()
{}
//- Calculate the patch geometry
virtual void calcGeometry()
{}
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&)
{}
//- Correct patch after moving points
virtual void movePoints(const pointField&);
//- Initialise the update of the patch topology
virtual void initUpdateMesh()
{}
//- Update of the patch topology
virtual void updateMesh()
{}
public:
typedef faBoundaryMesh BoundaryMesh;
//- Runtime type information
TypeName("patch");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
faPatch,
dictionary,
(
const word& name,
const dictionary& dict,
const label index,
const faBoundaryMesh& bm
),
(name, dict, index, bm)
);
// Constructors
//- Construct from components
faPatch
(
const word& name,
const labelList& edgeLabels,
const label index,
const faBoundaryMesh& bm,
const label ngbPolyPatchIndex
);
//- Construct from dictionary
faPatch
(
const word& name,
const dictionary& dict,
const label index,
const faBoundaryMesh& bm
);
//- Construct as copy, resetting the boundary mesh
faPatch(const faPatch&, const faBoundaryMesh&);
//- Construct and return a clone, resetting the edge list
//- and boundary mesh
virtual autoPtr clone
(
const faBoundaryMesh& bm,
const labelList& edgeLabels,
const label index,
const label ngbPolyPatchIndex
) const
{
return
autoPtr::New
(name(), edgeLabels, index, bm, ngbPolyPatchIndex);
}
// Selectors
//- Return a pointer to a new patch created
//- on freestore from dictionary
static autoPtr New
(
const word& name,
const dictionary& dict,
const label index,
const faBoundaryMesh& bm
);
//- Destructor
virtual ~faPatch();
// Member Functions
//- Return the list of edges
const labelList& edgeLabels() const noexcept
{
return static_cast(*this);
}
void edgeLabels(const UList