COMP: remove 64-bit label ambiguity
COMP: fix SP/DP inconsistency in fvGeometryScheme STYLE: rename polyMesh::updateGeom to polyMesh::updateGeomPoints - avoids compiler complaints and potential masking of primitiveMesh::updateGeom / fvMesh::updateGeom - mark argument as movable, since that is what is happening inside. GIT: remove merge cruft TUT: better clean on MPPICInterFoam
This commit is contained in:
parent
b89f389606
commit
4fdeb3be83
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -61,7 +61,7 @@ void Foam::UPstream::setParRun(const label nProcs, const bool haveThreads)
|
||||
haveThreads_ = haveThreads;
|
||||
|
||||
freeCommunicator(UPstream::worldComm);
|
||||
label comm = allocateCommunicator(-1, labelList(1, Zero), false);
|
||||
label comm = allocateCommunicator(-1, labelList(Foam::one{}, 0), false);
|
||||
if (comm != UPstream::worldComm)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -258,8 +258,8 @@ Foam::UList<Foam::UPstream::commsStruct>::operator[](const label procID)
|
||||
// Not yet allocated
|
||||
|
||||
label above(-1);
|
||||
labelList below(0);
|
||||
labelList allBelow(0);
|
||||
labelList below;
|
||||
labelList allBelow;
|
||||
|
||||
if (size() < UPstream::nProcsSimpleSum)
|
||||
{
|
||||
@ -373,8 +373,8 @@ Foam::DynamicList<Foam::List<int>> Foam::UPstream::procIDs_(10);
|
||||
|
||||
Foam::DynamicList<Foam::label> Foam::UPstream::parentCommunicator_(10);
|
||||
|
||||
Foam::wordList Foam::UPstream::allWorlds_(1, "");
|
||||
Foam::labelList Foam::UPstream::worldIDs_(1, 0);
|
||||
Foam::wordList Foam::UPstream::allWorlds_(Foam::one{}, "");
|
||||
Foam::labelList Foam::UPstream::worldIDs_(Foam::one{}, 0);
|
||||
|
||||
Foam::DynamicList<Foam::List<Foam::UPstream::commsStruct>>
|
||||
Foam::UPstream::linearCommunication_(10);
|
||||
@ -388,7 +388,7 @@ Foam::UPstream::treeCommunication_(10);
|
||||
Foam::UPstream::communicator serialComm
|
||||
(
|
||||
-1,
|
||||
Foam::labelList(1, Foam::Zero),
|
||||
Foam::labelList(Foam::one{}, 0),
|
||||
false
|
||||
);
|
||||
|
||||
|
@ -625,15 +625,16 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Storage management
|
||||
// Storage management
|
||||
|
||||
//- Clear geometry
|
||||
void clearGeom();
|
||||
|
||||
//- Update geometry; keep topology. Optional new face decomposition
|
||||
void updateGeom
|
||||
//- Update geometry points; keep topology.
|
||||
//- Optionally with new face decomposition
|
||||
void updateGeomPoints
|
||||
(
|
||||
pointIOField& newPoints,
|
||||
pointIOField&& newPoints,
|
||||
autoPtr<labelIOList>& newTetBasePtIsPtr
|
||||
);
|
||||
|
||||
|
@ -71,9 +71,9 @@ void Foam::polyMesh::clearGeom()
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyMesh::updateGeom
|
||||
void Foam::polyMesh::updateGeomPoints
|
||||
(
|
||||
pointIOField& newPoints,
|
||||
pointIOField&& newPoints,
|
||||
autoPtr<labelIOList>& newTetBasePtIsPtr
|
||||
)
|
||||
{
|
||||
|
@ -434,7 +434,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
autoPtr<labelIOList> newTetBasePtIsPtr = readTetBasePtIs();
|
||||
|
||||
// Update all geometry
|
||||
updateGeom(newPoints, newTetBasePtIsPtr);
|
||||
updateGeomPoints(std::move(newPoints), newTetBasePtIsPtr);
|
||||
|
||||
return polyMesh::POINTS_MOVED;
|
||||
}
|
||||
|
@ -70,11 +70,20 @@ Foam::label Foam::averageNeighbourFvGeometryScheme::clipFaceTet
|
||||
label nClipped = 0;
|
||||
for (label facei = 0; facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
#ifdef WM_SPDP
|
||||
const solveVector fcCorr(faceCorrection[facei]);
|
||||
#else
|
||||
const vector& fcCorr = faceCorrection[facei];
|
||||
if (fcCorr != vector::zero)
|
||||
#endif
|
||||
if (fcCorr != solveVector::zero)
|
||||
{
|
||||
#ifdef WM_SPDP
|
||||
const solveVector fn(faceNormals[facei]);
|
||||
const solveVector fc(faceCentres[facei]);
|
||||
#else
|
||||
const vector& fn = faceNormals[facei];
|
||||
const point& fc = faceCentres[facei];
|
||||
#endif
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
@ -142,15 +151,20 @@ void Foam::averageNeighbourFvGeometryScheme::makePyrHeights
|
||||
{
|
||||
const solveVector n = faceNormals[facei];
|
||||
const solveVector fc = faceCentres[facei];
|
||||
ownHeight[facei] = ((fc-cellCentres[own[facei]])&n);
|
||||
neiHeight[facei] = ((cellCentres[nei[facei]]-fc)&n);
|
||||
const solveVector ownCc = cellCentres[own[facei]];
|
||||
const solveVector neiCc = cellCentres[nei[facei]];
|
||||
|
||||
ownHeight[facei] = ((fc-ownCc)&n);
|
||||
neiHeight[facei] = ((neiCc-fc)&n);
|
||||
}
|
||||
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
const solveVector n = faceNormals[facei];
|
||||
const solveVector fc = faceCentres[facei];
|
||||
ownHeight[facei] = ((fc-cellCentres[own[facei]])&n);
|
||||
const solveVector ownCc = cellCentres[own[facei]];
|
||||
|
||||
ownHeight[facei] = ((fc-ownCc)&n);
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,8 +192,13 @@ Foam::label Foam::averageNeighbourFvGeometryScheme::clipPyramids
|
||||
label nClipped = 0;
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[facei]);
|
||||
const solveVector fc(faceCentres[facei]);
|
||||
#else
|
||||
const vector& n = faceNormals[facei];
|
||||
const point& fc = faceCentres[facei];
|
||||
#endif
|
||||
|
||||
const label ownCelli = own[facei];
|
||||
if (correction[ownCelli] != vector::zero)
|
||||
@ -218,8 +237,13 @@ Foam::label Foam::averageNeighbourFvGeometryScheme::clipPyramids
|
||||
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[facei]);
|
||||
const solveVector fc(faceCentres[facei]);
|
||||
#else
|
||||
const vector& n = faceNormals[facei];
|
||||
const point& fc = faceCentres[facei];
|
||||
#endif
|
||||
|
||||
const label ownCelli = own[facei];
|
||||
if (correction[ownCelli] != vector::zero)
|
||||
@ -264,7 +288,11 @@ Foam::averageNeighbourFvGeometryScheme::averageNeighbourCentres
|
||||
// Internal faces
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[facei]);
|
||||
#else
|
||||
const vector& n = faceNormals[facei];
|
||||
#endif
|
||||
const point& ownCc = cellCentres[own[facei]];
|
||||
const point& neiCc = cellCentres[nei[facei]];
|
||||
|
||||
@ -281,10 +309,10 @@ Foam::averageNeighbourFvGeometryScheme::averageNeighbourCentres
|
||||
// Apply half to both sides (as a correction)
|
||||
// Note: should this be linear weights instead of 0.5?
|
||||
const scalar w = 0.5*faceWeights[facei];
|
||||
cc[own[facei]] += w*d;
|
||||
cc[own[facei]] += point(w*d);
|
||||
cellWeights[own[facei]] += w;
|
||||
|
||||
cc[nei[facei]] -= w*d;
|
||||
cc[nei[facei]] -= point(w*d);
|
||||
cellWeights[nei[facei]] += w;
|
||||
}
|
||||
|
||||
@ -294,9 +322,8 @@ Foam::averageNeighbourFvGeometryScheme::averageNeighbourCentres
|
||||
syncTools::swapBoundaryCellPositions(mesh_, cellCentres, neiCellCentres);
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||
forAll(pbm, patchi)
|
||||
for (const polyPatch& pp : pbm)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
if (pp.coupled())
|
||||
{
|
||||
const labelUList& fc = pp.faceCells();
|
||||
@ -306,7 +333,11 @@ Foam::averageNeighbourFvGeometryScheme::averageNeighbourCentres
|
||||
const label meshFacei = pp.start()+i;
|
||||
const label bFacei = meshFacei-mesh_.nInternalFaces();
|
||||
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[meshFacei]);
|
||||
#else
|
||||
const vector& n = faceNormals[meshFacei];
|
||||
#endif
|
||||
|
||||
const point& ownCc = cellCentres[fc[i]];
|
||||
const point& neiCc = neiCellCentres[bFacei];
|
||||
@ -323,7 +354,7 @@ Foam::averageNeighbourFvGeometryScheme::averageNeighbourCentres
|
||||
|
||||
// Apply half to both sides (as a correction)
|
||||
const scalar w = 0.5*faceWeights[meshFacei];
|
||||
cc[fc[i]] += w*d;
|
||||
cc[fc[i]] += point(w*d);
|
||||
cellWeights[fc[i]] += w;
|
||||
}
|
||||
}
|
||||
@ -367,8 +398,13 @@ Foam::averageNeighbourFvGeometryScheme::averageCentres
|
||||
// Internal faces
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[facei]);
|
||||
const solveVector oldFc(faceCentres[facei]);
|
||||
#else
|
||||
const vector& n = faceNormals[facei];
|
||||
const point& oldFc = faceCentres[facei];
|
||||
#endif
|
||||
|
||||
const solveVector ownCc(cellCentres[own[facei]]);
|
||||
const solveVector neiCc(cellCentres[nei[facei]]);
|
||||
@ -395,7 +431,7 @@ Foam::averageNeighbourFvGeometryScheme::averageCentres
|
||||
// (= non-ortho correction vector?)
|
||||
d -= (d&n)*n;
|
||||
|
||||
// // Clip to limit change in
|
||||
// // Clip to limit change in
|
||||
// d *= ratio;
|
||||
|
||||
|
||||
@ -408,9 +444,8 @@ Foam::averageNeighbourFvGeometryScheme::averageCentres
|
||||
syncTools::swapBoundaryCellPositions(mesh_, cellCentres, neiCellCentres);
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||
forAll(pbm, patchi)
|
||||
for (const polyPatch& pp : pbm)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
const labelUList& fc = pp.faceCells();
|
||||
|
||||
if (pp.coupled())
|
||||
@ -421,8 +456,13 @@ Foam::averageNeighbourFvGeometryScheme::averageCentres
|
||||
const label facei = pp.start()+i;
|
||||
const label bFacei = facei-mesh_.nInternalFaces();
|
||||
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[facei]);
|
||||
const solveVector oldFc(faceCentres[facei]);
|
||||
#else
|
||||
const vector& n = faceNormals[facei];
|
||||
const point& oldFc = faceCentres[facei];
|
||||
#endif
|
||||
|
||||
const solveVector ownCc(cellCentres[fc[i]]);
|
||||
const solveVector neiCc(neiCellCentres[bFacei]);
|
||||
@ -449,8 +489,14 @@ Foam::averageNeighbourFvGeometryScheme::averageCentres
|
||||
{
|
||||
const label facei = pp.start()+i;
|
||||
|
||||
#ifdef WM_SPDP
|
||||
const solveVector n(faceNormals[facei]);
|
||||
const solveVector oldFc(faceCentres[facei]);
|
||||
#else
|
||||
const vector& n = faceNormals[facei];
|
||||
const point& oldFc = faceCentres[facei];
|
||||
#endif
|
||||
|
||||
const solveVector ownCc(cellCentres[fc[i]]);
|
||||
|
||||
solveVector d(ownCc-oldFc);
|
||||
|
@ -194,12 +194,12 @@ void Foam::highAspectRatioFvGeometryScheme::calcAspectRatioWeights
|
||||
cellWeight =
|
||||
max
|
||||
(
|
||||
scalar(0),
|
||||
min
|
||||
(
|
||||
(aratio-minAspect_)/delta,
|
||||
1.0
|
||||
),
|
||||
0.0
|
||||
scalar(1),
|
||||
(aratio-minAspect_)/delta
|
||||
)
|
||||
);
|
||||
|
||||
faceWeight.setSize(mesh_.nFaces());
|
||||
@ -292,7 +292,7 @@ void Foam::highAspectRatioFvGeometryScheme::makeAverageCentres
|
||||
sumAc = Zero;
|
||||
for (label pi = 0; pi < nPoints; pi++)
|
||||
{
|
||||
sumAc += p[f[pi]];
|
||||
sumAc += static_cast<solveVector>(p[f[pi]]);
|
||||
}
|
||||
faceCentres[facei] = sumAc/nPoints;
|
||||
}
|
||||
@ -310,7 +310,7 @@ void Foam::highAspectRatioFvGeometryScheme::makeAverageCentres
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
const solveScalar magfA(magFaceAreas[facei]);
|
||||
const solveVector weightedFc(magfA*faceCentres[facei]);
|
||||
const vector weightedFc(magfA*faceCentres[facei]);
|
||||
|
||||
// Accumulate area-weighted face-centre
|
||||
cellCentres[own[facei]] += weightedFc;
|
||||
@ -334,7 +334,7 @@ void Foam::highAspectRatioFvGeometryScheme::makeAverageCentres
|
||||
)
|
||||
{
|
||||
const solveScalar magfA(magFaceAreas[facei]);
|
||||
const solveVector weightedFc(magfA*faceCentres[facei]);
|
||||
const vector weightedFc(magfA*faceCentres[facei]);
|
||||
|
||||
cellCentres[own[facei]] += weightedFc;
|
||||
cellWeights[own[facei]] += magfA;
|
||||
|
@ -462,18 +462,21 @@ public:
|
||||
//- Update mesh corresponding to the given map
|
||||
virtual void updateMesh(const mapPolyMesh& mpm);
|
||||
|
||||
//- Avoid masking surfaceInterpolation method
|
||||
using surfaceInterpolation::movePoints;
|
||||
|
||||
//- Move points, returns volumes swept by faces in motion
|
||||
virtual tmp<scalarField> movePoints(const pointField&);
|
||||
|
||||
//- Update all geometric data. This gets redirected up from
|
||||
// primitiveMesh level
|
||||
//- primitiveMesh level
|
||||
virtual void updateGeom();
|
||||
|
||||
//- Map all fields in time using given map.
|
||||
virtual void mapFields(const mapPolyMesh& mpm);
|
||||
|
||||
//- Remove boundary patches. Warning: fvPatchFields hold ref to
|
||||
// these fvPatches.
|
||||
//- these fvPatches.
|
||||
void removeFvBoundary();
|
||||
|
||||
//- Return cell face motion fluxes
|
||||
|
@ -1600,7 +1600,7 @@ Foam::label Foam::snappyRefineDriver::boundaryRefinementInterfaceRefine
|
||||
mesh,
|
||||
boundaryPointLevel,
|
||||
maxEqOp<label>(),
|
||||
0
|
||||
label(0)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ bool Foam::mappedPatchBase::constructIOField
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
0
|
||||
label(0)
|
||||
);
|
||||
fldPtr->transfer
|
||||
(
|
||||
|
@ -159,9 +159,6 @@ class boundaryDataWriter
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Write option (default: IOstream::ASCII)
|
||||
IOstream::streamFormat writeFormat_;
|
||||
|
||||
//- Templated write field operation
|
||||
template<class Type>
|
||||
fileName writeTemplate
|
||||
|
@ -3,6 +3,6 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cleanCase
|
||||
cleanCase0
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user