mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: geometry calculation not implemented.
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user