polyMesh.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-2019 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 "polyMesh.H"
30 #include "Time.H"
31 #include "cellIOList.H"
32 #include "wedgePolyPatch.H"
33 #include "emptyPolyPatch.H"
34 #include "globalMeshData.H"
35 #include "processorPolyPatch.H"
37 #include "indexedOctree.H"
38 #include "treeDataCell.H"
39 #include "MeshObject.H"
40 #include "pointMesh.H"
41 
42 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46  defineTypeNameAndDebug(polyMesh, 0);
47 
48  word polyMesh::defaultRegion = "region0";
49  word polyMesh::meshSubDir = "polyMesh";
50 }
51 
52 
53 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
54 
55 void Foam::polyMesh::calcDirections() const
56 {
57  for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
58  {
59  solutionD_[cmpt] = 1;
60  }
61 
62  // Knock out empty and wedge directions. Note:they will be present on all
63  // domains.
64 
65  label nEmptyPatches = 0;
66  label nWedgePatches = 0;
67 
68  vector emptyDirVec = Zero;
69  vector wedgeDirVec = Zero;
70 
71  forAll(boundaryMesh(), patchi)
72  {
73  if (boundaryMesh()[patchi].size())
74  {
75  if (isA<emptyPolyPatch>(boundaryMesh()[patchi]))
76  {
77  nEmptyPatches++;
78  emptyDirVec += sum(cmptMag(boundaryMesh()[patchi].faceAreas()));
79  }
80  else if (isA<wedgePolyPatch>(boundaryMesh()[patchi]))
81  {
82  const wedgePolyPatch& wpp = refCast<const wedgePolyPatch>
83  (
84  boundaryMesh()[patchi]
85  );
86 
87  nWedgePatches++;
88  wedgeDirVec += cmptMag(wpp.centreNormal());
89  }
90  }
91  }
92 
93  reduce(nEmptyPatches, maxOp<label>());
94  reduce(nWedgePatches, maxOp<label>());
95 
96  if (nEmptyPatches)
97  {
98  reduce(emptyDirVec, sumOp<vector>());
99 
100  emptyDirVec.normalise();
101 
102  for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
103  {
104  if (emptyDirVec[cmpt] > 1e-6)
105  {
106  solutionD_[cmpt] = -1;
107  }
108  else
109  {
110  solutionD_[cmpt] = 1;
111  }
112  }
113  }
114 
115 
116  // Knock out wedge directions
117 
118  geometricD_ = solutionD_;
119 
120  if (nWedgePatches)
121  {
122  reduce(wedgeDirVec, sumOp<vector>());
123 
124  wedgeDirVec.normalise();
125 
126  for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
127  {
128  if (wedgeDirVec[cmpt] > 1e-6)
129  {
130  geometricD_[cmpt] = -1;
131  }
132  else
133  {
134  geometricD_[cmpt] = 1;
135  }
136  }
137  }
138 }
139 
140 
141 Foam::autoPtr<Foam::labelIOList> Foam::polyMesh::readTetBasePtIs() const
142 {
143  IOobject io
144  (
145  "tetBasePtIs",
146  instance(),
147  meshSubDir,
148  *this,
151  );
152 
153  if (io.typeHeaderOk<labelIOList>(true))
154  {
155  return autoPtr<labelIOList>::New(io);
156  }
157 
158  return nullptr;
159 }
160 
161 
162 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
163 
164 Foam::polyMesh::polyMesh(const IOobject& io)
165 :
166  objectRegistry(io),
167  primitiveMesh(),
168  points_
169  (
170  IOobject
171  (
172  "points",
173  time().findInstance(meshDir(), "points"),
174  meshSubDir,
175  *this,
176  IOobject::MUST_READ,
177  IOobject::NO_WRITE
178  )
179  ),
180  faces_
181  (
182  IOobject
183  (
184  "faces",
185  time().findInstance(meshDir(), "faces"),
186  meshSubDir,
187  *this,
188  IOobject::MUST_READ,
189  IOobject::NO_WRITE
190  )
191  ),
192  owner_
193  (
194  IOobject
195  (
196  "owner",
197  faces_.instance(),
198  meshSubDir,
199  *this,
200  IOobject::READ_IF_PRESENT,
201  IOobject::NO_WRITE
202  )
203  ),
204  neighbour_
205  (
206  IOobject
207  (
208  "neighbour",
209  faces_.instance(),
210  meshSubDir,
211  *this,
212  IOobject::READ_IF_PRESENT,
213  IOobject::NO_WRITE
214  )
215  ),
216  clearedPrimitives_(false),
217  boundary_
218  (
219  IOobject
220  (
221  "boundary",
222  time().findInstance // allow 'newer' boundary file
223  (
224  meshDir(),
225  "boundary",
226  IOobject::MUST_READ,
227  faces_.instance()
228  ),
229  meshSubDir,
230  *this,
231  IOobject::MUST_READ,
232  IOobject::NO_WRITE
233  ),
234  *this
235  ),
236  bounds_(points_),
237  comm_(UPstream::worldComm),
238  geometricD_(Zero),
239  solutionD_(Zero),
240  tetBasePtIsPtr_(readTetBasePtIs()),
241  cellTreePtr_(nullptr),
242  pointZones_
243  (
244  IOobject
245  (
246  "pointZones",
247  //time().findInstance
248  //(
249  // meshDir(),
250  // "pointZones",
251  // IOobject::READ_IF_PRESENT
252  //),
253  faces_.instance(),
254  meshSubDir,
255  *this,
256  IOobject::READ_IF_PRESENT,
257  IOobject::NO_WRITE
258  ),
259  *this
260  ),
261  faceZones_
262  (
263  IOobject
264  (
265  "faceZones",
266  //time().findInstance
267  //(
268  // meshDir(),
269  // "faceZones",
270  // IOobject::READ_IF_PRESENT
271  //),
272  faces_.instance(),
273  meshSubDir,
274  *this,
275  IOobject::READ_IF_PRESENT,
276  IOobject::NO_WRITE
277  ),
278  *this
279  ),
280  cellZones_
281  (
282  IOobject
283  (
284  "cellZones",
285  //time().findInstance
286  //(
287  // meshDir(),
288  // "cellZones",
289  // IOobject::READ_IF_PRESENT
290  //),
291  faces_.instance(),
292  meshSubDir,
293  *this,
294  IOobject::READ_IF_PRESENT,
295  IOobject::NO_WRITE
296  ),
297  *this
298  ),
299  globalMeshDataPtr_(nullptr),
300  moving_(false),
301  topoChanging_(false),
302  curMotionTimeIndex_(time().timeIndex()),
303  oldPointsPtr_(nullptr)
304 {
305  if (!owner_.headerClassName().empty())
306  {
307  initMesh();
308  }
309  else
310  {
311  cellCompactIOList cLst
312  (
313  IOobject
314  (
315  "cells",
316  time().findInstance(meshDir(), "cells"),
317  meshSubDir,
318  *this,
321  )
322  );
323 
324  // Set the primitive mesh
325  initMesh(cLst);
326 
327  owner_.write();
328  neighbour_.write();
329  }
330 
331  // Calculate topology for the patches (processor-processor comms etc.)
332  boundary_.updateMesh();
333 
334  // Calculate the geometry for the patches (transformation tensors etc.)
335  boundary_.calcGeometry();
336 
337  // Warn if global empty mesh
338  if (returnReduce(boundary_.empty(), orOp<bool>()))
339  {
341  << "mesh missing boundary on one or more domains" << endl;
342 
343  if (returnReduce(nPoints(), sumOp<label>()) == 0)
344  {
346  << "no points in mesh" << endl;
347  }
348  if (returnReduce(nCells(), sumOp<label>()) == 0)
349  {
351  << "no cells in mesh" << endl;
352  }
353  }
354 
355  // Initialise demand-driven data
356  calcDirections();
357 }
358 
359 
360 Foam::polyMesh::polyMesh
361 (
362  const IOobject& io,
363  pointField&& points,
364  faceList&& faces,
365  labelList&& owner,
366  labelList&& neighbour,
367  const bool syncPar
368 )
369 :
370  objectRegistry(io),
371  primitiveMesh(),
372  points_
373  (
374  IOobject
375  (
376  "points",
377  instance(),
378  meshSubDir,
379  *this,
380  io.readOpt(),
381  io.writeOpt()
382  ),
383  std::move(points)
384  ),
385  faces_
386  (
387  IOobject
388  (
389  "faces",
390  instance(),
391  meshSubDir,
392  *this,
393  io.readOpt(),
394  io.writeOpt()
395  ),
396  std::move(faces)
397  ),
398  owner_
399  (
400  IOobject
401  (
402  "owner",
403  instance(),
404  meshSubDir,
405  *this,
406  io.readOpt(),
407  io.writeOpt()
408  ),
409  std::move(owner)
410  ),
411  neighbour_
412  (
413  IOobject
414  (
415  "neighbour",
416  instance(),
417  meshSubDir,
418  *this,
419  io.readOpt(),
420  io.writeOpt()
421  ),
422  std::move(neighbour)
423  ),
424  clearedPrimitives_(false),
425  boundary_
426  (
427  IOobject
428  (
429  "boundary",
430  instance(),
431  meshSubDir,
432  *this,
433  io.readOpt(),
434  io.writeOpt()
435  ),
436  *this,
437  polyPatchList()
438  ),
439  bounds_(points_, syncPar),
440  comm_(UPstream::worldComm),
441  geometricD_(Zero),
442  solutionD_(Zero),
443  tetBasePtIsPtr_(readTetBasePtIs()),
444  cellTreePtr_(nullptr),
445  pointZones_
446  (
447  IOobject
448  (
449  "pointZones",
450  instance(),
451  meshSubDir,
452  *this,
453  io.readOpt(),
455  ),
456  *this,
458  ),
459  faceZones_
460  (
461  IOobject
462  (
463  "faceZones",
464  instance(),
465  meshSubDir,
466  *this,
467  io.readOpt(),
469  ),
470  *this,
472  ),
473  cellZones_
474  (
475  IOobject
476  (
477  "cellZones",
478  instance(),
479  meshSubDir,
480  *this,
481  io.readOpt(),
483  ),
484  *this,
486  ),
487  globalMeshDataPtr_(nullptr),
488  moving_(false),
489  topoChanging_(false),
490  curMotionTimeIndex_(time().timeIndex()),
491  oldPointsPtr_(nullptr)
492 {
493  // Check if the faces and cells are valid
494  forAll(faces_, facei)
495  {
496  const face& curFace = faces_[facei];
497 
498  if (min(curFace) < 0 || max(curFace) > points_.size())
499  {
501  << "Face " << facei << "contains vertex labels out of range: "
502  << curFace << " Max point index = " << points_.size()
503  << abort(FatalError);
504  }
505  }
506 
507  // Set the primitive mesh
508  initMesh();
509 }
510 
511 
512 Foam::polyMesh::polyMesh
513 (
514  const IOobject& io,
515  pointField&& points,
516  faceList&& faces,
517  cellList&& cells,
518  const bool syncPar
519 )
520 :
521  objectRegistry(io),
522  primitiveMesh(),
523  points_
524  (
525  IOobject
526  (
527  "points",
528  instance(),
529  meshSubDir,
530  *this,
532  io.writeOpt()
533  ),
534  std::move(points)
535  ),
536  faces_
537  (
538  IOobject
539  (
540  "faces",
541  instance(),
542  meshSubDir,
543  *this,
545  io.writeOpt()
546  ),
547  std::move(faces)
548  ),
549  owner_
550  (
551  IOobject
552  (
553  "owner",
554  instance(),
555  meshSubDir,
556  *this,
558  io.writeOpt()
559  ),
560  0
561  ),
562  neighbour_
563  (
564  IOobject
565  (
566  "neighbour",
567  instance(),
568  meshSubDir,
569  *this,
571  io.writeOpt()
572  ),
573  0
574  ),
575  clearedPrimitives_(false),
576  boundary_
577  (
578  IOobject
579  (
580  "boundary",
581  instance(),
582  meshSubDir,
583  *this,
585  io.writeOpt()
586  ),
587  *this,
588  0
589  ),
590  bounds_(points_, syncPar),
591  comm_(UPstream::worldComm),
592  geometricD_(Zero),
593  solutionD_(Zero),
594  tetBasePtIsPtr_(readTetBasePtIs()),
595  cellTreePtr_(nullptr),
596  pointZones_
597  (
598  IOobject
599  (
600  "pointZones",
601  instance(),
602  meshSubDir,
603  *this,
606  ),
607  *this,
608  0
609  ),
610  faceZones_
611  (
612  IOobject
613  (
614  "faceZones",
615  instance(),
616  meshSubDir,
617  *this,
620  ),
621  *this,
622  0
623  ),
624  cellZones_
625  (
626  IOobject
627  (
628  "cellZones",
629  instance(),
630  meshSubDir,
631  *this,
634  ),
635  *this,
636  0
637  ),
638  globalMeshDataPtr_(nullptr),
639  moving_(false),
640  topoChanging_(false),
641  curMotionTimeIndex_(time().timeIndex()),
642  oldPointsPtr_(nullptr)
643 {
644  // Check if faces are valid
645  forAll(faces_, facei)
646  {
647  const face& curFace = faces_[facei];
648 
649  if (min(curFace) < 0 || max(curFace) > points_.size())
650  {
652  << "Face " << facei << "contains vertex labels out of range: "
653  << curFace << " Max point index = " << points_.size()
654  << abort(FatalError);
655  }
656  }
657 
658  // Transfer in cell list
659  cellList cLst(std::move(cells));
660 
661  // Check if cells are valid
662  forAll(cLst, celli)
663  {
664  const cell& curCell = cLst[celli];
665 
666  if (min(curCell) < 0 || max(curCell) > faces_.size())
667  {
669  << "Cell " << celli << "contains face labels out of range: "
670  << curCell << " Max face index = " << faces_.size()
671  << abort(FatalError);
672  }
673  }
674 
675  // Set the primitive mesh
676  initMesh(cLst);
677 }
678 
679 
680 Foam::polyMesh::polyMesh(const IOobject& io, const zero, const bool syncPar)
681 :
682  polyMesh(io, pointField(), faceList(), labelList(), labelList(), syncPar)
683 {}
684 
685 
687 (
689  autoPtr<faceList>&& faces,
690  autoPtr<labelList>&& owner,
691  autoPtr<labelList>&& neighbour,
692  const labelUList& patchSizes,
693  const labelUList& patchStarts,
694  const bool validBoundary
695 )
696 {
697  // Clear addressing. Keep geometric props and updateable props for mapping.
698  clearAddressing(true);
699 
700  // Take over new primitive data.
701  // Optimized to avoid overwriting data at all
702  if (points.valid())
703  {
704  points_.transfer(points());
705  bounds_ = boundBox(points_, validBoundary);
706  }
707 
708  if (faces.valid())
709  {
710  faces_.transfer(faces());
711  }
712 
713  if (owner.valid())
714  {
715  owner_.transfer(owner());
716  }
717 
718  if (neighbour.valid())
719  {
720  neighbour_.transfer(neighbour());
721  }
722 
723 
724  // Reset patch sizes and starts
725  forAll(boundary_, patchi)
726  {
727  boundary_[patchi] = polyPatch
728  (
729  boundary_[patchi],
730  boundary_,
731  patchi,
732  patchSizes[patchi],
733  patchStarts[patchi]
734  );
735  }
736 
737 
738  // Flags the mesh files as being changed
739  setInstance(time().timeName());
740 
741  // Check if the faces and cells are valid
742  forAll(faces_, facei)
743  {
744  const face& curFace = faces_[facei];
745 
746  if (min(curFace) < 0 || max(curFace) > points_.size())
747  {
749  << "Face " << facei << " contains vertex labels out of range: "
750  << curFace << " Max point index = " << points_.size()
751  << abort(FatalError);
752  }
753  }
754 
755 
756  // Set the primitive mesh from the owner_, neighbour_.
757  // Works out from patch end where the active faces stop.
758  initMesh();
759 
760 
761  if (validBoundary)
762  {
763  // Note that we assume that all the patches stay the same and are
764  // correct etc. so we can already use the patches to do
765  // processor-processor comms.
766 
767  // Calculate topology for the patches (processor-processor comms etc.)
768  boundary_.updateMesh();
769 
770  // Calculate the geometry for the patches (transformation tensors etc.)
771  boundary_.calcGeometry();
772 
773  // Warn if global empty mesh
774  if
775  (
776  (returnReduce(nPoints(), sumOp<label>()) == 0)
777  || (returnReduce(nCells(), sumOp<label>()) == 0)
778  )
779  {
781  << "no points or no cells in mesh" << endl;
782  }
783  }
784 }
785 
786 
787 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
788 
790 {
791  clearOut();
792  resetMotion();
793 }
794 
795 
796 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
797 
799 {
800  if (objectRegistry::dbDir() == defaultRegion)
801  {
802  return parent().dbDir();
803  }
804 
805  return objectRegistry::dbDir();
806 }
807 
808 
810 {
811  return dbDir()/meshSubDir;
812 }
813 
814 
816 {
817  return points_.instance();
818 }
819 
820 
822 {
823  return faces_.instance();
824 }
825 
826 
828 {
829  if (geometricD_.x() == 0)
830  {
831  calcDirections();
832  }
833 
834  return geometricD_;
835 }
836 
837 
839 {
840  return cmptSum(geometricD() + Vector<label>::one)/2;
841 }
842 
843 
845 {
846  if (solutionD_.x() == 0)
847  {
848  calcDirections();
849  }
850 
851  return solutionD_;
852 }
853 
854 
856 {
857  return cmptSum(solutionD() + Vector<label>::one)/2;
858 }
859 
860 
862 {
863  if (tetBasePtIsPtr_.empty())
864  {
865  if (debug)
866  {
868  << "Forcing storage of base points."
869  << endl;
870  }
871 
872  tetBasePtIsPtr_.reset
873  (
874  new labelIOList
875  (
876  IOobject
877  (
878  "tetBasePtIs",
879  instance(),
880  meshSubDir,
881  *this,
884  ),
886  )
887  );
888  }
889 
890  return *tetBasePtIsPtr_;
891 }
892 
893 
896 {
897  if (cellTreePtr_.empty())
898  {
899  treeBoundBox overallBb(points());
900 
901  Random rndGen(261782);
902 
903  overallBb = overallBb.extend(rndGen, 1e-4);
904  overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
905  overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
906 
907  cellTreePtr_.reset
908  (
910  (
912  (
913  false, // not cache bb
914  *this,
915  CELL_TETS // use tet-decomposition for any inside test
916  ),
917  overallBb,
918  8, // maxLevel
919  10, // leafsize
920  5.0 // duplicity
921  )
922  );
923  }
924 
925  return cellTreePtr_();
926 }
927 
928 
930 (
931  PtrList<polyPatch>& plist,
932  const bool validBoundary
933 )
934 {
935  if (boundaryMesh().size())
936  {
938  << "boundary already exists"
939  << abort(FatalError);
940  }
941 
942  // Reset valid directions
943  geometricD_ = Zero;
944  solutionD_ = Zero;
945 
946  boundary_.transfer(plist);
947 
948  // parallelData depends on the processorPatch ordering so force
949  // recalculation. Problem: should really be done in removeBoundary but
950  // there is some info in parallelData which might be interesting inbetween
951  // removeBoundary and addPatches.
952  globalMeshDataPtr_.clear();
953 
954  if (validBoundary)
955  {
956  // Calculate topology for the patches (processor-processor comms etc.)
957  boundary_.updateMesh();
958 
959  // Calculate the geometry for the patches (transformation tensors etc.)
960  boundary_.calcGeometry();
961 
962  boundary_.checkDefinition();
963  }
964 }
965 
966 
968 (
969  const List<pointZone*>& pz,
970  const List<faceZone*>& fz,
971  const List<cellZone*>& cz
972 )
973 {
974  if (pointZones().size() || faceZones().size() || cellZones().size())
975  {
977  << "point, face or cell zone already exists"
978  << abort(FatalError);
979  }
980 
981  // Point zones
982  if (pz.size())
983  {
984  pointZones_.setSize(pz.size());
985 
986  // Copy the zone pointers
987  forAll(pz, pI)
988  {
989  pointZones_.set(pI, pz[pI]);
990  }
991 
992  pointZones_.writeOpt() = IOobject::AUTO_WRITE;
993  }
994 
995  // Face zones
996  if (fz.size())
997  {
998  faceZones_.setSize(fz.size());
999 
1000  // Copy the zone pointers
1001  forAll(fz, fI)
1002  {
1003  faceZones_.set(fI, fz[fI]);
1004  }
1005 
1006  faceZones_.writeOpt() = IOobject::AUTO_WRITE;
1007  }
1008 
1009  // Cell zones
1010  if (cz.size())
1011  {
1012  cellZones_.setSize(cz.size());
1013 
1014  // Copy the zone pointers
1015  forAll(cz, cI)
1016  {
1017  cellZones_.set(cI, cz[cI]);
1018  }
1019 
1020  cellZones_.writeOpt() = IOobject::AUTO_WRITE;
1021  }
1022 }
1023 
1024 
1027  const List<polyPatch*>& p,
1028  const bool validBoundary
1029 )
1030 {
1031  // Acquire ownership of the pointers
1032  PtrList<polyPatch> plist(const_cast<List<polyPatch*>&>(p));
1033 
1034  addPatches(plist, validBoundary);
1035 }
1036 
1037 
1039 {
1040  if (clearedPrimitives_)
1041  {
1043  << "points deallocated"
1044  << abort(FatalError);
1045  }
1046 
1047  return points_;
1048 }
1049 
1050 
1052 {
1053  return io.upToDate(points_);
1054 }
1055 
1056 
1058 {
1059  io.eventNo() = points_.eventNo()+1;
1060 }
1061 
1062 
1064 {
1065  if (clearedPrimitives_)
1066  {
1068  << "faces deallocated"
1069  << abort(FatalError);
1070  }
1071 
1072  return faces_;
1073 }
1074 
1075 
1077 {
1078  return owner_;
1079 }
1080 
1081 
1083 {
1084  return neighbour_;
1085 }
1086 
1087 
1089 {
1090  if (oldPointsPtr_.empty())
1091  {
1092  if (debug)
1093  {
1095  << endl;
1096  }
1097 
1098  oldPointsPtr_.reset(new pointField(points_));
1099  curMotionTimeIndex_ = time().timeIndex();
1100  }
1101 
1102  return *oldPointsPtr_;
1103 }
1104 
1105 
1108  const pointField& newPoints
1109 )
1110 {
1111  if (debug)
1112  {
1114  << "Moving points for time " << time().value()
1115  << " index " << time().timeIndex() << endl;
1116  }
1117 
1118  if (newPoints.size() != points_.size())
1119  {
1121  << "Size of newPoints " << newPoints.size()
1122  << " does not correspond to current mesh points size "
1123  << points_.size()
1124  << exit(FatalError);
1125  }
1126 
1127 
1128  moving(true);
1129 
1130  // Pick up old points
1131  if (curMotionTimeIndex_ != time().timeIndex())
1132  {
1133  if (debug)
1134  {
1135  Info<< "tmp<scalarField> polyMesh::movePoints(const pointField&) : "
1136  << " Storing current points for time " << time().value()
1137  << " index " << time().timeIndex() << endl;
1138  }
1139 
1140  // Mesh motion in the new time step
1141  oldPointsPtr_.clear();
1142  oldPointsPtr_.reset(new pointField(points_));
1143  curMotionTimeIndex_ = time().timeIndex();
1144  }
1145 
1146  points_ = newPoints;
1147 
1148  bool moveError = false;
1149  if (debug)
1150  {
1151  // Check mesh motion
1152  if (checkMeshMotion(points_, true))
1153  {
1154  moveError = true;
1155 
1157  << "Moving the mesh with given points will "
1158  << "invalidate the mesh." << nl
1159  << "Mesh motion should not be executed." << endl;
1160  }
1161  }
1162 
1163  points_.writeOpt() = IOobject::AUTO_WRITE;
1164  points_.instance() = time().timeName();
1165  points_.eventNo() = getEvent();
1166 
1167  if (tetBasePtIsPtr_.valid())
1168  {
1169  tetBasePtIsPtr_().writeOpt() = IOobject::AUTO_WRITE;
1170  tetBasePtIsPtr_().instance() = time().timeName();
1171  tetBasePtIsPtr_().eventNo() = getEvent();
1172  }
1173 
1175  (
1176  points_,
1177  oldPoints()
1178  );
1179 
1180  // Adjust parallel shared points
1181  if (globalMeshDataPtr_.valid())
1182  {
1183  globalMeshDataPtr_().movePoints(points_);
1184  }
1185 
1186  // Force recalculation of all geometric data with new points
1187 
1188  bounds_ = boundBox(points_);
1189  boundary_.movePoints(points_);
1190 
1191  pointZones_.movePoints(points_);
1192  faceZones_.movePoints(points_);
1193  cellZones_.movePoints(points_);
1194 
1195  // Cell tree might become invalid
1196  cellTreePtr_.clear();
1197 
1198  // Reset valid directions (could change with rotation)
1199  geometricD_ = Zero;
1200  solutionD_ = Zero;
1201 
1202  // Reset cell tree - it gets built from mesh geometry so might have
1203  // wrong boxes. It is correct as long as none of the cells leaves
1204  // the boxes it is in which most likely is almost never the case except
1205  // for tiny displacements. An alternative is to check the displacements
1206  // to see if they are tiny - imagine a big windtunnel with a small rotating
1207  // object. In this case the processors without the rotating object wouldn't
1208  // have to clear any geometry. However your critical path still stays the
1209  // same so no time would be gained (unless the decomposition gets weighted).
1210  // Small benefit for lots of scope for problems so not done.
1211  cellTreePtr_.clear();
1212 
1213  // Note: tet-base decomposition does not get cleared. Ideally your face
1214  // decomposition should not change during mesh motion ...
1215 
1216 
1217  meshObject::movePoints<polyMesh>(*this);
1218  meshObject::movePoints<pointMesh>(*this);
1219 
1220  const_cast<Time&>(time()).functionObjects().movePoints(*this);
1221 
1222 
1223  if (debug && moveError)
1224  {
1225  // Write mesh to ease debugging. Note we want to avoid calling
1226  // e.g. fvMesh::write since meshPhi not yet complete.
1227  polyMesh::write();
1228  }
1229 
1230  return sweptVols;
1231 }
1232 
1233 
1235 {
1236  curMotionTimeIndex_ = 0;
1237  oldPointsPtr_.clear();
1238 }
1239 
1240 
1242 {
1243  if (globalMeshDataPtr_.empty())
1244  {
1245  if (debug)
1246  {
1247  Pout<< "polyMesh::globalData() const : "
1248  << "Constructing parallelData from processor topology"
1249  << endl;
1250  }
1251  // Construct globalMeshData using processorPatch information only.
1252  globalMeshDataPtr_.reset(new globalMeshData(*this));
1253  }
1254 
1255  return *globalMeshDataPtr_;
1256 }
1257 
1258 
1260 {
1261  return comm_;
1262 }
1263 
1264 
1266 {
1267  return comm_;
1268 }
1269 
1270 
1271 void Foam::polyMesh::removeFiles(const fileName& instanceDir) const
1272 {
1273  fileName meshFilesPath = thisDb().time().path()/instanceDir/meshDir();
1274 
1275  rm(meshFilesPath/"points");
1276  rm(meshFilesPath/"faces");
1277  rm(meshFilesPath/"owner");
1278  rm(meshFilesPath/"neighbour");
1279  rm(meshFilesPath/"cells");
1280  rm(meshFilesPath/"boundary");
1281  rm(meshFilesPath/"pointZones");
1282  rm(meshFilesPath/"faceZones");
1283  rm(meshFilesPath/"cellZones");
1284  rm(meshFilesPath/"meshModifiers");
1285  rm(meshFilesPath/"parallelData");
1286 
1287  // remove subdirectories
1288  if (isDir(meshFilesPath/"sets"))
1289  {
1290  rmDir(meshFilesPath/"sets");
1291  }
1292 }
1293 
1294 
1296 {
1297  removeFiles(instance());
1298 }
1299 
1300 
1303  const point& p,
1304  label& celli,
1305  label& tetFacei,
1306  label& tetPti
1307 ) const
1308 {
1309  celli = -1;
1310  tetFacei = -1;
1311  tetPti = -1;
1312 
1313  const indexedOctree<treeDataCell>& tree = cellTree();
1314 
1315  // Find point inside cell
1316  celli = tree.findInside(p);
1317 
1318  if (celli != -1)
1319  {
1320  // Check the nearest cell to see if the point is inside.
1321  findTetFacePt(celli, p, tetFacei, tetPti);
1322  }
1323 }
1324 
1325 
1328  const label celli,
1329  const point& p,
1330  label& tetFacei,
1331  label& tetPti
1332 ) const
1333 {
1334  const polyMesh& mesh = *this;
1335 
1337  tetFacei = tet.face();
1338  tetPti = tet.tetPt();
1339 }
1340 
1341 
1344  const point& p,
1345  label celli,
1346  const cellDecomposition decompMode
1347 ) const
1348 {
1349  switch (decompMode)
1350  {
1351  case FACE_PLANES:
1352  {
1353  return primitiveMesh::pointInCell(p, celli);
1354  }
1355  break;
1356 
1357  case FACE_CENTRE_TRIS:
1358  {
1359  // only test that point is on inside of plane defined by cell face
1360  // triangles
1361  const cell& cFaces = cells()[celli];
1362 
1363  forAll(cFaces, cFacei)
1364  {
1365  label facei = cFaces[cFacei];
1366  const face& f = faces_[facei];
1367  const point& fc = faceCentres()[facei];
1368  bool isOwn = (owner_[facei] == celli);
1369 
1370  forAll(f, fp)
1371  {
1372  label pointi;
1373  label nextPointi;
1374 
1375  if (isOwn)
1376  {
1377  pointi = f[fp];
1378  nextPointi = f.nextLabel(fp);
1379  }
1380  else
1381  {
1382  pointi = f.nextLabel(fp);
1383  nextPointi = f[fp];
1384  }
1385 
1386  triPointRef faceTri
1387  (
1388  points()[pointi],
1389  points()[nextPointi],
1390  fc
1391  );
1392 
1393  vector proj = p - faceTri.centre();
1394 
1395  if ((faceTri.areaNormal() & proj) > 0)
1396  {
1397  return false;
1398  }
1399  }
1400  }
1401  return true;
1402  }
1403  break;
1404 
1405  case FACE_DIAG_TRIS:
1406  {
1407  // only test that point is on inside of plane defined by cell face
1408  // triangles
1409  const cell& cFaces = cells()[celli];
1410 
1411  forAll(cFaces, cFacei)
1412  {
1413  label facei = cFaces[cFacei];
1414  const face& f = faces_[facei];
1415 
1416  for (label tetPti = 1; tetPti < f.size() - 1; tetPti++)
1417  {
1418  // Get tetIndices of face triangle
1419  tetIndices faceTetIs(celli, facei, tetPti);
1420 
1421  triPointRef faceTri = faceTetIs.faceTri(*this);
1422 
1423  vector proj = p - faceTri.centre();
1424 
1425  if ((faceTri.areaNormal() & proj) > 0)
1426  {
1427  return false;
1428  }
1429  }
1430  }
1431 
1432  return true;
1433  }
1434  break;
1435 
1436  case CELL_TETS:
1437  {
1438  label tetFacei;
1439  label tetPti;
1440 
1441  findTetFacePt(celli, p, tetFacei, tetPti);
1442 
1443  return tetFacei != -1;
1444  }
1445  break;
1446  }
1447 
1448  return false;
1449 }
1450 
1451 
1454  const point& p,
1455  const cellDecomposition decompMode
1456 ) const
1457 {
1458  if
1459  (
1460  Pstream::parRun()
1461  && (decompMode == FACE_DIAG_TRIS || decompMode == CELL_TETS)
1462  )
1463  {
1464  // Force construction of face-diagonal decomposition before testing
1465  // for zero cells.
1466  //
1467  // If parallel running a local domain might have zero cells so never
1468  // construct the face-diagonal decomposition which uses parallel
1469  // transfers.
1470  (void)tetBasePtIs();
1471  }
1472 
1473  if (nCells() == 0)
1474  {
1475  return -1;
1476  }
1477 
1478  if (decompMode == CELL_TETS)
1479  {
1480  // Advanced search method utilizing an octree
1481  // and tet-decomposition of the cells
1482 
1483  label celli;
1484  label tetFacei;
1485  label tetPti;
1486 
1487  findCellFacePt(p, celli, tetFacei, tetPti);
1488 
1489  return celli;
1490  }
1491  else
1492  {
1493  // Approximate search avoiding the construction of an octree
1494  // and cell decomposition
1495 
1496  if (Pstream::parRun() && decompMode == FACE_DIAG_TRIS)
1497  {
1498  // Force construction of face-diagonal decomposition before testing
1499  // for zero cells. If parallel running a local domain might have
1500  // zero cells so never construct the face-diagonal decomposition
1501  // (which uses parallel transfers)
1502  (void)tetBasePtIs();
1503  }
1504 
1505  // Find the nearest cell centre to this location
1506  label celli = findNearestCell(p);
1507 
1508  // If point is in the nearest cell return
1509  if (pointInCell(p, celli, decompMode))
1510  {
1511  return celli;
1512  }
1513  else
1514  {
1515  // Point is not in the nearest cell so search all cells
1516 
1517  for (label celli = 0; celli < nCells(); celli++)
1518  {
1519  if (pointInCell(p, celli, decompMode))
1520  {
1521  return celli;
1522  }
1523  }
1524 
1525  return -1;
1526  }
1527  }
1528 }
1529 
1530 
1531 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::polyMesh::addPatches
void addPatches(PtrList< polyPatch > &plist, const bool validBoundary=true)
Add boundary patches.
Definition: polyMesh.C:930
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::HashTable< regIOobject * >::size
label size() const noexcept
The number of elements in table.
Definition: HashTableI.H:52
Foam::Random
Random number generator.
Definition: Random.H:59
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1038
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::treeBoundBox::extend
treeBoundBox extend(Random &rndGen, const scalar s) const
Return slightly wider bounding box.
Definition: treeBoundBoxI.H:325
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:316
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::polyMesh::resetMotion
void resetMotion() const
Reset motion.
Definition: polyMesh.C:1234
Foam::polyMesh::cellDecomposition
cellDecomposition
Enumeration defining the decomposition of the cell for.
Definition: polyMesh.H:101
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:312
Foam::fileName::path
static std::string path(const std::string &str)
Return directory path name (part before last /)
Definition: fileNameI.H:186
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::regIOobject::upToDate
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
Definition: regIOobject.C:350
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::polyMesh::nGeometricD
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
Definition: polyMesh.C:838
Foam::polyMesh::movePoints
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
Definition: polyMesh.C:1107
Foam::IOobject::typeHeaderOk
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
Definition: IOobjectTemplates.C:39
globalMeshData.H
Foam::polyMeshTetDecomposition::findFaceBasePts
static labelList findFaceBasePts(const polyMesh &mesh, scalar tol=minTetQuality, bool report=false)
Find a suitable base point for each face for decomposition.
Definition: polyMeshTetDecomposition.C:186
wedgePolyPatch.H
Foam::polyMesh::dbDir
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
Definition: polyMesh.C:798
Foam::treeBoundBox
Standard boundBox with extra functionality for use in octree.
Definition: treeBoundBox.H:87
Foam::objectRegistry::time
const Time & time() const
Return time.
Definition: objectRegistry.H:186
Foam::polyMesh::meshSubDir
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Definition: polyMesh.H:315
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:414
indexedOctree.H
Foam::primitiveMesh::pointInCell
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
Definition: primitiveMeshFindCell.C:61
Foam::tetIndices::face
label face() const
Return the face.
Definition: tetIndicesI.H:42
Foam::polyMesh::facesInstance
const fileName & facesInstance() const
Return the current instance directory for faces.
Definition: polyMesh.C:821
Foam::rm
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
Definition: MSwindows.C:994
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:435
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::boundBox::max
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:97
Foam::regIOobject::eventNo
label eventNo() const
Event number at last update.
Definition: regIOobjectI.H:83
Foam::polyMesh::solutionD
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
Definition: polyMesh.C:844
Foam::Pout
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
Foam::polyMesh::removeFiles
void removeFiles() const
Remove all files from mesh instance()
Definition: polyMesh.C:1295
polyMesh.H
Foam::labelIOList
IOList< label > labelIOList
Label container classes.
Definition: labelIOList.H:44
Foam::polyMesh::geometricD
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
Definition: polyMesh.C:827
Foam::polyMesh::pointInCell
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
Definition: polyMesh.C:1343
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
polyMeshTetDecomposition.H
Foam::boundBox::min
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:91
Foam::sumOp
Definition: ops.H:213
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::triangle::centre
Point centre() const
Return centre (centroid)
Definition: triangleI.H:105
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::cmptMag
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:400
Foam::triangle
A triangle primitive used to calculate face normals and swept volumes.
Definition: triangle.H:62
Foam::polyMesh::pointsInstance
const fileName & pointsInstance() const
Return the current instance directory for points.
Definition: polyMesh.C:815
Foam::objectRegistry::dbDir
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
Definition: objectRegistry.H:198
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:51
Foam::primitiveMesh::nCells
label nCells() const
Number of mesh cells.
Definition: primitiveMeshI.H:96
Foam::treeDataCell
Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e....
Definition: treeDataCell.H:56
Foam::label
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:62
Foam::UPstream
Inter-processor communications stream.
Definition: UPstream.H:61
Foam::Field< vector >
Foam::regIOobject::write
virtual bool write(const bool valid=true) const
Write using setting from DB.
Definition: regIOobjectWrite.C:170
Foam::IOobject::writeOpt
writeOption writeOpt() const
The write option.
Definition: IOobjectI.H:153
Foam::tetIndices::faceTri
triPointRef faceTri(const polyMesh &mesh) const
Return the geometry corresponding to the tri on the face for.
Definition: tetIndicesI.H:169
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::polyPatchList
PtrList< polyPatch > polyPatchList
container classes for polyPatch
Definition: polyPatchList.H:47
Foam::polyMesh::faceOwner
virtual const labelList & faceOwner() const
Return face owner.
Definition: polyMesh.C:1076
Foam::IOobject::READ_IF_PRESENT
Definition: IOobject.H:122
Foam::polyMesh::resetPrimitives
void resetPrimitives(autoPtr< pointField > &&points, autoPtr< faceList > &&faces, autoPtr< labelList > &&owner, autoPtr< labelList > &&neighbour, const labelUList &patchSizes, const labelUList &patchStarts, const bool validBoundary=true)
Reset mesh primitive data. Assumes all patch info correct.
Definition: polyMesh.C:687
Foam::indexedOctree< Foam::treeDataCell >
Foam::CompactIOList
A List of objects of type <T> with automated input and output using a compact storage....
Definition: CompactIOList.H:55
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:65
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::indexedOctree::findInside
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
Definition: indexedOctree.C:2629
Foam::polyMesh::comm
label comm() const
Return communicator used for parallel communication.
Definition: polyMesh.C:1259
Foam::polyMesh::oldPoints
virtual const pointField & oldPoints() const
Return old points for mesh motion.
Definition: polyMesh.C:1088
timeIndex
label timeIndex
Definition: getTimeIndex.H:4
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::FatalError
error FatalError
processorPolyPatch.H
Foam::globalMeshData
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Definition: globalMeshData.H:106
Foam::polyMesh::findCellFacePt
void findCellFacePt(const point &p, label &celli, label &tetFacei, label &tetPti) const
Find the cell, tetFacei and tetPti for point p.
Definition: polyMesh.C:1302
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::polyMesh::upToDatePoints
virtual bool upToDatePoints(const regIOobject &io) const
Return true if io is up-to-date with points.
Definition: polyMesh.C:1051
Foam::polyMeshTetDecomposition::findTet
static tetIndices findTet(const polyMesh &mesh, label cI, const point &pt)
Find the tet decomposition of the cell containing the given point.
Definition: polyMeshTetDecomposition.C:556
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cmptSum
Cmpt cmptSum(const SphericalTensor< Cmpt > &st)
Definition: SphericalTensorI.H:177
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
treeDataCell.H
Foam::tetIndices::tetPt
label tetPt() const
Return the characterising tetPtI.
Definition: tetIndicesI.H:54
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
emptyPolyPatch.H
Foam::polyMesh::meshDir
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Definition: polyMesh.C:809
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::IOobject::headerClassName
const word & headerClassName() const
Return name of the class name read from header.
Definition: IOobjectI.H:64
Foam::polyBoundaryMesh::updateMesh
void updateMesh()
Correct polyBoundaryMesh after topology update.
Definition: polyBoundaryMesh.C:1141
Foam::polyMesh::nSolutionD
label nSolutionD() const
Return the number of valid solved-for dimensions in the mesh.
Definition: polyMesh.C:855
Time.H
Foam::tetIndices
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:83
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::polyMesh::cellTree
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
Definition: polyMesh.C:895
Foam::polyMesh::~polyMesh
virtual ~polyMesh()
Destructor.
Definition: polyMesh.C:789
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:67
Foam::polyMesh::findCell
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
Definition: polyMesh.C:1453
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1063
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::nl
constexpr char nl
Definition: Ostream.H:372
f
labelList f(nPoints)
Foam::rmDir
bool rmDir(const fileName &directory, const bool silent=false)
Remove a dirctory and its contents (optionally silencing warnings)
Definition: MSwindows.C:1018
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::UPstream::worldComm
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:285
Foam::List< face >
Foam::IOobject::readOpt
readOption readOpt() const
The read option.
Definition: IOobjectI.H:141
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::primitiveMesh::nPoints
label nPoints() const
Number of mesh points.
Definition: primitiveMeshI.H:37
Foam::IOList< label >
Foam::primitiveMesh::movePoints
tmp< scalarField > movePoints(const pointField &p, const pointField &oldP)
Move points, returns volumes swept by faces in motion.
Definition: primitiveMesh.C:285
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:327
Foam::direction
uint8_t direction
Definition: direction.H:47
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
MeshObject.H
rndGen
Random rndGen
Definition: createFields.H:23
Foam::boundaryMesh
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:61
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:74
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::polyMesh::globalData
const globalMeshData & globalData() const
Return parallel info.
Definition: polyMesh.C:1241
Foam::triangle::areaNormal
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
Definition: triangleI.H:112
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::orOp
Definition: ops.H:234
Foam::polyMesh::findTetFacePt
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
Definition: polyMesh.C:1327
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:294
Foam::cell
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:54
Foam::polyMesh::addZones
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
Definition: polyMesh.C:968
cellIOList.H
Foam::polyMesh::setUpToDatePoints
virtual void setUpToDatePoints(regIOobject &io) const
Set io to be up-to-date with points.
Definition: polyMesh.C:1057
pointMesh.H
Foam::polyMesh::faceNeighbour
virtual const labelList & faceNeighbour() const
Return face neighbour.
Definition: polyMesh.C:1082
Foam::VectorSpace< Vector< scalar >, scalar, 3 >::nComponents
static constexpr direction nComponents
Number of components in this vector space.
Definition: VectorSpace.H:101
Foam::isDir
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Definition: MSwindows.C:643
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61
Foam::IOobject::MUST_READ
Definition: IOobject.H:120
Foam::primitiveMesh::faceAreas
const vectorField & faceAreas() const
Definition: primitiveMeshFaceCentresAndAreas.C:156
Foam::polyMesh::tetBasePtIs
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
Definition: polyMesh.C:861
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78