Closing brace in wrong place, non internalOrBoundaryPoint Dvs asked for

alignment which was uninitialised.
This commit is contained in:
graham
2009-07-11 12:49:34 +01:00
parent 0e8967e654
commit 5f50cd5f29
2 changed files with 48 additions and 51 deletions

View File

@ -59,16 +59,11 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
Info<< nl << "Time = " << runTime.timeName() Info<< nl << "Time = " << runTime.timeName() << endl;
<< endl;
mesh.move(); mesh.move();
runTime++; runTime++;
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< endl;
} }
Info<< nl << "End\n" << endl; Info<< nl << "End\n" << endl;

View File

@ -2100,74 +2100,76 @@ void Foam::conformalVoronoiMesh::move()
} while (++cc != ccStart); } while (++cc != ccStart);
verticesOnFace.shrink(); verticesOnFace.shrink();
}
Cell_handle c = eit->first; Cell_handle c = eit->first;
Vertex_handle vA = c->vertex(eit->second); Vertex_handle vA = c->vertex(eit->second);
Vertex_handle vB = c->vertex(eit->third); Vertex_handle vB = c->vertex(eit->third);
point dVA = topoint(vA->point()); point dVA = topoint(vA->point());
point dVB = topoint(vB->point()); point dVB = topoint(vB->point());
Field<vector> alignmentDirsA = vA->alignment() & cartesianDirections; Field<vector> alignmentDirsA =
Field<vector> alignmentDirsB = vB->alignment() & cartesianDirections; vA->alignment() & cartesianDirections;
Field<vector> alignmentDirsB =
vB->alignment() & cartesianDirections;
Field<vector> alignmentDirs(3); Field<vector> alignmentDirs(3);
forAll(alignmentDirsA, aA) forAll(alignmentDirsA, aA)
{
const vector& a(alignmentDirsA[aA]);
scalar maxDotProduct = 0.0;
forAll(alignmentDirsB, aB)
{ {
const vector& b(alignmentDirsB[aB]); const vector& a(alignmentDirsA[aA]);
scalar dotProduct = a & b; scalar maxDotProduct = 0.0;
if (mag(dotProduct) > maxDotProduct) forAll(alignmentDirsB, aB)
{ {
maxDotProduct = mag(dotProduct); const vector& b(alignmentDirsB[aB]);
alignmentDirs[aA] = a + sign(dotProduct)*b; scalar dotProduct = a & b;
alignmentDirs[aA] /= mag(alignmentDirs[aA]); if (mag(dotProduct) > maxDotProduct)
{
maxDotProduct = mag(dotProduct);
alignmentDirs[aA] = a + sign(dotProduct)*b;
alignmentDirs[aA] /= mag(alignmentDirs[aA]);
}
} }
} }
}
vector rAB = dVA - dVB; vector rAB = dVA - dVB;
scalar rABMag = mag(rAB); scalar rABMag = mag(rAB);
forAll(alignmentDirs, aD) forAll(alignmentDirs, aD)
{
vector& alignmentDir = alignmentDirs[aD];
if ((rAB & alignmentDir) < 0)
{ {
// swap the direction of the alignment so that has the vector& alignmentDir = alignmentDirs[aD];
// same sense as rAB
alignmentDir *= -1;
}
scalar alignmentDotProd = ((rAB/rABMag) & alignmentDir); if ((rAB & alignmentDir) < 0)
{
// swap the direction of the alignment so that has the
// same sense as rAB
alignmentDir *= -1;
}
scalar targetCellSize = scalar alignmentDotProd = ((rAB/rABMag) & alignmentDir);
scalar targetCellSize =
0.5*(vA->targetCellSize() + vB->targetCellSize()); 0.5*(vA->targetCellSize() + vB->targetCellSize());
scalar targetFaceArea = sqr(targetCellSize); scalar targetFaceArea = sqr(targetCellSize);
if if
( (
alignmentDotProd alignmentDotProd
> cvMeshControls().cosAlignmentAcceptanceAngle() > cvMeshControls().cosAlignmentAcceptanceAngle()
) )
{ {
alignmentDir *= 0.5*targetCellSize; alignmentDir *= 0.5*targetCellSize;
vector delta = alignmentDir - 0.5*rAB; vector delta = alignmentDir - 0.5*rAB;
}
} }
} }
} }