mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Initial state after latest Foundation merge
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -98,16 +98,16 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh)
|
||||
// Set zero value at the start of the tri area list
|
||||
triMagSf.append(0.0);
|
||||
|
||||
forAll(patch, faceI)
|
||||
forAll(patch, facei)
|
||||
{
|
||||
const face& f = patch[faceI];
|
||||
const face& f = patch[facei];
|
||||
|
||||
tris.clear();
|
||||
f.triangles(points, tris);
|
||||
|
||||
forAll(tris, i)
|
||||
{
|
||||
triToFace.append(faceI);
|
||||
triToFace.append(facei);
|
||||
triFace.append(tris[i]);
|
||||
triMagSf.append(tris[i].mag(points));
|
||||
}
|
||||
@ -152,37 +152,30 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
cachedRandom& rnd,
|
||||
vector& position,
|
||||
label& cellOwner,
|
||||
label& tetFaceI,
|
||||
label& tetPtI
|
||||
label& tetFacei,
|
||||
label& tetPti
|
||||
)
|
||||
{
|
||||
scalar areaFraction = 0;
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
areaFraction = rnd.position<scalar>(0, patchArea_);
|
||||
}
|
||||
|
||||
Pstream::scatter(areaFraction);
|
||||
scalar areaFraction = rnd.globalPosition(scalar(0), patchArea_);
|
||||
|
||||
if (cellOwners_.size() > 0)
|
||||
{
|
||||
// Determine which processor to inject from
|
||||
label procI = 0;
|
||||
label proci = 0;
|
||||
forAllReverse(sumTriMagSf_, i)
|
||||
{
|
||||
if (areaFraction >= sumTriMagSf_[i])
|
||||
{
|
||||
procI = i;
|
||||
proci = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Pstream::myProcNo() == procI)
|
||||
if (Pstream::myProcNo() == proci)
|
||||
{
|
||||
// Find corresponding decomposed face triangle
|
||||
label triI = 0;
|
||||
scalar offset = sumTriMagSf_[procI];
|
||||
scalar offset = sumTriMagSf_[proci];
|
||||
forAllReverse(triCumulativeMagSf_, i)
|
||||
{
|
||||
if (areaFraction > triCumulativeMagSf_[i] + offset)
|
||||
@ -193,8 +186,8 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
}
|
||||
|
||||
// Set cellOwner
|
||||
label faceI = triToFace_[triI];
|
||||
cellOwner = cellOwners_[faceI];
|
||||
label facei = triToFace_[triI];
|
||||
cellOwner = cellOwners_[facei];
|
||||
|
||||
// Find random point in triangle
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchId_];
|
||||
@ -206,7 +199,7 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
// Position perturbed away from face (into domain)
|
||||
const scalar a = rnd.position(scalar(0.1), scalar(0.5));
|
||||
const vector& pc = mesh.cellCentres()[cellOwner];
|
||||
const vector d = mag(pf - pc)*patchNormal_[faceI];
|
||||
const vector d = mag(pf - pc)*patchNormal_[facei];
|
||||
|
||||
position = pf - a*d;
|
||||
|
||||
@ -233,8 +226,8 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
else
|
||||
{
|
||||
cellOwner = -1;
|
||||
tetFaceI = -1;
|
||||
tetPtI = -1;
|
||||
tetFacei = -1;
|
||||
tetPti = -1;
|
||||
|
||||
// Dummy position
|
||||
position = pTraits<vector>::max;
|
||||
@ -243,8 +236,8 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
else
|
||||
{
|
||||
cellOwner = -1;
|
||||
tetFaceI = -1;
|
||||
tetPtI = -1;
|
||||
tetFacei = -1;
|
||||
tetPti = -1;
|
||||
|
||||
// Dummy position
|
||||
position = pTraits<vector>::max;
|
||||
|
||||
Reference in New Issue
Block a user