Loading...
Searching...
No Matches
snappyVoxelMeshDriver.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) 2018 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::snappyVoxelMeshDriver
28
29Description
30 Equivalent of snappyRefineDriver but operating on a voxel mesh.
31
32 Used to estimate cell size count from refinement (currently).
33
34SourceFiles
35 snappyVoxelMeshDriver.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef snappyVoxelMeshDriver_H
40#define snappyVoxelMeshDriver_H
41
42#include "labelList.H"
43#include "DynamicList.H"
44#include "labelVector.H"
45#include "boundBox.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward declarations
54class layerParameters;
55class meshRefinement;
57/*---------------------------------------------------------------------------*\
58 Class snappyVoxelMeshDriver Declaration
59\*---------------------------------------------------------------------------*/
60
61class snappyVoxelMeshDriver
62{
63 // Private data
64
65 //- Mesh+surface
66 meshRefinement& meshRefiner_;
67
68 //- From surface region to patch
69 const labelList globalToMasterPatch_;
70
71 //- From surface region to patch
72 const labelList globalToSlavePatch_;
73
74 //- Bounding box
75 boundBox bb_;
76
77 //- Number of voxels
78 labelVector n_;
79
80 //- Per voxel the refinement level
81 labelList voxelLevel_;
82
83 //- Per insersected voxel the originating surface
84 labelList globalRegion_;
85
86
87 // Private Member Functions
88
89 void addNeighbours
90 (
91 const labelList& cellLevel,
92 const labelVector& voxel,
93 const label voxeli,
95 ) const;
96
97 tmp<pointField> voxelCentres() const;
98
99 void isInside
100 (
101 const pointField& voxelCentres,
102 boolList& isVoxelInMesh
103 ) const;
104
105 void markSurfaceRefinement
106 (
107 labelList& voxelLevel,
108 labelList& globalRegion
109 ) const;
110
111 void findVoxels
112 (
113 const labelList& voxelLevel,
114 const pointField& locationsOutsideMesh,
115 labelList& voxels
116 ) const;
117
118 void floodFill
119 (
120 const label voxeli,
121 const label newLevel,
122 labelList& voxelLevel
123 ) const;
124
125 void max
126 (
127 const labelList& maxLevel,
128 labelList& voxelLevel
129 ) const;
130
131 labelList count(const labelList& voxelLevel) const;
132
133
134 //- No copy construct
135 snappyVoxelMeshDriver(const snappyVoxelMeshDriver&) = delete;
136
137 //- No copy assignment
138 void operator=(const snappyVoxelMeshDriver&) = delete;
139
140
141public:
142
143 //- Runtime type information
144 ClassName("snappyVoxelMeshDriver");
145
146
147 // Constructors
148
149 //- Construct from components
150 snappyVoxelMeshDriver
151 (
152 meshRefinement& meshRefiner,
153 const labelUList& globalToMasterPatch,
154 const labelUList& globalToSlavePatch
155 );
156
157
158 // Member Functions
160 void doRefine(const refinementParameters& refineParams);
161
162 //void doLayers(const layerParameters& layerParams);
163};
164
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168} // End namespace Foam
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#endif
173
174// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
A bounding box defined in terms of min/max extrema points.
Definition boundBox.H:71
Simple container to keep together layer specific information.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Simple container to keep together refinement specific information.
ClassName("snappyVoxelMeshDriver")
Runtime type information.
void doRefine(const refinementParameters &refineParams)
A class for managing temporary objects.
Definition tmp.H:75
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:74
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Vector< label > labelVector
Vector of labels.
Definition labelVector.H:47
List< bool > boolList
A List of bools.
Definition List.H:60
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75