displacementSmartPointSmoothingMotionSolver.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) 2024 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
30 #include "syncTools.H"
31 #include "pointConstraints.H"
32 #include "motionSmootherAlgo.H"
33 
34 //#include "fvMesh.H"
35 //#include "fvGeometryScheme.H"
36 #include "OBJstream.H"
37 #include "emptyPointPatchFields.H"
38 
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43  defineTypeNameAndDebug(displacementSmartPointSmoothingMotionSolver, 0);
44 
46  (
47  motionSolver,
48  displacementSmartPointSmoothingMotionSolver,
49  dictionary
50  );
51 
53  (
54  displacementMotionSolver,
55  displacementSmartPointSmoothingMotionSolver,
56  displacement
57  );
58 }
59 
60 
61 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
62 
64 (
65  const labelHashSet& changedFaces,
66  labelHashSet& affectedFaces
67 )
68 {
69  PackedBoolList affectedPoints(mesh().nPoints(), false);
70 
71  forAllConstIter(labelHashSet, changedFaces, iter)
72  {
73  const label faceI(iter.key());
74 
75  const face& fPoints(mesh().faces()[faceI]);
76 
77  forAll(fPoints, fPointI)
78  {
79  const label pointI(fPoints[fPointI]);
80 
81  affectedPoints[pointI] = true;
82  }
83  }
84 
86  (
87  mesh(),
88  affectedPoints,
89  orEqOp<unsigned int>(),
90  0U
91  );
92 
93  forAll(affectedPoints, pointI)
94  {
95  if (affectedPoints[pointI])
96  {
97  const labelList& pCells(mesh().pointCells()[pointI]);
98 
99  forAll(pCells, pointCellI)
100  {
101  const label cellI(pCells[pointCellI]);
102 
103  const labelList& cFaces(mesh().cells()[cellI]);
104 
105  affectedFaces.insert(cFaces);
106  }
107  }
108  }
109 }
110 
111 
113 {
114  if
115  (
116  (relaxationFactors_.size() == 0)
117  || (relaxationFactors_.size() == 1 && relaxationFactors_[0] == 1.0)
118  )
119  {
120  relaxedPoints_ = points0() + pointDisplacement().internalField();
121  return true;
122  }
123 
124 
125  const pointField oldRelaxedPoints(relaxedPoints_);
126 
127  labelHashSet affectedFaces(facesToMove_);
128 
129  // Create a list of relaxation levels
130  // -1 indicates a point which is not to be moved
131  // 0 is the starting value for a moving point
132  labelList relaxationLevel(mesh().nPoints(), -1);
133  forAllConstIter(labelHashSet, affectedFaces, iter)
134  {
135  const label faceI(iter.key());
136 
137  const face& fPoints(mesh().faces()[faceI]);
138 
139  forAll(fPoints, fPointI)
140  {
141  const label pointI(fPoints[fPointI]);
142 
143  relaxationLevel[pointI] = 0;
144  }
145  }
146 
148  (
149  mesh(),
150  relaxationLevel,
151  maxEqOp<label>(),
152  label(-1)
153  );
154 
155  // Loop whilst relaxation levels are being incremented
156  bool complete(false);
157  while (!complete)
158  {
159  //scalar nAffectedFaces(affectedFaces.size());
160  //reduce(nAffectedFaces, sumOp<scalar>());
161  //Info << " Moving " << nAffectedFaces << " faces" << endl;
162 
163  // Move the points
164  forAll(relaxationLevel, pointI)
165  {
166  if (relaxationLevel[pointI] >= 0)
167  {
168  const scalar x
169  (
170  relaxationFactors_[relaxationLevel[pointI]]
171  );
172 
173  relaxedPoints_[pointI] =
174  (1 - x)*oldRelaxedPoints[pointI]
175  + x*(points0()[pointI] + pointDisplacement()[pointI]);
176  }
177  }
178 
179  // Get a list of changed faces
180  labelHashSet markedFaces;
181  markAffectedFaces(affectedFaces, markedFaces);
182  labelList markedFacesList(markedFaces.toc());
183 
184  // Update the geometry
185  meshGeometry_.correct(relaxedPoints_, markedFacesList);
186 
187  // Check the modified face quality
188  if (false)
189  {
190  // Use snappyHexMesh compatible checks
191  markedFaces.clear();
193  (
194  false,
195  meshQualityDict_,
196  meshGeometry_,
197  relaxedPoints_,
198  markedFacesList,
199  markedFaces
200  );
201 
202  // Mark the affected faces
203  affectedFaces.clear();
204  markAffectedFaces(markedFaces, affectedFaces);
205  }
206  else
207  {
208  // Use pointSmoother specific
209  tmp<scalarField> tfaceQ
210  (
211  pointUntangler_->faceQuality
212  (
213  relaxedPoints_,
214  meshGeometry_.faceCentres(),
215  meshGeometry_.faceAreas(),
216  meshGeometry_.cellCentres(),
217  meshGeometry_.cellVolumes()
218  )
219  );
220 
221  if (debug)
222  {
223  MinMax<scalar> range(gMinMax(tfaceQ()));
224  Pout<< " min:" << range.min() << nl
225  << " max:" << range.max() << endl;
226  }
227 
228  labelList order;
229  Foam::sortedOrder(tfaceQ(), order);
230 
231  label nUntangle = 0;
232  forAll(order, i)
233  {
234  if (tfaceQ()[order[i]] > untangleQ_)
235  {
236  nUntangle = i;
237  break;
238  }
239  }
240 
241  affectedFaces = labelList(SubList<label>(order, nUntangle));
242  }
243 
244  // Increase relaxation and check convergence
245  PackedBoolList pointsToRelax(mesh().nPoints(), false);
246  complete = true;
247  forAllConstIter(labelHashSet, affectedFaces, iter)
248  {
249  const label faceI(iter.key());
250 
251  const face& fPoints(mesh().faces()[faceI]);
252 
253  forAll(fPoints, fPointI)
254  {
255  const label pointI(fPoints[fPointI]);
256 
257  pointsToRelax[pointI] = true;
258  }
259  }
260 
261  forAll(pointsToRelax, pointI)
262  {
263  if
264  (
265  pointsToRelax[pointI]
266  && (relaxationLevel[pointI] < relaxationFactors_.size() - 1)
267  )
268  {
269  ++ relaxationLevel[pointI];
270 
271  complete = false;
272  }
273  }
274 
275  // Synchronise relaxation levels
277  (
278  mesh(),
279  relaxationLevel,
280  maxEqOp<label>(),
281  label(0)
282  );
283 
284  // Synchronise completion
285  reduce(complete, andOp<bool>());
286  }
287 
288  // Check for convergence
289  bool converged(true);
290  forAll(mesh().faces(), faceI)
291  {
292  const face& fPoints(mesh().faces()[faceI]);
293 
294  forAll(fPoints, fPointI)
295  {
296  const label pointI(fPoints[fPointI]);
297 
298  if (relaxationLevel[pointI] > 0)
299  {
300  facesToMove_.insert(faceI);
301 
302  converged = false;
303 
304  break;
305  }
306  }
307  }
308 
309  // Syncronise convergence
310  reduce(converged, andOp<bool>());
311 
312  //if (converged)
313  //{
314  // Info<< "... Converged" << endl << endl;
315  //}
316  //else
317  //{
318  // Info<< "... Not converged" << endl << endl;
319  //}
320 
321  return converged;
322 }
323 
324 
326 (
327  const dictionary& dict
328 )
329 {
330  if (dict.getOrDefault<bool>("moveInternalFaces", true))
331  {
332  facesToMove_.resize(2*mesh().nFaces());
333  forAll(mesh().faces(), faceI)
334  {
335  facesToMove_.insert(faceI);
336  }
337  }
338  else
339  {
340  facesToMove_.resize(2*(mesh().nBoundaryFaces()));
341  for
342  (
343  label faceI = mesh().nInternalFaces();
344  faceI < mesh().nFaces();
345  ++ faceI
346  )
347  {
348  facesToMove_.insert(faceI);
349  }
350  }
351 }
352 
353 
355 (
356  pointVectorField& pointDisplacement
357 )
358 {
359  // Assume empty point patches are already in correct location
360  // so knock out any off-plane displacement.
361  auto& fld = pointDisplacement.primitiveFieldRef();
362  for (const auto& ppf : pointDisplacement.boundaryField())
363  {
364  if (isA<emptyPointPatchVectorField>(ppf))
365  {
366  const auto& mp = ppf.patch().meshPoints();
367  forAll(mp, i)
368  {
369  pointConstraint pc;
370  ppf.patch().applyConstraint(i, pc);
371  fld[mp[i]] = pc.constrainDisplacement(fld[mp[i]]);
372  }
373  }
374  }
375 
376  pointField wantedPoints(points0() + fld);
377  twoDCorrectPoints(wantedPoints);
378  fld = wantedPoints-points0();
379 }
380 
381 
382 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
383 
386 (
387  const polyMesh& mesh,
388  const IOdictionary& dict
389 )
390 :
391  displacementMotionSolver(mesh, dict, typeName),
392  meshGeometry_(mesh),
393  pointUntangler_
394  (
396  (
397  coeffDict().get<word>("untangler"),
398  mesh,
399  coeffDict()
400  )
401  ),
402  untangleQ_(coeffDict().get<scalar>("untangleQ")),
403  minQ_(coeffDict().get<scalar>("minQ")),
404  pointSmoother_(pointSmoother::New(mesh, coeffDict())),
405  nPointSmootherIter_
406  (
407  readLabel(coeffDict().lookup("nPointSmootherIter"))
408  ),
409  relaxedPoints_(mesh.points())
410 {
411  if (coeffDict().readIfPresent("relaxationFactors", relaxationFactors_))
412  {
413  meshQualityDict_ = coeffDict().subDict("meshQuality");
414  }
416 }
417 
418 
421 (
422  const polyMesh& mesh,
423  const IOdictionary& dict,
424  const pointVectorField& pointDisplacement,
425  const pointIOField& points0
426 )
427 :
428  displacementMotionSolver(mesh, dict, pointDisplacement, points0, typeName),
429  meshGeometry_(mesh),
430  pointUntangler_
431  (
432  pointSmoother::New
433  (
434  coeffDict().get<word>("untangler"),
435  mesh,
436  coeffDict()
437  )
438  ),
439  untangleQ_(coeffDict().get<scalar>("untangleQ")),
440  minQ_(coeffDict().get<scalar>("minQ")),
441  pointSmoother_
442  (
443  pointSmoother::New
444  (
445  mesh,
446  coeffDict()
447  )
448  ),
449  nPointSmootherIter_
450  (
451  readLabel(coeffDict().lookup("nPointSmootherIter"))
452  ),
453  relaxedPoints_(mesh.points())
454 {
455  if (coeffDict().readIfPresent("relaxationFactors", relaxationFactors_))
456  {
457  meshQualityDict_ = coeffDict().subDict("meshQuality");
458  }
460 }
461 
462 
463 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
464 
467 {
468  //Note: twoDCorrect already done by ::solve
469 
470  return relaxedPoints_;
471 }
472 
473 
475 {
476  movePoints(curPoints());
477 
478  // Update values on pointDisplacement. Note: should also evaluate? Since
479  // e.g. cellMotionBC uses pointDisplacement value.
480  pointDisplacement().boundaryFieldRef().updateCoeffs();
481 
482 
483  fileName debugDir;
484  if (debug & 2)
485  {
486  debugDir = mesh().time().timePath();
487  mkDir(debugDir);
488  OBJstream os(debugDir/"bc.obj");
489 
490  const pointField wantedPoints
491  (
492  points0()
493  + pointDisplacement().internalField()
494  );
495  const auto& pbm = pointDisplacement().mesh().boundary();
496  for (const auto& ppp : pbm)
497  {
498  if (!isA<emptyPointPatch>(ppp))
499  {
500  const auto& mp = ppp.meshPoints();
501  for (const label pointi : mp)
502  {
503  os.write
504  (
506  (
507  points0()[pointi],
508  wantedPoints[pointi]
509  )
510  );
511  }
512  }
513  }
514  Pout<< "Written " << os.nVertices() << " initial displacements to "
515  << os.name() << endl;
516  }
517 
518 
519  // Extend: face-to-point-to-cell-to-faces
520  labelHashSet affectedFaces;
521  markAffectedFaces(facesToMove_, affectedFaces);
522 
523 
524  for(label i = 0; i < nPointSmootherIter_; i ++)
525  {
526  const pointField wantedPoints
527  (
528  points0()
529  + pointDisplacement().internalField()
530  );
531 
532  meshGeometry_.correct
533  (
534  wantedPoints,
535  affectedFaces.toc()
536  );
537 
538  //{
539  // // Debugging: check meshGeometry consistent with fvGeometryScheme
540  // const auto& geom =
541  // reinterpret_cast<const fvMesh&>(mesh()).geometry();
542  // pointField faceCentres(mesh().nFaces());
543  // vectorField faceAreas(mesh().nFaces());
544  // pointField cellCentres(mesh().nCells());
545  // scalarField cellVolumes(mesh().nCells());
546  // geom.updateGeom
547  // (
548  // wantedPoints,
549  // mesh().points(), // old points
550  // faceCentres,
551  // faceAreas,
552  // cellCentres,
553  // cellVolumes
554  // );
555  // forAll(faceCentres, facei)
556  // {
557  // const point& meshFc = mesh().faceCentres()[facei];
558  // const point& meshGeomFc = meshGeometry_.faceCentres()[facei];
559  // const point& updatedFc = faceCentres[facei];
560  //
561  // if (updatedFc != meshGeomFc)
562  // {
563  // const face& f = mesh().faces()[facei];
564  //
565  // Pout<< "At face:" << facei << nl
566  // << " old :" << meshFc << nl
567  // << " new :" << updatedFc << nl
568  // << " polyMeshGeom:" << meshGeomFc << nl
569  // << " oldPoints :"
570  // << UIndirectList<point>(mesh().points(), f) << nl
571  // << " wantedPoints:"
572  // << UIndirectList<point>(wantedPoints, f) << nl
573  // << endl;
574  // }
575  // }
576  //}
577 
578  // Get measure of face quality
579  tmp<scalarField> tfaceQ
580  (
581  pointUntangler_->faceQuality
582  (
583  wantedPoints,
584  meshGeometry_.faceCentres(),
585  meshGeometry_.faceAreas(),
586  meshGeometry_.cellCentres(),
587  meshGeometry_.cellVolumes()
588  )
589  );
590 
591 
592  if (debug)
593  {
594  MinMax<scalar> range(gMinMax(tfaceQ()));
595  Pout<< " min:" << range.min() << nl
596  << " max:" << range.max() << endl;
597  }
598 
599  labelList order;
600  Foam::sortedOrder(tfaceQ(), order);
601 
602  label nUntangle = 0;
603  forAll(order, i)
604  {
605  if (tfaceQ()[order[i]] > untangleQ_)
606  {
607  nUntangle = i;
608  break;
609  }
610  }
611  label nLow = 0;
612  forAll(order, i)
613  {
614  if (tfaceQ()[order[i]] > minQ_)
615  {
616  nLow = i;
617  break;
618  }
619  }
620 
621 
622  if (debug)
623  {
624  Pout<< " nUntangle:" << returnReduce(nUntangle, sumOp<label>())
625  << nl
626  << " nLow :" << returnReduce(nLow, sumOp<label>())
627  << nl;
628  }
629 
630 
631  if (returnReduce(nUntangle, sumOp<label>()))
632  {
633  // Start untangling
634  labelList lowQFaces(SubList<label>(order, nUntangle));
635  //{
636  // // Grow set (non parallel)
637  // bitSet isMarkedFace(mesh().nFaces());
638  // for (const label facei : lowQFaces)
639  // {
640  // for (const label pointi : mesh().faces()[facei])
641  // {
642  // isMarkedFace.set(mesh().pointFaces()[pointi]);
643  // }
644  // }
645  // lowQFaces = isMarkedFace.sortedToc();
646  //}
647 
648  //Pout<< " untangling "
649  // << returnReduce(lowQFaces.size(), sumOp<label>())
650  // << " faces" << endl;
651  pointUntangler_->update
652  (
653  lowQFaces,
654  points0(),
655  wantedPoints,
656  meshGeometry_,
657  pointDisplacement()
658  //false // ! do NOT apply bcs, constraints
659  );
660 
661  // Keep points on empty patches. Note: since pointConstraints
662  // does not implement constraints on emptyPointPatches and
663  // emptyPointPatchField does not either.
664  emptyCorrectPoints(pointDisplacement());
665 
666  if (debug & 2)
667  {
668  OBJstream os(debugDir/"untangle_" + Foam::name(i) + ".obj");
669 
670  const pointField wantedPoints
671  (
672  points0()
673  + pointDisplacement().internalField()
674  );
675  forAll(wantedPoints, pointi)
676  {
677  os.write
678  (
680  (
681  points0()[pointi],
682  wantedPoints[pointi]
683  )
684  );
685  }
686  Pout<< "Written " << os.nVertices() << " wanted untangle to "
687  << os.name() << endl;
688  }
689  }
690  else if (returnReduce(nLow, sumOp<label>()))
691  {
692  labelList lowQFaces(SubList<label>(order, nLow));
693  //{
694  // // Grow set (non parallel)
695  // bitSet isMarkedFace(mesh().nFaces());
696  // for (const label facei : lowQFaces)
697  // {
698  // for (const label pointi : mesh().faces()[facei])
699  // {
700  // isMarkedFace.set(mesh().pointFaces()[pointi]);
701  // }
702  // }
703  // lowQFaces = isMarkedFace.sortedToc();
704  //}
705 
706  //Pout<< " smoothing "
707  // << returnReduce(lowQFaces.size(), sumOp<label>())
708  // << " faces" << endl;
709 
710  pointSmoother_->update
711  (
712  lowQFaces,
713  points0(),
714  wantedPoints,
715  meshGeometry_,
716  pointDisplacement()
717  );
718  // Keep points on empty patches
719  emptyCorrectPoints(pointDisplacement());
720  }
721  else
722  {
723  //Pout<< "** converged" << endl;
724  break;
725  }
726  }
727 
728 
729  relax();
730  //relaxedPoints_ = points0() + pointDisplacement().internalField();
731 
732  twoDCorrectPoints(relaxedPoints_);
733 
734  // Update pointDisplacement for actual relaxedPoints. Keep fixed-value
735  // bcs.
736  pointDisplacement().primitiveFieldRef() = relaxedPoints_-points0();
737 
738  // Adhere to multi-point constraints. Does correctBoundaryConditions +
739  // multi-patch issues.
740  const pointConstraints& pcs =
741  pointConstraints::New(pointDisplacement().mesh());
742  pcs.constrainDisplacement(pointDisplacement(), false);
743 }
744 
745 
746 // ************************************************************************* //
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
const polyBoundaryMesh & pbm
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
dictionary dict
Virtual base class for displacement motion solver.
A line primitive.
Definition: line.H:52
A class for handling file names.
Definition: fileName.H:72
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:68
UEqn relax()
virtual Ostream & write(const char c) override
Write character.
Definition: OBJstream.C:69
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
fileName timePath() const
Return current time path = path/timeName.
Definition: Time.H:520
Abstract base class for point smoothing methods. Handles parallel communication via reset and average...
Definition: pointSmoother.H:50
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
virtual const fileName & name() const override
Read/write access to the name of the stream.
Definition: OSstream.H:134
vectorIOField pointIOField
pointIOField is a vectorIOField.
Definition: pointIOField.H:38
static const pointConstraints & New(const pointMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
Definition: MeshObject.C:53
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Definition: label.H:63
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
virtual void setFacesToMove(const dictionary &)
Set all the faces to be moved.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: motionSolver.H:173
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:360
label nFaces() const noexcept
Number of mesh faces.
Lookup type of boundary radiation properties.
Definition: lookup.H:57
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
Definition: stdFoam.H:478
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:232
label nVertices() const noexcept
Return the number of vertices written.
Definition: OBJstream.H:120
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:441
Macros for easy insertion into run-time selection tables.
scalar range
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
dynamicFvMesh & mesh
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:614
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
line< point, const point & > linePointRef
A line using referred points.
Definition: line.H:66
const cellShapeList & cells
const pointField & points
const polyMesh & mesh() const noexcept
Return the mesh reference.
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:130
A class for handling words, derived from Foam::string.
Definition: word.H:63
label nPoints
void clear()
Remove all entries from table.
Definition: HashTable.C:749
void emptyCorrectPoints(pointVectorField &pointDisplacement)
Handle 2D & empty bcs. Assume in both cases the starting mesh.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static void syncPointList(const polyMesh &mesh, List< T > &pointValues, const CombineOp &cop, const T &nullValue, const TransformOp &top)
Synchronize values on all mesh points.
An OFstream that keeps track of vertices and provides convenience output methods for OBJ files...
Definition: OBJstream.H:55
int debug
Static debugging option.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
void markAffectedFaces(const labelHashSet &changedFaces, labelHashSet &affectedFaces)
Mark affected faces.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
U
Definition: pEqn.H:72
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
displacementSmartPointSmoothingMotionSolver(const polyMesh &, const IOdictionary &)
Construct from a polyMesh and an IOdictionary.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:75
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
List< label > labelList
A List of labels.
Definition: List.H:62
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:165
A class for managing temporary objects.
Definition: HashPtrTable.H:50
scalarList relaxationFactors_
Relaxation factors to use in each iteration.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
const dimensionedScalar mp
Proton mass.
Namespace for OpenFOAM.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
bitSet PackedBoolList