faceCells.C
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) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 #include "faceCells.H"
31 #include "fvMesh.H"
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
47 faceCells::faceCells
48 (
49  const fvMesh& mesh,
50  const dictionary& dict
51 )
52 :
54 {
55  for (const fvPatch& patch : mesh_.boundary())
56  {
57  for (const word& patchType : zeroATCPatches_)
58  {
59  if (patch.type() == patchType)
60  {
61  const labelList& faceCells_ = patch.faceCells();
62  zeroATCcells_.append(faceCells_);
63  }
64  }
65  }
66 
67  for (const label zoneID: zeroATCZones_)
68  {
69  if (zoneID !=-1)
70  {
71  const labelList& zoneCells = mesh_.cellZones()[zoneID];
72  zeroATCcells_.append(zoneCells);
73  }
74  }
75  label size = zeroATCcells_.size();
76  reduce(size, sumOp<label>());
77  Info<< "Setting limiter on " << size << " cells" << nl << endl;
78 }
79 
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 } // End namespace Foam
84 
85 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:63
Foam::zeroATCcells
Base class for selecting cells on which to zero the ATC term.
Definition: zeroATCcells.H:52
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::zeroATCcells::zeroATCcells_
labelList zeroATCcells_
Definition: zeroATCcells.H:72
Foam::List::append
void append(const T &val)
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::sumOp
Definition: ops.H:207
Foam::zeroATCcells::zeroATCZones_
labelList zeroATCZones_
Definition: zeroATCcells.H:71
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:45
Foam::Info
messageStream Info
Foam::polyMesh::cellZones
const cellZoneMesh & cellZones() const noexcept
Definition: polyMesh.H:488
Foam::zeroATCcells::mesh_
const fvMesh & mesh_
Definition: zeroATCcells.H:69
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
zoneID
const labelIOList & zoneID
Definition: interpolatedFaces.H:22
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:81
fvMesh.H
Foam
Definition: atmBoundaryLayer.C:26
faceCells.H
Foam::zeroATCcells::zeroATCPatches_
wordList zeroATCPatches_
Definition: zeroATCcells.H:70
Foam::fvMesh::boundary
const fvBoundaryMesh & boundary() const
Definition: fvMesh.C:678
Foam::nl
constexpr char nl
Definition: Ostream.H:424
Foam::foamVersion::patch
const std::string patch
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:52