OppositeFaceCellWave.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::OppositeFaceCellWave
28 
29 Description
30  Version of FaceCellWave that walks through prismatic cells only.
31 
32  Used to determine mesh structure. In the front walking routines
33  (faceToCell and faceToCell) it
34  - walks across prismatic cells only
35  - and only to a single opposite face
36 
37  Notes:
38  A cell with a split faces will be marked but not walked through (since
39  there is no single opposite face.
40 
41 SourceFiles
42  OppositeFaceCellWave.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef OppositeFaceCellWave_H
47 #define OppositeFaceCellWave_H
48 
49 #include "FaceCellWave.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class OppositeFaceCellWaveName Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 TemplateName(OppositeFaceCellWave);
61 
62 
63 /*---------------------------------------------------------------------------*\
64  Class OppositeFaceCellWave Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class Type, class TrackingData = int>
69 :
70  public FaceCellWave<Type, TrackingData>,
71  public OppositeFaceCellWaveName
72 {
73 protected:
74 
75  // Protected data
76 
77  //- For every entry in changedCells (i.e. the cell front) gives
78  // the face that it needs to transfer to
80 
81 
82  // Protected Member Functions
83 
84  //- Determine 'opposite' faces (= faces not sharing a vertex) on cell
86  (
87  const label celli,
88  const label facei,
90  ) const;
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from mesh and list of changed faces with the Type
98  // for these faces. Iterates until nothing changes or maxIter reached.
99  // (maxIter can be 0)
101  (
102  const polyMesh&,
103  const labelList& initialChangedFaces,
104  const List<Type>& changedFacesInfo,
107  const label maxIter,
109  );
110 
111 
112  //- Destructor
113  virtual ~OppositeFaceCellWave() = default;
114 
115 
116  // Member Functions
117 
118  //- Propagate from face to cell. Returns total number of cells
119  // (over all processors) changed.
120  virtual label faceToCell();
121 
122  //- Propagate from cell to face. Returns total number of faces
123  // (over all processors) changed. (Faces on processorpatches are
124  // counted double)
125  virtual label cellToFace();
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #ifdef NoRepository
137  #include "OppositeFaceCellWave.C"
138 #endif
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Foam::OppositeFaceCellWave::faceToCell
virtual label faceToCell()
Propagate from face to cell. Returns total number of cells.
Definition: OppositeFaceCellWave.C:141
OppositeFaceCellWave.C
Foam::DynamicList< label >
Foam::FaceCellWave::allFaceInfo
UList< Type > & allFaceInfo()
Access allFaceInfo.
Definition: FaceCellWave.H:339
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::TemplateName
TemplateName(blendedSchemeBase)
Foam::OppositeFaceCellWave::opposingFaceLabels
void opposingFaceLabels(const label celli, const label facei, DynamicList< label > &) const
Determine 'opposite' faces (= faces not sharing a vertex) on cell.
Definition: OppositeFaceCellWave.C:35
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::FaceCellWave
Wave propagation of information through grid. Every iteration information goes through one layer of c...
Definition: FaceCellWave.H:78
Foam::FaceCellWave::allCellInfo
UList< Type > & allCellInfo()
Access allCellInfo.
Definition: FaceCellWave.H:345
Foam::OppositeFaceCellWave::OppositeFaceCellWave
OppositeFaceCellWave(const polyMesh &, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=FaceCellWave< Type, TrackingData >::dummyTrackData_)
Construct from mesh and list of changed faces with the Type.
Definition: OppositeFaceCellWave.C:100
Foam::OppositeFaceCellWave::~OppositeFaceCellWave
virtual ~OppositeFaceCellWave()=default
Destructor.
Foam::List< label >
Foam::OppositeFaceCellWave::changedOppositeFaces_
DynamicList< label > changedOppositeFaces_
For every entry in changedCells (i.e. the cell front) gives.
Definition: OppositeFaceCellWave.H:78
FaceCellWave.H
Foam::UList< Type >
Foam::OppositeFaceCellWave
Version of FaceCellWave that walks through prismatic cells only.
Definition: OppositeFaceCellWave.H:67
Foam::OppositeFaceCellWave::cellToFace
virtual label cellToFace()
Propagate from cell to face. Returns total number of faces.
Definition: OppositeFaceCellWave.C:258