Foam::tmp<Foam::scalarField> Foam::inverseDistanceDiffusivity::y() const { labelHashSet patchSet(mesh().boundaryMesh().patchSet(patchNames_)); if (patchSet.size()) { return tmp<scalarField> ( new scalarField(patchWave(mesh(), patchSet, false).distance()) ); } else { return tmp<scalarField>(new scalarField(mesh().nCells(), 1.0)); } }
Foam::tmp<Foam::scalarField> Foam::linearDiff::L() const { const polyMesh& m = tetMesh()(); const polyBoundaryMesh& bdry = m.boundaryMesh(); labelHashSet patchSet(bdry.size()); forAll (patchNames_, i) { label pID = bdry.findPatchID(patchNames_[i]); if (pID > -1) { patchSet.insert(pID); } }
void Foam::inverseFaceDistanceDiffusivity::correct() { const polyMesh& mesh = mSolver().mesh(); const polyBoundaryMesh& bdry = mesh.boundaryMesh(); labelHashSet patchSet(bdry.size()); label nPatchFaces = 0; forAll (patchNames_, i) { label pID = bdry.findPatchID(patchNames_[i]); if (pID > -1) { patchSet.insert(pID); nPatchFaces += bdry[pID].size(); } }
void Foam::inverseFaceDistanceDiffusivity::correct() { const polyMesh& mesh = mSolver().mesh(); const polyBoundaryMesh& bdry = mesh.boundaryMesh(); labelHashSet patchSet(bdry.size()); label nPatchFaces = 0; forAll(patchNames_, i) { const label pID = bdry.findPatchID(patchNames_[i]); if (pID > -1) { patchSet.insert(pID); nPatchFaces += bdry[pID].size(); } } List<wallPoint> faceDist(nPatchFaces); labelList changedFaces(nPatchFaces); nPatchFaces = 0; forAllConstIter(labelHashSet, patchSet, iter) { const polyPatch& patch = bdry[iter.key()]; const vectorField::subField fc(patch.faceCentres()); forAll(fc, patchFaceI) { changedFaces[nPatchFaces] = patch.start() + patchFaceI; faceDist[nPatchFaces] = wallPoint(fc[patchFaceI], 0); nPatchFaces++; } }
void Foam::inversePointDistanceDiffusivity::correct() { const polyBoundaryMesh& bdry = mesh().boundaryMesh(); labelHashSet patchSet(bdry.patchSet(patchNames_)); label nPatchEdges = 0; forAllConstIter(labelHashSet, patchSet, iter) { nPatchEdges += bdry[iter.key()].nEdges(); } // Distance to wall on points and edges. List<pointEdgePoint> pointWallDist(mesh().nPoints()); List<pointEdgePoint> edgeWallDist(mesh().nEdges()); int dummyTrackData = 0; { // Seeds List<pointEdgePoint> seedInfo(nPatchEdges); labelList seedPoints(nPatchEdges); nPatchEdges = 0; forAllConstIter(labelHashSet, patchSet, iter) { const polyPatch& patch = bdry[iter.key()]; const labelList& meshPoints = patch.meshPoints(); forAll(meshPoints, i) { label pointI = meshPoints[i]; if (!pointWallDist[pointI].valid(dummyTrackData)) { // Not yet seeded seedInfo[nPatchEdges] = pointEdgePoint ( mesh().points()[pointI], 0.0 ); seedPoints[nPatchEdges] = pointI; pointWallDist[pointI] = seedInfo[nPatchEdges]; nPatchEdges++; } } } seedInfo.setSize(nPatchEdges); seedPoints.setSize(nPatchEdges); // Do calculations PointEdgeWave<pointEdgePoint> waveInfo ( mesh(), seedPoints, seedInfo, pointWallDist, edgeWallDist, mesh().globalData().nTotalPoints(),// max iterations dummyTrackData ); }