31 template<
class TransferType>
36 List<TransferType>& faceDist
41 label nChangedFaces = 0;
45 if (patchIDs.found(
patchi))
47 const polyPatch& patch = mesh.boundaryMesh()[
patchi];
49 const Field<Type>& patchField = initialPatchValuePtrs_[
patchi];
51 forAll(patch.faceCentres(), patchFacei)
53 label meshFacei = patch.start() + patchFacei;
55 changedFaces[nChangedFaces] = meshFacei;
57 faceDist[nChangedFaces] =
60 patch.faceCentres()[patchFacei],
61 patchField[patchFacei],
73 template<
class TransferType>
76 const MeshWave<TransferType>& waveInfo
81 const List<TransferType>& cellInfo = waveInfo.allCellInfo();
82 const List<TransferType>& faceInfo = waveInfo.allFaceInfo();
87 distance_.setSize(cellInfo.size());
91 const TransferType & wpn = cellInfo[celli];
93 scalar dist = wpn.distSqr();
95 if (cellInfo[celli].valid(waveInfo.data()))
99 cellData_[celli] = cellInfo[celli].data();
106 distance_[celli] =
mag(dist);
109 cellData_[celli] = cellInfo[celli].data();
118 const polyPatch& patch = mesh.boundaryMesh()[
patchi];
123 patchDistance_.set(
patchi, patchFieldPtr);
128 Field<Type>* patchDataFieldPtr =
new Field<Type>(patch.size());
130 patchData_.set(
patchi, patchDataFieldPtr);
132 Field<Type>& patchDataField = *patchDataFieldPtr;
135 forAll(patchField, patchFacei)
137 label meshFacei = patch.start() + patchFacei;
139 scalar dist = faceInfo[meshFacei].distSqr();
141 if (faceInfo[meshFacei].valid(waveInfo.data()))
145 patchField[patchFacei] =
Foam::sqrt(dist) + small;
147 patchDataField[patchFacei] = faceInfo[meshFacei].data();
153 patchField[patchFacei] =
mag(dist);
156 patchDataField[patchFacei] = faceInfo[meshFacei].data();
170 template<
class TransferType>
176 const bool correctWalls
181 initialPatchValuePtrs_(initialPatchValuePtrs),
182 correctWalls_(correctWalls),
195 template<
class TransferType>
203 template<
class TransferType>
212 label nWalls = sumPatchSize(patchIDs_);
217 setChangedFaces(patchIDs_, changedFaces, faceDist);
228 mesh().globalData().nTotalCells()+1
236 nUnset_ = getValues(waveInfo);
247 correctBoundaryFaceCells
254 correctBoundaryPointCells
266 forAll(wallCells, wallCelli)
268 label celli = wallCells[wallCelli];
270 label facei = nearestFace[celli];
272 cellData_[celli] = faceInfo[facei].
data();
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
Takes a set of patches to start MeshWave from.
patchDataWave(const polyMesh &mesh, const labelHashSet &patchIDs, const UPtrList< Field< Type >> &initialPatchValuePtrs, bool correctWalls=true)
Construct from mesh, information on patches to initialize and flag.
Collection of functions used in wall distance calculation.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
const List< Type > & allFaceInfo() const
Get allFaceInfo.
virtual void correct()
Correct for mesh geom/topo changes.
Pre-declare SubField and related Field type.
List< label > labelList
A List of labels.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
volScalarField scalarField(fieldObject, mesh)
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-7/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
label size() const
Return the number of elements in the UPtrList.
T * data()
Return a pointer to the first data element,.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
List< Key > toc() const
Return the table of contents.
virtual ~patchDataWave()
Destructor.