Commit ce5d08c5 authored by sergio's avatar sergio
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents 6d22f299 11fbada5
......@@ -95,8 +95,8 @@ Foam::label Foam::mergePoints
sortedTol[sortI] =
2*mergeTol*
(
mag(scalar(pt.x() - compareOrigin.x())),
+ mag(scalar(pt.y() - compareOrigin.y())),
mag(scalar(pt.x() - compareOrigin.x()))
+ mag(scalar(pt.y() - compareOrigin.y()))
+ mag(scalar(pt.z() - compareOrigin.z()))
);
}
......
......@@ -232,6 +232,39 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
{
// Negative tet volume. Track back by setting the end point
projectedEndPosition = position() - (endPosition-position());
// Make sure to use a large enough vector to cross the negative
// face. Bit overkill.
const vector d(endPosition-position());
const scalar magD(mag(d));
if (magD > ROOTVSMALL)
{
// Get overall mesh bounding box
treeBoundBox meshBb(mesh_.bounds());
// Extend to make 3D
meshBb.inflate(ROOTSMALL);
// Create vector guaranteed to cross mesh bounds
projectedEndPosition = position()-meshBb.mag()*d/magD;
// Clip to mesh bounds
point intPt;
direction intPtBits;
bool ok = meshBb.intersects
(
projectedEndPosition,
position()-projectedEndPosition,
projectedEndPosition,
position(),
intPt,
intPtBits
);
if (ok)
{
// Should always be the case
projectedEndPosition = intPt;
}
}
}
// Remove normal component
......
......@@ -190,7 +190,7 @@ void Foam::fieldToCell::applyToSet
false
);
// Note: should check for volScalarField but that introduces depencendy
// Note: should check for volScalarField but that introduces dependency
// on volMesh so just use another type with processor-local scope
if (!fieldObject.typeHeaderOk<labelIOList>(false))
{
......@@ -198,6 +198,9 @@ void Foam::fieldToCell::applyToSet
<< "Cannot read field " << fieldName_
<< " from time " << mesh().time().timeName() << endl;
}
// Note: should use volScalarField::typeName instead below
// but that would introduce linkage problems (finiteVolume needs
// meshTools)
else if (fieldObject.headerClassName() == "volScalarField")
{
IFstream str(typeFilePath<labelIOList>(fieldObject));
......
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