INT: Compatibility updates followinglatest integrations

This commit is contained in:
Andrew Heather
2017-09-05 10:19:09 +01:00
parent 9976caa1c9
commit 065bfa264e
18 changed files with 71 additions and 124 deletions

View File

@ -140,7 +140,7 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking); PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
{ {
// List of lists of particles to be transfered for all of the // List of lists of particles to be transferred for all of the
// neighbour processors // neighbour processors
List<IDLList<passiveParticle>> particleTransferLists List<IDLList<passiveParticle>> particleTransferLists
( (

View File

@ -147,7 +147,7 @@ Foam::autoPtr<Foam::labelIOList> Foam::polyMesh::readTetBasePtIs() const
IOobject::NO_WRITE IOobject::NO_WRITE
); );
if (io.headerOk()) if (io.typeHeaderOk<labelIOList>(true))
{ {
return autoPtr<labelIOList>(new labelIOList(io)); return autoPtr<labelIOList>(new labelIOList(io));
} }

View File

@ -25,7 +25,6 @@ License
#include "barycentric.H" #include "barycentric.H"
#include "Random.H" #include "Random.H"
#include "cachedRandom.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,18 +68,6 @@ Foam::barycentric barycentric01
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::barycentric Foam::barycentric01(Random& rndGen) Foam::barycentric Foam::barycentric01(Random& rndGen)
{
return
::barycentric01
(
rndGen.scalar01(),
rndGen.scalar01(),
rndGen.scalar01()
);
}
Foam::barycentric Foam::barycentric01(cachedRandom& rndGen)
{ {
return return
::barycentric01 ::barycentric01

View File

@ -53,7 +53,6 @@ typedef Barycentric<scalar> barycentric;
//- Generate a random barycentric coordinate within the unit tetrahedron //- Generate a random barycentric coordinate within the unit tetrahedron
barycentric barycentric01(Random& rndGen); barycentric barycentric01(Random& rndGen);
barycentric barycentric01(cachedRandom& rndGen);
template<> template<>

View File

@ -25,7 +25,6 @@ License
#include "barycentric2D.H" #include "barycentric2D.H"
#include "Random.H" #include "Random.H"
#include "cachedRandom.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,17 +50,6 @@ Foam::barycentric2D barycentric2D01
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::barycentric2D Foam::barycentric2D01(Random& rndGen) Foam::barycentric2D Foam::barycentric2D01(Random& rndGen)
{
return
::barycentric2D01
(
rndGen.scalar01(),
rndGen.scalar01()
);
}
Foam::barycentric2D Foam::barycentric2D01(cachedRandom& rndGen)
{ {
return return
::barycentric2D01 ::barycentric2D01

View File

@ -53,7 +53,6 @@ typedef Barycentric2D<scalar> barycentric2D;
//- Generate a random barycentric coordinate within the unit triangle //- Generate a random barycentric coordinate within the unit triangle
barycentric2D barycentric2D01(Random& rndGen); barycentric2D barycentric2D01(Random& rndGen);
barycentric2D barycentric2D01(cachedRandom& rndGen);
template<> template<>

View File

@ -39,6 +39,7 @@ Description
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#include "tetIndices.H" #include "tetIndices.H"
#include "barycentric.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,6 +25,13 @@ streamLine/streamLineBase.C
streamLine/streamLineParticle.C streamLine/streamLineParticle.C
streamLine/streamLineParticleCloud.C streamLine/streamLineParticleCloud.C
/*
wallBoundedStreamLine/wallBoundedStreamLine.C
wallBoundedStreamLine/wallBoundedStreamLineParticle.C
wallBoundedStreamLine/wallBoundedStreamLineParticleCloud.C
wallBoundedStreamLine/wallBoundedParticle.C
*/
surfaceInterpolate/surfaceInterpolate.C surfaceInterpolate/surfaceInterpolate.C
regionSizeDistribution/regionSizeDistribution.C regionSizeDistribution/regionSizeDistribution.C

View File

@ -36,7 +36,7 @@ inline Foam::injectedParticle::injectedParticle
const vector& U const vector& U
) )
: :
particle(mesh, position, -1, false), particle(mesh, position, -1),
tag_(tag), tag_(tag),
soi_(soi), soi_(soi),
d_(d), d_(d),

View File

@ -88,7 +88,7 @@ class particle
// Private member data // Private member data
//- Size in bytes of the position data //- Size in bytes of the position data
static const std::size_t sizeofPosition_; static const std::size_t sizeofPosition;
//- Size in bytes of the fields //- Size in bytes of the fields
static const std::size_t sizeofFields; static const std::size_t sizeofFields;
@ -180,8 +180,6 @@ private:
label origId_; label origId_;
private:
// Private Member Functions // Private Member Functions
// Tetrahedra functions // Tetrahedra functions
@ -197,8 +195,8 @@ private:
//- Get the transformation associated with the current tet. This //- Get the transformation associated with the current tet. This
// will convert a barycentric position within the tet to a // will convert a barycentric position within the tet to a
// cartesian position in the global coordinate system. The // Cartesian position in the global coordinate system. The
// conversion is x = A & y, where x is the cartesian position, y is // conversion is x = A & y, where x is the Cartesian position, y is
// the barycentric position and A is the transformation tensor. // the barycentric position and A is the transformation tensor.
barycentricTensor stationaryTetTransform() const; barycentricTensor stationaryTetTransform() const;
@ -398,7 +396,7 @@ public:
"{vector label label scalar label label label label}" "{vector label label scalar label label label label}"
); );
//- Cumulative particle counter - used to provode unique ID //- Cumulative particle counter - used to provide unique ID
static label particleCount_; static label particleCount_;
@ -429,7 +427,7 @@ public:
//- Construct as a copy //- Construct as a copy
particle(const particle& p); particle(const particle& p);
//- Construct as a copy with refernce to a new mesh //- Construct as a copy with reference to a new mesh
particle(const particle& p, const polyMesh& mesh); particle(const particle& p, const polyMesh& mesh);
//- Construct a clone //- Construct a clone
@ -610,7 +608,7 @@ public:
TrackData& td TrackData& td
); );
//- Convenience function. Cobines trackToFace and hitFace //- Convenience function. Combines trackToFace and hitFace
template<class TrackData> template<class TrackData>
void trackToAndHitFace void trackToAndHitFace
( (
@ -674,7 +672,7 @@ public:
// Decompose and reconstruct // Decompose and reconstruct
//- Return the tet point approproate for decomposition or reconstruction //- Return the tet point appropriate for decomposition or reconstruction
// to or from the given mesh. // to or from the given mesh.
label procTetPt label procTetPt
( (

View File

@ -31,7 +31,7 @@ License
Foam::string Foam::particle::propertyList_ = Foam::particle::propertyList(); Foam::string Foam::particle::propertyList_ = Foam::particle::propertyList();
Foam::string Foam::particle::propertyTypes_ = Foam::particle::propertyTypes(); Foam::string Foam::particle::propertyTypes_ = Foam::particle::propertyTypes();
const std::size_t Foam::particle::sizeofPosition_ const std::size_t Foam::particle::sizeofPosition
( (
offsetof(particle, facei_) - offsetof(particle, coordinates_) offsetof(particle, facei_) - offsetof(particle, coordinates_)
); );
@ -69,11 +69,11 @@ Foam::particle::particle(const polyMesh& mesh, Istream& is, bool readFields)
{ {
if (readFields) if (readFields)
{ {
is.read(reinterpret_cast<char*>(&coordinates_), sizeofFields_); is.read(reinterpret_cast<char*>(&coordinates_), sizeofFields);
} }
else else
{ {
is.read(reinterpret_cast<char*>(&coordinates_), sizeofPosition_); is.read(reinterpret_cast<char*>(&coordinates_), sizeofPosition);
} }
} }
@ -93,7 +93,7 @@ void Foam::particle::writePosition(Ostream& os) const
} }
else else
{ {
os.write(reinterpret_cast<const char*>(&coordinates_), sizeofPosition_); os.write(reinterpret_cast<const char*>(&coordinates_), sizeofPosition);
} }
// Check state of Ostream // Check state of Ostream
@ -119,7 +119,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const particle& p)
os.write os.write
( (
reinterpret_cast<const char*>(&p.coordinates_), reinterpret_cast<const char*>(&p.coordinates_),
particle::sizeofFields_ particle::sizeofFields
); );
} }

