fvMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fvMesh
26 
27 Description
28  Mesh data needed to do the Finite Volume discretisation.
29 
30  NOTE ON USAGE:
31  fvMesh contains all the topological and geometric information
32  related to the mesh. It is also responsible for keeping the data
33  up-to-date. This is done by deleting the cell volume, face area,
34  cell/face centre, addressing and other derived information as
35  required and recalculating it as necessary. The fvMesh therefore
36  reserves the right to delete the derived information upon every
37  topological (mesh refinement/morphing) or geometric change (mesh
38  motion). It is therefore unsafe to keep local references to the
39  derived data outside of the time loop.
40 
41 SourceFiles
42  fvMesh.C
43  fvMeshGeometry.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef fvMesh_H
48 #define fvMesh_H
49 
50 #include "polyMesh.H"
51 #include "surfaceMesh.H"
52 #include "lduMesh.H"
53 #include "primitiveMesh.H"
54 #include "fvBoundaryMesh.H"
55 #include "surfaceInterpolation.H"
56 #include "fvSchemes.H"
57 #include "fvSolution.H"
58 #include "DimensionedField.H"
59 #include "SlicedDimensionedField.H"
60 #include "volFieldsFwd.H"
61 #include "surfaceFieldsFwd.H"
62 #include "pointFieldsFwd.H"
63 #include "slicedVolFieldsFwd.H"
64 #include "slicedSurfaceFieldsFwd.H"
65 #include "className.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 class fvMeshLduAddressing;
73 class fvMeshStitcher;
74 class fvMeshTopoChanger;
75 class fvMeshDistributor;
76 class fvMeshMover;
77 class fvMesh;
78 class polyDistributionMap;
79 
80 template<class Type>
81 class UCompactListList;
82 
83 namespace fvMeshTopoChangers
84 {
85  class list;
86 }
87 
88 
89 /*---------------------------------------------------------------------------*\
90  Class fvMesh Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class fvMesh
94 :
95  public polyMesh,
96  public lduMesh,
97  public surfaceMesh,
99 {
100 public:
101 
102  // Public data types
103 
104  //- Enumeration defining the state of the mesh after a read update.
105  // Used for post-processing applications, where the mesh
106  // needs to update based on the files written in time directories.
107  enum readUpdateState
108  {
112  TOPO_CHANGE,
114  };
115 
116  //- Extent to which to stitch on read and readUpdate. By default, a
117  // full geometric stitch is performed. A non-geometric stitch can be
118  // done as an optimisation in situations when finite volume geometry
119  // is not needed (e.g., decomposition). Stitching can also be
120  // prevented altogether if that is appropriate (e.g., if the mesh is
121  // loaded for mapping in an un-stitched state).
122  enum class stitchType
123  {
124  none,
125  nonGeometric,
126  geometric
127  };
128 
129 
130 private:
131 
132  // Private Data
133 
134  //- Boundary mesh
135  fvBoundaryMesh boundary_;
136 
137  //- The stitcher function class
138  autoPtr<fvMeshStitcher> stitcher_;
139 
140  //- The topo-changer function class
141  autoPtr<fvMeshTopoChanger> topoChanger_;
142 
143  //- The distributor function class
144  autoPtr<fvMeshDistributor> distributor_;
145 
146  //- The mover function class
147  autoPtr<fvMeshMover> mover_;
148 
149 
150  // Demand-driven data
151 
152  //- Matrix addressing
153  mutable fvMeshLduAddressing* lduPtr_;
154 
155  //- Face-poly-face IO
156  mutable IOobject* polyFacesBfIOPtr_;
157 
158  //- Face-poly-face addressing
159  mutable GeometricBoundaryField<label, surfaceMesh>* polyFacesBfPtr_;
160 
161  //- Offsets for poly-bFace-patch and patch-face addressing
162  mutable labelList* polyBFaceOffsetsPtr_;
163 
164  //- Poly-bFace-patch addressing
165  mutable labelList* polyBFaceOffsetPatchesPtr_;
166 
167  //- Poly-bFace-patch-face addressing
168  mutable labelList* polyBFaceOffsetPatchFacesPtr_;
169 
170  //- Poly-bFace-patch addressing
171  mutable UCompactListList<label>* polyBFacePatchesPtr_;
172 
173  //- Poly-bFace-patch-face addressing
174  mutable UCompactListList<label>* polyBFacePatchFacesPtr_;
175 
176  //- Face-owner addressing
177  mutable GeometricBoundaryField<label, surfaceMesh>* ownerBfPtr_;
178 
179  //- Current time index for cell volumes
180  // Note. The whole mechanism will be replaced once the
181  // dimensionedField is created and the dimensionedField
182  // will take care of the old-time levels.
183  mutable label curTimeIndex_;
184 
185  //- Cell volumes
187 
188  //- Cell volumes old time level
189  mutable DimensionedField<scalar, fvMesh>* V0Ptr_;
190 
191  //- Cell volumes old-old time level
192  mutable DimensionedField<scalar, fvMesh>* V00Ptr_;
193 
194  //- Face area vectors
195  mutable slicedSurfaceVectorField* SfSlicePtr_;
196 
197  //- Face area vectors
198  mutable surfaceVectorField* SfPtr_;
199 
200  //- Mag face area vectors
201  mutable slicedSurfaceScalarField* magSfSlicePtr_;
202 
203  //- Mag face area vectors
204  mutable surfaceScalarField* magSfPtr_;
205 
206  //- Cell centres
207  mutable slicedVolVectorField* CSlicePtr_;
208 
209  //- Cell centres
210  mutable volVectorField* CPtr_;
211 
212  //- Face centres
213  mutable slicedSurfaceVectorField* CfSlicePtr_;
214 
215  //- Face centres
216  mutable surfaceVectorField* CfPtr_;
217 
218  //- Face motion fluxes
219  mutable surfaceScalarField* phiPtr_;
220 
221  //- fvSchemes created on demand
222  mutable autoPtr<fvSchemes> fvSchemes_;
223 
224  //- fvSolution created on demand
225  mutable autoPtr<fvSolution> fvSolution_;
226 
227 
228  // Private Member Functions
229 
230  // Storage management
231 
232  //- Clear FV geometry but not the old-time cell volumes
233  void clearFvGeomNotOldVol();
234 
235  //- Clear FV geometry
236  void clearFvGeom();
237 
238  //- Clear geometry like clearGeomNotOldVol but recreate any
239  // geometric demand-driven data that was set
240  void updateGeomNotOldVol();
241 
242  //- Store old times fields for all fields of a given type and class
243  template<class Type, template<class> class GeoField>
244  void storeOldTimeFields();
245 
246  //- Store old times fields for all fields of a given class
247  template<template<class> class GeoField>
248  void storeOldTimeFields();
249 
250  //- Store old times fields for all fields
251  // Used prior to field mapping following mesh-motion
252  // and NCC stitching
253  void storeOldTimeFields();
254 
255  //- Null oldest time field for all fields of a given type and class
256  template<class Type, template<class> class GeoField>
257  void nullOldestTimeFields();
258 
259  //- Null oldest time field for all fields of a given class
260  template<template<class> class GeoField>
261  void nullOldestTimeFields();
262 
263  //- Null oldest time field for all fields
264  // Used prior to field mapping following mesh topology change
265  void nullOldestTimeFields();
266 
267 
268  // Make topological data
269 
270  //- Get the patch types for the poly faces field
271  wordList polyFacesPatchTypes() const;
272 
273  //- Modify face-poly-face addressing
275 
276 
277  // Make geometric data
278 
279  //- Make the face area vectors
280  void makeSf() const;
281 
282  //- Make the mag face area vectors
283  void makeMagSf() const;
284 
285  //- Make the cell centres
286  void makeC() const;
287 
288  //- Make the face centres
289  void makeCf() const;
290 
291  //- Modify cell face area vectors
292  surfaceVectorField& SfRef();
293 
294  //- Modify cell face area magnitudes
295  surfaceScalarField& magSfRef();
296 
297  //- Modify cell centres
298  volVectorField& CRef();
299 
300  //- Modify face centres
301  surfaceVectorField& CfRef();
302 
303  //- Modify cell face motion fluxes
304  surfaceScalarField& phiRef();
305 
306 
307 public:
308 
309  // Public Typedefs
310 
311  typedef fvMesh Mesh;
313 
314  //- Zone type
315  typedef cellZone Zone;
316 
317  //- Patch field type
318  template<class Type>
320 
321  //- Field source type
322  template<class Type>
324 
326 
327 
328  // Declare name of the class and its debug switch
329  ClassName("fvMesh");
330 
331 
332  // Static data
333 
334  //- Set of names of registered geometric fields
335  // Vc, Vc0, Vc00, Sf, magSf, C, Cf, meshPhi, meshPhi_0
336  const static HashSet<word> geometryFields;
337 
338  //- Set of names of registered current-time geometric fields
339  // Vc, Sf, magSf, C, Cf
340  const static HashSet<word> curGeometryFields;
341 
342 
343  // Constructors
344 
345  //- Construct from IOobject.
346  // Optionally prevent post-construction, so that postConstruct may be
347  // called manually for finer control of construction of mesh changes
348  // and the level of stitching.
349  // Optionally prevent zone generation
350  explicit fvMesh
351  (
352  const IOobject& io,
353  const bool doPost = true
354  );
355 
356  //- Construct from cellShapes with boundary.
357  fvMesh
358  (
359  const IOobject& io,
360  pointField&& points,
361  const cellShapeList& shapes,
362  const faceListList& boundaryFaces,
363  const wordList& boundaryPatchNames,
364  const PtrList<dictionary>& boundaryDicts,
365  const word& defaultBoundaryPatchName,
366  const word& defaultBoundaryPatchType,
367  const bool syncPar = true
368  );
369 
370  //- Construct from components without boundary.
371  // Boundary is added using addFvPatches() member function
372  fvMesh
373  (
374  const IOobject& io,
375  pointField&& points,
376  faceList&& faces,
377  labelList&& allOwner,
378  labelList&& allNeighbour,
379  const bool syncPar = true
380  );
381 
382  //- Construct without boundary from cells rather than owner/neighbour.
383  // Boundary is added using addFvPatches() member function
384  fvMesh
385  (
386  const IOobject& io,
387  pointField&& points,
388  faceList&& faces,
389  cellList&& cells,
390  const bool syncPar = true
391  );
392 
393  //- Move constructor
394  fvMesh(fvMesh&&);
395 
396  //- Disallow default bitwise copy construction
397  fvMesh(const fvMesh&) = delete;
398 
399 
400  //- Destructor
401  virtual ~fvMesh();
402 
403 
404  // Member Functions
405 
406  // Helpers
407 
408  //- Complete construction of the mesh
409  void postConstruct
410  (
411  const bool changers,
412  const bool zones,
413  const stitchType stitch
414  );
415 
416  //- Add boundary patches. Constructor helper
417  void addFvPatches
418  (
419  const List<polyPatch*>&,
420  const bool validBoundary = true
421  );
422 
423  //- Update the mesh based on the mesh files saved in time
424  // directories
426  (
427  const stitchType stitch = stitchType::geometric
428  );
429 
430 
431  // Access
432 
433  //- Return the top-level database
434  const Time& time() const
435  {
436  return polyMesh::time();
437  }
438 
439  //- Return the object registry - resolve conflict polyMesh/lduMesh
440  virtual const objectRegistry& db() const
441  {
442  return polyMesh::db();
443  }
444 
445  //- Return reference to name
446  // Note: name() is currently ambiguous due to derivation from
447  // surfaceInterpolation
448  const word& name() const
449  {
450  return polyMesh::name();
451  }
452 
453  //- Return reference to boundary mesh
454  const fvBoundaryMesh& boundary() const;
455 
456  //- Return reference to polyMesh
457  const polyMesh& poly() const
458  {
459  return *this;
460  }
461 
462  //- Return reference to fvMesh for volFields GeoMesh argument
463  const fvMesh& operator()() const
464  {
465  return *this;
466  }
467 
468  //- Return fvMesh size
469  label size() const
470  {
471  return nCells();
472  }
473 
474  //- Return ldu addressing
475  virtual const lduAddressing& lduAddr() const;
476 
477  //- Return a list of pointers for each patch
478  // with only those pointing to interfaces being set
479  virtual lduInterfacePtrsList interfaces() const
480  {
481  return boundary().interfaces();
482  }
483 
484  //- Return communicator used for parallel communication
485  virtual label comm() const
486  {
487  return polyMesh::comm();
488  }
489 
490  //- Internal face owner
491  const labelUList& owner() const
492  {
493  return lduAddr().lowerAddr();
494  }
495 
496  //- Internal face neighbour
497  const labelUList& neighbour() const
498  {
499  return lduAddr().upperAddr();
500  }
501 
502  //- Return whether the fvMesh is conformal with the polyMesh
503  bool conformal() const;
504 
505  //- Return face-poly-face addressing
507  polyFacesBf() const;
508 
509  //- Return poly-bFace-patch addressing
511 
512  //- Return poly-bFace-patch-face addressing
514 
515  //- Return face-owner addressing
517 
518  //- Return the stitcher function class
519  const fvMeshStitcher& stitcher() const;
520 
521  //- Return the stitcher function class
523 
524  //- Return the topo-changer function class
525  const fvMeshTopoChanger& topoChanger() const;
526 
527  //- Return the distributor function class
528  const fvMeshDistributor& distributor() const;
529 
530  //- Return the mover function class
531  const fvMeshMover& mover() const;
532 
533  //- Return cell volumes
534  const DimensionedField<scalar, fvMesh>& V() const;
535 
536  //- Return old-time cell volumes
537  const DimensionedField<scalar, fvMesh>& V0() const;
538 
539  //- Return old-old-time cell volumes
540  const DimensionedField<scalar, fvMesh>& V00() const;
541 
542  //- Return sub-cycle cell volumes
544 
545  //- Return sub-cycle old-time cell volumes
547 
548  //- Return cell face area vectors
549  const surfaceVectorField& Sf() const;
550 
551  //- Return cell face area magnitudes
552  const surfaceScalarField& magSf() const;
553 
554  //- Return cell face normal vectors
555  tmp<surfaceVectorField> nf() const;
556 
557  //- Return cell centres
558  const volVectorField& C() const;
559 
560  //- Return face centres
561  const surfaceVectorField& Cf() const;
562 
563  //- Return face deltas as surfaceVectorField
565 
566  //- Return cell face motion fluxes
567  const surfaceScalarField& phi() const;
568 
569  //- Return the list of fields of type GeoField
570  // i.e. fields that are not geometry
571  template<class GeoField>
573  (
574  bool strict = false,
576  ) const;
577 
578  //- Return the list of current fields of type GeoField
579  // i.e. fields that are not old-times or geometry
580  template<class GeoField>
582  (
583  const bool strict = false,
585  ) const;
586 
587  //- Lookup a dimensioned field for this geometry
588  template<class Type>
590 
591  //- Return a labelType of valid component indicators
592  // 1 : valid (solved)
593  // -1 : invalid (not solved)
594  template<class Type>
595  typename pTraits<Type>::labelType validComponents() const;
596 
597  //- Return the fvSchemes
598  const fvSchemes& schemes() const;
599 
600  //- Return the fvSolution
601  const fvSolution& solution() const;
602 
603 
604  // Edit
605 
606  //- Does the mesh topology change?
607  bool topoChanging() const;
608 
609  //- Does the mesh get redistributed?
610  bool distributing() const;
611 
612  //- Is this mesh dynamic?
613  bool dynamic() const;
614 
615  //- Has the mesh topology changed this time-step?
616  // Note the additional condition vs the polyMesh. The
617  // finite-volume topology changes if the stitcher changes the
618  // non-conformal faces.
619  bool topoChanged() const
620  {
621  return poly().topoChanged() || (moving() && !conformal());
622  }
623 
624  //- Update the mesh for topology change, mesh to mesh mapping
625  // or redistribution
626  bool update();
627 
628  //- Move the mesh
629  bool move();
630 
631  //- Print a list of all the currently allocated mesh data
632  void printAllocated() const;
633 
634  //- Clear geometry
635  void clearGeom();
636 
637  //- Clear addressing
638  void clearAddressing(const bool isMeshUpdate = false);
639 
640  //- Clear all geometry and addressing
641  void clearOut();
642 
643  //- Prepare for a mesh change
644  void preChange();
645 
646  //- Update mesh corresponding to the given map
647  virtual void topoChange(const polyTopoChangeMap& map);
648 
649  //- Update from another mesh using the given map
650  virtual void mapMesh(const polyMeshMap&);
651 
652  //- Redistribute or update using the given distribution map
653  virtual void distribute(const polyDistributionMap& map);
654 
655  //- Reset the points
656  // without storing old points or returning swept volumes
657  virtual void setPoints(const pointField&);
658 
659  //- Move points, returns volumes swept by faces in motion
660  virtual tmp<scalarField> movePoints(const pointField&);
661 
662  //- Get the current instance for the poly faces boundary field
663  const fileName& polyFacesBfInstance() const;
664 
665  //- Set the instance for the poly faces boundary field
666  void setPolyFacesBfInstance(const fileName&);
667 
668  //- Conform the fvMesh to the polyMesh
669  void conform
670  (
671  const surfaceScalarField& phi =
672  NullObjectRef<surfaceScalarField>()
673  );
674 
675  //- Unconform the fvMesh from the polyMesh
676  void unconform
677  (
679  const surfaceVectorField& Sf,
680  const surfaceVectorField& Cf,
681  const surfaceScalarField& phi =
682  NullObjectRef<surfaceScalarField>(),
683  const bool sync = true
684  );
685 
686  //- Map all fields in time using given map.
687  void mapFields(const polyTopoChangeMap& map);
688 
689  //- Add/insert single patch
690  virtual void addPatch
691  (
692  const label insertPatchi,
693  const polyPatch& patch
694  );
695 
696  //- Reorder and trim existing patches. If validBoundary the new
697  // situation is consistent across processors
698  virtual void reorderPatches
699  (
700  const labelUList& newToOld,
701  const bool validBoundary
702  );
703 
704  //- Remove boundary patches. Warning: fvPatchFields hold ref to
705  // these fvPatches.
706  void removeFvBoundary();
707 
708  //- Swap mesh
709  // For run-time mesh replacement and mesh to mesh mapping
710  void swap(fvMesh&);
711 
712 
713  // Write
714 
715  //- Write the mesh data and all objects in the registry
716  virtual bool writeObject
717  (
721  const bool write = true
722  ) const;
723 
724  //- Write the mesh data only
725  virtual bool writeMesh() const;
726 
727 
728  // Member Operators
729 
730  //- Disallow default bitwise assignment
731  void operator=(const fvMesh&) = delete;
732 
733  bool operator!=(const fvMesh&) const;
734 
735  bool operator==(const fvMesh&) const;
736 };
737 
738 
739 template<>
741 fvMesh::validComponents<sphericalTensor>() const;
742 
743 //- Cast the give dictionary to the corresponding region fvMesh
744 // Useful for \#codeStream in the context of field initialisation
745 const fvMesh& region(const dictionary& dict);
746 
747 
748 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
749 
750 } // End namespace Foam
751 
752 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
753 
754 #include "surfaceMeshI.H"
755 
756 #ifdef NoRepository
757  #include "fvMeshTemplates.C"
758 #endif
759 
760 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
761 
762 #endif
763 
764 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricBoundaryField class.
Generic GeometricField class.
A HashTable with keys but without contents.
Definition: HashSet.H:62
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
const word & name() const
Return name.
Definition: IOobject.H:307
Version number type.
Definition: IOstream.H:97
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:87
compressionType
Enumeration for the format of data in the stream.
Definition: IOstream.H:194
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Specialisation of DimensionedField which holds a slice of a given complete field in such a form that ...
Specialisation of GeometricField which holds slices of given complete fields in a form that they act ...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Named list of cell indices representing a sub-set of the mesh.
Definition: cellZone.H:61
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for handling file names.
Definition: fileName.H:82
Foam::fvBoundaryMesh.
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
Base class for finite-volume field sources.
Definition: fvFieldSource.H:62
Abstract base class for fvMesh movers.
Foam::fvMeshLduAddressing.
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:53
Mesh manipulator that uses the intersection provided by the cyclic non-conformal poly patches to crea...
Abstract base class for fvMesh topology changers.
Sequence of mesh topology changes applied in order.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:433
const volVectorField & C() const
Return cell centres.
static const HashSet< word > curGeometryFields
Set of names of registered current-time geometric fields.
Definition: fvMesh.H:339
virtual const objectRegistry & db() const
Return the object registry - resolve conflict polyMesh/lduMesh.
Definition: fvMesh.H:439
const fileName & polyFacesBfInstance() const
Get the current instance for the poly faces boundary field.
Definition: fvMesh.C:1476
const DimensionedField< scalar, fvMesh > & V() const
Return cell volumes.
const labelUList & owner() const
Internal face owner.
Definition: fvMesh.H:490
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:934
const DimensionedField< scalar, fvMesh > & V00() const
Return old-old-time cell volumes.
void operator=(const fvMesh &)=delete
Disallow default bitwise assignment.
stitchType
Extent to which to stitch on read and readUpdate. By default, a.
Definition: fvMesh.H:122
void postConstruct(const bool changers, const bool zones, const stitchType stitch)
Complete construction of the mesh.
Definition: fvMesh.C:612
const surfaceScalarField & phi() const
Return cell face motion fluxes.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
Definition: fvMesh.C:940
const UCompactListList< label > & polyBFacePatches() const
Return poly-bFace-patch addressing.
Definition: fvMesh.C:988
const fvMeshDistributor & distributor() const
Return the distributor function class.
Definition: fvMesh.C:1121
const fvSchemes & schemes() const
Return the fvSchemes.
Definition: fvMesh.C:1795
void clearGeom()
Clear geometry.
Definition: fvMesh.C:246
fvMesh Mesh
Definition: fvMesh.H:310
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: fvMesh.H:107
@ POINTS_MOVED
Definition: fvMesh.H:109
@ TOPO_CHANGE
Definition: fvMesh.H:111
@ TOPO_PATCH_CHANGE
Definition: fvMesh.H:112
virtual ~fvMesh()
Destructor.
Definition: fvMesh.C:603
pTraits< Type >::labelType validComponents() const
Return a labelType of valid component indicators.
UPtrList< GeoField > curFields(const bool strict=false, const HashSet< word > &geometryFields=fvMesh::geometryFields) const
Return the list of current fields of type GeoField.
cellZone Zone
Zone type.
Definition: fvMesh.H:314
const GeometricBoundaryField< label, surfaceMesh > & ownerBf() const
Return face-owner addressing.
Definition: fvMesh.C:1075
static const HashSet< word > geometryFields
Set of names of registered geometric fields.
Definition: fvMesh.H:335
const fvMeshStitcher & stitcher() const
Return the stitcher function class.
Definition: fvMesh.C:1103
void preChange()
Prepare for a mesh change.
Definition: fvMesh.C:1190
tmp< surfaceVectorField > nf() const
Return cell face normal vectors.
const fvSolution & solution() const
Return the fvSolution.
Definition: fvMesh.C:1806
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
Definition: fvMesh.C:760
const surfaceVectorField & Cf() const
Return face centres.
void swap(fvMesh &)
Swap mesh.
Definition: fvMesh.C:791
const GeometricBoundaryField< label, surfaceMesh > & polyFacesBf() const
Return face-poly-face addressing.
Definition: fvMesh.C:957
bool operator==(const fvMesh &) const
Definition: fvMesh.C:1825
virtual label comm() const
Return communicator used for parallel communication.
Definition: fvMesh.H:484
const UCompactListList< label > & polyBFacePatchFaces() const
Return poly-bFace-patch-face addressing.
Definition: fvMesh.C:1064
bool operator!=(const fvMesh &) const
Definition: fvMesh.C:1819
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write=true) const
Write the mesh data and all objects in the registry.
Definition: fvMesh.C:1693
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: fvMesh.C:1398
void mapFields(const polyTopoChangeMap &map)
Map all fields in time using given map.
Definition: fvMesh.C:1133
const DimensionedField< scalar, fvMesh > & V0() const
Return old-time cell volumes.
UPtrList< GeoField > fields(bool strict=false, const HashSet< word > &geometryFields=fvMesh::geometryFields) const
Return the list of fields of type GeoField.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
Definition: fvMesh.H:478
tmp< DimensionedField< Type, fvMesh > > lookupField(const word &) const
Lookup a dimensioned field for this geometry.
const surfaceVectorField & Sf() const
Return cell face area vectors.
label size() const
Return fvMesh size.
Definition: fvMesh.H:468
bool update()
Update the mesh for topology change, mesh to mesh mapping.
Definition: fvMesh.C:705
bool topoChanged() const
Has the mesh topology changed this time-step?
Definition: fvMesh.H:618
const labelUList & neighbour() const
Internal face neighbour.
Definition: fvMesh.H:496
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
void setPolyFacesBfInstance(const fileName &)
Set the instance for the poly faces boundary field.
Definition: fvMesh.C:1464
virtual void distribute(const polyDistributionMap &map)
Redistribute or update using the given distribution map.
Definition: fvMesh.C:1431
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
Definition: fvMesh.C:778
bool distributing() const
Does the mesh get redistributed?
Definition: fvMesh.C:691
tmp< DimensionedField< scalar, fvMesh > > Vsc0() const
Return sub-cycle old-time cell volumes.
void printAllocated() const
Print a list of all the currently allocated mesh data.
Definition: fvMesh.C:180
fvBoundaryMesh BoundaryMesh
Definition: fvMesh.H:311
const word & name() const
Return reference to name.
Definition: fvMesh.H:447
virtual void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reorder and trim existing patches. If validBoundary the new.
Definition: fvMesh.C:1671
ClassName("fvMesh")
const fvMesh & operator()() const
Return reference to fvMesh for volFields GeoMesh argument.
Definition: fvMesh.H:462
void unconform(const GeometricBoundaryField< label, surfaceMesh > &polyFacesBf, const surfaceVectorField &Sf, const surfaceVectorField &Cf, const surfaceScalarField &phi=NullObjectRef< surfaceScalarField >(), const bool sync=true)
Unconform the fvMesh from the polyMesh.
Definition: fvMesh.C:1510
bool dynamic() const
Is this mesh dynamic?
Definition: fvMesh.C:697
fvMesh(const IOobject &io, const bool doPost=true)
Construct from IOobject.
Definition: fvMesh.C:352
const fvMeshTopoChanger & topoChanger() const
Return the topo-changer function class.
Definition: fvMesh.C:1115
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
Definition: fvMesh.C:1338
tmp< surfaceVectorField > delta() const
Return face deltas as surfaceVectorField.
bool topoChanging() const
Does the mesh topology change?
Definition: fvMesh.C:685
virtual bool writeMesh() const
Write the mesh data only.
Definition: fvMesh.C:1762
tmp< DimensionedField< scalar, fvMesh > > Vsc() const
Return sub-cycle cell volumes.
virtual void addPatch(const label insertPatchi, const polyPatch &patch)
Add/insert single patch.
Definition: fvMesh.C:1614
void clearOut()
Clear all geometry and addressing.
Definition: fvMesh.C:301
bool move()
Move the mesh.
Definition: fvMesh.C:745
virtual void setPoints(const pointField &)
Reset the points.
Definition: fvMesh.C:1196
const fvMeshMover & mover() const
Return the mover function class.
Definition: fvMesh.C:1127
void conform(const surfaceScalarField &phi=NullObjectRef< surfaceScalarField >())
Conform the fvMesh to the polyMesh.
Definition: fvMesh.C:1487
bool conformal() const
Return whether the fvMesh is conformal with the polyMesh.
Definition: fvMesh.C:951
const polyMesh & poly() const
Return reference to polyMesh.
Definition: fvMesh.H:456
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Definition: fvSchemes.H:53
Selector class for finite volume solution solution. fvMesh is derived from fvSolution so that all fie...
Definition: fvSolution.H:50
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:60
Registry of regIOobjects.
const Time & time() const
Return time.
Traits class for primitives.
Definition: pTraits.H:53
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
const objectRegistry & db() const
Return the object registry.
Definition: polyMesh.H:453
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1308
label comm() const
Return communicator used for parallel communication.
Definition: polyMesh.C:1490
readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
Definition: polyMeshIO.C:132
bool topoChanged() const
Has the mesh topology changed this time-step?
Definition: polyMesh.H:468
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1295
bool moving() const
Is the mesh moving?
Definition: polyMesh.H:462
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
label nCells() const
const cellList & cells() const
virtual bool write(const bool write=true) const
Write using setting from DB.
Cell to surface interpolation scheme. Included in fvMesh.
bool movePoints()
Do what is necessary if the mesh has moved.
Mesh data for surface fields.
Definition: surfaceMesh.H:51
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const fvMesh & region(const dictionary &dict)
Cast the give dictionary to the corresponding region fvMesh.
Definition: fvMesh.C:1834
dictionary dict