Fixed faMeshDecomposition for globalFaceZone faces; added fam::laplacian with specified name
This commit is contained in:
parent
bc0dc681ad
commit
c5dfd0efb6
3 changed files with 130 additions and 19 deletions
|
@ -61,6 +61,65 @@ void faMeshDecomposition::distributeFaces()
|
|||
)
|
||||
);
|
||||
|
||||
// If faMesh's fvPatch is a part of the global face zones, faces of that
|
||||
// patch will be present on all processors. Because of that, looping
|
||||
// through faceProcAddressing will decompose global faMesh faces to the
|
||||
// very last processor regardless of where fvPatch is really decomposed.
|
||||
// Since global faces which do not belong to specific processor are
|
||||
// located at the end of the faceProcAddressing, cutting it at
|
||||
// i = owner.size() will correctly decompose faMesh faces.
|
||||
// Vanja Skuric, 2016-04-21
|
||||
if (decompositionDict_.found("globalFaceZones"))
|
||||
{
|
||||
labelList faceProcAddressing
|
||||
(
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
"constant",
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const label ownerSize =
|
||||
(
|
||||
labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"owner",
|
||||
"constant",
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
).size();
|
||||
|
||||
labelHashSet faceProcAddressingHash(ownerSize);
|
||||
|
||||
for (int i = 0; i < ownerSize; ++i)
|
||||
{
|
||||
faceProcAddressingHash.insert(faceProcAddressing[i]);
|
||||
}
|
||||
|
||||
forAll (faceLabels(), faceI)
|
||||
{
|
||||
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1))
|
||||
{
|
||||
faceToProc_[faceI] = procI;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
labelHashSet faceProcAddressingHash
|
||||
(
|
||||
labelIOList
|
||||
|
@ -85,6 +144,7 @@ void faMeshDecomposition::distributeFaces()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nFinished decomposition in "
|
||||
<< decompositionTime.elapsedCpuTime()
|
||||
|
|
|
@ -329,6 +329,40 @@ laplacian
|
|||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const edgeTensorField& gamma,
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf,
|
||||
const word& name
|
||||
)
|
||||
{
|
||||
const faMesh& mesh = vf.mesh();
|
||||
|
||||
return fam::laplacian
|
||||
(
|
||||
(mesh.Le() & gamma & mesh.Le())/sqr(mesh.magLe()),
|
||||
vf,
|
||||
name
|
||||
);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> >
|
||||
laplacian
|
||||
(
|
||||
const tmp<edgeTensorField>& tgamma,
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf,
|
||||
const word& name
|
||||
)
|
||||
{
|
||||
tmp<faMatrix<Type> > Laplacian = fam::laplacian(tgamma(), vf, name);
|
||||
tgamma.clear();
|
||||
return Laplacian;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fam
|
||||
|
|
|
@ -180,6 +180,23 @@ namespace fam
|
|||
const tmp<edgeTensorField>&,
|
||||
const GeometricField<Type, faPatchField, areaMesh>&
|
||||
);
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> > laplacian
|
||||
(
|
||||
const edgeTensorField&,
|
||||
const GeometricField<Type, faPatchField, areaMesh>&,
|
||||
const word& name
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
tmp<faMatrix<Type> > laplacian
|
||||
(
|
||||
const tmp<edgeTensorField>&,
|
||||
const GeometricField<Type, faPatchField, areaMesh>&,
|
||||
const word& name
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
Reference in a new issue