View File

@ -168,17 +168,12 @@ void Foam::particle::writeObjects(const CloudType& c, objectRegistry& obr)
{ {
label np = c.size(); label np = c.size();
IOField<vector>& position
(
cloud::createIOField<vector>("position", np, obr)
);
IOField<label>& origProc(cloud::createIOField<label>("origProc", np, obr)); IOField<label>& origProc(cloud::createIOField<label>("origProc", np, obr));
IOField<label>& origId(cloud::createIOField<label>("origId", np, obr)); IOField<label>& origId(cloud::createIOField<label>("origId", np, obr));
label i = 0; label i = 0;
forAllConstIter(typename CloudType, c, iter) forAllConstIter(typename CloudType, c, iter)
{ {
position[i] = iter().position_;
origProc[i] = iter().origProc_; origProc[i] = iter().origProc_;
origId[i] = iter().origId_; origId[i] = iter().origId_;
i++; i++;

View File

@ -267,6 +267,7 @@ bool Foam::KinematicParcel<ParcelType>::move
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const cloudSolution& solution = td.cloud().solution(); const cloudSolution& solution = td.cloud().solution();
const scalarField& cellLengthScale = td.cloud().cellLengthScale(); const scalarField& cellLengthScale = td.cloud().cellLengthScale();
const scalar maxCo = solution.maxCo();
while (td.keepParticle && !td.switchProcessor && p.stepFraction() < 1) while (td.keepParticle && !td.switchProcessor && p.stepFraction() < 1)
{ {

View File

@ -72,8 +72,11 @@ void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
{ {
this->Uc_ += td.cloud().UTrans()[celli]/this->massCell(celli); this->Uc_ += td.cloud().UTrans()[celli]/this->massCell(celli);
tetIndices tetIs = this->currentTetIndices(); // tetIndices tetIs = this->currentTetIndices();
Tc_ = td.TInterp().interpolate(this->position(), tetIs); // Tc_ = td.TInterp().interpolate(this->coordinates(), tetIs);
const scalar CpMean = td.CpInterp().psi()[celli];
Tc_ += td.cloud().hsTrans()[celli]/(CpMean*this->massCell(celli));
if (Tc_ < td.cloud().constProps().TMin()) if (Tc_ < td.cloud().constProps().TMin())
{ {

View File

@ -122,13 +122,12 @@ Foam::forceSuSp Foam::InterfaceForce<CloudType>::calcNonCoupled
{ {
forceSuSp value(vector::zero, 0.0); forceSuSp value(vector::zero, 0.0);
const interpolation<vector>& gradInterForceInterp = const interpolation<vector>& interp = gradInterForceInterpPtr_();
gradInterForceInterpPtr_();
value.Su()= value.Su() =
C_ C_
*mass *mass
*gradInterForceInterp.interpolate(p.position(), p.currentTetIndices()); *interp.interpolate(p.coordinates(), p.currentTetIndices());
return value; return value;
} }

View File

@ -3,7 +3,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) 2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,6 +27,7 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "triSurface.H" #include "triSurface.H"
#include "triSurfaceSearch.H" #include "triSurfaceSearch.H"
#include "barycentric2D.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -115,9 +116,7 @@ point offsetSurface::operator()
const triSurface& base = baseSurfPtr_(); const triSurface& base = baseSurfPtr_();
const triPointRef baseTri(base[triI].tri(base.points())); const triPointRef baseTri(base[triI].tri(base.points()));
const barycentric2D bary = baseTri.pointToBarycentric(surfacePoint);
FixedList<scalar, 3> bary;
baseTri.barycentric(surfacePoint, bary);
const triSurface& offset = offsetSurfPtr_(); const triSurface& offset = offsetSurfPtr_();
const triPointRef offsetTri(offset[triI].tri(offset.points())); const triPointRef offsetTri(offset[triI].tri(offset.points()));
@ -125,8 +124,8 @@ point offsetSurface::operator()
const point offsetPoint const point offsetPoint
( (
bary[0]*offsetTri.a() bary[0]*offsetTri.a()
+bary[1]*offsetTri.b() + bary[1]*offsetTri.b()
+bary[2]*offsetTri.c() + bary[2]*offsetTri.c()
); );
point interpolatedPoint point interpolatedPoint

View File

@ -346,20 +346,18 @@ void Foam::meshRefinement::markFeatureCellLevel
// what to seed. Do this on only the processor that // what to seed. Do this on only the processor that
// holds the keepPoint. // holds the keepPoint.
forAll(keepPoints, i) for (const point& keepPoint : keepPoints)
{ {
const point& keepPoint = keepPoints[i];
const label celli = mesh_.cellTree().findInside(keepPoint); const label celli = mesh_.cellTree().findInside(keepPoint);
if (cellI != -1) if (celli != -1)
{ {
// I am the processor that holds the keepPoint // I am the processor that holds the keepPoint
forAll(features_, featI) forAll(features_, feati)
{ {
const edgeMesh& featureMesh = features_[featI]; const edgeMesh& featureMesh = features_[feati];
const label featureLevel = features_.levels()[featI][0]; const label featureLevel = features_.levels()[feati][0];
const labelListList& pointEdges = featureMesh.pointEdges(); const labelListList& pointEdges = featureMesh.pointEdges();
// Find regions on edgeMesh // Find regions on edgeMesh
@ -373,16 +371,16 @@ void Foam::meshRefinement::markFeatureCellLevel
// 1. Seed all 'knots' in edgeMesh // 1. Seed all 'knots' in edgeMesh
forAll(pointEdges, pointI) forAll(pointEdges, pointi)
{ {
if (pointEdges[pointI].size() != 2) if (pointEdges[pointi].size() != 2)
{ {
if (debug&meshRefinement::FEATURESEEDS) if (debug&meshRefinement::FEATURESEEDS)
{ {
Pout<< "Adding particle from point:" << pointI Pout<< "Adding particle from point:" << pointi
<< " coord:" << featureMesh.points()[pointI] << " coord:" << featureMesh.points()[pointi]
<< " since number of emanating edges:" << " since number of emanating edges:"
<< pointEdges[pointI].size() << pointEdges[pointi].size()
<< endl; << endl;
} }
@ -393,28 +391,21 @@ void Foam::meshRefinement::markFeatureCellLevel
( (
mesh_, mesh_,
keepPoint, keepPoint,
<<<<<<< HEAD
cellI,
tetFaceI,
tetPtI,
featureMesh.points()[pointI], // endpos
=======
celli, celli,
featureMesh.points()[pointi], // endpos featureMesh.points()[pointi], // endpos
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
featureLevel, // level featureLevel, // level
featI, // featureMesh feati, // featureMesh
pointI, // end point pointi, // end point
-1 // feature edge -1 // feature edge
) )
); );
// Mark // Mark
if (pointEdges[pointI].size() > 0) if (pointEdges[pointi].size() > 0)
{ {
label e0 = pointEdges[pointI][0]; label e0 = pointEdges[pointi][0];
label regionI = edgeRegion[e0]; label regioni = edgeRegion[e0];
regionVisited[regionI] = 1u; regionVisited[regioni] = 1u;
} }
} }
} }
@ -422,17 +413,17 @@ void Foam::meshRefinement::markFeatureCellLevel
// 2. Any regions that have not been visited at all? These can // 2. Any regions that have not been visited at all? These can
// only be circular regions! // only be circular regions!
forAll(featureMesh.edges(), edgeI) forAll(featureMesh.edges(), edgei)
{ {
if (regionVisited.set(edgeRegion[edgeI], 1u)) if (regionVisited.set(edgeRegion[edgei], 1u))
{ {
const edge& e = featureMesh.edges()[edgeI]; const edge& e = featureMesh.edges()[edgei];
label pointI = e.start(); label pointi = e.start();
if (debug&meshRefinement::FEATURESEEDS) if (debug&meshRefinement::FEATURESEEDS)
{ {
Pout<< "Adding particle from point:" << pointI Pout<< "Adding particle from point:" << pointi
<< " coord:" << featureMesh.points()[pointI] << " coord:" << featureMesh.points()[pointi]
<< " on circular region:" << edgeRegion[edgeI] << " on circular region:" << edgeRegion[edgei]
<< endl; << endl;
} }
@ -443,18 +434,11 @@ void Foam::meshRefinement::markFeatureCellLevel
( (
mesh_, mesh_,
keepPoint, keepPoint,
<<<<<<< HEAD
cellI,
tetFaceI,
tetPtI,
featureMesh.points()[pointI], // endpos
=======
celli, celli,
featureMesh.points()[pointi], // endpos featureMesh.points()[pointi], // endpos
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
featureLevel, // level featureLevel, // level
featI, // featureMesh feati, // featureMesh
pointI, // end point pointi, // end point
-1 // feature edge -1 // feature edge
) )
); );
@ -541,17 +525,12 @@ void Foam::meshRefinement::markFeatureCellLevel
// on the edge. // on the edge.
const edge& e = featureMesh.edges()[edgeI]; const edge& e = featureMesh.edges()[edgeI];
label otherPointI = e.otherVertex(pointI); label otherPointi = e.otherVertex(pointI);
trackedParticle* tp(new trackedParticle(startTp)); trackedParticle* tp(new trackedParticle(startTp));
<<<<<<< HEAD
tp->end() = featureMesh.points()[otherPointI];
tp->j() = otherPointI;
=======
tp->start() = tp->position(); tp->start() = tp->position();
tp->end() = featureMesh.points()[otherPointi]; tp->end() = featureMesh.points()[otherPointi];
tp->j() = otherPointi; tp->j() = otherPointi;
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
tp->k() = edgeI; tp->k() = edgeI;
if (debug&meshRefinement::FEATURESEEDS) if (debug&meshRefinement::FEATURESEEDS)
@ -608,16 +587,11 @@ void Foam::meshRefinement::markFeatureCellLevel
// on the edge. // on the edge.
const edge& e = featureMesh.edges()[edgeI]; const edge& e = featureMesh.edges()[edgeI];
label otherPointI = e.otherVertex(pointI); label otherPointi = e.otherVertex(pointI);
<<<<<<< HEAD
tp.end() = featureMesh.points()[otherPointI];
tp.j() = otherPointI;
=======
tp.start() = tp.position(); tp.start() = tp.position();
tp.end() = featureMesh.points()[otherPointi]; tp.end() = featureMesh.points()[otherPointi];
tp.j() = otherPointi; tp.j() = otherPointi;
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
tp.k() = edgeI; tp.k() = edgeI;
keepParticle = true; keepParticle = true;
break; break;

View File

@ -1235,19 +1235,16 @@ void Foam::isoSurface::trimToBox
{ {
dynInterpolatedPoints.append(pointI); dynInterpolatedPoints.append(pointI);
FixedList<label, 3> oldPoints; FixedList<label, 3> oldPoints
oldPoints[0] = 3*oldTriI; (
oldPoints[1] = 3*oldTriI+1; {3*oldTriI, 3*oldTriI+1, 3*oldTriI+2}
oldPoints[2] = 3*oldTriI+2; );
dynInterpolatedOldPoints.append(oldPoints); dynInterpolatedOldPoints.append(oldPoints);
triPointRef tri(oldTriPoints, oldPoints); triPointRef tri(oldTriPoints, oldPoints);
FixedList<scalar, 3> bary; barycentric2D bary = tri.pointToBarycentric(pt);
tri.barycentric(pt, bary); FixedList<scalar, 3> weights({bary.a(), bary.b(), bary.c()});
FixedList<scalar, 3> weights;
weights[0] = bary[0];
weights[1] = bary[1];
weights[2] = bary[2];
dynInterpolationWeights.append(weights); dynInterpolationWeights.append(weights);
} }
} }