[bugfix]: 64-bit label bugfix some how got overwritten by cfMesh update.

This commit is contained in:
Danial Khazaei 2019-02-16 00:44:11 +03:30
parent 7fee1a978c
commit e8a0078301
No known key found for this signature in database
GPG key ID: F4F9B78264E84372
9 changed files with 36 additions and 17 deletions

View file

@ -150,6 +150,25 @@ inline Foam::DynList<T, staticSize>::DynList(const label s)
# endif
}
#if WM_LABEL_SIZE == 64
template<class T, Foam::label staticSize>
inline Foam::DynList<T, staticSize>::DynList(const int s)
:
dataPtr_(nullptr),
nAllocated_(0),
staticData_(),
nextFree_(0)
{
setSize(s);
# ifdef DEBUG
checkAllocation();
# endif
}
#endif
template<class T, Foam::label staticSize>
inline Foam::DynList<T, staticSize>::DynList(const label s, const T& val)
:

View file

@ -58,8 +58,10 @@ void decomposeCells::findAddressingForCell
const faceListPMG& faces = mesh_.faces();
forAll(faceEdges, feI)
{
faceEdges[feI].setSize(faces[c[feI]].size());
faceEdges[feI] = -1;
DynList<label, 8>& fEdges = faceEdges[feI];
fEdges.setSize(faces[c[feI]].size());
fEdges = label(-1);
}
forAll(c, fI)

View file

@ -1221,7 +1221,7 @@ inline bool doTrianglesOverlap
x /= (mag(x) + VSMALL);
vector y = vec ^ x;
DynList<point2D, 6> poly2D(3);
DynList<point2D, 6> poly2D(label(3));
poly2D[0] = point2D((tri0.a() - origin) & x, (tri0.a() - origin) & y);
poly2D[1] = point2D((tri0.b() - origin) & x, (tri0.b() - origin) & y);
poly2D[2] = point2D((tri0.c() - origin) & x, (tri0.c() - origin) & y);

View file

@ -354,7 +354,7 @@ void partTriMesh::createBufferLayers()
{
const parTriFace& tri = receivedTrias[i];
DynList<label, 3> triPointLabels(3);
DynList<label, 3> triPointLabels(label(3));
for(label j=0;j<3;++j)
{
const label gpI = tri.globalLabelOfPoint(j);

View file

@ -136,7 +136,7 @@ void meshOctree::setOctantVectorsAndPositions()
//- set vrtLeavesPos_
for(label vrtI=0;vrtI<8;++vrtI)
{
FixedList<label, 3> vc(0);
FixedList<label, 3> vc(label(0));
if( vrtI & 1 )
vc[0] += 1;

View file

@ -138,7 +138,7 @@ void meshOctreeAutomaticRefinement::setMaxRefLevel()
{
finished = false;
const scalar lSize = size / pow(2, label(maxRefLevel_));
const scalar lSize = size / pow(2.0, label(maxRefLevel_));
if( lSize < cs )
{

View file

@ -87,12 +87,12 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{
finished = false;
const scalar lSize = size / Foam::pow(2, label(globalRefLevel_));
const scalar lSize = size / pow(label(2), label(globalRefLevel_));
if( lSize < (maxSize * (1.0-SMALL)) )
{
const scalar bbSize =
0.5 * maxSize * Foam::pow(2, label(globalRefLevel_));
0.5 * maxSize * pow(label(2), label(globalRefLevel_));
rootBox.max() = c + point(bbSize, bbSize, bbSize);
rootBox.min() = c - point(bbSize, bbSize, bbSize);
finished = true;
@ -136,7 +136,7 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{
finished = false;
const scalar lSize = maxSize / Foam::pow(2, addLevel);
const scalar lSize = maxSize / Foam::pow(label(2), addLevel);
if( lSize <= cs )
{
@ -233,7 +233,7 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{
finished = false;
const scalar lSize = maxSize / Foam::pow(2, addLevel);
const scalar lSize = maxSize / Foam::pow(label(2), addLevel);
if( lSize <= cs )
{
@ -311,7 +311,7 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{
finished = false;
const scalar lSize = maxSize / Foam::pow(2, addLevel);
const scalar lSize = maxSize / Foam::pow(label(2), addLevel);
if( lSize <= cs )
{
@ -383,7 +383,7 @@ void meshOctreeCreator::setRootCubeSizeAndRefParameters()
{
finished = false;
const scalar lSize = maxSize / Foam::pow(2, nLevel);
const scalar lSize = maxSize / Foam::pow(label(2), nLevel);
if( lSize <= cs )
{

View file

@ -75,7 +75,7 @@ void meshUntangler::cutRegion::findNewFaces()
<< " consisting of edges " << f << endl;
# endif
pointUsage = 0;
pointUsage = label(0);
DynList<label, 8> newFace;
@ -147,7 +147,7 @@ void meshUntangler::cutRegion::findNewFaces()
//- find edges which form the faceInPlane
DynList<label, 128> edgeUsage;
edgeUsage.setSize(cEdges.size());
edgeUsage = 0;
edgeUsage = label(0);
forAll(cFaces, fI)
{
const DynList<label, 8>& f = cFaces[fI];

View file

@ -29,8 +29,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "objectRegistry.H"
#include "foamTime.H"
#include "polyMeshGenModifier.H"
#include "edgeExtractor.H"
#include "meshSurfaceEngine.H"
@ -1529,7 +1527,7 @@ bool edgeExtractor::checkConcaveEdgeCells()
DynList<label, 2> nFacesInPatch;
nFacesInPatch.setSize(2);
nFacesInPatch = 0;
nFacesInPatch = label(0);
DynList<bool, 2> hasPatchPoints;
hasPatchPoints.setSize(2);