33 template<
class TransferType,
class TrackingData>
40 template<
class TransferType,
class TrackingData>
44 DynamicList<label>& changedFaces,
45 DynamicList<TransferType>& faceDist
54 const polyPatch&
patch =
mesh.boundaryMesh()[patchi];
56 const auto areaFraction(
patch.areaFraction());
58 const auto faceCentres(
patch.faceCentres());
60 const Field<Type>& patchField = initialPatchValuePtrs_[patchi];
62 forAll(faceCentres, patchFacei)
67 || (areaFraction()[patchFacei] > 0.5)
70 label meshFacei =
patch.start() + patchFacei;
71 changedFaces.append(meshFacei);
77 faceCentres[patchFacei],
78 patchField[patchFacei],
90 template<
class TransferType,
class TrackingData>
93 const MeshWave<TransferType, TrackingData>& waveInfo
98 const List<TransferType>& cellInfo = waveInfo.allCellInfo();
99 const List<TransferType>& faceInfo = waveInfo.allFaceInfo();
104 distance_.setSize(cellInfo.size());
108 const TransferType & wpn = cellInfo[celli];
110 scalar dist = wpn.distSqr();
112 if (cellInfo[celli].valid(waveInfo.data()))
116 cellData_[celli] = cellInfo[celli].data();
123 distance_[celli] =
mag(dist);
126 cellData_[celli] = cellInfo[celli].data();
133 forAll(patchDistance_, patchi)
135 const polyPatch&
patch =
mesh.boundaryMesh()[patchi];
140 patchDistance_.
set(patchi, patchFieldPtr);
145 Field<Type>* patchDataFieldPtr =
new Field<Type>(
patch.size());
147 patchData_.
set(patchi, patchDataFieldPtr);
149 Field<Type>& patchDataField = *patchDataFieldPtr;
152 forAll(patchField, patchFacei)
154 label meshFacei =
patch.start() + patchFacei;
156 scalar dist = faceInfo[meshFacei].distSqr();
158 if (faceInfo[meshFacei].valid(waveInfo.data()))
162 patchField[patchFacei] =
Foam::sqrt(dist) + SMALL;
164 patchDataField[patchFacei] = faceInfo[meshFacei].data();
170 patchField[patchFacei] =
mag(dist);
173 patchDataField[patchFacei] = faceInfo[meshFacei].data();
187 template<
class TransferType,
class TrackingData>
193 const bool correctWalls,
199 initialPatchValuePtrs_(initialPatchValuePtrs),
200 correctWalls_(correctWalls),
203 distance_(
mesh.nCells()),
205 cellData_(
mesh.nCells()),
214 template<
class TransferType,
class TrackingData>
222 template<
class TransferType,
class TrackingData>
231 label nWalls = sumPatchSize(patchIDs_);
236 setChangedFaces(patchIDs_, changedFaces, faceDist);
247 mesh().globalData().nTotalCells()+1,
256 nUnset_ = getValues(waveInfo);
267 correctBoundaryFaceCells
274 correctBoundaryPointCells
284 const labelList wallCells(nearestFace.toc());
286 forAll(wallCells, wallCelli)
288 label celli = wallCells[wallCelli];
290 label facei = nearestFace[celli];
292 cellData_[celli] = faceInfo[facei].
data();
const labelList patchIDs(pbm.indices(polyPatchNames, true))
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
dimensionedScalar sqrt(const dimensionedScalar &ds)
Takes a set of patches to start MeshWave from.
#define forAll(list, i)
Loop across all elements in list.
Collection of functions used in wall distance calculation.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
virtual void correct()
Correct for mesh geom/topo changes.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Generic templated field type.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const std::string patch
OpenFOAM patch number as a std::string.
Mesh consisting of general polyhedral cells.
patchDataWave(const polyMesh &mesh, const labelHashSet &patchIDs, const UPtrList< Field< Type >> &initialPatchValuePtrs, const bool correctWalls=true, TrackingData &td=dummyTrackData_)
Construct from mesh, information on patches to initialize and flag.
virtual ~patchDataWave()
Destructor.