faMesh.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) 2016-2017 Wikki Ltd
9  Copyright (C) 2020-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "faMesh.H"
30 #include "faMeshBoundaryHalo.H"
31 #include "faGlobalMeshData.H"
32 #include "Time.H"
33 #include "polyMesh.H"
34 #include "primitiveMesh.H"
35 #include "demandDrivenData.H"
36 #include "IndirectList.H"
37 #include "areaFields.H"
38 #include "edgeFields.H"
39 #include "faMeshLduAddressing.H"
40 #include "wedgeFaPatch.H"
41 #include "faPatchData.H"
42 
43 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47  defineTypeNameAndDebug(faMesh, 0);
48 }
49 
50 
51 const Foam::word Foam::faMesh::prefix("finite-area");
52 
54 
55 int Foam::faMesh::origPointAreaMethod_ = 0; // Tuning
56 
57 const int Foam::faMesh::quadricsFit_ = 0; // Tuning
58 
59 
60 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 // Convert patch names to face labels. Preserve patch order
67 (
68  const polyBoundaryMesh& pbm,
69  const wordRes& polyPatchNames
70 )
71 {
72  const labelList patchIDs
73  (
74  pbm.patchSet
75  (
76  polyPatchNames,
77  false, // warnNotFound
78  true // useGroups
79  ).sortedToc()
80  );
81 
82  if (patchIDs.empty())
83  {
85  << "No matching patches: " << polyPatchNames << nl
86  << exit(FatalError);
87  }
88 
89  label nFaceLabels = 0;
90  for (const label patchi : patchIDs)
91  {
92  nFaceLabels += pbm[patchi].size();
93  }
94 
95  labelList faceLabels(nFaceLabels);
96 
97  nFaceLabels = 0;
98  for (const label patchi : patchIDs)
99  {
100  for (const label facei : pbm[patchi].range())
101  {
102  faceLabels[nFaceLabels] = facei;
103  ++nFaceLabels;
104  }
105  }
106 
107  return faceLabels;
108 }
109 
110 } // End namespace Foam
111 
112 
113 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
114 
115 void Foam::faMesh::checkBoundaryEdgeLabelRange
116 (
117  const labelUList& edgeLabels
118 ) const
119 {
120  label nErrors = 0;
121 
122  for (const label edgei : edgeLabels)
123  {
124  if (edgei < nInternalEdges_ || edgei >= nEdges_)
125  {
126  if (!nErrors++)
127  {
129  << "Boundary edge label out of range "
130  << nInternalEdges_ << ".." << (nEdges_-1) << nl
131  << " ";
132  }
133 
134  FatalError<< ' ' << edgei;
135  }
136  }
137 
138  if (nErrors)
139  {
140  FatalError << nl << exit(FatalError);
141  }
142 }
143 
144 
145 void Foam::faMesh::initPatch() const
146 {
147  patchPtr_.reset
148  (
150  (
151  UIndirectList<face>(mesh().faces(), faceLabels_),
152  mesh().points()
153  )
154  );
155  bndConnectPtr_.reset(nullptr);
156  haloMapPtr_.reset(nullptr);
157  haloFaceCentresPtr_.reset(nullptr);
158  haloFaceNormalsPtr_.reset(nullptr);
159 }
160 
161 
162 void Foam::faMesh::setPrimitiveMeshData()
163 {
164  DebugInFunction << "Setting primitive data" << endl;
165 
166  const uindirectPrimitivePatch& bp = patch();
167  const labelListList& edgeFaces = bp.edgeFaces();
168 
169  // Dimensions
170 
171  nEdges_ = bp.nEdges();
172  nInternalEdges_ = bp.nInternalEdges();
173  nFaces_ = bp.size();
174  nPoints_ = bp.nPoints();
175 
176  edges_.resize(nEdges_);
177  edgeOwner_.resize(nEdges_);
178  edgeNeighbour_.resize(nInternalEdges_);
179 
180  // Internal edges
181  for (label edgei = 0; edgei < nInternalEdges_; ++edgei)
182  {
183  edges_[edgei] = bp.edges()[edgei];
184 
185  edgeOwner_[edgei] = edgeFaces[edgei][0];
186 
187  edgeNeighbour_[edgei] = edgeFaces[edgei][1];
188  }
189 
190  // Continue with boundary edges
191  label edgei = nInternalEdges_;
192 
193  for (const faPatch& p : boundary())
194  {
195  for (const label patchEdgei : p.edgeLabels())
196  {
197  edges_[edgei] = bp.edges()[patchEdgei];
198 
199  edgeOwner_[edgei] = edgeFaces[patchEdgei][0];
200 
201  ++edgei;
202  }
203  }
204 }
205 
206 
207 void Foam::faMesh::clearHalo() const
208 {
209  DebugInFunction << "Clearing halo information" << endl;
210 
211  haloMapPtr_.reset(nullptr);
212  haloFaceCentresPtr_.reset(nullptr);
213  haloFaceNormalsPtr_.reset(nullptr);
214 }
215 
216 
217 void Foam::faMesh::clearGeomNotAreas() const
218 {
219  DebugInFunction << "Clearing geometry" << endl;
220 
221  clearHalo();
222  patchPtr_.reset(nullptr);
223  bndConnectPtr_.reset(nullptr);
224  deleteDemandDrivenData(SPtr_);
225  deleteDemandDrivenData(patchStartsPtr_);
226  deleteDemandDrivenData(LePtr_);
227  deleteDemandDrivenData(magLePtr_);
228  deleteDemandDrivenData(centresPtr_);
229  deleteDemandDrivenData(edgeCentresPtr_);
230  deleteDemandDrivenData(faceAreaNormalsPtr_);
231  deleteDemandDrivenData(edgeAreaNormalsPtr_);
232  pointAreaNormalsPtr_.reset(nullptr);
233  deleteDemandDrivenData(faceCurvaturesPtr_);
234  deleteDemandDrivenData(edgeTransformTensorsPtr_);
235 }
236 
237 
238 void Foam::faMesh::clearGeom() const
239 {
240  DebugInFunction << "Clearing geometry" << endl;
241 
242  clearGeomNotAreas();
243  deleteDemandDrivenData(S0Ptr_);
244  deleteDemandDrivenData(S00Ptr_);
245  deleteDemandDrivenData(correctPatchPointNormalsPtr_);
246 }
247 
248 
249 void Foam::faMesh::clearAddressing() const
250 {
251  DebugInFunction << "Clearing addressing" << endl;
252 
253  deleteDemandDrivenData(lduPtr_);
254 }
255 
256 
257 void Foam::faMesh::clearOut() const
258 {
259  clearGeom();
260  clearAddressing();
261  globalMeshDataPtr_.reset(nullptr);
262 }
263 
264 
265 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
266 
267 Foam::faMesh::faMesh(const polyMesh& pMesh, const zero)
268 :
269  faMesh(pMesh, labelList())
270 {}
271 
272 
273 Foam::faMesh::faMesh(const polyMesh& pMesh)
274 :
276  edgeInterpolation(*this),
277  faSchemes(mesh()),
278  faSolution(mesh()),
279  data(mesh()),
280  faceLabels_
281  (
282  IOobject
283  (
284  "faceLabels",
285  time().findInstance(meshDir(), "faceLabels"),
286  faMesh::meshSubDir,
287  mesh(),
288  IOobject::MUST_READ,
289  IOobject::NO_WRITE
290  )
291  ),
292  boundary_
293  (
294  IOobject
295  (
296  "faBoundary",
297  time().findInstance(meshDir(), "faBoundary"),
298  faMesh::meshSubDir,
299  mesh(),
300  IOobject::MUST_READ,
301  IOobject::NO_WRITE
302  ),
303  *this
304  ),
305  comm_(Pstream::worldComm),
306  patchPtr_(nullptr),
307  bndConnectPtr_(nullptr),
308  lduPtr_(nullptr),
309  curTimeIndex_(time().timeIndex()),
310  SPtr_(nullptr),
311  S0Ptr_(nullptr),
312  S00Ptr_(nullptr),
313  patchStartsPtr_(nullptr),
314  LePtr_(nullptr),
315  magLePtr_(nullptr),
316  centresPtr_(nullptr),
317  edgeCentresPtr_(nullptr),
318  faceAreaNormalsPtr_(nullptr),
319  edgeAreaNormalsPtr_(nullptr),
320  pointAreaNormalsPtr_(nullptr),
321  faceCurvaturesPtr_(nullptr),
322  edgeTransformTensorsPtr_(nullptr),
323  correctPatchPointNormalsPtr_(nullptr),
324  globalMeshDataPtr_(nullptr),
325 
326  haloMapPtr_(nullptr),
327  haloFaceCentresPtr_(nullptr),
328  haloFaceNormalsPtr_(nullptr)
329 {
330  DebugInFunction << "Creating from IOobject" << endl;
331 
332  setPrimitiveMeshData();
333 
334  // Create global mesh data
335  if (Pstream::parRun())
336  {
337  globalData();
338  }
339 
340  // Calculate topology for the patches (processor-processor comms etc.)
341  boundary_.updateMesh();
342 
343  // Calculate the geometry for the patches (transformation tensors etc.)
344  boundary_.calcGeometry();
345 
346  if (fileHandler().isFile(pMesh.time().timePath()/"S0"))
347  {
349  (
350  IOobject
351  (
352  "S0",
353  time().timeName(),
355  mesh(),
358  ),
359  *this
360  );
361  }
362 }
363 
364 
365 Foam::faMesh::faMesh
366 (
367  const polyMesh& pMesh,
368  const UList<label>& faceLabels
369 )
370 :
372  edgeInterpolation(*this),
373  faSchemes(mesh()),
374  faSolution(mesh()),
375  data(mesh()),
376  faceLabels_
377  (
378  IOobject
379  (
380  "faceLabels",
381  mesh().facesInstance(),
383  mesh(),
386  ),
387  faceLabels
388  ),
389  boundary_
390  (
391  IOobject
392  (
393  "faBoundary",
394  mesh().facesInstance(),
396  mesh(),
399  ),
400  *this,
401  label(0)
402  ),
403  comm_(Pstream::worldComm),
404  patchPtr_(nullptr),
405  bndConnectPtr_(nullptr),
406  lduPtr_(nullptr),
407  curTimeIndex_(time().timeIndex()),
408  SPtr_(nullptr),
409  S0Ptr_(nullptr),
410  S00Ptr_(nullptr),
411  patchStartsPtr_(nullptr),
412  LePtr_(nullptr),
413  magLePtr_(nullptr),
414  centresPtr_(nullptr),
415  edgeCentresPtr_(nullptr),
416  faceAreaNormalsPtr_(nullptr),
417  edgeAreaNormalsPtr_(nullptr),
418  pointAreaNormalsPtr_(nullptr),
419  faceCurvaturesPtr_(nullptr),
420  edgeTransformTensorsPtr_(nullptr),
421  correctPatchPointNormalsPtr_(nullptr),
422  globalMeshDataPtr_(nullptr),
423 
424  haloMapPtr_(nullptr),
425  haloFaceCentresPtr_(nullptr),
426  haloFaceNormalsPtr_(nullptr)
427 {}
428 
429 
430 Foam::faMesh::faMesh(const polyPatch& pp)
431 :
432  faMesh
433  (
434  pp.boundaryMesh().mesh(),
435  identity(pp.range())
436  )
437 {
438  DebugInFunction << "Creating from polyPatch:" << pp.name() << endl;
439 
440  // Add single faPatch "default", but with processor connections
441  PtrList<faPatch> newPatches
442  (
443  createOnePatch("default")
444  );
445 
446  addFaPatches(newPatches);
447 
448  setPrimitiveMeshData();
449 
450  // Create global mesh data
451  if (Pstream::parRun())
452  {
453  globalData();
454  }
455 
456  // Calculate topology for the patches (processor-processor comms etc.)
457  boundary_.updateMesh();
458 
459  // Calculate the geometry for the patches (transformation tensors etc.)
460  boundary_.calcGeometry();
461 }
462 
463 
464 Foam::faMesh::faMesh
465 (
466  const polyMesh& pMesh,
467  const dictionary& faMeshDefinition
468 )
469 :
470  faMesh
471  (
472  pMesh,
474  (
475  pMesh.boundaryMesh(),
476  faMeshDefinition.get<wordRes>("polyMeshPatches")
477  )
478  )
479 {
480  DebugInFunction << "Creating from definition (dictionary)" << endl;
481 
482  PtrList<faPatch> newPatches
483  (
484  createPatchList
485  (
486  faMeshDefinition.subDict("boundary"),
487 
488  // Optional 'empty' patch
489  faMeshDefinition.getOrDefault<word>("emptyPatch", word::null),
490 
491  // Optional specification for default patch
492  faMeshDefinition.findDict("defaultPatch")
493  )
494  );
495 
496 
497  addFaPatches(newPatches);
498 
499  // Create global mesh data
500  if (Pstream::parRun())
501  {
502  globalData();
503  }
504 
505  // Calculate topology for the patches (processor-processor comms etc.)
506  boundary_.updateMesh();
507 
508  // Calculate the geometry for the patches (transformation tensors etc.)
509  boundary_.calcGeometry();
510 
511  if (fileHandler().isFile(pMesh.time().timePath()/"S0"))
512  {
514  (
515  IOobject
516  (
517  "S0",
518  time().timeName(),
520  mesh(),
523  ),
524  *this
525  );
526  }
527 }
528 
529 
530 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
531 
533 {
534  clearOut();
535 }
536 
537 
538 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
539 
541 {
542  return mesh().dbDir()/faMesh::meshSubDir;
543 }
544 
545 
547 {
548  return mesh().time();
549 }
550 
551 
553 {
554  return mesh().pointsInstance();
555 }
556 
557 
559 {
560  return mesh().facesInstance();
561 }
562 
563 
565 {
566  return true;
567 }
568 
569 
571 {
572  return mesh().thisDb();
573 }
574 
575 
577 {
578  if (!patchStartsPtr_)
579  {
580  calcPatchStarts();
581  }
582 
583  return *patchStartsPtr_;
584 }
585 
586 
588 {
589  if (!LePtr_)
590  {
591  calcLe();
592  }
593 
594  return *LePtr_;
595 }
596 
597 
599 {
600  if (!magLePtr_)
601  {
602  calcMagLe();
603  }
604 
605  return *magLePtr_;
606 }
607 
608 
610 {
611  if (!centresPtr_)
612  {
613  calcAreaCentres();
614  }
615 
616  return *centresPtr_;
617 }
618 
619 
621 {
622  if (!edgeCentresPtr_)
623  {
624  calcEdgeCentres();
625  }
626 
627  return *edgeCentresPtr_;
628 }
629 
630 
633 {
634  if (!SPtr_)
635  {
636  calcS();
637  }
638 
639  return *SPtr_;
640 }
641 
642 
645 {
646  if (!S0Ptr_)
647  {
649  << "S0 is not available"
650  << abort(FatalError);
651  }
652 
653  return *S0Ptr_;
654 }
655 
656 
659 {
660  if (!S00Ptr_)
661  {
663  (
664  IOobject
665  (
666  "S00",
667  time().timeName(),
668  mesh(),
671  ),
672  S0()
673  );
674 
675  S0Ptr_->writeOpt(IOobject::AUTO_WRITE);
676  }
677 
678  return *S00Ptr_;
679 }
680 
681 
683 {
684  if (!faceAreaNormalsPtr_)
685  {
686  calcFaceAreaNormals();
687  }
688 
689  return *faceAreaNormalsPtr_;
690 }
691 
692 
694 {
695  if (!edgeAreaNormalsPtr_)
696  {
697  calcEdgeAreaNormals();
698  }
699 
700  return *edgeAreaNormalsPtr_;
701 }
702 
703 
705 {
706  if (!pointAreaNormalsPtr_)
707  {
708  pointAreaNormalsPtr_.reset(new vectorField(nPoints()));
709 
710  if (origPointAreaMethod_)
711  {
712  calcPointAreaNormals_orig(*pointAreaNormalsPtr_);
713  }
714  else
715  {
716  calcPointAreaNormals(*pointAreaNormalsPtr_);
717  }
718 
719  if (quadricsFit_ > 0)
720  {
721  calcPointAreaNormalsByQuadricsFit(*pointAreaNormalsPtr_);
722  }
723  }
724 
725  return *pointAreaNormalsPtr_;
726 }
727 
728 
730 {
731  if (!faceCurvaturesPtr_)
732  {
733  calcFaceCurvatures();
734  }
735 
736  return *faceCurvaturesPtr_;
737 }
738 
739 
742 {
743  if (!edgeTransformTensorsPtr_)
744  {
745  calcEdgeTransformTensors();
746  }
747 
748  return *edgeTransformTensorsPtr_;
749 }
750 
751 
753 {
754  if (!globalMeshDataPtr_)
755  {
756  globalMeshDataPtr_.reset(new faGlobalMeshData(*this));
757  }
758 
759  return *globalMeshDataPtr_;
760 }
761 
762 
764 {
765  if (!lduPtr_)
766  {
767  calcLduAddressing();
768  }
769 
770  return *lduPtr_;
771 }
772 
773 
775 {
776  // Grab point motion from polyMesh
777  const vectorField& newPoints = mesh().points();
778 
779  // Grab old time areas if the time has been incremented
780  if (curTimeIndex_ < time().timeIndex())
781  {
782  if (S00Ptr_ && S0Ptr_)
783  {
784  DebugInfo<< "Copy old-old S" << endl;
785  *S00Ptr_ = *S0Ptr_;
786  }
787 
788  if (S0Ptr_)
789  {
790  DebugInfo<< "Copy old S" << endl;
791  *S0Ptr_ = S();
792  }
793  else
794  {
795  DebugInfo<< "Creating old cell volumes." << endl;
796 
798  (
799  IOobject
800  (
801  "S0",
802  time().timeName(),
803  mesh(),
806  false
807  ),
808  S()
809  );
810  }
811 
812  curTimeIndex_ = time().timeIndex();
813  }
814 
815  clearGeomNotAreas();
816 
817  // To satisfy the motion interface for MeshObject, const cast is needed
818  if (patchPtr_)
819  {
820  patchPtr_->movePoints(newPoints);
821  }
822 
823  // Move boundary points
824  const_cast<faBoundaryMesh&>(boundary_).movePoints(newPoints);
825 
826  // Move interpolation
827  const edgeInterpolation& cei = *this;
829 
830  // Note: Fluxes were dummy?
831 
832  return true;
833 }
834 
835 
837 {
838  if ((patchID < 0) || (patchID >= boundary().size()))
839  {
841  << "patchID is not in the valid range"
842  << abort(FatalError);
843  }
844 
845  if (correctPatchPointNormalsPtr_)
846  {
847  return (*correctPatchPointNormalsPtr_)[patchID];
848  }
849 
850  return false;
851 }
852 
853 
855 {
856  if (!correctPatchPointNormalsPtr_)
857  {
858  correctPatchPointNormalsPtr_ = new boolList(boundary().size(), false);
859  }
860 
861  return *correctPatchPointNormalsPtr_;
862 }
863 
864 
865 bool Foam::faMesh::write(const bool valid) const
866 {
867  faceLabels_.write();
868  boundary_.write();
869 
870  return false;
871 }
872 
873 
874 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
875 
876 bool Foam::faMesh::operator!=(const faMesh& m) const
877 {
878  return &m != this;
879 }
880 
881 
882 bool Foam::faMesh::operator==(const faMesh& m) const
883 {
884  return &m == this;
885 }
886 
887 
888 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::dictionary::findDict
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
Definition: dictionaryI.H:127
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1069
Foam::faMesh::meshDir
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Definition: faMesh.C:540
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::faMesh::Le
const edgeVectorField & Le() const
Return edge length vectors.
Definition: faMesh.C:587
Foam::faBoundaryMesh::updateMesh
void updateMesh()
Correct faBoundaryMesh after topology update.
Definition: faBoundaryMesh.C:468
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:194
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::selectPatchFaces
static labelList selectPatchFaces(const polyBoundaryMesh &pbm, const wordRes &polyPatchNames)
Definition: faMesh.C:67
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::faMesh::write
virtual bool write(const bool valid=true) const
Write mesh.
Definition: faMesh.C:865
Foam::List::resize
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:139
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
Foam::faSchemes
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
Definition: faSchemes.H:52
Foam::fvMesh::thisDb
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
Definition: fvMesh.H:292
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::faMesh::prefix
static const word prefix
The prefix to local: finite-area.
Definition: faMesh.H:468
Foam::polyMesh::dbDir
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
Definition: polyMesh.C:829
Foam::faBoundaryMesh::calcGeometry
void calcGeometry()
Calculate the geometry for the patches.
Definition: faBoundaryMesh.C:132
Foam::polyMesh::facesInstance
const fileName & facesInstance() const
Return the current instance directory for faces.
Definition: polyMesh.C:852
Foam::boolList
List< bool > boolList
A List of bools.
Definition: List.H:65
Foam::isFile
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Definition: MSwindows.C:658
Foam::fileHandler
const fileOperation & fileHandler()
Get current file handler.
Definition: fileOperation.C:1485
Foam::faGlobalMeshData
Various mesh related information for a parallel run.
Definition: faGlobalMeshData.H:54
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:444
primitiveMesh.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
faMesh.H
Foam::faMesh::pointAreaNormals
const vectorField & pointAreaNormals() const
Return point area normals.
Definition: faMesh.C:704
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:107
Foam::faMesh::~faMesh
virtual ~faMesh()
Destructor.
Definition: faMesh.C:532
Foam::faMesh::S00
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
Definition: faMesh.C:658
polyMesh.H
Foam::UpdateableMeshObject
Definition: MeshObject.H:241
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::faMesh::patchStarts
const labelList & patchStarts() const
Return patch starts.
Definition: faMesh.C:576
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
Foam::faMesh::globalData
const faGlobalMeshData & globalData() const
Return parallel info.
Definition: faMesh.C:752
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:42
Foam::polyMesh::pointsInstance
const fileName & pointsInstance() const
Return the current instance directory for points.
Definition: polyMesh.C:846
Foam::faBoundaryMesh
Finite area boundary mesh.
Definition: faBoundaryMesh.H:65
Foam::faMesh::edgeTransformTensors
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
Definition: faMesh.C:741
Foam::faMesh::S0
const DimensionedField< scalar, areaMesh > & S0() const
Return old-time face areas.
Definition: faMesh.C:644
Foam::Field< vector >
Foam::faMesh::S
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
Definition: faMesh.C:632
Foam::faMesh::operator==
bool operator==(const faMesh &m) const
Definition: faMesh.C:882
Foam::faMesh::lduAddr
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
Definition: faMesh.C:763
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:388
edgeFields.H
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::Time::timePath
fileName timePath() const
Return current time path.
Definition: Time.H:375
Foam::faMesh::faceAreaNormals
const areaVectorField & faceAreaNormals() const
Return face area normals.
Definition: faMesh.C:682
Foam::faMesh::time
const Time & time() const
Return reference to time.
Definition: faMesh.C:546
patchID
label patchID
Definition: boundaryProcessorFaPatchPoints.H:5
Foam::dictionary::subDict
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
IndirectList.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::faSolution
Selector class for finite area solution. faMesh is derived from faSolution so that all fields have ac...
Definition: faSolution.H:54
Foam::faMesh::magLe
const edgeScalarField & magLe() const
Return edge length magnitudes.
Definition: faMesh.C:598
Foam::faMesh::facesInstance
const fileName & facesInstance() const
Return the current instance directory for faces.
Definition: faMesh.C:558
areaFields.H
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::faMesh::operator!=
bool operator!=(const faMesh &m) const
Definition: faMesh.C:876
Foam::faMesh::mesh
const polyMesh & mesh() const
Return access to polyMesh.
Definition: faMeshI.H:31
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
faPatchData.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::edgeInterpolation::movePoints
bool movePoints() const
Do what is necessary if the mesh has moved.
Definition: edgeInterpolation.C:161
Foam::faMesh::edgeAreaNormals
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
Definition: faMesh.C:693
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::faMesh::correctPatchPointNormals
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
Definition: faMesh.C:854
Foam::faMesh::thisDb
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
Definition: faMesh.C:570
Time.H
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::faMesh::hasDb
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
Definition: faMesh.C:564
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:382
Foam::faMesh::faceCurvatures
const areaScalarField & faceCurvatures() const
Return face curvatures.
Definition: faMesh.C:729
range
scalar range
Definition: LISASMDCalcMethod1.H:12
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Pstream
Inter-processor communications stream.
Definition: Pstream.H:56
Foam::UPstream::worldComm
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:293
Foam::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
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:63
faMeshLduAddressing.H
Foam::faMesh::meshSubDir
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
Definition: faMesh.H:471
Foam::faMesh::addFaPatches
void addFaPatches(PtrList< faPatch > &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
Definition: faMeshPatches.C:38
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
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::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::polyBoundaryMesh::patchSet
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
Definition: polyBoundaryMesh.C:864
Foam::faMesh::edgeCentres
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
Definition: faMesh.C:620
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:280
Foam::boundaryMesh
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:62
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
Foam::patchIdentifier::name
const word & name() const noexcept
The patch name.
Definition: patchIdentifier.H:135
timeIndex
label timeIndex
Definition: getTimeIndex.H:30
Foam::uindirectPrimitivePatch
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
Definition: uindirectPrimitivePatch.H:49
Foam::faMesh::pointsInstance
const fileName & pointsInstance() const
Return the current instance directory for points.
Definition: faMesh.C:552
Foam::labelUList
UList< label > labelUList
A UList of labels.
Definition: UList.H:85
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:148
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::IOobject::NO_READ
Definition: IOobject.H:188
wedgeFaPatch.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::edgeInterpolation
Face to edge interpolation scheme. Included in faMesh.
Definition: edgeInterpolation.H:60
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55
Foam::objectRegistry::time
const Time & time() const noexcept
Return time registry.
Definition: objectRegistry.H:178
boundary
faceListList boundary
Definition: createBlockMesh.H:4
faMeshBoundaryHalo.H
Foam::faMesh::movePoints
virtual bool movePoints()
Update after mesh motion.
Definition: faMesh.C:774
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::faMesh::areaCentres
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
Definition: faMesh.C:609
Foam::IOobject::MUST_READ
Definition: IOobject.H:185
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62
faGlobalMeshData.H