Files
openfoam/src/meshTools/cellDist/cellDistFuncs.H
Mark Olesen 1c9102dada HashSet gets additional operators
- operator+=  : add in the listed keys
 - operator-=  : remove the listed keys
 - operator&=  : intersection of keys
 - added xfer constructor (just in case)
 - moved labelHashSet typedef to HashSet.H, for consistency with the
   wordHashSet typedef being there and since it is used so often
2008-11-18 23:11:09 +01:00

165 lines
4.8 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cellDistFuncs
Description
Collection of functions used in wall distance calculation.
SourceFiles
cellDistFuncs.C
\*---------------------------------------------------------------------------*/
#ifndef cellDistFuncs_H
#define cellDistFuncs_H
#include "scalarField.H"
#include "HashSet.H"
#include "Map.H"
#include "wordList.H"
#include "scalarField.H"
#include "point.H"
#include "primitivePatch.H"
#include "className.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polyMesh;
class polyPatch;
class polyBoundaryMesh;
/*---------------------------------------------------------------------------*\
Class cellDistFuncs Declaration
\*---------------------------------------------------------------------------*/
class cellDistFuncs
{
// Private Member Data
//- Reference to mesh
const polyMesh& mesh_;
// Private Member Functions
//- Search for element in first n elements of labelList. Return index
// or -1.
static label findIndex(const label n, const labelList&, const label);
//- Disallow default bitwise copy construct
cellDistFuncs(const cellDistFuncs&);
//- Disallow default bitwise assignment
void operator=(const cellDistFuncs&);
public:
ClassName("cellDistFuncs");
// Constructors
//- Construct from mesh
cellDistFuncs(const polyMesh& mesh);
// Member Functions
//- Access mesh
const polyMesh& mesh() const
{
return mesh_;
}
//- Get patchIDs of named patches
labelHashSet getPatchIDs(const wordList&) const;
//- Get patchIDs of certain type (e.g. 'processorPolyPatch')
labelHashSet getPatchIDs(const word&) const;
//- Calculate smallest true distance (and face index)
// from pt to faces wallFaces.
// For efficiency reasons we still pass in patch instead of extracting
// it from mesh_
scalar smallestDist
(
const point& p,
const polyPatch& patch,
const label nWallFaces,
const labelList& wallFaces,
label& meshFaceI
) const;
//- Get faces sharing point with face on patch
label getPointNeighbours
(
const primitivePatch&,
const label patchFaceI,
labelList&
) const;
//- Size of largest patch (out of supplied subset of patches)
label maxPatchSize(const labelHashSet& patchIDs) const;
//- Sum of patch sizes (out of supplied subset of patches).
// Used in sizing arrays.
label sumPatchSize(const labelHashSet& patchIDs) const;
//- Correct all cells connected to boundary (via face). Sets values in
// wallDistCorrected. Sets nearest wallface in nearestFace.
void correctBoundaryFaceCells
(
const labelHashSet& patchIDs,
scalarField& wallDistCorrected,
Map<label>& nearestFace
) const;
//- Correct all cells connected to wall (via point). Sets values in
// wallDistCorrected. Uses/sets nearest wallFace in nearestFace.
void correctBoundaryPointCells
(
const labelHashSet& patchIDs,
scalarField& wallDistCorrected,
Map<label>& nearestFace
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //