Loading...
Searching...
No Matches
cellBox.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) 2017-2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::processorLODs::cellBox
28
29Description
30 Creates the parallel distribution map by describing the source and target
31 objects using box shapes.
32
33 A single box is created for the source object, which is then split using
34 2x2x2 refinement based on the number of remote target objects that overlap.
35 The refinement is local between communicating processor pairs, where the
36 refinement continues until a threshold number of remote target objects per
37 source box is achieved.
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Foam_processorLODs_cellBox
42#define Foam_processorLODs_cellBox
43
44#include "faceBox.H"
45#include "cellList.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
52{
53
54/*---------------------------------------------------------------------------*\
55 Class cellBox Declaration
56\*---------------------------------------------------------------------------*/
57
58class cellBox
59:
61{
62protected:
63
64 // Protected Data
65
66 //- Reference to the source cell list
68
69 //- Reference to the target cell list
70 const cellList& tgtCells_;
71
72
73 // Protected Member Functions
74
75 //- The local boundBox associated with given source object
76 virtual treeBoundBox calcSrcBox(const label srcObji) const;
77
78 //- The local boundBox associated with given target object
79 virtual treeBoundBox calcTgtBox(const label tgtObji) const;
80
81
82
83public:
84
85 //- Runtime type information
86 TypeName("box");
87
88 // Constructors
90 //- Construct from list of points/faces/cells for source and target
92 (
93 const cellList& srcCells,
94 const faceList& srcFaces,
95 const UList<point>& srcPoints,
96 const cellList& tgtCells,
97 const faceList& tgtFaces,
98 const UList<point>& tgtPoints,
99 const label maxObjectsPerLeaf,
100 const label nObjectsOfType,
101 const label nRefineIterMax = 100
102 );
103
104
105 //- Destructor
106 virtual ~cellBox() = default;
107
108
109 // Member Functions
110
111 //- Return the parallel distribution map
112 //- (usually linear construct order)
114 (
115 const mapDistributeBase::layoutTypes constructLayout
116 );
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace processorLODs
123} // End namespace Foam
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127#endif
128
129// ************************************************************************* //
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
layoutTypes
The map layout (eg, of the constructMap).
virtual ~cellBox()=default
Destructor.
cellBox(const cellList &srcCells, const faceList &srcFaces, const UList< point > &srcPoints, const cellList &tgtCells, const faceList &tgtFaces, const UList< point > &tgtPoints, const label maxObjectsPerLeaf, const label nObjectsOfType, const label nRefineIterMax=100)
Construct from list of points/faces/cells for source and target.
Definition cellBox.C:70
virtual treeBoundBox calcTgtBox(const label tgtObji) const
The local boundBox associated with given target object.
Definition cellBox.C:52
virtual treeBoundBox calcSrcBox(const label srcObji) const
The local boundBox associated with given source object.
Definition cellBox.C:36
TypeName("box")
Runtime type information.
const cellList & tgtCells_
Reference to the target cell list.
Definition cellBox.H:67
const cellList & srcCells_
Reference to the source cell list.
Definition cellBox.H:62
virtual autoPtr< mapDistribute > map(const mapDistributeBase::layoutTypes constructLayout)
Return the parallel distribution map (usually linear construct order).
Definition cellBox.C:101
Creates the parallel distribution map by describing the source and target objects using box shapes.
Definition faceBox.H:53
Standard boundBox with extra functionality for use in octree.
Namespace for OpenFOAM.
List< face > faceList
List of faces.
Definition faceListFwd.H:41
List< cell > cellList
List of cell.
Definition cellListFwd.H:41
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68