/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see .
Class
meshDualiser
Description
Creates dual of polyMesh. Every point becomes a cell (or multiple cells
for feature points), a walk around every edge creates faces between them.
Put all points you want in the final mesh into featurePoints;
all edge(mid)s you want in the final mesh into featureEdges;
all face(centre)s in faceFaces.
Usually to preserve boundaries:
- all boundary faces are featureFaces
- all edges and points inbetween different patches are
featureEdges/points.
In same way you can also preserve internal faces (e.g. faceZones)
SourceFiles
meshDualiser.C
\*---------------------------------------------------------------------------*/
#ifndef meshDualiser_H
#define meshDualiser_H
#include "DynamicList.H"
#include "PackedBoolList.H"
#include "boolList.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class polyMesh;
class directTopoChange;
/*---------------------------------------------------------------------------*\
Class meshDualiser Declaration
\*---------------------------------------------------------------------------*/
class meshDualiser
{
// Private data
const polyMesh& mesh_;
//- From point on cell to dual cell. Either single entry or
// one entry per pointCells
labelListList pointToDualCells_;
//- From point to dual point (or -1 if not feature point).
labelList pointToDualPoint_;
//- From cell to dual point. All cells become point
labelList cellToDualPoint_;
//- From face to dual point (or -1 if not feature face)
labelList faceToDualPoint_;
//- From edge to dual point (or -1 if not feature edge)
labelList edgeToDualPoint_;
// Private Member Functions
static void checkPolyTopoChange(const directTopoChange&);
static void dumpPolyTopoChange(const directTopoChange&, const fileName&);
//- Find dual cell given point and cell
label findDualCell(const label cellI, const label pointI) const;
//- Helper function to generate dualpoints on all boundary edges
// emanating from (boundary & feature) point
void generateDualBoundaryEdges
(
const PackedBoolList&,
const label pointI,
directTopoChange&
);
//- Check that owner and neighbour of face have same dual cell
bool sameDualCell
(
const label faceI,
const label pointI
) const;
//- Add internal face
label addInternalFace
(
const label masterPointI,
const label masterEdgeI,
const label masterFaceI,
const bool edgeOrder,
const label dualCell0,
const label dualCell1,
const DynamicList