Skip to content
Snippets Groups Projects
Commit 022e4cc6 authored by mattijs's avatar mattijs
Browse files

BUG: geometry calculation not implemented.

parent 89c7523c
Branches
Tags
No related merge requests found
......@@ -188,15 +188,70 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs)
//Pout<< "processorPolyPatch::calcGeometry() : received data for "
// << neighbFaceCentres_.size() << " faces." << endl;
calcGeometry
// My normals
vectorField faceNormals(size());
// Neighbour normals
vectorField nbrFaceNormals(neighbFaceAreas_.size());
// Calculate normals from areas and check
forAll(faceNormals, facei)
{
scalar magSf = mag(faceAreas()[facei]);
scalar nbrMagSf = mag(neighbFaceAreas_[facei]);
scalar avSf = (magSf + nbrMagSf)/2.0;
if (magSf < ROOTVSMALL && nbrMagSf < ROOTVSMALL)
{
// Undetermined normal. Use dummy normal to force separation
// check. (note use of sqrt(VSMALL) since that is how mag
// scales)
faceNormals[facei] = point(1, 0, 0);
nbrFaceNormals[facei] = faceNormals[facei];
}
else if (mag(magSf - nbrMagSf)/avSf > coupledPolyPatch::matchTol)
{
fileName nm
(
boundaryMesh().mesh().time().path()
/name()+"_faces.obj"
);
Pout<< "processorPolyPatch::order : Writing my " << size()
<< " faces to OBJ file " << nm << endl;
writeOBJ(nm, *this, points());
FatalErrorIn
(
"processorPolyPatch::calcGeometry()"
) << "face " << facei << " area does not match neighbour by "
<< 100*mag(magSf - nbrMagSf)/avSf
<< "% -- possible face ordering problem." << endl
<< "patch:" << name()
<< " my area:" << magSf
<< " neighbour area:" << nbrMagSf
<< " matching tolerance:" << coupledPolyPatch::matchTol
<< endl
<< "Mesh face:" << start()+facei
<< " vertices:"
<< UIndirectList<point>(points(), operator[](facei))()
<< endl
<< "Rerun with processor debug flag set for"
<< " more information." << exit(FatalError);
}
else
{
faceNormals[facei] = faceAreas()[facei]/magSf;
nbrFaceNormals[facei] = neighbFaceAreas_[facei]/nbrMagSf;
}
}
calcTransformTensors
(
*this,
faceCentres(),
faceAreas(),
faceCellCentres()(),
neighbFaceCentres_,
neighbFaceAreas_,
neighbFaceCellCentres_
faceNormals,
nbrFaceNormals,
calcFaceTol(*this, points(), faceCentres())
);
//Pout<< "**neighbFaceCentres_:" << neighbFaceCentres_ << endl;
//Pout<< "**neighbFaceAreas_:" << neighbFaceAreas_ << endl;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment