foamyHexMeshBackgroundMesh.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2016-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Application
28 foamyHexMeshBackGroundMesh
29
30Description
31 Writes out background mesh as constructed by foamyHexMesh and constructs
32 distanceSurface.
33
34\*---------------------------------------------------------------------------*/
35
36#include "PatchTools.H"
37#include "argList.H"
38#include "Time.H"
39#include "triSurface.H"
40#include "searchableSurfaces.H"
42#include "cellShapeControl.H"
44#include "cellShape.H"
45#include "DynamicField.H"
46#include "isoSurfaceCell.H"
48#include "syncTools.H"
49#include "decompositionModel.H"
50
51using namespace Foam;
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55// Tolerance (as fraction of the bounding box). Needs to be fairly lax since
56// usually meshes get written with limited precision (6 digits)
57static const scalar defaultMergeTol = 1e-6;
58
59// Get merging distance when matching face centres
60scalar getMergeDistance
61(
62 const argList& args,
63 const Time& runTime,
64 const boundBox& bb
65)
66{
67 const scalar mergeTol =
68 args.getOrDefault<scalar>("mergeTol", defaultMergeTol);
69
70 scalar writeTol =
71 Foam::pow(scalar(10), -scalar(IOstream::defaultPrecision()));
72
73 Info<< "Merge tolerance : " << mergeTol << nl
74 << "Write tolerance : " << writeTol << endl;
75
76 if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol)
77 {
79 << "Your current settings specify ASCII writing with "
80 << IOstream::defaultPrecision() << " digits precision." << endl
81 << "Your merging tolerance (" << mergeTol << ") is finer than this."
82 << endl
83 << "Please change your writeFormat to binary"
84 << " or increase the writePrecision" << endl
85 << "or adjust the merge tolerance (-mergeTol)."
86 << exit(FatalError);
87 }
88
89 scalar mergeDist = mergeTol * bb.mag();
90
91 Info<< "Overall meshes bounding box : " << bb << nl
92 << "Relative tolerance : " << mergeTol << nl
93 << "Absolute matching distance : " << mergeDist << nl
94 << endl;
95
96 return mergeDist;
97}
98
99
100void printMeshData(const polyMesh& mesh)
101{
102 // Collect all data on master
103
104 globalIndex globalCells(mesh.nCells());
105 labelListList patchNeiProcNo(Pstream::nProcs());
106 labelListList patchSize(Pstream::nProcs());
107 const labelList& pPatches = mesh.globalData().processorPatches();
108 patchNeiProcNo[Pstream::myProcNo()].setSize(pPatches.size());
109 patchSize[Pstream::myProcNo()].setSize(pPatches.size());
110 forAll(pPatches, i)
111 {
112 const processorPolyPatch& ppp = refCast<const processorPolyPatch>
113 (
114 mesh.boundaryMesh()[pPatches[i]]
115 );
116 patchNeiProcNo[Pstream::myProcNo()][i] = ppp.neighbProcNo();
117 patchSize[Pstream::myProcNo()][i] = ppp.size();
118 }
119 Pstream::gatherList(patchNeiProcNo);
120 Pstream::gatherList(patchSize);
121
122
123 // Print stats
124
125 globalIndex globalBoundaryFaces(mesh.nBoundaryFaces());
126
127 label maxProcCells = 0;
128 label totProcFaces = 0;
129 label maxProcPatches = 0;
130 label totProcPatches = 0;
131 label maxProcFaces = 0;
132
133 for (const int proci : Pstream::allProcs())
134 {
135 Info<< endl
136 << "Processor " << proci << nl
137 << " Number of cells = " << globalCells.localSize(proci)
138 << endl;
139
140 label nProcFaces = 0;
141
142 const labelList& nei = patchNeiProcNo[proci];
143
144 forAll(patchNeiProcNo[proci], i)
145 {
146 Info<< " Number of faces shared with processor "
147 << patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
148 << endl;
149
150 nProcFaces += patchSize[proci][i];
151 }
152
153 Info<< " Number of processor patches = " << nei.size() << nl
154 << " Number of processor faces = " << nProcFaces << nl
155 << " Number of boundary faces = "
156 << globalBoundaryFaces.localSize(proci) << endl;
157
158 maxProcCells = max(maxProcCells, globalCells.localSize(proci));
159 totProcFaces += nProcFaces;
160 totProcPatches += nei.size();
161 maxProcPatches = max(maxProcPatches, nei.size());
162 maxProcFaces = max(maxProcFaces, nProcFaces);
163 }
164
165 // Stats
166
167 scalar avgProcCells = scalar(globalCells.size())/Pstream::nProcs();
168 scalar avgProcPatches = scalar(totProcPatches)/Pstream::nProcs();
169 scalar avgProcFaces = scalar(totProcFaces)/Pstream::nProcs();
170
171 // In case of all faces on one processor. Just to avoid division by 0.
172 if (totProcPatches == 0)
173 {
174 avgProcPatches = 1;
175 }
176 if (totProcFaces == 0)
177 {
178 avgProcFaces = 1;
179 }
180
181 Info<< nl
182 << "Number of processor faces = " << totProcFaces/2 << nl
183 << "Max number of cells = " << maxProcCells
184 << " (" << 100.0*(maxProcCells-avgProcCells)/avgProcCells
185 << "% above average " << avgProcCells << ")" << nl
186 << "Max number of processor patches = " << maxProcPatches
187 << " (" << 100.0*(maxProcPatches-avgProcPatches)/avgProcPatches
188 << "% above average " << avgProcPatches << ")" << nl
189 << "Max number of faces between processors = " << maxProcFaces
190 << " (" << 100.0*(maxProcFaces-avgProcFaces)/avgProcFaces
191 << "% above average " << avgProcFaces << ")" << nl
192 << endl;
193}
194
195
196// Return cellID
197label cellLabel
198(
199 const Vector<label>& nCells,
200 const label i,
201 const label j,
202 const label k
203)
204{
205 return i*nCells[1]*nCells[2]+j*nCells[2]+k;
206}
207
208label vtxLabel
209(
210 const Vector<label>& nCells,
211 const label i,
212 const label j,
213 const label k
214)
215{
217 (
218 nCells[0]+1,
219 nCells[1]+1,
220 nCells[2]+1
221 );
222 return i*nPoints[1]*nPoints[2]+j*nPoints[2]+k;
223}
224
225
226autoPtr<polyMesh> generateHexMesh
227(
228 const IOobject& io,
229 const point& origin,
230 const vector& cellSize,
231 const Vector<label>& nCells
232)
233{
235 if (nCells[0]+nCells[1]+nCells[2] > 0)
236 {
237 points.setSize((nCells[0]+1)*(nCells[1]+1)*(nCells[2]+1));
238
239 // Generate points
240 for (label i = 0; i <= nCells[0]; i++)
241 {
242 for (label j = 0; j <= nCells[1]; j++)
243 {
244 for (label k = 0; k <= nCells[2]; k++)
245 {
246 point pt = origin;
247 pt.x() += i*cellSize[0];
248 pt.y() += j*cellSize[1];
249 pt.z() += k*cellSize[2];
250 points[vtxLabel(nCells, i, j, k)] = pt;
251 }
252 }
253 }
254 }
255
256
257 const cellModel& hex = cellModel::ref(cellModel::HEX);
258 cellShapeList cellShapes(nCells[0]*nCells[1]*nCells[2]);
259
260 labelList hexPoints(8);
261 label celli = 0;
262 for (label i = 0; i < nCells[0]; i++)
263 {
264 for (label j = 0; j < nCells[1]; j++)
265 {
266 for (label k = 0; k < nCells[2]; k++)
267 {
268 hexPoints[0] = vtxLabel(nCells, i, j, k);
269 hexPoints[1] = vtxLabel(nCells, i+1, j, k);
270 hexPoints[2] = vtxLabel(nCells, i+1, j+1, k);
271 hexPoints[3] = vtxLabel(nCells, i, j+1, k);
272 hexPoints[4] = vtxLabel(nCells, i, j, k+1);
273 hexPoints[5] = vtxLabel(nCells, i+1, j, k+1);
274 hexPoints[6] = vtxLabel(nCells, i+1, j+1, k+1);
275 hexPoints[7] = vtxLabel(nCells, i, j+1, k+1);
276 cellShapes[celli++].reset(hex, hexPoints);
277 }
278 }
279 }
280
284 word defaultFacesName = "defaultFaces";
285 word defaultFacesType = polyPatch::typeName;
286 wordList patchPhysicalTypes(0);
287
289 (
290 io,
291 std::move(points),
293 boundary,
298 patchPhysicalTypes
299 );
300}
301
302
303// Determine for every point a signed distance to the nearest surface
304// (outside is positive)
305tmp<scalarField> signedDistance
306(
307 const scalarField& distSqr,
308 const pointField& points,
309 const searchableSurfaces& geometry,
310 const labelList& surfaces
311)
312{
313 tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT)));
314 scalarField& fld = tfld.ref();
315
316 // Find nearest
317 List<pointIndexHit> nearest;
318 labelList nearestSurfaces;
319 searchableSurfacesQueries::findNearest
320 (
321 geometry,
322 surfaces,
323 points,
324 scalarField(points.size(), Foam::sqr(GREAT)),//distSqr
325 nearestSurfaces,
326 nearest
327 );
328
329 // Determine sign of nearest. Sort by surface to do this.
330 DynamicField<point> surfPoints(points.size());
331 DynamicList<label> surfIndices(points.size());
332
333 forAll(surfaces, surfI)
334 {
335 // Extract points on this surface
336 surfPoints.clear();
337 surfIndices.clear();
338 forAll(nearestSurfaces, i)
339 {
340 if (nearestSurfaces[i] == surfI)
341 {
342 surfPoints.append(points[i]);
343 surfIndices.append(i);
344 }
345 }
346
347 // Calculate sideness of these surface points
348 label geomI = surfaces[surfI];
349 List<volumeType> volType;
350 geometry[geomI].getVolumeType(surfPoints, volType);
351
352 // Push back to original
353 forAll(volType, i)
354 {
355 label pointi = surfIndices[i];
356 scalar dist = mag(points[pointi] - nearest[pointi].hitPoint());
357
358 volumeType vT = volType[i];
359
360 if (vT == volumeType::OUTSIDE)
361 {
362 fld[pointi] = dist;
363 }
364 else if (vT == volumeType::INSIDE)
365 {
366 fld[i] = -dist;
367 }
368 else
369 {
371 << "getVolumeType failure, neither INSIDE or OUTSIDE"
372 << exit(FatalError);
373 }
374 }
375 }
376
377 return tfld;
378}
379
380
381
382// Main program:
383
384int main(int argc, char *argv[])
385{
386 argList::addNote
387 (
388 "Generate foamyHexMesh-consistent representation of surfaces"
389 );
390 argList::addBoolOption
391 (
392 "writeMesh",
393 "Write the resulting mesh and distance fields"
394 );
395 argList::addOption
396 (
397 "mergeTol",
398 "scalar",
399 "The merge distance relative to the bounding box size (default 1e-6)"
400 );
401
402 argList::noFunctionObjects(); // Never use function objects
403
404 #include "setRootCase.H"
405 #include "createTime.H"
406
407 const bool writeMesh = args.found("writeMesh");
408
409 if (writeMesh)
410 {
411 Info<< "Writing resulting mesh and cellDistance, pointDistance fields."
412 << nl << endl;
413 }
414
415
416 IOdictionary foamyHexMeshDict
417 (
419 (
420 "foamyHexMeshDict",
421 runTime.system(),
422 runTime,
423 IOobject::MUST_READ_IF_MODIFIED,
424 IOobject::NO_WRITE
425 )
426 );
427
428 // Define/load all geometry
429 searchableSurfaces allGeometry
430 (
432 (
433 "cvSearchableSurfaces",
434 runTime.constant(),
435 "triSurface",
436 runTime,
437 IOobject::MUST_READ,
438 IOobject::NO_WRITE
439 ),
440 foamyHexMeshDict.subDict("geometry"),
441 foamyHexMeshDict.getOrDefault("singleRegionName", true)
442 );
443
444 Random rndGen(64293*Pstream::myProcNo());
445
446 conformationSurfaces geometryToConformTo
447 (
448 runTime,
449 rndGen,
450 allGeometry,
451 foamyHexMeshDict.subDict("surfaceConformation")
452 );
453
454 cellShapeControl cellShapeControls
455 (
456 runTime,
457 foamyHexMeshDict.subDict("motionControl"),
458 allGeometry,
459 geometryToConformTo
460 );
461
462
463 // Generate starting block mesh
464 vector cellSize;
465 {
466 const treeBoundBox& bb = geometryToConformTo.globalBounds();
467
468 // Determine the number of cells in each direction.
469 const vector span = bb.span();
470 vector nScalarCells = span/cellShapeControls.defaultCellSize();
471
472 // Calculate initial cell size to be a little bit smaller than the
473 // defaultCellSize to avoid initial refinement triggering.
475 (
476 label(nScalarCells.x())+2,
477 label(nScalarCells.y())+2,
478 label(nScalarCells.z())+2
479 );
480 cellSize = vector
481 (
482 span[0]/nCells[0],
483 span[1]/nCells[1],
484 span[2]/nCells[2]
485 );
486
487 Info<< "Generating initial hex mesh with" << nl
488 << " bounding box : " << bb << nl
489 << " nCells : " << nCells << nl
490 << " cellSize : " << cellSize << nl
491 << endl;
492
494 (
495 generateHexMesh
496 (
498 (
499 polyMesh::defaultRegion,
500 runTime.constant(),
501 runTime
502 ),
503 bb.min(),
504 cellSize,
505 (
506 Pstream::master()
507 ? nCells
508 : Vector<label>(0, 0, 0)
509 )
510 )
511 );
512 Info<< "Writing initial hex mesh to " << meshPtr().instance() << nl
513 << endl;
514 meshPtr().write();
515 }
516
517 // Distribute the initial mesh
518 if (Pstream::parRun())
519 {
520 #include "createNamedMesh.H"
521 Info<< "Loaded mesh:" << endl;
522 printMeshData(mesh);
523
524 // Allow override of decomposeParDict location
525 const fileName decompDictFile =
526 args.getOrDefault<fileName>("decomposeParDict", "");
527
528 labelList decomp = decompositionModel::New
529 (
530 mesh,
531 decompDictFile
532 ).decomposer().decompose(mesh, mesh.cellCentres());
533
534 // Global matching tolerance
535 //const scalar tolDim = getMergeDistance
536 //(
537 // args,
538 // runTime,
539 // mesh.bounds()
540 //);
541
542 // Mesh distribution engine
543 fvMeshDistribute distributor(mesh);
544
545 Info<< "Wanted distribution:"
546 << distributor.countCells(decomp) << nl << endl;
547
548 // Do actual sending/receiving of mesh
549 autoPtr<mapDistributePolyMesh> map = distributor.distribute(decomp);
550
551 // Print some statistics
552 //Info<< "After distribution:" << endl;
553 //printMeshData(mesh);
554
555 mesh.setInstance(runTime.constant());
556 Info<< "Writing redistributed mesh" << nl << endl;
557 mesh.write();
558 }
559
560
561 Info<< "Refining background mesh according to cell size specification" << nl
562 << endl;
563
564 const dictionary& backgroundMeshDict =
565 foamyHexMeshDict.subDict("backgroundMeshDecomposition");
566
567 backgroundMeshDecomposition backgroundMesh
568 (
569 runTime,
570 rndGen,
571 geometryToConformTo,
572 backgroundMeshDict
573 );
574
575 if (writeMesh)
576 {
577 ++runTime;
578 Info<< "Writing mesh to " << runTime.timeName() << endl;
579 backgroundMesh.mesh().write();
580 }
581
582 const scalar tolDim = getMergeDistance
583 (
584 args,
585 runTime,
586 backgroundMesh.mesh().bounds()
587 );
588
589
590 faceList isoFaces;
591 pointField isoPoints;
592
593 {
594 // Apply a distanceSurface to it.
595 const fvMesh& fvm = backgroundMesh.mesh();
596
597 volScalarField cellDistance
598 (
600 (
601 "cellDistance",
602 fvm.time().timeName(),
603 fvm.time(),
604 IOobject::NO_READ,
605 IOobject::NO_WRITE,
606 false
607 ),
608 fvm,
609 dimensionedScalar(dimLength, Zero)
610 );
611
612 const searchableSurfaces& geometry = geometryToConformTo.geometry();
613 const labelList& surfaces = geometryToConformTo.surfaces();
614
615
616 // Get maximum search size per cell
617 scalarField distSqr(cellDistance.size());
618
619 const labelList& cellLevel = backgroundMesh.cellLevel();
620 forAll(cellLevel, celli)
621 {
622 // The largest edge of the cell will always be less than the
623 // span of the bounding box of the cell.
624 distSqr[celli] = magSqr(cellSize)/pow(2, cellLevel[celli]);
625 }
626
627 {
628 // Internal field
629 cellDistance.primitiveFieldRef() = signedDistance
630 (
631 distSqr,
632 fvm.C(),
633 geometry,
634 surfaces
635 );
636
637 // Patch fields
638 volScalarField::Boundary& cellDistanceBf =
639 cellDistance.boundaryFieldRef();
640 forAll(fvm.C().boundaryField(), patchi)
641 {
642 const pointField& cc = fvm.C().boundaryField()[patchi];
643 fvPatchScalarField& fld = cellDistanceBf[patchi];
644 scalarField patchDistSqr
645 (
646 fld.patch().patchInternalField(distSqr)
647 );
648 fld = signedDistance(patchDistSqr, cc, geometry, surfaces);
649 }
650
651 // On processor patches the fvm.C() will already be the cell centre
652 // on the opposite side so no need to swap cellDistance.
653
654 if (writeMesh)
655 {
656 cellDistance.write();
657 }
658 }
659
660
661 // Distance to points
662 pointScalarField pointDistance
663 (
665 (
666 "pointDistance",
667 fvm.time().timeName(),
668 fvm.time(),
669 IOobject::NO_READ,
670 IOobject::NO_WRITE,
671 false
672 ),
673 pointMesh::New(fvm),
674 dimensionedScalar(dimLength, Zero)
675 );
676 {
677 scalarField pointDistSqr(fvm.nPoints(), -sqr(GREAT));
678 for (label facei = 0; facei < fvm.nInternalFaces(); facei++)
679 {
680 label own = fvm.faceOwner()[facei];
681 label ownDistSqr = distSqr[own];
682
683 const face& f = fvm.faces()[facei];
684 forAll(f, fp)
685 {
686 pointDistSqr[f[fp]] = max(pointDistSqr[f[fp]], ownDistSqr);
687 }
688 }
689 syncTools::syncPointList
690 (
691 fvm,
692 pointDistSqr,
694 -sqr(GREAT) // null value
695 );
696
697 pointDistance.primitiveFieldRef() = signedDistance
698 (
699 pointDistSqr,
700 fvm.points(),
701 geometry,
702 surfaces
703 );
704
705 if (writeMesh)
706 {
707 pointDistance.write();
708 }
709 }
710
712 (
713 fvm,
714 cellDistance,
715 pointDistance,
716 scalar(0) // distance
717 );
718
719 isoFaces.setSize(iso.size());
720 forAll(isoFaces, i)
721 {
722 isoFaces[i] = iso[i];
723 }
724 isoPoints = iso.points();
725 }
726
727
728 pointField mergedPoints;
729 faceList mergedFaces;
730 labelList pointMergeMap;
731 PatchTools::gatherAndMerge
732 (
733 tolDim,
734 primitivePatch(SubList<face>(isoFaces), isoPoints),
735 mergedPoints,
736 mergedFaces,
737 pointMergeMap
738 );
739
740 if (Pstream::master())
741 {
743 (
744 mergedPoints,
745 mergedFaces,
746 (runTime.path() / "iso"),
747 false // serial only
748 );
749
750 writer.writeGeometry();
751 }
752
753 Info<< "End\n" << endl;
754
755 return 0;
756}
757
758
759// ************************************************************************* //
label k
Y[inertIndex] max(0.0)
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Dynamically sized Field.
Definition: DynamicField.H:65
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
const Boundary & boundaryField() const
Return const-reference to the boundary field.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
void setSize(const label n)
Alias for resize()
Definition: List.H:218
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
A list of faces which address into the list of points.
Random number generator.
Definition: Random.H:60
A List obtained as a section of another List.
Definition: SubList.H:70
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
const Cmpt & z() const
Access to the vector z component.
Definition: VectorI.H:85
const Cmpt & y() const
Access to the vector y component.
Definition: VectorI.H:79
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:73
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:124
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:178
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Definition: argListI.H:307
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:64
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:91
scalar mag() const
The magnitude of the bounding box span.
Definition: boundBoxI.H:133
vector span() const
The bounding box span (from minimum to maximum)
Definition: boundBoxI.H:127
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:73
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
A class for handling file names.
Definition: fileName.H:76
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
const volVectorField & C() const
Return cell centres as volVectorField.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:290
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
A surface formed by the iso value. After "Polygonising A Scalar Field Using Tetrahedrons",...
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1108
virtual const labelList & faceOwner() const
Return face owner.
Definition: polyMesh.C:1121
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1083
label nInternalFaces() const noexcept
Number of internal faces.
label nPoints() const noexcept
Number of mesh points.
Neighbour processor patch.
int neighbProcNo() const
Return neighbour processor number.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
A class for managing temporary objects.
Definition: tmp.H:65
Standard boundBox with extra functionality for use in octree.
Definition: treeBoundBox.H:89
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
An enumeration wrapper for classification of a location as being inside/outside of a volume.
Definition: volumeType.H:61
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
A class for handling words, derived from Foam::string.
Definition: word.H:68
const cellModel & hex
cellShapeList cellShapes
faceListList boundary
dynamicFvMesh & mesh
engineTime & runTime
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Required Variables.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
const pointField & points
label nPoints
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
wordList patchTypes(nPatches)
wordList patchNames(nPatches)
labelList f(nPoints)
word defaultFacesName
Definition: readKivaGrid.H:455
word defaultFacesType
Definition: readKivaGrid.H:456
Foam::argList args(argc, argv)
volScalarField & e
Definition: createFields.H:11
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
Random rndGen
Definition: createFields.H:23