volPointInterpolate.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 "volPointInterpolation.H"
30 #include "volFields.H"
31 #include "pointFields.H"
32 #include "emptyFvPatch.H"
33 #include "coupledPointPatchField.H"
34 #include "pointConstraints.H"
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 template<class Type>
39 void Foam::volPointInterpolation::pushUntransformedData
40 (
41  List<Type>& pointData
42 ) const
43 {
44  // Transfer onto coupled patch
45  const globalMeshData& gmd = mesh().globalData();
46  const indirectPrimitivePatch& cpp = gmd.coupledPatch();
47  const labelList& meshPoints = cpp.meshPoints();
48 
49  const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
50  const labelListList& slaves = gmd.globalCoPointSlaves();
51 
52  List<Type> elems(slavesMap.constructSize());
53  forAll(meshPoints, i)
54  {
55  elems[i] = pointData[meshPoints[i]];
56  }
57 
58  // Combine master data with slave data
59  forAll(slaves, i)
60  {
61  const labelList& slavePoints = slaves[i];
62 
63  // Copy master data to slave slots
64  forAll(slavePoints, j)
65  {
66  elems[slavePoints[j]] = elems[i];
67  }
68  }
69 
70  // Push slave-slot data back to slaves
71  slavesMap.reverseDistribute(elems.size(), elems, false);
72 
73  // Extract back onto mesh
74  forAll(meshPoints, i)
75  {
76  pointData[meshPoints[i]] = elems[i];
77  }
78 }
79 
80 
81 template<class Type>
82 void Foam::volPointInterpolation::addSeparated
83 (
84  GeometricField<Type, pointPatchField, pointMesh>& pf
85 ) const
86 {
87  if (debug)
88  {
89  Pout<< "volPointInterpolation::addSeparated" << endl;
90  }
91 
92  typename GeometricField<Type, pointPatchField, pointMesh>::
93  Internal& pfi = pf.ref();
94 
95  typename GeometricField<Type, pointPatchField, pointMesh>::
96  Boundary& pfbf = pf.boundaryFieldRef();
97 
98  const label nReq = Pstream::nRequests();
99 
100  forAll(pfbf, patchi)
101  {
102  if (pfbf[patchi].coupled())
103  {
104  refCast<coupledPointPatchField<Type>>
105  (pfbf[patchi]).initSwapAddSeparated
106  (
108  pfi
109  );
110  }
111  }
112 
113  // Block for any outstanding requests
114  Pstream::waitRequests(nReq);
115 
116  forAll(pfbf, patchi)
117  {
118  if (pfbf[patchi].coupled())
119  {
120  refCast<coupledPointPatchField<Type>>
121  (pfbf[patchi]).swapAddSeparated
122  (
124  pfi
125  );
126  }
127  }
128 }
129 
130 
131 template<class Type>
133 (
136 ) const
137 {
138  if (debug)
139  {
140  Pout<< "volPointInterpolation::interpolateInternalField("
141  << "const GeometricField<Type, fvPatchField, volMesh>&, "
142  << "GeometricField<Type, pointPatchField, pointMesh>&) : "
143  << "interpolating field " << vf.name()
144  << " from cells to points " << pf.name() << endl;
145  }
146 
147  const labelListList& pointCells = vf.mesh().pointCells();
148 
149  // Multiply volField by weighting factor matrix to create pointField
150  forAll(pointCells, pointi)
151  {
152  if (!isPatchPoint_[pointi])
153  {
154  const scalarList& pw = pointWeights_[pointi];
155  const labelList& ppc = pointCells[pointi];
156 
157  pf[pointi] = Zero;
158 
159  forAll(ppc, pointCelli)
160  {
161  pf[pointi] += pw[pointCelli]*vf[ppc[pointCelli]];
162  }
163  }
164  }
165 }
166 
167 
168 template<class Type>
170 (
173 ) const
174 {
175  if (debug)
176  {
177  Pout<< "volPointInterpolation::interpolateDimensionedInternalField("
178  << "const DimensionedField<Type, volMesh>&, "
179  << "DimensionedField<Type, pointMesh>&) : "
180  << "interpolating field " << vf.name() << " from cells to points "
181  << pf.name() << endl;
182  }
183 
184  const fvMesh& mesh = vf.mesh();
185 
187  const pointField& points = mesh.points();
188  const vectorField& cellCentres = mesh.cellCentres();
189 
190  // Re-do weights and interpolation since normal interpolation
191  // pointWeights_ are for non-boundary points only. Not efficient but
192  // then saves on space.
193 
194  // Multiply volField by weighting factor matrix to create pointField
195  scalarField sumW(points.size(), Zero);
196  forAll(pointCells, pointi)
197  {
198  const labelList& ppc = pointCells[pointi];
199 
200  pf[pointi] = Type(Zero);
201 
202  forAll(ppc, pointCelli)
203  {
204  label celli = ppc[pointCelli];
205  scalar pw = 1.0/mag(points[pointi] - cellCentres[celli]);
206 
207  pf[pointi] += pw*vf[celli];
208  sumW[pointi] += pw;
209  }
210  }
211 
212  // Sum collocated contributions
215 
216  // Normalise
217  forAll(pf, pointi)
218  {
219  scalar s = sumW[pointi];
220  if (s > ROOTVSMALL)
221  {
222  pf[pointi] /= s;
223  }
224  }
225 }
226 
227 
228 template<class Type>
229 Foam::tmp<Foam::Field<Type>> Foam::volPointInterpolation::flatBoundaryField
230 (
232 ) const
233 {
234  const fvMesh& mesh = vf.mesh();
235  const fvBoundaryMesh& bm = mesh.boundary();
236 
237  tmp<Field<Type>> tboundaryVals
238  (
240  );
241  Field<Type>& boundaryVals = tboundaryVals.ref();
242 
243  forAll(vf.boundaryField(), patchi)
244  {
245  label bFacei = bm[patchi].patch().start() - mesh.nInternalFaces();
246 
247  if
248  (
249  !isA<emptyFvPatch>(bm[patchi])
250  && !vf.boundaryField()[patchi].coupled()
251  )
252  {
254  (
255  boundaryVals,
256  vf.boundaryField()[patchi].size(),
257  bFacei
258  ) = vf.boundaryField()[patchi];
259  }
260  else
261  {
262  const polyPatch& pp = bm[patchi].patch();
263 
264  forAll(pp, i)
265  {
266  boundaryVals[bFacei++] = Zero;
267  }
268  }
269  }
270 
271  return tboundaryVals;
272 }
273 
274 
275 template<class Type>
277 (
280 ) const
281 {
282  const primitivePatch& boundary = boundaryPtr_();
283 
284  Field<Type>& pfi = pf.primitiveFieldRef();
285 
286  // Get face data in flat list
287  tmp<Field<Type>> tboundaryVals(flatBoundaryField(vf));
288  const Field<Type>& boundaryVals = tboundaryVals();
289 
290 
291  // Do points on 'normal' patches from the surrounding patch faces
292  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
293 
294  const labelList& mp = boundary.meshPoints();
295 
296  forAll(mp, i)
297  {
298  label pointi = mp[i];
299 
300  if (isPatchPoint_[pointi])
301  {
302  const labelList& pFaces = boundary.pointFaces()[i];
303  const scalarList& pWeights = boundaryPointWeights_[i];
304 
305  Type& val = pfi[pointi];
306 
307  val = Zero;
308  forAll(pFaces, j)
309  {
310  if (boundaryIsPatchFace_[pFaces[j]])
311  {
312  val += pWeights[j]*boundaryVals[pFaces[j]];
313  }
314  }
315  }
316  }
317 
318  // Sum collocated contributions
320 
321  // And add separated contributions
322  addSeparated(pf);
323 
324  // Optionally normalise
325  if (normalisationPtr_)
326  {
327  const scalarField& normalisation = normalisationPtr_();
328  forAll(mp, i)
329  {
330  pfi[mp[i]] *= normalisation[i];
331  }
332  }
333 
334 
335  // Push master data to slaves. It is possible (not sure how often) for
336  // a coupled point to have its master on a different patch so
337  // to make sure just push master data to slaves.
338  pushUntransformedData(pfi);
339 }
340 
341 
342 template<class Type>
344 (
347  const bool overrideFixedValue
348 ) const
349 {
350  interpolateBoundaryField(vf, pf);
351 
352  // Apply constraints
353  const pointConstraints& pcs = pointConstraints::New(pf.mesh());
354 
355  pcs.constrain(pf, overrideFixedValue);
356 }
357 
358 
359 template<class Type>
361 (
364 ) const
365 {
366  if (debug)
367  {
368  Pout<< "volPointInterpolation::interpolate("
369  << "const GeometricField<Type, fvPatchField, volMesh>&, "
370  << "GeometricField<Type, pointPatchField, pointMesh>&) : "
371  << "interpolating field " << vf.name() << " from cells to points "
372  << pf.name() << endl;
373  }
374 
375  interpolateInternalField(vf, pf);
376 
377  // Interpolate to the patches preserving fixed value BCs
378  interpolateBoundaryField(vf, pf, false);
379 }
380 
381 
382 template<class Type>
385 (
387  const wordList& patchFieldTypes
388 ) const
389 {
390  const pointMesh& pm = pointMesh::New(vf.mesh());
391 
392  // Construct tmp<pointField>
394  (
395  IOobject
396  (
397  "volPointInterpolate(" + vf.name() + ')',
398  vf.instance(),
399  pm.thisDb()
400  ),
401  pm,
402  vf.dimensions(),
403  patchFieldTypes
404  );
405 
406  interpolateInternalField(vf, tpf.ref());
407 
408  // Interpolate to the patches overriding fixed value BCs
409  interpolateBoundaryField(vf, tpf.ref(), true);
410 
411  return tpf;
412 }
413 
414 
415 template<class Type>
418 (
420  const wordList& patchFieldTypes
421 ) const
422 {
423  // Construct tmp<pointField>
425  interpolate(tvf(), patchFieldTypes);
426  tvf.clear();
427  return tpf;
428 }
429 
430 
431 template<class Type>
434 (
436  const word& name,
437  const bool cache
438 ) const
439 {
441 
442  const pointMesh& pm = pointMesh::New(vf.mesh());
443  const objectRegistry& db = pm.thisDb();
444 
445  PointFieldType* pfPtr =
446  db.objectRegistry::template getObjectPtr<PointFieldType>(name);
447 
448  if (!cache || vf.mesh().changing())
449  {
450  // Delete any old occurrences to avoid double registration
451  if (pfPtr && pfPtr->ownedByRegistry())
452  {
453  solution::cachePrintMessage("Deleting", name, vf);
454  delete pfPtr;
455  }
456 
458  (
459  IOobject
460  (
461  name,
462  vf.instance(),
463  pm.thisDb()
464  ),
465  pm,
466  vf.dimensions()
467  );
468 
469  interpolate(vf, tpf.ref());
470 
471  return tpf;
472  }
473 
474 
475  if (!pfPtr)
476  {
477  solution::cachePrintMessage("Calculating and caching", name, vf);
478 
479  pfPtr = interpolate(vf, name, false).ptr();
480  regIOobject::store(pfPtr);
481  }
482  else
483  {
484  PointFieldType& pf = *pfPtr;
485 
486  if (pf.upToDate(vf)) //TBD: , vf.mesh().points()))
487  {
488  solution::cachePrintMessage("Reusing", name, vf);
489  }
490  else
491  {
492  solution::cachePrintMessage("Updating", name, vf);
493  interpolate(vf, pf);
494  }
495  }
496 
497  return *pfPtr;
498 }
499 
500 
501 template<class Type>
504 (
506 ) const
507 {
508  return interpolate(vf, "volPointInterpolate(" + vf.name() + ')', false);
509 }
510 
511 
512 template<class Type>
515 (
517 ) const
518 {
519  // Construct tmp<pointField>
521  interpolate(tvf());
522  tvf.clear();
523  return tpf;
524 }
525 
526 
527 template<class Type>
530 (
532  const word& name,
533  const bool cache
534 ) const
535 {
536  typedef DimensionedField<Type, pointMesh> PointFieldType;
537 
538  const pointMesh& pm = pointMesh::New(vf.mesh());
539  const objectRegistry& db = pm.thisDb();
540 
541 
542  PointFieldType* pfPtr =
543  db.objectRegistry::template getObjectPtr<PointFieldType>(name);
544 
545  if (!cache || vf.mesh().changing())
546  {
547  // Delete any old occurrences to avoid double registration
548  if (pfPtr && pfPtr->ownedByRegistry())
549  {
550  solution::cachePrintMessage("Deleting", name, vf);
551  delete pfPtr;
552  }
553 
555  (
556  IOobject
557  (
558  name,
559  vf.instance(),
560  pm.thisDb()
561  ),
562  pm,
563  vf.dimensions()
564  );
565 
566  interpolateDimensionedInternalField(vf, tpf.ref());
567 
568  return tpf;
569  }
570 
571 
572  if (!pfPtr)
573  {
574  solution::cachePrintMessage("Calculating and caching", name, vf);
575  pfPtr = interpolate(vf, name, false).ptr();
576 
577  regIOobject::store(pfPtr);
578  }
579  else
580  {
581  PointFieldType& pf = *pfPtr;
582 
583  if (pf.upToDate(vf)) //TBD: , vf.mesh().points()))
584  {
585  solution::cachePrintMessage("Reusing", name, vf);
586  }
587  else
588  {
589  solution::cachePrintMessage("Updating", name, vf);
590  interpolateDimensionedInternalField(vf, pf);
591  }
592  }
593 
594  return *pfPtr;
595 }
596 
597 
598 template<class Type>
601 (
603 ) const
604 {
605  return interpolate(vf, "volPointInterpolate(" + vf.name() + ')', false);
606 }
607 
608 
609 template<class Type>
612 (
614 ) const
615 {
616  // Construct tmp<pointField>
618  tvf.clear();
619  return tpf;
620 }
621 
622 
623 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
volFields.H
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1069
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::constant::atomic::mp
const dimensionedScalar mp
Proton mass.
coupledPointPatchField.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
s
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:54
Foam::MeshObject< pointMesh, UpdateableMeshObject, pointConstraints >::New
static const pointConstraints & New(const pointMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Definition: MeshObject.C:48
Foam::UPstream::waitRequests
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
Definition: UPstream.C:262
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::solution::cachePrintMessage
static void cachePrintMessage(const char *message, const word &name, const FieldType &vf)
Helper for printing cache message.
Definition: solutionTemplates.C:34
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::volPointInterpolation::interpolate
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
Foam::regIOobject::store
bool store()
Definition: regIOobjectI.H:37
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::interpolate
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Definition: curveTools.C:75
Foam::Field< vector >
Foam::DimensionedField::mesh
const Mesh & mesh() const
Return mesh.
Definition: DimensionedFieldI.H:41
Foam::MeshObject< fvMesh, UpdateableMeshObject, volPointInterpolation >::mesh
const fvMesh & mesh() const
Definition: MeshObject.H:122
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
pointConstraints.H
Foam::primitiveMesh::nBoundaryFaces
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
Definition: primitiveMeshI.H:84
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
emptyFvPatch.H
Foam::DimensionedField::dimensions
const dimensionSet & dimensions() const
Return dimensions.
Definition: DimensionedFieldI.H:49
Foam::GeometricField::primitiveFieldRef
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
Definition: GeometricField.C:766
Foam::indirectPrimitivePatch
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
Definition: indirectPrimitivePatch.H:49
Foam::pointConstraints
Application of (multi-)patch point constraints.
Definition: pointConstraints.H:64
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
volPointInterpolation.H
Foam::fvMesh::boundary
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:685
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
Foam::primitiveMesh::cellCentres
const vectorField & cellCentres() const
Definition: primitiveMeshCellCentresAndVols.C:84
Foam::UPstream::commsTypes::nonBlocking
Foam::UPstream::nRequests
static label nRequests()
Get number of outstanding requests.
Definition: UPstream.C:252
Foam::GeometricField::ref
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
Definition: GeometricField.C:749
Foam::pointConstraints::syncUntransformedData
static void syncUntransformedData(const polyMesh &mesh, List< Type > &pointData, const CombineOp &cop)
Helper: sync data on collocated points only.
Definition: pointConstraintsTemplates.C:36
Foam::primitiveMesh::nInternalFaces
label nInternalFaces() const noexcept
Number of internal faces.
Definition: primitiveMeshI.H:78
Foam::List< labelList >
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::pointMesh::thisDb
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:121
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::volPointInterpolation::interpolateInternalField
void interpolateInternalField(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate internal field from volField to pointField.
Definition: volPointInterpolate.C:133
Foam::primitiveMesh::pointCells
const labelListList & pointCells() const
Definition: primitiveMeshPointCells.C:110
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::pointCells
Smooth ATC in cells having a point to a set of patches supplied by type.
Definition: pointCells.H:56
Foam::pointConstraints::constrain
void constrain(GeometricField< Type, pointPatchField, pointMesh > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
Definition: pointConstraintsTemplates.C:131
Foam::plusEqOp
Definition: ops.H:72
coupled
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
Foam::polyMesh::globalData
const globalMeshData & globalData() const
Return parallel info.
Definition: polyMesh.C:1295
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::volPointInterpolation::interpolateDimensionedInternalField
void interpolateDimensionedInternalField(const DimensionedField< Type, volMesh > &vf, DimensionedField< Type, pointMesh > &pf) const
Interpolate dimensioned internal field from cells to points.
Definition: volPointInterpolate.C:170
Foam::volPointInterpolation::interpolateBoundaryField
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
Interpolate boundary field without applying constraints/boundary.
Definition: volPointInterpolate.C:277
pointFields.H
boundary
faceListList boundary
Definition: createBlockMesh.H:4
pFaces
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
Definition: readKivaGrid.H:235
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.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::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79