33template<
class TransferType,
class TrackingData>
40template<
class TransferType,
class TrackingData>
43 const labelHashSet& patchIDs,
44 labelList& changedFaces,
45 List<TransferType>& faceDist
48 const polyMesh&
mesh = cellDistFuncs::mesh();
50 label nChangedFaces = 0;
54 if (patchIDs.found(patchi))
56 const polyPatch&
patch =
mesh.boundaryMesh()[patchi];
58 const Field<Type>& patchField = initialPatchValuePtrs_[patchi];
62 label meshFacei =
patch.start() + patchFacei;
64 changedFaces[nChangedFaces] = meshFacei;
66 faceDist[nChangedFaces] =
69 patch.faceCentres()[patchFacei],
70 patchField[patchFacei],
82template<
class TransferType,
class TrackingData>
85 const MeshWave<TransferType, TrackingData>& waveInfo
88 const polyMesh&
mesh = cellDistFuncs::mesh();
90 const List<TransferType>& cellInfo = waveInfo.allCellInfo();
91 const List<TransferType>& faceInfo = waveInfo.allFaceInfo();
96 distance_.setSize(cellInfo.size());
100 const TransferType & wpn = cellInfo[celli];
102 scalar dist = wpn.distSqr();
104 if (cellInfo[celli].valid(waveInfo.data()))
108 cellData_[celli] = cellInfo[celli].data();
115 distance_[celli] =
mag(dist);
118 cellData_[celli] = cellInfo[celli].data();
125 forAll(patchDistance_, patchi)
127 const polyPatch&
patch =
mesh.boundaryMesh()[patchi];
132 patchDistance_.set(patchi, patchFieldPtr);
137 Field<Type>* patchDataFieldPtr =
new Field<Type>(
patch.size());
139 patchData_.set(patchi, patchDataFieldPtr);
141 Field<Type>& patchDataField = *patchDataFieldPtr;
144 forAll(patchField, patchFacei)
146 label meshFacei =
patch.start() + patchFacei;
148 scalar dist = faceInfo[meshFacei].distSqr();
150 if (faceInfo[meshFacei].valid(waveInfo.data()))
154 patchField[patchFacei] =
Foam::sqrt(dist) + SMALL;
156 patchDataField[patchFacei] = faceInfo[meshFacei].data();
162 patchField[patchFacei] =
mag(dist);
165 patchDataField[patchFacei] = faceInfo[meshFacei].data();
179template<
class TransferType,
class TrackingData>
185 const bool correctWalls,
191 initialPatchValuePtrs_(initialPatchValuePtrs),
192 correctWalls_(correctWalls),
195 distance_(
mesh.nCells()),
197 cellData_(
mesh.nCells()),
206template<
class TransferType,
class TrackingData>
214template<
class TransferType,
class TrackingData>
223 label nWalls = sumPatchSize(patchIDs_);
228 setChangedFaces(patchIDs_, changedFaces, faceDist);
239 mesh().globalData().nTotalCells()+1,
248 nUnset_ = getValues(waveInfo);
259 correctBoundaryFaceCells
266 correctBoundaryPointCells
278 forAll(wallCells, wallCelli)
280 label celli = wallCells[wallCelli];
282 label facei = nearestFace[celli];
284 cellData_[celli] = faceInfo[facei].
data();
Generic templated field type.
List< Key > toc() const
The table of contents (the keys) in unsorted order.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A HashTable to objects of type <T> with a label key.
const List< Type > & allFaceInfo() const
Get allFaceInfo.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Collection of functions used in wall distance calculation.
Takes a set of patches to start MeshWave from.
virtual ~patchDataWave()
Destructor.
virtual void correct()
Correct for mesh geom/topo changes.
Mesh consisting of general polyhedral cells.
const std::string patch
OpenFOAM patch number as a std::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.