Commit 065bfa26 authored by Andrew Heather's avatar Andrew Heather
Browse files

INT: Compatibility updates followinglatest integrations

parent 9976caa1
......@@ -140,7 +140,7 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
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
List<IDLList<passiveParticle>> particleTransferLists
(
......
......@@ -147,7 +147,7 @@ Foam::autoPtr<Foam::labelIOList> Foam::polyMesh::readTetBasePtIs() const
IOobject::NO_WRITE
);
if (io.headerOk())
if (io.typeHeaderOk<labelIOList>(true))
{
return autoPtr<labelIOList>(new labelIOList(io));
}
......
......@@ -25,7 +25,6 @@ License
#include "barycentric.H"
#include "Random.H"
#include "cachedRandom.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -69,18 +68,6 @@ Foam::barycentric barycentric01
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::barycentric Foam::barycentric01(Random& rndGen)
{
return
::barycentric01
(
rndGen.scalar01(),
rndGen.scalar01(),
rndGen.scalar01()
);
}
Foam::barycentric Foam::barycentric01(cachedRandom& rndGen)
{
return
::barycentric01
......
......@@ -53,7 +53,6 @@ typedef Barycentric<scalar> barycentric;
//- Generate a random barycentric coordinate within the unit tetrahedron
barycentric barycentric01(Random& rndGen);
barycentric barycentric01(cachedRandom& rndGen);
template<>
......
......@@ -25,7 +25,6 @@ License
#include "barycentric2D.H"
#include "Random.H"
#include "cachedRandom.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -51,17 +50,6 @@ Foam::barycentric2D barycentric2D01
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::barycentric2D Foam::barycentric2D01(Random& rndGen)
{
return
::barycentric2D01
(
rndGen.scalar01(),
rndGen.scalar01()
);
}
Foam::barycentric2D Foam::barycentric2D01(cachedRandom& rndGen)
{
return
::barycentric2D01
......
......@@ -53,7 +53,6 @@ typedef Barycentric2D<scalar> barycentric2D;
//- Generate a random barycentric coordinate within the unit triangle
barycentric2D barycentric2D01(Random& rndGen);
barycentric2D barycentric2D01(cachedRandom& rndGen);
template<>
......
......@@ -39,6 +39,7 @@ Description
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "tetIndices.H"
#include "barycentric.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -25,6 +25,13 @@ streamLine/streamLineBase.C
streamLine/streamLineParticle.C
streamLine/streamLineParticleCloud.C
/*
wallBoundedStreamLine/wallBoundedStreamLine.C
wallBoundedStreamLine/wallBoundedStreamLineParticle.C
wallBoundedStreamLine/wallBoundedStreamLineParticleCloud.C
wallBoundedStreamLine/wallBoundedParticle.C
*/
surfaceInterpolate/surfaceInterpolate.C
regionSizeDistribution/regionSizeDistribution.C
......
......@@ -36,7 +36,7 @@ inline Foam::injectedParticle::injectedParticle
const vector& U
)
:
particle(mesh, position, -1, false),
particle(mesh, position, -1),
tag_(tag),
soi_(soi),
d_(d),
......
......@@ -88,7 +88,7 @@ class particle
// Private member 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
static const std::size_t sizeofFields;
......@@ -180,8 +180,6 @@ private:
label origId_;
private:
// Private Member Functions
// Tetrahedra functions
......@@ -197,8 +195,8 @@ private:
//- Get the transformation associated with the current tet. This
// will convert a barycentric position within the tet to a
// cartesian position in the global coordinate system. The
// conversion is x = A & y, where x is the cartesian position, y is
// Cartesian position in the global coordinate system. The
// conversion is x = A & y, where x is the Cartesian position, y is
// the barycentric position and A is the transformation tensor.
barycentricTensor stationaryTetTransform() const;
......@@ -398,7 +396,7 @@ public:
"{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_;
......@@ -429,7 +427,7 @@ public:
//- Construct as a copy
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);
//- Construct a clone
......@@ -610,7 +608,7 @@ public:
TrackData& td
);
//- Convenience function. Cobines trackToFace and hitFace
//- Convenience function. Combines trackToFace and hitFace
template<class TrackData>
void trackToAndHitFace
(
......@@ -674,7 +672,7 @@ public:
// 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.
label procTetPt
(
......
......@@ -31,7 +31,7 @@ License
Foam::string Foam::particle::propertyList_ = Foam::particle::propertyList();
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_)
);
......@@ -69,11 +69,11 @@ Foam::particle::particle(const polyMesh& mesh, Istream& is, bool readFields)
{
if (readFields)
{
is.read(reinterpret_cast<char*>(&coordinates_), sizeofFields_);
is.read(reinterpret_cast<char*>(&coordinates_), sizeofFields);
}
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
{
os.write(reinterpret_cast<const char*>(&coordinates_), sizeofPosition_);
os.write(reinterpret_cast<const char*>(&coordinates_), sizeofPosition);
}
// Check state of Ostream
......@@ -119,7 +119,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const particle& p)
os.write
(
reinterpret_cast<const char*>(&p.coordinates_),
particle::sizeofFields_
particle::sizeofFields
);
}
......
......@@ -168,17 +168,12 @@ void Foam::particle::writeObjects(const CloudType& c, objectRegistry& obr)
{
label np = c.size();
IOField<vector>& position
(
cloud::createIOField<vector>("position", np, obr)
);
IOField<label>& origProc(cloud::createIOField<label>("origProc", np, obr));
IOField<label>& origId(cloud::createIOField<label>("origId", np, obr));
label i = 0;
forAllConstIter(typename CloudType, c, iter)
{
position[i] = iter().position_;
origProc[i] = iter().origProc_;
origId[i] = iter().origId_;
i++;
......
......@@ -267,6 +267,7 @@ bool Foam::KinematicParcel<ParcelType>::move
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const cloudSolution& solution = td.cloud().solution();
const scalarField& cellLengthScale = td.cloud().cellLengthScale();
const scalar maxCo = solution.maxCo();
while (td.keepParticle && !td.switchProcessor && p.stepFraction() < 1)
{
......
......@@ -72,8 +72,11 @@ void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
{
this->Uc_ += td.cloud().UTrans()[celli]/this->massCell(celli);
tetIndices tetIs = this->currentTetIndices();
Tc_ = td.TInterp().interpolate(this->position(), tetIs);
// tetIndices tetIs = this->currentTetIndices();
// 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())
{
......
......@@ -122,13 +122,12 @@ Foam::forceSuSp Foam::InterfaceForce<CloudType>::calcNonCoupled
{
forceSuSp value(vector::zero, 0.0);
const interpolation<vector>& gradInterForceInterp =
gradInterForceInterpPtr_();
const interpolation<vector>& interp = gradInterForceInterpPtr_();
value.Su()=
value.Su() =
C_
*mass
*gradInterForceInterp.interpolate(p.position(), p.currentTetIndices());
*interp.interpolate(p.coordinates(), p.currentTetIndices());
return value;
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -27,6 +27,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "triSurface.H"
#include "triSurfaceSearch.H"
#include "barycentric2D.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -115,9 +116,7 @@ point offsetSurface::operator()
const triSurface& base = baseSurfPtr_();
const triPointRef baseTri(base[triI].tri(base.points()));
FixedList<scalar, 3> bary;
baseTri.barycentric(surfacePoint, bary);
const barycentric2D bary = baseTri.pointToBarycentric(surfacePoint);
const triSurface& offset = offsetSurfPtr_();
const triPointRef offsetTri(offset[triI].tri(offset.points()));
......@@ -125,8 +124,8 @@ point offsetSurface::operator()
const point offsetPoint
(
bary[0]*offsetTri.a()
+bary[1]*offsetTri.b()
+bary[2]*offsetTri.c()
+ bary[1]*offsetTri.b()
+ bary[2]*offsetTri.c()
);
point interpolatedPoint
......
......@@ -346,20 +346,18 @@ void Foam::meshRefinement::markFeatureCellLevel
// what to seed. Do this on only the processor that
// holds the keepPoint.
forAll(keepPoints, i)
for (const point& keepPoint : keepPoints)
{
const point& keepPoint = keepPoints[i];
const label celli = mesh_.cellTree().findInside(keepPoint);
if (cellI != -1)
if (celli != -1)
{
// I am the processor that holds the keepPoint
forAll(features_, featI)
forAll(features_, feati)
{
const edgeMesh& featureMesh = features_[featI];
const label featureLevel = features_.levels()[featI][0];
const edgeMesh& featureMesh = features_[feati];
const label featureLevel = features_.levels()[feati][0];
const labelListList& pointEdges = featureMesh.pointEdges();
// Find regions on edgeMesh
......@@ -373,16 +371,16 @@ void Foam::meshRefinement::markFeatureCellLevel
// 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)
{
Pout<< "Adding particle from point:" << pointI
<< " coord:" << featureMesh.points()[pointI]
Pout<< "Adding particle from point:" << pointi
<< " coord:" << featureMesh.points()[pointi]
<< " since number of emanating edges:"
<< pointEdges[pointI].size()
<< pointEdges[pointi].size()
<< endl;
}
......@@ -393,28 +391,21 @@ void Foam::meshRefinement::markFeatureCellLevel
(
mesh_,
keepPoint,
<<<<<<< HEAD
cellI,
tetFaceI,
tetPtI,
featureMesh.points()[pointI], // endpos
=======
celli,
featureMesh.points()[pointi], // endpos
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
featureLevel, // level
featI, // featureMesh
pointI, // end point
feati, // featureMesh
pointi, // end point
-1 // feature edge
)
);
// Mark
if (pointEdges[pointI].size() > 0)
if (pointEdges[pointi].size() > 0)
{
label e0 = pointEdges[pointI][0];
label regionI = edgeRegion[e0];
regionVisited[regionI] = 1u;
label e0 = pointEdges[pointi][0];
label regioni = edgeRegion[e0];
regionVisited[regioni] = 1u;
}
}
}
......@@ -422,17 +413,17 @@ void Foam::meshRefinement::markFeatureCellLevel
// 2. Any regions that have not been visited at all? These can
// 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];
label pointI = e.start();
const edge& e = featureMesh.edges()[edgei];
label pointi = e.start();
if (debug&meshRefinement::FEATURESEEDS)
{
Pout<< "Adding particle from point:" << pointI
<< " coord:" << featureMesh.points()[pointI]
<< " on circular region:" << edgeRegion[edgeI]
Pout<< "Adding particle from point:" << pointi
<< " coord:" << featureMesh.points()[pointi]
<< " on circular region:" << edgeRegion[edgei]
<< endl;
}
......@@ -443,18 +434,11 @@ void Foam::meshRefinement::markFeatureCellLevel
(
mesh_,
keepPoint,
<<<<<<< HEAD
cellI,
tetFaceI,
tetPtI,
featureMesh.points()[pointI], // endpos
=======
celli,
featureMesh.points()[pointi], // endpos
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
featureLevel, // level
featI, // featureMesh
pointI, // end point
feati, // featureMesh
pointi, // end point
-1 // feature edge
)
);
......@@ -541,17 +525,12 @@ void Foam::meshRefinement::markFeatureCellLevel
// on the edge.
const edge& e = featureMesh.edges()[edgeI];
label otherPointI = e.otherVertex(pointI);
label otherPointi = e.otherVertex(pointI);
trackedParticle* tp(new trackedParticle(startTp));
<<<<<<< HEAD
tp->end() = featureMesh.points()[otherPointI];
tp->j() = otherPointI;
=======
tp->start() = tp->position();
tp->end() = featureMesh.points()[otherPointi];
tp->j() = otherPointi;
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
tp->k() = edgeI;
if (debug&meshRefinement::FEATURESEEDS)
......@@ -608,16 +587,11 @@ void Foam::meshRefinement::markFeatureCellLevel
// on the edge.
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.end() = featureMesh.points()[otherPointi];
tp.j() = otherPointi;
>>>>>>> 371762757... Lagrangian: Rewrite of the particle tracking algorithm to function in
tp.k() = edgeI;
keepParticle = true;
break;
......
......@@ -1235,19 +1235,16 @@ void Foam::isoSurface::trimToBox
{
dynInterpolatedPoints.append(pointI);
FixedList<label, 3> oldPoints;
oldPoints[0] = 3*oldTriI;
oldPoints[1] = 3*oldTriI+1;
oldPoints[2] = 3*oldTriI+2;
FixedList<label, 3> oldPoints
(
{3*oldTriI, 3*oldTriI+1, 3*oldTriI+2}
);
dynInterpolatedOldPoints.append(oldPoints);
triPointRef tri(oldTriPoints, oldPoints);
FixedList<scalar, 3> bary;
tri.barycentric(pt, bary);
FixedList<scalar, 3> weights;
weights[0] = bary[0];
weights[1] = bary[1];
weights[2] = bary[2];
barycentric2D bary = tri.pointToBarycentric(pt);
FixedList<scalar, 3> weights({bary.a(), bary.b(), bary.c()});
dynInterpolationWeights.append(weights);
}
}
......
Markdown is supported
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