Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
022e4cc6
Commit
022e4cc6
authored
Mar 30, 2010
by
mattijs
Browse files
BUG: geometry calculation not implemented.
parent
89c7523c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
View file @
022e4cc6
...
...
@@ -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;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment