Commit 13b458eb authored by mattijs's avatar mattijs
Browse files

BUG: timeVaryingMappedFixedValue : find furthest away point

parent d31d652d
......@@ -261,17 +261,16 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::readSamplePoints()
for (label i = 1; i < samplePoints.size(); i++)
{
e1 = samplePoints[i] - p0;
scalar magE1 = mag(e1);
const vector d = samplePoints[i] - p0;
scalar magD = mag(d);
if (magE1 > maxDist)
if (magD > maxDist)
{
e1 /= magE1;
e1 = d/magD;
index1 = i;
maxDist = magE1;
maxDist = magD;
}
}
e1 = samplePoints[index1] - p0;
// Find point that is furthest away from line p0-p1
const point& p1 = samplePoints[index1];
......
Supports Markdown
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