Fixed faMeshDecomposition for globalFaceZone faces; added fam::laplacian with specified name

This commit is contained in:
Vanja Skuric 2016-06-05 01:40:44 +02:00
parent bc0dc681ad
commit c5dfd0efb6
3 changed files with 130 additions and 19 deletions

View file

@ -61,27 +61,87 @@ void faMeshDecomposition::distributeFaces()
) )
); );
labelHashSet faceProcAddressingHash // 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
labelIOList // through faceProcAddressing will decompose global faMesh faces to the
( // very last processor regardless of where fvPatch is really decomposed.
IOobject // Since global faces which do not belong to specific processor are
( // located at the end of the faceProcAddressing, cutting it at
"faceProcAddressing", // i = owner.size() will correctly decompose faMesh faces.
"constant", // Vanja Skuric, 2016-04-21
procMesh.meshSubDir, if (decompositionDict_.found("globalFaceZones"))
procMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
)
);
forAll (faceLabels(), faceI)
{ {
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1)) 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)
{ {
faceToProc_[faceI] = procI; faceProcAddressingHash.insert(faceProcAddressing[i]);
}
forAll (faceLabels(), faceI)
{
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1))
{
faceToProc_[faceI] = procI;
}
}
}
else
{
labelHashSet faceProcAddressingHash
(
labelIOList
(
IOobject
(
"faceProcAddressing",
"constant",
procMesh.meshSubDir,
procMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
)
);
forAll (faceLabels(), faceI)
{
if (faceProcAddressingHash.found(faceLabels()[faceI] + 1))
{
faceToProc_[faceI] = procI;
}
} }
} }
} }

View file

@ -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 } // End namespace fam

View file

@ -180,6 +180,23 @@ namespace fam
const tmp<edgeTensorField>&, const tmp<edgeTensorField>&,
const GeometricField<Type, faPatchField, areaMesh>& 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
);
} }