faMesh.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) 2016-2017 Wikki Ltd
9  Copyright (C) 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 Class
28  Foam::faMesh
29 
30 Description
31  Finite area mesh. Used for 2-D non-Euclidian finite area method.
32 
33 SourceFiles
34  faMesh.C
35  faMeshDemandDrivenData.C
36  faMeshPatches.C
37  faMeshTopology.C
38  faMeshUpdate.C
39 
40 Author
41  Zeljko Tukovic, FMENA
42  Hrvoje Jasak, Wikki Ltd.
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef faMesh_H
47 #define faMesh_H
48 
49 #include "MeshObject.H"
50 #include "polyMesh.H"
51 #include "lduMesh.H"
52 #include "faBoundaryMesh.H"
53 #include "edgeList.H"
54 #include "faceList.H"
55 #include "primitiveFieldsFwd.H"
56 #include "DimensionedField.H"
57 #include "areaFieldsFwd.H"
58 #include "edgeFieldsFwd.H"
60 #include "edgeInterpolation.H"
61 #include "labelIOList.H"
62 #include "FieldFields.H"
63 #include "faGlobalMeshData.H"
64 #include "faSchemes.H"
65 #include "faSolution.H"
66 #include "data.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 // Forward Declarations
74 class faMeshBoundaryHalo;
75 class faMeshLduAddressing;
76 class faMeshMapper;
77 class faPatchData;
78 
79 /*---------------------------------------------------------------------------*\
80  Class faMesh Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class faMesh
84 :
85  public MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>,
86  public lduMesh,
87  public edgeInterpolation,
88  public faSchemes,
89  public faSolution,
90  public data
91 {
92  // Private (internal) classes/structures
93 
94  //- A (proc, patchi, patchEdgei) tuple used internally for managing
95  //- patch/patch bookkeeping during construction.
96  // Finite-area patches are stored with negated indices, which makes
97  // them readily identifiable and always sort before normal patches.
98  // Note
99  struct patchTuple
100  :
101  public FixedList<label, 4>
102  {
103 
104  // Constructors
105 
106  // Inherit constructors
108 
109  //- Default construct as 'invalid'
110  patchTuple()
111  {
112  clear();
113  }
114 
115 
116  // Static Member Functions
117 
118  // Globally consistent ordering
119  //
120  // 1. sort left/right as lower/higher processor connection
121  // 2. sort by proc/patch/patch index
122  static void sort(UList<Pair<patchTuple>>& list)
123  {
124  for (auto& tuples : list)
125  {
126  tuples.sort();
127  }
128  Foam::stableSort(list);
129  }
130 
131 
132  // Member Functions
133 
134  //- Reset to 'invalid'
135  void clear()
136  {
137  procNo(-1);
138  patchi(labelMax);
139  patchEdgei(-1);
140  meshFacei(-1);
141  }
142 
143  //- Valid if proc and edge are non-negative
144  bool valid() const noexcept
145  {
146  return (procNo() >= 0 && patchEdgei() >= 0);
147  }
148 
149  // Processor is the first sort index
150  label procNo() const { return (*this)[0]; }
151  void procNo(label val) { (*this)[0] = val; }
152 
153  // PatchId (-ve for finiteArea patches) is the second sort index
154  label patchi() const { return (*this)[1]; }
155  void patchi(label val) { (*this)[1] = val; }
156 
157  // The patch edge index (on the finiteArea patch)
158  // is the third sort index
159  label patchEdgei() const { return (*this)[2]; }
160  void patchEdgei(label val) { (*this)[2] = val; }
161 
162  // The processor-local mesh face is the fourth sort index
163  label meshFacei() const { return (*this)[3]; }
164  void meshFacei(label val) { (*this)[3] = val; }
165 
166  //- Return the real patchId
167  label realPatchi() const
168  {
169  const label id = patchi();
170  return (id < 0 ? -(id + 1) : id);
171  }
172 
173  //- Set patchId as finiteArea
174  void faPatchi(label val)
175  {
176  patchi(-(val + 1));
177  }
178 
179  //- Considered to be finiteArea if patchi < 0
180  bool is_finiteArea() const noexcept
181  {
182  return (patchi() < 0);
183  }
184 
185  //- Considered to be processor local
186  bool is_localProc() const noexcept
187  {
188  return (procNo() == Pstream::myProcNo());
189  }
190  };
191 
192 
193  // Private Data
194 
195  //- Face labels
196  labelIOList faceLabels_;
197 
198  //- Boundary mesh
199  faBoundaryMesh boundary_;
200 
201 
202  // Primitive mesh data
203 
204  //- Edges, addressing into local point list
205  edgeList edges_;
206 
207  //- Edge owner
208  labelList edgeOwner_;
209 
210  //- Edge neighbour
211  labelList edgeNeighbour_;
212 
213 
214  // Primitive size data
215 
216  //- Number of points
217  mutable label nPoints_;
218 
219  //- Number of edges
220  mutable label nEdges_;
221 
222  //- Number of internal edges
223  mutable label nInternalEdges_;
224 
225  //- Number of faces
226  mutable label nFaces_;
227 
228 
229  // Communication support
230 
231  //- Communicator used for parallel communication
232  label comm_;
233 
234 
235  // Demand-driven data
236 
237  //- Primitive patch
238  mutable std::unique_ptr<uindirectPrimitivePatch> patchPtr_;
239 
240  //- List of proc/mesh-face for boundary edge neighbours
241  mutable std::unique_ptr<List<labelPair>> bndConnectPtr_;
242 
243  //- Ldu addressing data
244  mutable faMeshLduAddressing* lduPtr_;
245 
246  //- Current time index for motion
247  // Note. The whole mechanism will be replaced once the
248  // dimensionedField is created and the dimensionedField
249  // will take care of the old-time levels.
250  mutable label curTimeIndex_;
251 
252  //- Face areas
253  mutable DimensionedField<scalar, areaMesh>* SPtr_;
254 
255  //- Face areas old time level
256  mutable DimensionedField<scalar, areaMesh>* S0Ptr_;
257 
258  //- Face areas old-old time level
259  mutable DimensionedField<scalar, areaMesh>* S00Ptr_;
260 
261  //- Patch starts in the edge list
262  mutable labelList* patchStartsPtr_;
263 
264  //- Edge length vectors
265  mutable edgeVectorField* LePtr_;
266 
267  //- Mag edge length vectors
268  mutable edgeScalarField* magLePtr_;
269 
270  //- Face centres
271  mutable areaVectorField* centresPtr_;
272 
273  //- Edge centres
274  mutable edgeVectorField* edgeCentresPtr_;
275 
276  //- Face area normals
277  mutable areaVectorField* faceAreaNormalsPtr_;
278 
279  //- Edge area normals
280  mutable edgeVectorField* edgeAreaNormalsPtr_;
281 
282  //- Point area normals
283  mutable std::unique_ptr<vectorField> pointAreaNormalsPtr_;
284 
285  //- Face curvatures
286  mutable areaScalarField* faceCurvaturesPtr_;
287 
288  //- Edge transformation tensors
289  mutable FieldField<Field, tensor>* edgeTransformTensorsPtr_;
290 
291  //- Whether point normals must be corrected for a patch
292  mutable boolList* correctPatchPointNormalsPtr_;
293 
294 
295  // Other mesh-related data
296 
297  //- Parallel info
298  mutable autoPtr<faGlobalMeshData> globalMeshDataPtr_;
299 
300  //- Mapping/swapping for boundary edge halo neighbours
301  mutable std::unique_ptr<faMeshBoundaryHalo> haloMapPtr_;
302 
303  //- Face centres for boundary edge halo neighbours
304  mutable std::unique_ptr<pointField> haloFaceCentresPtr_;
305 
306  //- Face normals for boundary edge halo neighbours
307  mutable std::unique_ptr<vectorField> haloFaceNormalsPtr_;
308 
309 
310  // Static Private Data
311 
312  //- Use the original method for point normals
313  static int origPointAreaMethod_;
314 
315  //- Use quadrics fit
316  static const int quadricsFit_;
317 
318 
319  // Private Member Functions
320 
321  //- No copy construct
322  faMesh(const faMesh&) = delete;
323 
324  //- No copy assignment
325  void operator=(const faMesh&) = delete;
326 
327  //- Set indirect patch, removing any old one
328  void initPatch() const;
329 
330  //- Set primitive mesh data
331  void setPrimitiveMeshData();
332 
333  //- Get list of (proc/patchi/patchEdgei/meshFacei) tuple pairs in an
334  //- globally consistent ordering
335  List<Pair<patchTuple>> getBoundaryEdgeConnections() const;
336 
337  //- Determine the boundary edge neighbour connections
338  void calcBoundaryConnections() const;
339 
340  //- Define boundary edge neighbours (proc/face) based on
341  //- gathered topology information
342  void setBoundaryConnections
343  (
344  const List<Pair<patchTuple>>& bndEdgeConnections
345  ) const;
346 
347 
348  // Private member functions to calculate demand driven data
349 
350  //- Calculate ldu addressing
351  void calcLduAddressing() const;
352 
353  //- Calculate patch starts in the edge list
354  void calcPatchStarts() const;
355 
356  //- Calculate edge lengths
357  void calcLe() const;
358 
359  //- Calculate mag edge lengths
360  void calcMagLe() const;
361 
362  //- Calculate face centres
363  void calcAreaCentres() const;
364 
365  //- Calculate edge centres
366  void calcEdgeCentres() const;
367 
368  //- Calculate face areas
369  void calcS() const;
370 
371  //- Calculate face area normals
372  void calcFaceAreaNormals() const;
373 
374  //- Calculate edge area normals
375  void calcEdgeAreaNormals() const;
376 
377  //- Calculate point area normals
378  void calcPointAreaNormals_orig(vectorField& result) const;
379 
380  //- Calculate point area normals
381  void calcPointAreaNormals(vectorField& result) const;
382 
383  //- Calculate point area normals by quadrics fit
384  void calcPointAreaNormalsByQuadricsFit(vectorField& result) const;
385 
386  //- Calculate face curvatures
387  void calcFaceCurvatures() const;
388 
389  //- Calculate edge transformation tensors
390  void calcEdgeTransformTensors() const;
391 
392  //- Clear geometry but not the face areas
393  void clearGeomNotAreas() const;
394 
395  //- Clear boundary halo information
396  void clearHalo() const;
397 
398  //- Clear geometry
399  void clearGeom() const;
400 
401  //- Clear addressing
402  void clearAddressing() const;
403 
404  //- Clear demand-driven data
405  void clearOut() const;
406 
407 
408  // Halo handling
409 
410  //- Calculate halo centres/normals
411  void calcHaloFaceGeometry() const;
412 
413 
414  // Helpers
415 
416  //- Create a single patch
417  PtrList<faPatch> createOnePatch
418  (
419  const word& patchName,
420  const word& patchType = ""
421  ) const;
422 
423  //- Create list of patches from boundary definition
424  PtrList<faPatch> createPatchList
425  (
426  const dictionary& bndDict,
427  const word& emptyPatchName = "",
428  const dictionary* defaultPatchDefinition = nullptr
429  ) const;
430 
431 
432  //- Fatal error if edge labels are out of range
433  void checkBoundaryEdgeLabelRange(const labelUList& edgeLabels) const;
434 
435  //- Extract list from contiguous (unordered) boundary data
436  //- to the locally sorted order.
437  template<class T>
438  List<T> boundarySubset
439  (
440  const UList<T>& bndField,
441  const labelUList& edgeLabels
442  ) const
443  {
444  #ifdef FULLDEBUG
445  checkBoundaryEdgeLabelRange(edgeLabels);
446  #endif
447  // Like UIndirectList but with an offset
448  List<T> result(edgeLabels.size());
449  forAll(edgeLabels, i)
450  {
451  result[i] = bndField[edgeLabels[i] - nInternalEdges_];
452  }
453  return result;
454  }
455 
456 
457 public:
458 
459  // Public Typedefs
460 
461  typedef faMesh Mesh;
463 
464 
465  //- Runtime type information
466  TypeName("faMesh");
467 
468  //- The prefix to local: %finite-area
469  static const word prefix;
470 
471  //- The mesh sub-directory name (usually "faMesh")
472  static word meshSubDir;
473 
474 
475  // Constructors
476 
477  //- Construct zero-sized from polyMesh
478  // Boundary is added using addFaPatches() member function
479  faMesh(const polyMesh& pMesh, const Foam::zero);
480 
481  //- Construct from polyMesh
482  explicit faMesh(const polyMesh& pMesh);
483 
484  //- Construct for specified face labels without boundary.
485  // Boundary is added using addFaPatches() member function
486  faMesh
487  (
488  const polyMesh& pMesh,
489  const UList<label>& faceLabels
490  );
491 
492  //- Construct from single polyPatch
493  explicit faMesh(const polyPatch& pp);
494 
495  //- Construct from definition
496  faMesh
497  (
498  const polyMesh& pMesh,
499  const dictionary& faMeshDefinition
500  );
501 
502 
503  //- Destructor
504  virtual ~faMesh();
505 
506 
507  // Member Functions
508 
509  // Helpers
510 
511  //- Add boundary patches. Constructor helper
512  void addFaPatches
513  (
514  PtrList<faPatch>& plist,
515  const bool validBoundary = true
516  );
517 
518  //- Add boundary patches. Constructor helper
519  void addFaPatches
520  (
521  const List<faPatch*>& p,
522  const bool validBoundary = true
523  );
524 
525 
526  // Database
527 
528  //- Return access to polyMesh
529  inline const polyMesh& mesh() const;
530 
531  //- Interface to referenced polyMesh (similar to GeoMesh)
532  const polyMesh& operator()() const { return mesh(); }
533 
534  //- Return the local mesh directory (dbDir()/meshSubDir)
535  fileName meshDir() const;
536 
537  //- Return reference to time
538  const Time& time() const;
539 
540  //- Return the current instance directory for points
541  // Used in the construction of geometric mesh data dependent
542  // on points
543  const fileName& pointsInstance() const;
544 
545  //- Return the current instance directory for faces
546  const fileName& facesInstance() const;
547 
548 
549  // Communication support
550 
551  //- Return communicator used for parallel communication
552  inline label comm() const noexcept;
553 
554  //- Return communicator used for parallel communication
555  inline label& comm() noexcept;
556 
557 
558  // Mesh size parameters
559 
560  //- Number of local mesh points
561  inline label nPoints() const noexcept;
562 
563  //- Number of local mesh edges
564  inline label nEdges() const noexcept;
565 
566  //- Number of internal faces
567  inline label nInternalEdges() const noexcept;
568 
569  //- Number of boundary edges (== nEdges - nInternalEdges)
570  inline label nBoundaryEdges() const noexcept;
571 
572  //- Number of patch faces
573  inline label nFaces() const noexcept;
574 
575 
576  // Primitive mesh data
577 
578  //- Return local patch points
579  inline const pointField& points() const;
580 
581  //- Return local patch edges with reordered boundary
582  inline const edgeList& edges() const noexcept;
583 
584  //- Return local patch faces
585  inline const faceList& faces() const;
586 
587  //- Edge owner addressing
588  inline const labelList& edgeOwner() const noexcept;
589 
590  //- Edge neighbour addressing
591  inline const labelList& edgeNeighbour() const noexcept;
592 
593 
594 
595  // Access
596 
597  //- Return true if thisDb() is a valid DB
598  virtual bool hasDb() const;
599 
600  //- Return reference to the mesh database
601  virtual const objectRegistry& thisDb() const;
602 
603  //- Name function is needed to disambiguate those inherited
604  // from base classes
605  const word& name() const
606  {
607  return thisDb().name();
608  }
609 
610  //- Return constant reference to boundary mesh
611  inline const faBoundaryMesh& boundary() const noexcept;
612 
613  //- Return the underlying polyMesh face labels
614  inline const labelList& faceLabels() const noexcept;
615 
616 
617  //- Return parallel info
618  const faGlobalMeshData& globalData() const;
619 
620  //- Return ldu addressing
621  virtual const lduAddressing& lduAddr() const;
622 
623  //- Return a list of pointers for each patch
624  // with only those pointing to interfaces being set
625  virtual lduInterfacePtrsList interfaces() const
626  {
627  return boundary().interfaces();
628  }
629 
630  //- Internal face owner
631  const labelUList& owner() const
632  {
633  return lduAddr().lowerAddr();
634  }
635 
636  //- Internal face neighbour
637  const labelUList& neighbour() const
638  {
639  return lduAddr().upperAddr();
640  }
641 
642  //- True if given edge label is internal to the mesh
643  bool isInternalEdge(const label edgeIndex) const
644  {
645  return (edgeIndex < nInternalEdges_);
646  }
647 
648  //- List of proc/face for the boundary edge neighbours
649  //- using primitive patch edge numbering.
650  inline const List<labelPair>& boundaryConnections() const;
651 
652  //- Boundary edge neighbour processors
653  //- (does not include own proc)
654  labelList boundaryProcs() const;
655 
656  //- List of proc/size for the boundary edge neighbour processors
657  //- (does not include own proc)
659 
660  //- Mapping/swapping for boundary halo neighbours
661  const faMeshBoundaryHalo& boundaryHaloMap() const;
662 
663  //- Face centres of boundary halo neighbours
664  const pointField& haloFaceCentres() const;
665 
666  //- Face normals of boundary halo neighbours
667  const vectorField& haloFaceNormals() const;
668 
669  //- Face centres of boundary halo neighbours for specified patch
670  tmp<pointField> haloFaceCentres(const label patchi) const;
671 
672  //- Face normals of boundary halo neighbours for specified patch
673  tmp<vectorField> haloFaceNormals(const label patchi) const;
674 
675 
676  // Mesh motion and morphing
677 
678  //- Is mesh moving
679  bool moving() const
680  {
681  return mesh().moving();
682  }
683 
684  //- Update after mesh motion
685  virtual bool movePoints();
686 
687  //- Update after topo change
688  virtual void updateMesh(const mapPolyMesh&);
689 
690 
691  // Mapping
692 
693  //- Map all fields in time using given map.
694  virtual void mapFields(const faMeshMapper& mapper) const;
695 
696  //- Map face areas in time using given map.
697  virtual void mapOldAreas(const faMeshMapper& mapper) const;
698 
699 
700  // Demand-driven data
701 
702  //- Return constant reference to primitive patch
703  inline const uindirectPrimitivePatch& patch() const;
704 
705  //- Return reference to primitive patch
706  inline uindirectPrimitivePatch& patch();
707 
708  //- Return patch starts
709  const labelList& patchStarts() const;
710 
711  //- Return edge length vectors
712  const edgeVectorField& Le() const;
713 
714  //- Return edge length magnitudes
715  const edgeScalarField& magLe() const;
716 
717  //- Return face centres as areaVectorField
718  const areaVectorField& areaCentres() const;
719 
720  //- Return edge centres as edgeVectorField
721  const edgeVectorField& edgeCentres() const;
722 
723  //- Return face areas
724  const DimensionedField<scalar, areaMesh>& S() const;
725 
726  //- Return old-time face areas
727  const DimensionedField<scalar, areaMesh>& S0() const;
728 
729  //- Return old-old-time face areas
731 
732  //- Return face area normals
733  const areaVectorField& faceAreaNormals() const;
734 
735  //- Return edge area normals
736  const edgeVectorField& edgeAreaNormals() const;
737 
738  //- Return point area normals
739  const vectorField& pointAreaNormals() const;
740 
741  //- Return face curvatures
742  const areaScalarField& faceCurvatures() const;
743 
744  //- Return edge transformation tensors
746 
747  //- Return internal point labels
748  labelList internalPoints() const;
749 
750  //- Return boundary point labels
751  labelList boundaryPoints() const;
752 
753  //- Return edge length correction
755 
756  //- Whether point normals should be corrected for a patch
757  bool correctPatchPointNormals(const label patchID) const;
758 
759  //- Set whether point normals should be corrected for a patch
761 
762 
763  //- Write mesh
764  virtual bool write(const bool valid = true) const;
765 
766 
767  // Member Operators
768 
769  bool operator!=(const faMesh& m) const;
770 
771  bool operator==(const faMesh& m) const;
772 };
773 
774 
775 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
776 
777 } // End namespace Foam
778 
779 
780 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
781 
782 #include "faMeshI.H"
783 
784 #ifdef NoRepository
785  #include "faPatchFaMeshTemplates.C"
786 #endif
787 
788 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
789 
790 #endif
791 
792 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::faMesh::name
const word & name() const
Name function is needed to disambiguate those inherited.
Definition: faMesh.H:604
Foam::faMesh::meshDir
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Definition: faMesh.C:540
Foam::faMesh::Le
const edgeVectorField & Le() const
Return edge length vectors.
Definition: faMesh.C:587
primitiveFieldsFwd.H
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::faMesh::mapOldAreas
virtual void mapOldAreas(const faMeshMapper &mapper) const
Map face areas in time using given map.
Definition: faMeshUpdate.C:179
Foam::faMesh::Mesh
faMesh Mesh
Definition: faMesh.H:460
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::labelMax
constexpr label labelMax
Definition: label.H:61
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::faMesh::faces
const faceList & faces() const
Return local patch faces.
Definition: faMeshI.H:98
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
uindirectPrimitivePatch.H
Foam::faMesh::faceLabels
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
Definition: faMeshI.H:116
Foam::faSchemes
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
Definition: faSchemes.H:52
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
FieldFields.H
DimensionedField.H
Foam::faMesh::edgeLengthCorrection
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
Definition: faMeshDemandDrivenData.C:2053
Foam::faMesh::prefix
static const word prefix
The prefix to local: finite-area.
Definition: faMesh.H:468
Foam::faMesh::operator()
const polyMesh & operator()() const
Interface to referenced polyMesh (similar to GeoMesh)
Definition: faMesh.H:531
Foam::faMesh::edgeOwner
const labelList & edgeOwner() const noexcept
Edge owner addressing.
Definition: faMeshI.H:104
faMeshI.H
Foam::faMesh::internalPoints
labelList internalPoints() const
Return internal point labels.
Definition: faMeshDemandDrivenData.C:857
Foam::faMesh::boundaryProcSizes
List< labelPair > boundaryProcSizes() const
Definition: faMeshTopology.C:777
Foam::faMesh::boundaryConnections
const List< labelPair > & boundaryConnections() const
Definition: faMeshI.H:143
Foam::faGlobalMeshData
Various mesh related information for a parallel run.
Definition: faGlobalMeshData.H:54
Foam::faMesh::pointAreaNormals
const vectorField & pointAreaNormals() const
Return point area normals.
Definition: faMesh.C:704
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
faceList.H
polyMesh.H
Foam::lduAddressing::upperAddr
virtual const labelUList & upperAddr() const =0
Return upper addressing.
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
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::stableSort
void stableSort(UList< T > &a)
Definition: UList.C:275
Foam::faMesh::globalData
const faGlobalMeshData & globalData() const
Return parallel info.
Definition: faMesh.C:752
Foam::faMesh::haloFaceNormals
const vectorField & haloFaceNormals() const
Face normals of boundary halo neighbours.
Definition: faMeshTopology.C:869
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::faMesh::nFaces
label nFaces() const noexcept
Number of patch faces.
Definition: faMeshI.H:80
Foam::faBoundaryMesh
Finite area boundary mesh.
Definition: faBoundaryMesh.H:65
Foam::faMesh::edges
const edgeList & edges() const noexcept
Return local patch edges with reordered boundary.
Definition: faMeshI.H:92
faSolution.H
Foam::faMesh::edgeTransformTensors
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
Definition: faMesh.C:741
Foam::faMeshMapper
Class holds all the necessary information for mapping fields associated with faMesh.
Definition: faMeshMapper.H:68
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
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
areaFieldsFwd.H
Forwards and collection of common area field types.
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
edgeInterpolation.H
Foam::faMesh::nEdges
label nEdges() const noexcept
Number of local mesh edges.
Definition: faMeshI.H:62
patchID
label patchID
Definition: boundaryProcessorFaPatchPoints.H:5
Foam::sort
void sort(UList< T > &a)
Definition: UList.C:261
Foam::UPtrList< const lduInterface >
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::faMesh::nInternalEdges
label nInternalEdges() const noexcept
Number of internal faces.
Definition: faMeshI.H:68
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::nBoundaryEdges
label nBoundaryEdges() const noexcept
Number of boundary edges (== nEdges - nInternalEdges)
Definition: faMeshI.H:74
Foam::faMesh::magLe
const edgeScalarField & magLe() const
Return edge length magnitudes.
Definition: faMesh.C:598
Foam::faMesh::boundaryHaloMap
const faMeshBoundaryHalo & boundaryHaloMap() const
Mapping/swapping for boundary halo neighbours.
Definition: faMeshTopology.C:804
Foam::faMesh::facesInstance
const fileName & facesInstance() const
Return the current instance directory for faces.
Definition: faMesh.C:558
Foam::faMesh::nPoints
label nPoints() const noexcept
Number of local mesh points.
Definition: faMeshI.H:56
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::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
edgeList.H
faBoundaryMesh.H
Foam::faMesh::moving
bool moving() const
Is mesh moving.
Definition: faMesh.H:678
Foam::faMesh::boundary
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
Definition: faMeshI.H:38
Foam::faMesh::points
const pointField & points() const
Return local patch points.
Definition: faMeshI.H:86
Foam::faMesh::neighbour
const labelUList & neighbour() const
Internal face neighbour.
Definition: faMesh.H:636
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faMesh::boundaryProcs
labelList boundaryProcs() const
Definition: faMeshTopology.C:759
Foam::faMesh::edgeAreaNormals
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
Definition: faMesh.C:693
Foam::faMesh::boundaryPoints
labelList boundaryPoints() const
Return boundary point labels.
Definition: faMeshDemandDrivenData.C:869
Foam::faMesh::correctPatchPointNormals
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
Definition: faMesh.C:854
Foam::faMesh::owner
const labelUList & owner() const
Internal face owner.
Definition: faMesh.H:630
Foam::faMesh::thisDb
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
Definition: faMesh.C:570
Foam::IOobject::name
const word & name() const noexcept
Return name.
Definition: IOobjectI.H:65
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::faMeshLduAddressing
lduAddressing wrapper for faMesh
Definition: faMeshLduAddressing.H:56
Foam::faMesh::hasDb
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
Definition: faMesh.C:564
Foam::faMesh::edgeNeighbour
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
Definition: faMeshI.H:110
Foam::faMesh::faceCurvatures
const areaScalarField & faceCurvatures() const
Return face curvatures.
Definition: faMesh.C:729
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:463
clear
patchWriters clear()
Foam::Pair
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:54
Foam::faMesh::comm
label comm() const noexcept
Return communicator used for parallel communication.
Definition: faMeshI.H:44
Foam::lduAddressing::lowerAddr
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
faSchemes.H
Foam::List< edge >
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
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
labelIOList.H
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::IOList< label >
Foam::faMesh::edgeCentres
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
Definition: faMesh.C:620
Foam::polyMesh::moving
bool moving() const noexcept
Is mesh moving.
Definition: polyMesh.H:522
Foam::faMesh::mapFields
virtual void mapFields(const faMeshMapper &mapper) const
Map all fields in time using given map.
Definition: faMeshUpdate.C:157
Foam::faMesh::interfaces
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
Definition: faMesh.H:624
MeshObject.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::faMesh::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update after topo change.
Definition: faMeshUpdate.C:38
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
data.H
Foam::UList::size
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Foam::faMesh::pointsInstance
const fileName & pointsInstance() const
Return the current instance directory for points.
Definition: faMesh.C:552
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
lduMesh.H
Foam::faMesh::isInternalEdge
bool isInternalEdge(const label edgeIndex) const
True if given edge label is internal to the mesh.
Definition: faMesh.H:642
faPatchFaMeshTemplates.C
Foam::faMesh::TypeName
TypeName("faMesh")
Runtime type information.
Foam::faMesh::patch
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
Definition: faMeshI.H:122
edgeFieldsFwd.H
Forwards for edge field types.
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::faMesh::BoundaryMesh
faBoundaryMesh BoundaryMesh
Definition: faMesh.H:461
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62
Foam::faMeshBoundaryHalo
Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ord...
Definition: faMeshBoundaryHalo.H:59
Foam::faMesh::movePoints
virtual bool movePoints()
Update after mesh motion.
Definition: faMesh.C:774
Foam::lduInterfacePtrsList
UPtrList< const lduInterface > lduInterfacePtrsList
List of coupled interface fields to be used in coupling.
Definition: lduInterfacePtrsList.H:44
Foam::faMesh::haloFaceCentres
const pointField & haloFaceCentres() const
Face centres of boundary halo neighbours.
Definition: faMeshTopology.C:858
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::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79
Foam::faMesh::areaCentres
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
Definition: faMesh.C:609
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
Foam::faBoundaryMesh::interfaces
lduInterfacePtrsList interfaces() const
Definition: faBoundaryMesh.C:168