fvMesh.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2016-2020 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 "fvMesh.H"
30 #include "volFields.H"
31 #include "surfaceFields.H"
32 #include "slicedVolFields.H"
33 #include "slicedSurfaceFields.H"
34 #include "SubField.H"
35 #include "demandDrivenData.H"
36 #include "fvMeshLduAddressing.H"
37 #include "mapPolyMesh.H"
38 #include "MapFvFields.H"
39 #include "fvMeshMapper.H"
40 #include "mapClouds.H"
41 #include "MeshObject.H"
42 #include "fvMatrix.H"
43 
44 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48  defineTypeNameAndDebug(fvMesh, 0);
49 }
50 
51 
52 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
53 
55 {
57  <
58  fvMesh,
61  >(*this);
62 
64  <
65  lduMesh,
68  >(*this);
69 
73  VPtr_ = nullptr;
74 
79 }
80 
81 
83 {
84  bool haveV = (VPtr_ != nullptr);
85  bool haveSf = (SfPtr_ != nullptr);
86  bool haveMagSf = (magSfPtr_ != nullptr);
87  bool haveCP = (CPtr_ != nullptr);
88  bool haveCf = (CfPtr_ != nullptr);
89 
90  clearGeomNotOldVol();
91 
92  // Now recreate the fields
93  if (haveV)
94  {
95  (void)V();
96  }
97  if (haveSf)
98  {
99  (void)Sf();
100  }
101  if (haveMagSf)
102  {
103  (void)magSf();
104  }
105  if (haveCP)
106  {
107  (void)C();
108  }
109  if (haveCf)
110  {
111  (void)Cf();
112  }
113 }
114 
115 
117 {
118  clearGeomNotOldVol();
119 
120  deleteDemandDrivenData(V0Ptr_);
121  deleteDemandDrivenData(V00Ptr_);
122 
123  // Mesh motion flux cannot be deleted here because the old-time flux
124  // needs to be saved.
125 }
126 
127 
128 void Foam::fvMesh::clearAddressing(const bool isMeshUpdate)
129 {
130  DebugInFunction << "isMeshUpdate: " << isMeshUpdate << endl;
131 
132  if (isMeshUpdate)
133  {
134  // Part of a mesh update. Keep meshObjects that have an updateMesh
135  // callback
137  <
138  fvMesh,
141  >
142  (
143  *this
144  );
146  <
147  lduMesh,
150  >
151  (
152  *this
153  );
154  }
155  else
156  {
157  meshObject::clear<fvMesh, TopologicalMeshObject>(*this);
158  meshObject::clear<lduMesh, TopologicalMeshObject>(*this);
159  }
160  deleteDemandDrivenData(lduPtr_);
161 }
162 
163 
165 {
166  if (curTimeIndex_ < time().timeIndex())
167  {
169  << " Storing old time volumes since from time " << curTimeIndex_
170  << " and time now " << time().timeIndex()
171  << " V:" << V.size() << endl;
172 
173  if (V00Ptr_ && V0Ptr_)
174  {
175  // Copy V0 into V00 storage
176  *V00Ptr_ = *V0Ptr_;
177  }
178 
179  if (V0Ptr_)
180  {
181  // Copy V into V0 storage
182  V0Ptr_->scalarField::operator=(V);
183  }
184  else
185  {
186  // Allocate V0 storage, fill with V
188  (
189  IOobject
190  (
191  "V0",
192  time().timeName(),
193  *this,
196  false
197  ),
198  *this,
199  dimVolume
200  );
201  scalarField& V0 = *V0Ptr_;
202  // Note: V0 now sized with current mesh, not with (potentially
203  // different size) V.
204  V0.setSize(V.size());
205  V0 = V;
206  }
207 
208  curTimeIndex_ = time().timeIndex();
209 
210  if (debug)
211  {
213  << " Stored old time volumes V0:" << V0Ptr_->size()
214  << endl;
215 
216  if (V00Ptr_)
217  {
219  << " Stored oldold time volumes V00:" << V00Ptr_->size()
220  << endl;
221  }
222  }
223  }
224 }
225 
226 
228 {
229  clearGeom();
231 
232  clearAddressing();
233 
234  // Clear mesh motion flux
235  deleteDemandDrivenData(phiPtr_);
236 
238 }
239 
240 
241 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
242 
244 :
245  polyMesh(io),
246  surfaceInterpolation(*this),
247  fvSchemes(static_cast<const objectRegistry&>(*this)),
248  fvSolution(static_cast<const objectRegistry&>(*this)),
249  data(static_cast<const objectRegistry&>(*this)),
250  boundary_(*this, boundaryMesh()),
251  lduPtr_(nullptr),
252  curTimeIndex_(time().timeIndex()),
253  VPtr_(nullptr),
254  V0Ptr_(nullptr),
255  V00Ptr_(nullptr),
256  SfPtr_(nullptr),
257  magSfPtr_(nullptr),
258  CPtr_(nullptr),
259  CfPtr_(nullptr),
260  phiPtr_(nullptr)
261 {
262  DebugInFunction << "Constructing fvMesh from IOobject" << endl;
263 
264  // Check the existence of the cell volumes and read if present
265  // and set the storage of V00
266  if (fileHandler().isFile(time().timePath()/dbDir()/"V0"))
267  {
269  (
270  IOobject
271  (
272  "V0",
273  time().timeName(),
274  *this,
277  false
278  ),
279  *this
280  );
281 
282  V00();
283  }
284 
285  // Check the existence of the mesh fluxes, read if present and set the
286  // mesh to be moving
287  if (fileHandler().isFile(time().timePath()/dbDir()/"meshPhi"))
288  {
290  (
291  IOobject
292  (
293  "meshPhi",
294  time().timeName(),
295  *this,
298  false
299  ),
300  *this
301  );
302 
303  // The mesh is now considered moving so the old-time cell volumes
304  // will be required for the time derivatives so if they haven't been
305  // read initialise to the current cell volumes
306  if (!V0Ptr_)
307  {
309  (
310  IOobject
311  (
312  "V0",
313  time().timeName(),
314  *this,
317  false
318  ),
319  V()
320  );
321  }
322 
323  moving(true);
324  }
325 }
326 
327 
329 (
330  const IOobject& io,
331  pointField&& points,
332  faceList&& faces,
333  labelList&& allOwner,
334  labelList&& allNeighbour,
335  const bool syncPar
336 )
337 :
338  polyMesh
339  (
340  io,
341  std::move(points),
342  std::move(faces),
343  std::move(allOwner),
344  std::move(allNeighbour),
345  syncPar
346  ),
347  surfaceInterpolation(*this),
348  fvSchemes(static_cast<const objectRegistry&>(*this)),
349  fvSolution(static_cast<const objectRegistry&>(*this)),
350  data(static_cast<const objectRegistry&>(*this)),
351  boundary_(*this, boundaryMesh()),
352  lduPtr_(nullptr),
353  curTimeIndex_(time().timeIndex()),
354  VPtr_(nullptr),
355  V0Ptr_(nullptr),
356  V00Ptr_(nullptr),
357  SfPtr_(nullptr),
358  magSfPtr_(nullptr),
359  CPtr_(nullptr),
360  CfPtr_(nullptr),
361  phiPtr_(nullptr)
362 {
363  DebugInFunction << "Constructing fvMesh from components" << endl;
364 }
365 
366 
368 (
369  const IOobject& io,
370  pointField&& points,
371  faceList&& faces,
372  cellList&& cells,
373  const bool syncPar
374 )
375 :
376  polyMesh
377  (
378  io,
379  std::move(points),
380  std::move(faces),
381  std::move(cells),
382  syncPar
383  ),
384  surfaceInterpolation(*this),
385  fvSchemes(static_cast<const objectRegistry&>(*this)),
386  fvSolution(static_cast<const objectRegistry&>(*this)),
387  data(static_cast<const objectRegistry&>(*this)),
388  boundary_(*this),
389  lduPtr_(nullptr),
390  curTimeIndex_(time().timeIndex()),
391  VPtr_(nullptr),
392  V0Ptr_(nullptr),
393  V00Ptr_(nullptr),
394  SfPtr_(nullptr),
395  magSfPtr_(nullptr),
396  CPtr_(nullptr),
397  CfPtr_(nullptr),
398  phiPtr_(nullptr)
399 {
400  DebugInFunction << "Constructing fvMesh from components" << endl;
401 }
402 
403 
404 Foam::fvMesh::fvMesh(const IOobject& io, const zero, const bool syncPar)
405 :
406  fvMesh(io, pointField(), faceList(), labelList(), labelList(), syncPar)
407 {}
408 
409 
410 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
411 
413 {
414  clearOut();
415 }
416 
417 
418 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
419 
421 (
422  fvMatrix<scalar>& m,
423  const dictionary& dict
424 ) const
425 {
426  // Redirect to fvMatrix solver
427  return m.solveSegregatedOrCoupled(dict);
428 }
429 
430 
432 (
433  fvMatrix<vector>& m,
434  const dictionary& dict
435 ) const
436 {
437  // Redirect to fvMatrix solver
438  return m.solveSegregatedOrCoupled(dict);
439 }
440 
441 
443 (
445  const dictionary& dict
446 ) const
447 {
448  // Redirect to fvMatrix solver
449  return m.solveSegregatedOrCoupled(dict);
450 }
451 
452 
454 (
456  const dictionary& dict
457 ) const
458 {
459  // Redirect to fvMatrix solver
460  return m.solveSegregatedOrCoupled(dict);
461 }
462 
463 
465 (
466  fvMatrix<tensor>& m,
467  const dictionary& dict
468 ) const
469 {
470  // Redirect to fvMatrix solver
471  return m.solveSegregatedOrCoupled(dict);
472 }
473 
474 
476 (
477  PtrList<polyPatch>& plist,
478  const bool validBoundary
479 )
480 {
481  if (boundary().size())
482  {
484  << " boundary already exists"
485  << abort(FatalError);
486  }
487 
488  addPatches(plist, validBoundary);
489  boundary_.addPatches(boundaryMesh());
490 }
491 
492 
494 (
495  const List<polyPatch*>& p,
496  const bool validBoundary
497 )
498 {
499  // Acquire ownership of the pointers
500  PtrList<polyPatch> plist(const_cast<List<polyPatch*>&>(p));
501 
502  addFvPatches(plist, validBoundary);
503 }
504 
505 
507 {
508  DebugInFunction << "Removing boundary patches." << endl;
509 
510  // Remove fvBoundaryMesh data first.
511  boundary_.clear();
512  boundary_.setSize(0);
514 
515  clearOut();
516 }
517 
518 
520 {
521  DebugInFunction << "Updating fvMesh. ";
522 
524 
525  if (state == polyMesh::TOPO_PATCH_CHANGE)
526  {
527  DebugInfo << "Boundary and topological update" << endl;
528 
529  boundary_.readUpdate(boundaryMesh());
530 
531  clearOut();
532 
533  }
534  else if (state == polyMesh::TOPO_CHANGE)
535  {
536  DebugInfo << "Topological update" << endl;
537 
538  clearOut();
539  }
540  else if (state == polyMesh::POINTS_MOVED)
541  {
542  DebugInfo << "Point motion update" << endl;
543 
544  clearGeom();
545  }
546  else
547  {
548  DebugInfo << "No update" << endl;
549  }
550 
551  return state;
552 }
553 
554 
556 {
557  return boundary_;
558 }
559 
560 
562 {
563  if (!lduPtr_)
564  {
566  << "Calculating fvMeshLduAddressing from nFaces:"
567  << nFaces() << endl;
568 
569  lduPtr_ = new fvMeshLduAddressing(*this);
570  }
571 
572  return *lduPtr_;
573 }
574 
575 
577 {
579  << " nOldCells:" << meshMap.nOldCells()
580  << " nCells:" << nCells()
581  << " nOldFaces:" << meshMap.nOldFaces()
582  << " nFaces:" << nFaces()
583  << endl;
584 
585  // We require geometric properties valid for the old mesh
586  if
587  (
588  meshMap.cellMap().size() != nCells()
589  || meshMap.faceMap().size() != nFaces()
590  )
591  {
593  << "mapPolyMesh does not correspond to the old mesh."
594  << " nCells:" << nCells()
595  << " cellMap:" << meshMap.cellMap().size()
596  << " nOldCells:" << meshMap.nOldCells()
597  << " nFaces:" << nFaces()
598  << " faceMap:" << meshMap.faceMap().size()
599  << " nOldFaces:" << meshMap.nOldFaces()
600  << exit(FatalError);
601  }
602 
603  // Create a mapper
604  const fvMeshMapper mapper(*this, meshMap);
605 
606  // Map all the volFields in the objectRegistry
607  MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
608  (mapper);
609  MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
610  (mapper);
611  MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
612  (mapper);
613  MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
614  (mapper);
615  MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
616  (mapper);
617 
618  // Map all the surfaceFields in the objectRegistry
619  MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
620  (mapper);
621  MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
622  (mapper);
623  MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
624  (mapper);
625  MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
626  (mapper);
627  MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
628  (mapper);
629 
630  // Map all the dimensionedFields in the objectRegistry
631  MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
632  MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
633  MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
634  MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
635  MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
636 
637  // Map all the clouds in the objectRegistry
638  mapClouds(*this, meshMap);
639 
640 
641  const labelList& cellMap = meshMap.cellMap();
642 
643  // Map the old volume. Just map to new cell labels.
644  if (V0Ptr_)
645  {
646  scalarField& V0 = *V0Ptr_;
647 
648  scalarField savedV0(V0);
649  V0.setSize(nCells());
650 
651  forAll(V0, i)
652  {
653  if (cellMap[i] > -1)
654  {
655  V0[i] = savedV0[cellMap[i]];
656  }
657  else
658  {
659  V0[i] = 0.0;
660  }
661  }
662 
663  // Inject volume of merged cells
664  label nMerged = 0;
665  forAll(meshMap.reverseCellMap(), oldCelli)
666  {
667  label index = meshMap.reverseCellMap()[oldCelli];
668 
669  if (index < -1)
670  {
671  label celli = -index-2;
672 
673  V0[celli] += savedV0[oldCelli];
674 
675  nMerged++;
676  }
677  }
678 
679  DebugInfo
680  << "Mapping old time volume V0. Merged "
681  << nMerged << " out of " << nCells() << " cells" << endl;
682  }
683 
684 
685  // Map the old-old volume. Just map to new cell labels.
686  if (V00Ptr_)
687  {
688  scalarField& V00 = *V00Ptr_;
689 
690  scalarField savedV00(V00);
691  V00.setSize(nCells());
692 
693  forAll(V00, i)
694  {
695  if (cellMap[i] > -1)
696  {
697  V00[i] = savedV00[cellMap[i]];
698  }
699  else
700  {
701  V00[i] = 0.0;
702  }
703  }
704 
705  // Inject volume of merged cells
706  label nMerged = 0;
707  forAll(meshMap.reverseCellMap(), oldCelli)
708  {
709  label index = meshMap.reverseCellMap()[oldCelli];
710 
711  if (index < -1)
712  {
713  label celli = -index-2;
714 
715  V00[celli] += savedV00[oldCelli];
716  nMerged++;
717  }
718  }
719 
720  DebugInfo
721  << "Mapping old time volume V00. Merged "
722  << nMerged << " out of " << nCells() << " cells" << endl;
723  }
724 }
725 
726 
728 {
730 
731  // Grab old time volumes if the time has been incremented
732  // This will update V0, V00
733  if (curTimeIndex_ < time().timeIndex())
734  {
735  storeOldVol(V());
736  }
737 
738 
739  // Move the polyMesh and set the mesh motion fluxes to the swept-volumes
740 
741  scalar rDeltaT = 1.0/time().deltaTValue();
742 
744  scalarField& sweptVols = tsweptVols.ref();
745 
746  if (!phiPtr_)
747  {
748  // Create mesh motion flux
749  phiPtr_ = new surfaceScalarField
750  (
751  IOobject
752  (
753  "meshPhi",
754  this->time().timeName(),
755  *this,
758  false
759  ),
760  *this,
762  );
763  }
764  else
765  {
766  // Grab old time mesh motion fluxes if the time has been incremented
767  if (phiPtr_->timeIndex() != time().timeIndex())
768  {
769  phiPtr_->oldTime();
770  }
771  }
772 
773  surfaceScalarField& phi = *phiPtr_;
775  scalarField::subField(sweptVols, nInternalFaces());
776  phi.primitiveFieldRef() *= rDeltaT;
777 
778  const fvPatchList& patches = boundary();
779 
780  surfaceScalarField::Boundary& phibf = phi.boundaryFieldRef();
781  forAll(patches, patchi)
782  {
783  phibf[patchi] = patches[patchi].patchSlice(sweptVols);
784  phibf[patchi] *= rDeltaT;
785  }
786 
787  // Update or delete the local geometric properties as early as possible so
788  // they can be used if necessary. These get recreated here instead of
789  // demand driven since they might do parallel transfers which can conflict
790  // with when they're actually being used.
791  // Note that between above "polyMesh::movePoints(p)" and here nothing
792  // should use the local geometric properties.
793  updateGeomNotOldVol();
794 
795 
796  // Update other local data
797  boundary_.movePoints();
799 
800  meshObject::movePoints<fvMesh>(*this);
801  meshObject::movePoints<lduMesh>(*this);
802 
803  return tsweptVols;
804 }
805 
806 
808 {
810 
811  // Update polyMesh. This needs to keep volume existent!
813 
814  // Our slice of the addressing is no longer valid
815  deleteDemandDrivenData(lduPtr_);
816 
817  if (VPtr_)
818  {
819  // Grab old time volumes if the time has been incremented
820  // This will update V0, V00
821  storeOldVol(mpm.oldCellVolumes());
822 
823  // Few checks
824  if (VPtr_ && (V().size() != mpm.nOldCells()))
825  {
827  << "V:" << V().size()
828  << " not equal to the number of old cells "
829  << mpm.nOldCells()
830  << exit(FatalError);
831  }
832  if (V0Ptr_ && (V0Ptr_->size() != mpm.nOldCells()))
833  {
835  << "V0:" << V0Ptr_->size()
836  << " not equal to the number of old cells "
837  << mpm.nOldCells()
838  << exit(FatalError);
839  }
840  if (V00Ptr_ && (V00Ptr_->size() != mpm.nOldCells()))
841  {
843  << "V0:" << V00Ptr_->size()
844  << " not equal to the number of old cells "
845  << mpm.nOldCells()
846  << exit(FatalError);
847  }
848  }
849 
850 
851  // Clear mesh motion flux (note: could instead save & map like volumes)
852  deleteDemandDrivenData(phiPtr_);
853 
854  // Clear the sliced fields
855  clearGeomNotOldVol();
856 
857  // Map all fields
858  mapFields(mpm);
859 
860  // Clear the current volume and other geometry factors
862 
863  // Clear any non-updateable addressing
864  clearAddressing(true);
865 
866  meshObject::updateMesh<fvMesh>(*this, mpm);
867  meshObject::updateMesh<lduMesh>(*this, mpm);
868 }
869 
870 
872 (
873  IOstreamOption streamOpt,
874  const bool valid
875 ) const
876 {
877  bool ok = true;
878  if (phiPtr_)
879  {
880  ok = phiPtr_->write(valid);
881  // NOTE: The old old time mesh phi might be necessary for certain
882  // solver smooth restart using second order time schemes.
883  //ok = phiPtr_->oldTime().write();
884  }
885  if (V0Ptr_ && V0Ptr_->writeOpt() == IOobject::AUTO_WRITE)
886  {
887  // For second order restarts we need to write V0
888  ok = V0Ptr_->write(valid);
889  }
890 
891  return ok && polyMesh::writeObject(streamOpt, valid);
892 }
893 
894 
895 bool Foam::fvMesh::write(const bool valid) const
896 {
897  return polyMesh::write(valid);
898 }
899 
900 
901 template<>
903 Foam::fvMesh::validComponents<Foam::sphericalTensor>() const
904 {
906 }
907 
908 
909 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
910 
911 bool Foam::fvMesh::operator!=(const fvMesh& rhs) const
912 {
913  return &rhs != this;
914 }
915 
916 
917 bool Foam::fvMesh::operator==(const fvMesh& rhs) const
918 {
919  return &rhs == this;
920 }
921 
922 
923 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::surfaceInterpolation::clearOut
void clearOut()
Clear all geometry and addressing.
Definition: surfaceInterpolation.C:48
Foam::fvMesh::storeOldVol
void storeOldVol(const scalarField &)
Preserve old volume(s)
Definition: fvMesh.C:164
volFields.H
Foam::fvMesh::~fvMesh
virtual ~fvMesh()
Destructor.
Definition: fvMesh.C:412
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:320
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
SubField.H
Foam::fvMesh::write
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
Definition: fvMesh.C:895
Foam::polyMesh::POINTS_MOVED
Definition: polyMesh.H:94
Foam::primitiveMesh::clearAddressing
void clearAddressing()
Clear topological data.
Definition: primitiveMeshClear.C:143
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::fvMesh::updateGeomNotOldVol
void updateGeomNotOldVol()
Clear geometry like clearGeomNotOldVol but recreate any.
Definition: fvMesh.C:82
Foam::polyMesh::movePoints
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
Definition: polyMesh.C:1106
Foam::fvMatrix::solveSegregatedOrCoupled
SolverPerformance< Type > solveSegregatedOrCoupled(const dictionary &)
Solve segregated or coupled returning the solution statistics.
Definition: fvMatrixSolve.C:62
Foam::fvSchemes
Selector class for finite volume differencing schemes. fvMesh is derived from fvShemes so that all fi...
Definition: fvSchemes.H:52
slicedVolFields.H
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::polyMesh::moving
bool moving() const
Is mesh moving.
Definition: polyMesh.H:513
Foam::GeometricMeshObject
Definition: MeshObject.H:201
Foam::polyMesh::dbDir
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
Definition: polyMesh.C:798
mapPolyMesh.H
Foam::fvMesh::VPtr_
void * VPtr_
Cell volumes old time level.
Definition: fvMesh.H:112
Foam::fvMesh::mapFields
virtual void mapFields(const mapPolyMesh &mpm)
Map all fields in time using given map.
Definition: fvMesh.C:576
Foam::fvMesh::clearGeomNotOldVol
void clearGeomNotOldVol()
Clear geometry but not the old-time cell volumes.
Definition: fvMesh.C:54
Foam::fvMesh::clearGeom
void clearGeom()
Clear geometry.
Definition: fvMesh.C:116
Foam::mapPolyMesh::nOldFaces
label nOldFaces() const
Number of old faces.
Definition: mapPolyMesh.H:380
Foam::MoveableMeshObject
Definition: MeshObject.H:220
Foam::fvMesh::removeFvBoundary
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
Definition: fvMesh.C:506
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:1170
fvMatrix.H
Foam::polyMesh::clearOut
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Definition: polyMeshClear.C:222
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
surfaceFields.H
Foam::surfaceFields.
Foam::fvMesh::operator!=
bool operator!=(const fvMesh &rhs) const
Compares addresses.
Definition: fvMesh.C:911
Foam::fvMesh::V00
const DimensionedField< scalar, volMesh > & V00() const
Return old-old-time cell volumes.
Definition: fvMeshGeometry.C:233
Foam::fvMesh::operator==
bool operator==(const fvMesh &rhs) const
Compares addresses.
Definition: fvMesh.C:917
Foam::UpdateableMeshObject
Definition: MeshObject.H:241
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
C
volScalarField & C
Definition: readThermalProperties.H:102
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
mapClouds.H
Generic Geometric field mapper. For "real" mapping, add template specialisations for mapping of inter...
Foam::fvMeshLduAddressing
Foam::fvMeshLduAddressing.
Definition: fvMeshLduAddressing.H:51
Foam::fvMesh::magSfPtr_
surfaceScalarField * magSfPtr_
Mag face area vectors.
Definition: fvMesh.H:124
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::fvMesh::SfPtr_
slicedSurfaceVectorField * SfPtr_
Face area vectors.
Definition: fvMesh.H:121
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::fvMesh::readUpdate
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
Definition: fvMesh.C:519
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:42
Foam::polyMesh::TOPO_PATCH_CHANGE
Definition: polyMesh.H:96
Foam::fvMesh::solve
virtual SolverPerformance< scalar > solve(fvMatrix< scalar > &, const dictionary &) const
Definition: fvMesh.C:421
Foam::fvMesh::V0Ptr_
DimensionedField< scalar, volMesh > * V0Ptr_
Cell volumes old time level.
Definition: fvMesh.H:115
Foam::fvMesh::CfPtr_
slicedSurfaceVectorField * CfPtr_
Face centres.
Definition: fvMesh.H:130
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:258
fvMeshMapper.H
Foam::Field< scalar >
Foam::regIOobject::write
virtual bool write(const bool valid=true) const
Write using setting from DB.
Definition: regIOobjectWrite.C:165
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:360
Foam::fvMesh::lduAddr
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
Definition: fvMesh.C:561
Foam::polyMesh::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Definition: polyMeshUpdate.C:42
Foam::fvSolution
Selector class for finite volume solution solution. fvMesh is derived from fvSolution so that all fie...
Definition: fvSolution.H:49
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::fvMesh::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
Definition: fvMesh.C:807
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::polyMesh::TOPO_CHANGE
Definition: polyMesh.H:95
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::objectRegistry::writeObject
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the objects using stream options.
Definition: objectRegistry.C:475
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:121
Foam::fvMesh::addFvPatches
void addFvPatches(PtrList< polyPatch > &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
Definition: fvMesh.C:476
Foam::surfaceInterpolation::movePoints
bool movePoints()
Do what is necessary if the mesh has moved.
Definition: surfaceInterpolation.C:125
MapFvFields.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
Foam::fvMesh::fvMesh
fvMesh(const fvMesh &)=delete
No copy construct.
Foam::mapPolyMesh::oldCellVolumes
const scalarField & oldCellVolumes() const
Definition: mapPolyMesh.H:650
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::polyMesh::removeBoundary
void removeBoundary()
Remove boundary patches.
Definition: polyMeshClear.C:39
Foam::GeometricField::primitiveFieldRef
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
Definition: GeometricField.C:766
Foam::polyMesh::readUpdateState
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: polyMesh.H:91
Foam::fvMesh::boundary
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:555
Foam::fvMesh::CPtr_
slicedVolVectorField * CPtr_
Cell centres.
Definition: fvMesh.H:127
Foam::mapPolyMesh::reverseCellMap
const labelList & reverseCellMap() const
Reverse cell map.
Definition: mapPolyMesh.H:531
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:372
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:354
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::fvMeshMapper
Class holds all the necessary information for mapping fields associated with fvMesh.
Definition: fvMeshMapper.H:57
Foam::GeometricField::boundaryFieldRef
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Definition: GeometricField.C:783
Foam::List< face >
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:54
Foam::mapClouds
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
Definition: mapClouds.H:51
Foam::mapPolyMesh::nOldCells
label nOldCells() const
Number of old cells.
Definition: mapPolyMesh.H:386
Foam::meshObject::clearUpto
static void clearUpto(objectRegistry &obr)
Definition: MeshObject.C:217
points
const pointField & points
Definition: gmvOutputHeader.H:1
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::mapPolyMesh::faceMap
const labelList & faceMap() const
Old face map.
Definition: mapPolyMesh.H:409
Foam::surfaceInterpolation
Cell to surface interpolation scheme. Included in fvMesh.
Definition: surfaceInterpolation.H:54
Foam::SlicedGeometricField::Internal
The internalField of a SlicedGeometricField.
Definition: SlicedGeometricField.H:196
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::TopologicalMeshObject
Definition: MeshObject.H:182
slicedSurfaceFields.H
MeshObject.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:248
Foam::boundaryMesh
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:62
Foam::Field< scalar >::subField
SubField< scalar > subField
Declare type of subField.
Definition: Field.H:90
timeIndex
label timeIndex
Definition: getTimeIndex.H:4
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:61
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::SolverPerformance
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.
Definition: SolverPerformance.H:51
fvMeshLduAddressing.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:54
boundary
faceListList boundary
Definition: createBlockMesh.H:4
Foam::mapPolyMesh::cellMap
const labelList & cellMap() const
Old cell map.
Definition: mapPolyMesh.H:434
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62
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::fvMesh::clearOut
void clearOut()
Clear all geometry and addressing.
Definition: fvMesh.C:227
Foam::polyMesh::readUpdate
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
Definition: polyMeshIO.C:75
Foam::fvMesh::V
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
Definition: fvMeshGeometry.C:179
Foam::fvMesh::phiPtr_
surfaceScalarField * phiPtr_
Face motion fluxes.
Definition: fvMesh.H:133
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62
Foam::IOobject::MUST_READ
Definition: IOobject.H:120
Foam::fvMesh::writeObject
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the underlying polyMesh and other data.
Definition: fvMesh.C:872