voxelMeshSearch.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) 2017-2021 OpenCFD Ltd.
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 \*---------------------------------------------------------------------------*/
27 
28 #include "voxelMeshSearch.H"
29 #include "polyMesh.H"
30 #include "processorPolyPatch.H"
31 #include "IOobject.H"
32 #include "fvMesh.H"
33 #include "block.H"
34 #include "emptyPolyPatch.H"
35 #include "fvMeshTools.H"
36 
37 /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
38 
39 namespace Foam
40 {
41  defineTypeNameAndDebug(voxelMeshSearch, 0);
42 }
43 
44 
45 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
46 
48 (
49  const labelVector& nDivs
50 )
51 {
52  return labelVector(1, nDivs.x(), nDivs.x()*nDivs.y());
53 }
54 
55 
57 (
58  const labelVector& nDivs,
59  const labelVector& voxel
60 )
61 {
62  return voxel.x()+voxel.y()*nDivs.x()+voxel.z()*nDivs.x()*nDivs.y();
63 }
64 
65 
67 (
68  const labelVector& nDivs,
69  label voxeli
70 )
71 {
72  const label nxy = nDivs.x()*nDivs.y();
73 
74  labelVector voxel;
75  voxel.z() = voxeli/nxy;
76  voxeli = voxeli % nxy;
77  voxel.y() = voxeli/nDivs.x();
78  voxel.x() = voxeli%nDivs.x();
79 
80  return voxel;
81 }
82 
83 
85 (
86  const boundBox& bb,
87  const labelVector& g,
88  const point& pt
89 )
90 {
91  const vector s(cmptDivide(bb.span(), vector(g.x(), g.y(), g.z())));
92 
93  labelVector v
94  (
95  floor((pt.x()-bb.min().x())/s.x()),
96  floor((pt.y()-bb.min().y())/s.y()),
97  floor((pt.z()-bb.min().z())/s.z())
98  );
99 
100  return v;
101 }
102 
103 
105 (
106  const boundBox& bb,
107  const labelVector& g,
108  const point& pt,
109  const bool clip
110 )
111 {
112  const vector s(cmptDivide(bb.span(), vector(g.x(), g.y(), g.z())));
113 
114  labelVector v
115  (
116  floor((pt.x()-bb.min().x())/s.x()),
117  floor((pt.y()-bb.min().y())/s.y()),
118  floor((pt.z()-bb.min().z())/s.z())
119  );
120 
121  if (clip)
122  {
123  v[0] = max(0, min(g[0]-1, v[0]));
124  v[1] = max(0, min(g[1]-1, v[1]));
125  v[2] = max(0, min(g[2]-1, v[2]));
126  }
127  else if
128  (
129  v[0] < 0
130  || v[1] < 0
131  || v[2] < 0
132  || v[0] >= g[0]
133  || v[1] >= g[1]
134  || v[2] >= g[2]
135  )
136  {
137  return -1;
138  }
139 
140  return index(g, v);
141 }
142 
143 
145 (
146  const boundBox& bb,
147  const labelVector& g,
148  const labelVector& voxel
149 )
150 {
151  const vector s(cmptDivide(bb.span(), vector(g.x(), g.y(), g.z())));
152 
153  return bb.min()+0.5*s+point(voxel[0]*s[0], voxel[1]*s[1], voxel[2]*s[2]);
154 }
155 
156 
158 (
159  OBJstream& os,
160  const boundBox& bb,
161  const labelVector& g
162 )
163 {
164  const vector s(cmptDivide(bb.span(), vector(g.x(), g.y(), g.z())));
165 
166  for (label i = 1; i < g[0]; i++)
167  {
168  for (label j = 0; j < g[1]; j++)
169  {
170  for (label k = 0; k < g[2]; k++)
171  {
172  point p1(bb.min()+point((i-1)*s[0], j*s[1], k*s[2]));
173  point p2(bb.min()+point(i*s[0], j*s[1], k*s[2]));
174  os.write(linePointRef(p1, p2));
175  }
176  }
177  }
178  for (label i = 0; i < g[0]; i++)
179  {
180  for (label j = 1; j < g[1]; j++)
181  {
182  for (label k = 0; k < g[2]; k++)
183  {
184  point p1(bb.min()+point(i*s[0], (j-1)*s[1], k*s[2]));
185  point p2(bb.min()+point(i*s[0], j*s[1], k*s[2]));
186  os.write(linePointRef(p1, p2));
187  }
188  }
189  }
190  for (label i = 0; i < g[0]; i++)
191  {
192  for (label j = 0; j < g[1]; j++)
193  {
194  for (label k = 1; k < g[2]; k++)
195  {
196  point p1(bb.min()+point(i*s[0], j*s[1], (k-1)*s[2]));
197  point p2(bb.min()+point(i*s[0], j*s[1], k*s[2]));
198  os.write(linePointRef(p1, p2));
199  }
200  }
201  }
202 }
203 
204 
205 Foam::label Foam::voxelMeshSearch::searchProcPatch
206 (
207  const label faceID,
208  const point& searchPoint
209 ) const
210 {
211  const pointField& cellCentres = mesh_.cellCentres();
212  const polyBoundaryMesh& bMeshes = mesh_.boundaryMesh();
213 
214  label patchi = bMeshes.patchID()[faceID-mesh_.nInternalFaces()];
215  const polyPatch& bMeshPatch = bMeshes[patchi];
216 
217  if (!isA<processorPolyPatch>(bMeshPatch))
218  {
219  return -1;
220  }
221  else
222  {
223  // Find nearest cell. Linear search since cheaper than constructing
224  // tree?
225  const labelUList& faceCells = bMeshPatch.faceCells();
226  scalar minProximity = GREAT;
227 
228  label nearestCellI = -1;
229  forAll(faceCells, i)
230  {
231  const point& cc = cellCentres[faceCells[i]];
232  scalar proximity = magSqr(cc-searchPoint);
233  if (proximity < minProximity)
234  {
235  minProximity = proximity;
236  nearestCellI = faceCells[i];
237  }
238  }
239  return nearestCellI;
240  }
241 }
242 
243 
244 Foam::label Foam::voxelMeshSearch::findIntersectedFace
245 (
246  const label cellI,
247  const point& p
248 ) const
249 {
250  // Return -1 or the label of the face intersected when tracking from
251  // p to centre of cellI
252 
253  const faceList& faces = mesh_.faces();
254  const pointField& faceCentres = mesh_.faceCentres();
255  const pointField& points = mesh_.points();
256 
257  const point& cc = mesh_.cellCentres()[cellI];
258  const labelList& cFaces = mesh_.cells()[cellI];
259 
260  const vector q(cc-p);
261 
262  forAll(cFaces, cFacei)
263  {
264  label facei = cFaces[cFacei];
265 
266  pointHit hitInfo = faces[facei].intersection
267  (
268  p,
269  q,
270  faceCentres[facei],
271  points,
273  );
274 
275  if (hitInfo.hit() && (hitInfo.distance() < 1))
276  {
277  return facei;
278  }
279  }
280  return -1;
281 }
282 
283 
284 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
285 
287 (
288  const polyMesh& mesh,
289  const bool doUpdate
290 )
291 :
292  mesh_(mesh)
293 {
294  // Determine number of voxels from number of cells in mesh
295  const labelVector& dim = mesh_.geometricD();
296 
297  // Guarantee at least one voxel
298  label nCells = max(1, mesh_.nCells());
299 
300  label nDivs = -1;
301  if (mesh_.nGeometricD() == 1)
302  {
303  nDivs = nCells;
304  }
305  else if (mesh_.nGeometricD() == 2)
306  {
307  nDivs = label(Foam::sqrt(scalar(nCells)));
308  }
309  else
310  {
311  nDivs = label(Foam::cbrt(scalar(nCells)));
312  }
313 
314  nDivs_ = labelVector(nDivs, nDivs, nDivs);
315  forAll(dim, i)
316  {
317  if (dim[i] == -1)
318  {
319  nDivs_[i] = 1;
320  }
321  }
322 
323  // Redo the local bounding box
324  localBb_ = boundBox(mesh_.points(), false);
325 
326  const point eps(1e-10, 1e-10, 1e-10);
327 
328  localBb_.min() = localBb_.min()-eps;
329  localBb_.max() = localBb_.max()+eps;
330 
331  if (debug)
332  {
333  Pout<< "voxelMeshSearch : mesh:" << mesh_.name()
334  << " nDivs:" << nDivs_ << endl;
335  }
336 
337  if (doUpdate)
338  {
339  update();
340  }
341 }
342 
343 
345 (
346  const polyMesh& mesh,
347  const boundBox& localBb,
348  const labelVector& nDivs,
349  const bool doUpdate
350 )
351 :
352  mesh_(mesh),
353  localBb_(localBb),
354  nDivs_(nDivs)
355 {
356  if (doUpdate)
357  {
358  update();
359  }
360 }
361 
362 
363 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
364 
366 {
367  // Initialise seed cell array
368 
369  seedCell_.setSize(cmptProduct(nDivs_));
370  seedCell_ = -1;
371 
372 
373  // Find seed cells
374  const pointField& points = mesh_.points();
375  const labelListList& cellPoints = mesh_.cellPoints();
376 
377  forAll(cellPoints, celli)
378  {
379  const labelList& cPoints = cellPoints[celli];
380 
381  // Get cell bounding box
382  boundBox bb(points, cPoints, false);
383 
384  fill(seedCell_, localBb_, nDivs_, bb, celli);
385  }
386 
387 
388  if (debug)
389  {
390  Pout<< "voxelMeshSearch : mesh:" << mesh_.name()
391  << " nDivs:" << nDivs_
392  << " localBb:" << localBb_ << endl;
393  }
394 
395 
398  //const pointField& cellCentres = mesh_.cellCentres();
399  //forAll(cellCentres, celli)
400  //{
401  // label voxeli = index(cellCentres[celli]);
402  // seedCell_[voxeli] = celli;
403  //}
404 
405  return true;
406 }
407 
408 
409 Foam::label Foam::voxelMeshSearch::findCell(const point& p) const
410 {
411  // First check if the point is contained in the bounding box, else exit
412  if (!localBb_.contains(p))
413  {
414  return -1;
415  }
416 
417 
418  // Locate the voxel index for this point. Do not clip.
419  label voxeli = index(localBb_, nDivs_, p, false);
420 
421  // The point may still be inside the bb but outside the actual domain.
422  if (voxeli < 0)
423  {
424  return -1;
425  }
426  else
427  {
428  // Inverse map to compute the seed cell.
429  label celli = seedCell_[voxeli];
430 
431  if (celli < 0)
432  {
433  return -1;
434  }
435  else
436  {
437  // Simplified, non-parallel tracking from cell centre of
438  // celli to wanted location p. Note that the cell thus
439  // found does not have to be the absolute 'correct' one as
440  // long as at least one of the processors finds a cell.
441 
442  track_.clear();
443  while (true)
444  {
445  if (track_.size() < 5)
446  {
447  track_.append(celli);
448  }
449 
450  // I am in celli now. How many faces do I have ?
451  label facei = findIntersectedFace(celli, p);
452 
453  if (facei == -1)
454  {
455  return celli;
456  }
457 
458  const label startOfTrack(max(0, track_.size()-5));
459 
460  label nextCell;
461  if (mesh_.isInternalFace(facei))
462  {
463  label own = mesh_.faceOwner()[facei];
464  label nei = mesh_.faceNeighbour()[facei];
465  nextCell = (own == celli ? nei : own);
466 
467  if (track_.found(nextCell, startOfTrack))
468  {
469  return celli;
470  }
471  }
472  else
473  {
474  nextCell = searchProcPatch(facei, p);
475 
476  if (nextCell == -1 || nextCell == celli)
477  {
478  return nextCell;
479  }
480  else if (track_.found(nextCell, startOfTrack))
481  {
482  return -1; // point is really out
483  }
484  }
485 
486  celli = nextCell;
487  }
488  return -1;
489  }
490  }
491 }
492 
493 
495 (
496  const IOobject& io
497 ) const
498 {
500 
504  {
505  //Info<< "Creating block" << endl;
506 
507  block b
508  (
509  cellShape(hex, identity(8)),
510  localBb_.points(),
511  blockEdgeList(),
512  blockFaceList(),
513  nDivs_,
515  );
516 
517  cellShapes = b.shapes();
518 
519  //Info<< "Creating boundary faces" << endl;
520 
521  boundary.setSize(b.boundaryPatches().size());
522  forAll(boundary, patchi)
523  {
524  faceList faces(b.boundaryPatches()[patchi].size());
525  forAll(faces, facei)
526  {
527  faces[facei] = face(b.boundaryPatches()[patchi][facei]);
528  }
529  boundary[patchi].transfer(faces);
530  }
531 
532  points.transfer(const_cast<pointField&>(b.points()));
533  }
534 
535  //Info<< "Creating patch dictionaries" << endl;
536  wordList patchNames(boundary.size());
537  forAll(patchNames, patchi)
538  {
539  patchNames[patchi] = polyPatch::defaultName(patchi);
540  }
541 
543  forAll(boundaryDicts, patchi)
544  {
545  boundaryDicts.set(patchi, new dictionary());
546  dictionary& patchDict = boundaryDicts[patchi];
547  patchDict.add("type", emptyPolyPatch::typeName);
548  }
549 
550  //Info<< "Creating polyMesh" << endl;
551  IOobject polyIO(io);
552  polyIO.readOpt(IOobject::NO_READ);
553  polyMesh mesh
554  (
555  //IOobject
556  //(
557  // polyMesh::defaultRegion,
558  // runTime.constant(),
559  // runTime,
560  // IOobject::NO_READ
561  //),
562  polyIO,
563  std::move(points),
564  cellShapes,
565  boundary,
566  patchNames,
568  "defaultFaces",
569  emptyPolyPatch::typeName,
570  false
571  );
572 
573  //Info<< "Writing polyMesh" << endl;
574  mesh.write();
575 
576  //Info<< "Reading fvMesh" << endl;
577 
579  (
580  io.db(),
581  io.name()
582  );
583  IOobject fvIO(io);
584  fvIO.readOpt(IOobject::MUST_READ);
585 
586  return autoPtr<fvMesh>::New(fvIO);
587 }
588 
589 
590 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::voxelMeshSearch::update
bool update()
Update lookup tables for geometry changes.
Definition: voxelMeshSearch.C:365
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::Vector::x
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:73
Foam::block
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
Definition: block.H:58
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::intersection::HALF_RAY
Definition: intersection.H:75
Foam::fvMesh::write
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
Definition: fvMesh.C:1041
Foam::fvMeshTools::createDummyFvMeshFiles
static void createDummyFvMeshFiles(const objectRegistry &parent, const word &regionName, const bool verbose=false)
Create additional fv* files.
Definition: fvMeshTools.C:760
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::OBJstream
OFstream that keeps track of vertices.
Definition: OBJstream.H:58
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
Foam::voxelMeshSearch::voxelMeshSearch
voxelMeshSearch(const polyMesh &, const bool doUpdate=true)
Construct from mesh; voxels estimated from local number of cells.
Definition: voxelMeshSearch.C:287
update
mesh update()
Foam::cellModel::HEX
hex
Definition: cellModel.H:81
Foam::voxelMeshSearch::index
static label index(const labelVector &nDivs, const labelVector &voxel)
Find cells. Returns number of cells found.
Definition: voxelMeshSearch.C:57
Foam::voxelMeshSearch::findCell
label findCell(const point &) const
Find a cell.
Definition: voxelMeshSearch.C:409
voxelMeshSearch.H
Foam::cmptProduct
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Definition: VectorSpaceI.H:596
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:444
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::voxelMeshSearch::writeGrid
static void writeGrid(OBJstream &, const boundBox &, const labelVector &)
Debug: write all edges.
Definition: voxelMeshSearch.C:158
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
polyMesh.H
Foam::Vector::z
const Cmpt & z() const
Access to the vector z component.
Definition: VectorI.H:85
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::boundBox::min
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:91
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Foam::labelVector
Vector< label > labelVector
Vector of labels.
Definition: labelVector.H:51
Foam::boundBox::span
vector span() const
The bounding box span (from minimum to maximum)
Definition: boundBoxI.H:127
Foam::blockEdgeList
PtrList< blockEdge > blockEdgeList
A PtrList of blockEdges.
Definition: blockEdgeList.H:47
Foam::polyBoundaryMesh::patchID
const labelList & patchID() const
Per boundary face label the patch index.
Definition: polyBoundaryMesh.C:456
Foam::cellShape::points
pointField points(const UList< point > &meshPoints) const
The points corresponding to this shape.
Definition: cellShapeI.H:151
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::Field< vector >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::OSstream::name
virtual const fileName & name() const
Get the name of the stream.
Definition: OSstream.H:107
Foam::List::setSize
void setSize(const label n)
Alias for resize()
Definition: List.H:222
Foam::List::transfer
void transfer(List< T > &list)
Definition: List.C:456
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
patchNames
wordList patchNames(nPatches)
Foam::cellModel::ref
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
Definition: cellModels.C:157
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
boundaryDicts
Info<< "Creating cells"<< endl;cellShapes=b.shapes();Info<< "Creating boundary faces"<< endl;boundary.setSize(b.boundaryPatches().size());forAll(boundary, patchi) { faceList faces(b.boundaryPatches()[patchi].size());forAll(faces, facei) { faces[facei]=face(b.boundaryPatches()[patchi][facei]);} boundary[patchi].transfer(faces);} points.transfer(const_cast< pointField & >b.points()));}Info<< "Creating patch dictionaries"<< endl;wordList patchNames(boundary.size());forAll(patchNames, patchi){ patchNames[patchi]=polyPatch::defaultName(patchi);}PtrList< dictionary > boundaryDicts(boundary.size())
Definition: createBlockMesh.H:56
IOobject.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
processorPolyPatch.H
Foam::pointHit
PointHit< point > pointHit
A PointIndexHit for 3D points.
Definition: pointHit.H:44
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:69
fvMesh.H
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::polyPatch::faceCells
const labelUList & faceCells() const
Return face-cell addressing.
Definition: polyPatch.C:371
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
emptyPolyPatch.H
Foam::voxelMeshSearch::makeMesh
autoPtr< fvMesh > makeMesh(const IOobject &) const
Debug: construct fvMesh. Note: writes a dummy mesh to.
Definition: voxelMeshSearch.C:495
Foam::hex
IOstream & hex(IOstream &io)
Definition: IOstream.H:446
Foam::IOobject::readOpt
readOption readOpt() const noexcept
The read option.
Definition: IOobjectI.H:164
Foam::cmptDivide
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::blockFaceList
PtrList< blockFace > blockFaceList
A PtrList of blockFaces.
Definition: blockFaceList.H:47
Foam::IOobject::name
const word & name() const noexcept
Return name.
Definition: IOobjectI.H:65
Foam::autoPtr< Foam::fvMesh >
Foam::Vector::y
const Cmpt & y() const
Access to the vector y component.
Definition: VectorI.H:79
Foam::primitiveMesh::cellCentres
const vectorField & cellCentres() const
Definition: primitiveMeshCellCentresAndVols.C:84
Foam::linePointRef
line< point, const point & > linePointRef
A line using referred points.
Definition: linePointRef.H:47
Foam::clip
dimensionSet clip(const dimensionSet &ds1, const dimensionSet &ds2)
Definition: dimensionSet.C:278
fvMeshTools.H
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:47
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::primitiveMesh::nInternalFaces
label nInternalFaces() const noexcept
Number of internal faces.
Definition: primitiveMeshI.H:78
Foam::List< labelList >
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::voxelMeshSearch::offset
static labelVector offset(const labelVector &nDivs)
Change in combined voxel index for change in components.
Definition: voxelMeshSearch.C:48
points
const pointField & points
Definition: gmvOutputHeader.H:1
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::identity
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
Definition: labelList.C:38
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
Foam::dictionary::add
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:640
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
cellShapes
cellShapeList cellShapes
Definition: createBlockMesh.H:3
Foam::cellModel
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:72
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::UList::null
static const UList< T > & null()
Return a UList reference to a nullObject.
Definition: UListI.H:53
Foam::labelUList
UList< label > labelUList
A UList of labels.
Definition: UList.H:85
Foam::voxelMeshSearch::centre
static point centre(const boundBox &bb, const labelVector &nDivs, const labelVector &voxel)
Voxel index to voxel centre.
Definition: voxelMeshSearch.C:145
Foam::patchIdentifier::defaultName
static word defaultName(const label n=-1)
Default patch name: "patch" or "patchN".
Definition: patchIdentifier.H:76
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::voxelMeshSearch::index3
static labelVector index3(const labelVector &nDivs, const label voxeli)
Combined voxel index to individual indices.
Definition: voxelMeshSearch.C:67
block.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
boundary
faceListList boundary
Definition: createBlockMesh.H:4
Foam::IOobject::MUST_READ
Definition: IOobject.H:185
Foam::IOobject::db
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition: IOobject.C:487