Commit def72acc authored by matti2's avatar matti2

BUG: releaseAreaMapping blocks in parallel (fixes #1)

caused by faMesh::faceAreaNormals() in a loop. Removed from the loop but the underlying finiteArea code (class faMesh) may need more attention.
parent 6adf9536
...@@ -47,6 +47,8 @@ int main(int argc, char *argv[]) ...@@ -47,6 +47,8 @@ int main(int argc, char *argv[])
# include "createFaMesh.H" # include "createFaMesh.H"
areaVectorField c = aMesh.areaCentres(); areaVectorField c = aMesh.areaCentres();
areaVectorField n = aMesh.faceAreaNormals();
IOdictionary releaseArea IOdictionary releaseArea
( (
...@@ -188,7 +190,7 @@ int main(int argc, char *argv[]) ...@@ -188,7 +190,7 @@ int main(int argc, char *argv[])
if (projectNormal) if (projectNormal)
{ {
projection = aMesh.faceAreaNormals()&vector(0, 0, -1); projection = n&vector(0, 0, -1);
} }
points.resize(vertices.size()); points.resize(vertices.size());
...@@ -241,7 +243,7 @@ int main(int argc, char *argv[]) ...@@ -241,7 +243,7 @@ int main(int argc, char *argv[])
if (projectNormal) if (projectNormal)
{ {
projection = aMesh.faceAreaNormals()&vector(0, 0, -1); projection = n&vector(0, 0, -1);
} }
Info << "linear function with" << endl Info << "linear function with" << endl
...@@ -281,7 +283,7 @@ int main(int argc, char *argv[]) ...@@ -281,7 +283,7 @@ int main(int argc, char *argv[])
scalar c_csmag = Foam::mag(c_cs); scalar c_csmag = Foam::mag(c_cs);
if (c_csmag < rad) if (c_csmag < rad)
{ {
scalar cy = -aMesh.faceAreaNormals().internalField()[i] & c_cs; scalar cy = -n[i] & c_cs;
scalar cx = Foam::sqrt(Foam::sqr(Foam::mag(c_cs))-Foam::sqr(cy)); scalar cx = Foam::sqrt(Foam::sqr(Foam::mag(c_cs))-Foam::sqr(cy));
f[i] = scale*(Foam::sqrt(Foam::sqr(rad)-Foam::sqr(cx))-cy); f[i] = scale*(Foam::sqrt(Foam::sqr(rad)-Foam::sqr(cx))-cy);
} }
......
Markdown is supported
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