mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: sampledSet: track on static mesh
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,6 +43,7 @@ namespace Foam
|
|||||||
|
|
||||||
bool Foam::faceOnlySet::trackToBoundary
|
bool Foam::faceOnlySet::trackToBoundary
|
||||||
(
|
(
|
||||||
|
passiveParticleCloud& particleCloud,
|
||||||
passiveParticle& singleParticle,
|
passiveParticle& singleParticle,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
@ -55,7 +56,6 @@ bool Foam::faceOnlySet::trackToBoundary
|
|||||||
const vector smallVec = tol*offset;
|
const vector smallVec = tol*offset;
|
||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
passiveParticleCloud particleCloud(mesh());
|
|
||||||
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
@ -115,8 +115,9 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
const vector smallVec = tol*offset;
|
const vector smallVec = tol*offset;
|
||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
// Force calculation of minimum-tet decomposition.
|
// Force calculation of cloud addressing on all processors
|
||||||
(void) mesh().tetBasePtIs();
|
const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
|
||||||
|
passiveParticleCloud particleCloud(mesh());
|
||||||
|
|
||||||
// Get all boundary intersections
|
// Get all boundary intersections
|
||||||
List<pointIndexHit> bHits = searchEngine().intersections
|
List<pointIndexHit> bHits = searchEngine().intersections
|
||||||
@ -218,6 +219,7 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
|
|
||||||
bool reachedBoundary = trackToBoundary
|
bool reachedBoundary = trackToBoundary
|
||||||
(
|
(
|
||||||
|
particleCloud,
|
||||||
singleParticle,
|
singleParticle,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
samplingCells,
|
samplingCells,
|
||||||
@ -286,6 +288,8 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
|
|
||||||
startSegmentI = samplingPts.size();
|
startSegmentI = samplingPts.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -68,6 +68,7 @@ class faceOnlySet
|
|||||||
// reached
|
// reached
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
|
passiveParticleCloud& particleCloud,
|
||||||
passiveParticle& singleParticle,
|
passiveParticle& singleParticle,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
DynamicList<label>& samplingCells,
|
DynamicList<label>& samplingCells,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,6 +43,7 @@ namespace Foam
|
|||||||
|
|
||||||
bool Foam::polyLineSet::trackToBoundary
|
bool Foam::polyLineSet::trackToBoundary
|
||||||
(
|
(
|
||||||
|
passiveParticleCloud& particleCloud,
|
||||||
passiveParticle& singleParticle,
|
passiveParticle& singleParticle,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
@ -51,7 +52,6 @@ bool Foam::polyLineSet::trackToBoundary
|
|||||||
DynamicList<scalar>& samplingCurveDist
|
DynamicList<scalar>& samplingCurveDist
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
passiveParticleCloud particleCloud(mesh());
|
|
||||||
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
particle::TrackingData<passiveParticleCloud> trackData(particleCloud);
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
@ -157,8 +157,9 @@ void Foam::polyLineSet::calcSamples
|
|||||||
oldPoint = sampleCoords_[sampleI];
|
oldPoint = sampleCoords_[sampleI];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force calculation of minimum-tet decomposition.
|
// Force calculation of cloud addressing on all processors
|
||||||
(void) mesh().tetBasePtIs();
|
const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
|
||||||
|
passiveParticleCloud particleCloud(mesh());
|
||||||
|
|
||||||
// current segment number
|
// current segment number
|
||||||
label segmentI = 0;
|
label segmentI = 0;
|
||||||
@ -267,6 +268,7 @@ void Foam::polyLineSet::calcSamples
|
|||||||
|
|
||||||
bool bReached = trackToBoundary
|
bool bReached = trackToBoundary
|
||||||
(
|
(
|
||||||
|
particleCloud,
|
||||||
singleParticle,
|
singleParticle,
|
||||||
sampleI,
|
sampleI,
|
||||||
samplingPts,
|
samplingPts,
|
||||||
@ -306,6 +308,8 @@ void Foam::polyLineSet::calcSamples
|
|||||||
|
|
||||||
startSegmentI = samplingPts.size();
|
startSegmentI = samplingPts.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -65,6 +65,7 @@ class polyLineSet
|
|||||||
// Returns false if end of samples reached.
|
// Returns false if end of samples reached.
|
||||||
bool trackToBoundary
|
bool trackToBoundary
|
||||||
(
|
(
|
||||||
|
passiveParticleCloud& particleCloud,
|
||||||
passiveParticle& singleParticle,
|
passiveParticle& singleParticle,
|
||||||
label& sampleI,
|
label& sampleI,
|
||||||
DynamicList<point>& samplingPts,
|
DynamicList<point>& samplingPts,
|
||||||
|
|||||||
@ -232,6 +232,7 @@ void Foam::uniformSet::calcSamples
|
|||||||
const scalar smallDist = mag(smallVec);
|
const scalar smallDist = mag(smallVec);
|
||||||
|
|
||||||
// Force calculation of cloud addressing on all processors
|
// Force calculation of cloud addressing on all processors
|
||||||
|
const bool oldMoving = const_cast<polyMesh&>(mesh()).moving(false);
|
||||||
passiveParticleCloud particleCloud(mesh());
|
passiveParticleCloud particleCloud(mesh());
|
||||||
|
|
||||||
// Get all boundary intersections
|
// Get all boundary intersections
|
||||||
@ -383,6 +384,8 @@ void Foam::uniformSet::calcSamples
|
|||||||
|
|
||||||
startSegmentI = samplingPts.size();
|
startSegmentI = samplingPts.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const_cast<polyMesh&>(mesh()).moving(oldMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user