BUGFIX: Compile WM_LABEL_SIZE=64

This commit is contained in:
Henrik Rusche 2019-01-05 02:14:17 +01:00
parent 67e2f83134
commit 923fee738e
105 changed files with 549 additions and 391 deletions

View file

@ -27,14 +27,15 @@ diff -ruN scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_mac_darwin10.shlib sc
diff -ruN scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib
--- scotch_6.0.4_orig/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2014-08-05 08:56:17.000000000 -0400
+++ scotch_6.0.4/src/Make.inc/Makefile.inc.i686_pc_linux2.shlib 2015-06-21 00:26:43.072992194 -0400
@@ -8,10 +8,10 @@
@@ -8,10 +8,11 @@
CAT = cat
CCS = gcc
CCP = mpicc
-CCD = gcc
-CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict
+CCD = mpicc -I$(MPI_HOME)/include
+CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -Xlinker --no-as-needed
+INTSIZE =
+CFLAGS = -O3 $(INTSIZE) -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -Xlinker --no-as-needed
CLIBFLAGS = -shared -fPIC
-LDFLAGS = -lz -lm -pthread
+LDFLAGS = -lz -lm -pthread -lrt

View file

@ -78,6 +78,7 @@ Prefix: %{_prefix}
Group: Development/Tools
Patch0: ParMGridGen-1.0.patch_darwin
Patch1: ParMGridGen-1.0.patch
Patch2: ParMGridGen-1.0.patch_64Bit
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
@ -93,6 +94,10 @@ Patch1: ParMGridGen-1.0.patch
%patch1 -p1
%endif
if [ "$WM_LABEL_SIZE" = "64" ]; then
%patch2 -p1
fi
%build
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"

View file

@ -77,6 +77,7 @@ Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
Patch0: metis-5.1.0_patch_gcc
Patch1: metis-5.1.0_patch_64Bit
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
@ -90,6 +91,10 @@ Patch0: metis-5.1.0_patch_gcc
%patch0 -p1
%endif
if [ "$WM_LABEL_SIZE" = "64" ]; then
%patch1 -p1
fi
%build
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"

View file

@ -78,6 +78,7 @@ Prefix: %{_prefix}
Group: Development/Tools
Patch0: ParMetis-3.1.1.patch_darwin
Patch1: ParMetis-3.1.1.patch
Patch2: ParMetis-3.1.1.patch_64Bit
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
@ -93,6 +94,10 @@ Patch1: ParMetis-3.1.1.patch
#patch1 -p1
%endif
if [ "$WM_LABEL_SIZE" = "64" ]; then
%patch2 -p1
fi
%build
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"

View file

@ -77,6 +77,7 @@ Prefix: %{_prefix}
Group: Development/Tools
Patch0: scotch-6.0.4_patch_0
Patch1: scotch-6.0.4_patch_darwin
Patch2: scotch-6.0.4_patch_64Bit
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
@ -92,6 +93,10 @@ Patch1: scotch-6.0.4_patch_darwin
%patch0 -p1
%endif
if [ "$WM_LABEL_SIZE" = "64" ]; then
%patch2 -p1
fi
%build
# export WM settings in a form that GNU configure recognizes
# [ -n "$WM_CC" ] && export CC="$WM_CC"

View file

@ -212,7 +212,7 @@ int main(int argc, char *argv[])
{
label curMeshEdge = meshEdges[edgeI];
labelList curEdgePatchIDs(2, -1);
labelList curEdgePatchIDs(2, label(-1));
label patchI = -1;

View file

@ -99,7 +99,11 @@ int main(int argc, char *argv[])
const labelList faceOwner = mesh.faceOwner();
const vectorField faceNormals = mesh.Sf()/mesh.magSf();
labelListList abaqusCellPoints(cellPoints.size(), List<label>(8, 1));
labelListList abaqusCellPoints
(
cellPoints.size(),
labelList(8, label(1))
);
forAll(cells, celli)
{
@ -338,7 +342,11 @@ int main(int argc, char *argv[])
}
}
labelListList materialsOrdered(numberOfMaterials, List<label>(0,0));
labelListList materialsOrdered
(
numberOfMaterials,
labelList(0, label(0))
);
forAll(materialsOrdered, matOrderi)
{
materialsOrdered[matOrderi].setSize(cellsOfEachMaterial[matOrderi], 0);
@ -401,7 +409,7 @@ int main(int argc, char *argv[])
//- face 5 is nodes 3 7 8 4
//- face 6 is nodes 4 8 5 1
//- So i will compare points on the face and
labelListList abaqusFaceConvention(6, List<label>(4,-1));
labelListList abaqusFaceConvention(6, labelList(4, label(-1)));
abaqusFaceConvention[0][0] = 1;
abaqusFaceConvention[0][1] = 2;
abaqusFaceConvention[0][2] = 3;
@ -438,7 +446,7 @@ int main(int argc, char *argv[])
//- face it is
const labelList& facePoints = mesh.boundaryMesh()[patchi][facei];
const labelList& thisCellAbaqusPoints = abaqusCellPoints[globalCelli];
labelList thisFaceAbaqusPoints(4,-1);
labelList thisFaceAbaqusPoints(4, label(-1));
label pointsFound = 0;
forAll(thisCellAbaqusPoints, pointi)
{

View file

@ -47,7 +47,7 @@ void sammMesh::readBoundary()
labelList pointLabels(4);
labelList pointLabelsTri(3);
labelList patchLabels(1000, -1);
labelList patchLabels(1000, label(-1));
word patchType;
patchTypes_.setSize(1000);

View file

@ -230,7 +230,7 @@ void sammMesh::readCells()
{
IFstream cellsFile(cellsFileName);
labelList labels(24, -1);
labelList labels(24, label(-1));
label lineLabel, sammLabel, regionLabel, typeFlag;
for (label cellI = 0; cellI < nCells; cellI++)

View file

@ -47,7 +47,7 @@ void starMesh::readBoundary()
labelList pointLabels(4);
labelList pointLabelsTri(3);
labelList patchLabels(1000, -1);
labelList patchLabels(1000, label(-1));
word patchType;
patchTypes_.setSize(1000);

View file

@ -275,7 +275,7 @@ void starMesh::readCells()
{
IFstream cellsFile(cellsFileName);
labelList labels(24, -1);
labelList labels(24, label(-1));
label lineLabel, starLabel, regionLabel, typeFlag;
for (label cellI = 0; cellI < nCells; cellI++)

View file

@ -30,6 +30,15 @@ License
#include <sys/endian.h>
#endif
// MacOSX
#ifdef __DARWIN_BYTE_ORDER
#if __DARWIN_BYTE_ORDER==__DARWIN_BIG_ENDIAN
#undef LITTLE_ENDIAN
#else
#undef BIG_ENDIAN
#endif
#endif
#if defined(LITTLE_ENDIAN) \
|| defined(_LITTLE_ENDIAN) \
|| defined(__LITTLE_ENDIAN)
@ -43,9 +52,9 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::writeFuns::swapWord(label& word32)
void Foam::writeFuns::swapWord(int32_t& word32)
{
char* mem = reinterpret_cast<char*>(&word32);
char* mem = reinterpret_cast<char*>(&word32);
char a = mem[0];
mem[0] = mem[3];
@ -57,7 +66,7 @@ void Foam::writeFuns::swapWord(label& word32)
}
void Foam::writeFuns::swapWords(const label nWords, label* words32)
void Foam::writeFuns::swapWords(const label nWords, int32_t* words32)
{
for (label i = 0; i < nWords; i++)
{
@ -75,9 +84,9 @@ void Foam::writeFuns::write
{
if (binary)
{
# ifdef LITTLEENDIAN
swapWords(fField.size(), reinterpret_cast<label*>(fField.begin()));
# endif
#ifdef LITTLEENDIAN
swapWords(fField.size(), reinterpret_cast<int32_t*>(fField.begin()));
#endif
os.write
(
@ -125,9 +134,13 @@ void Foam::writeFuns::write
{
if (binary)
{
# ifdef LITTLEENDIAN
swapWords(elems.size(), reinterpret_cast<label*>(elems.begin()));
# endif
#ifdef LITTLEENDIAN
swapWords
(
(sizeof(label)/4)*elems.size(),
reinterpret_cast<int32_t*>(elems.begin())
);
#endif
os.write
(
reinterpret_cast<char*>(elems.begin()),

View file

@ -55,9 +55,14 @@ namespace Foam
class writeFuns
{
//- Swap halves of word.
static void swapWord(label& word32);
static void swapWords(const label nWords, label* words32);
// Private member functions
//- Swap halves of word
static void swapWord(int32_t& word32);
//- Swap halves of word
static void swapWords(const label nWords, int32_t* words32);
public:

View file

@ -151,7 +151,7 @@ Foam::fieldviewTopology::fieldviewTopology
const cellModel& hex = *(cellModeller::lookup("hex"));
// Pre calculate headers for cells not on walls
labelList notWallFlags(6, NOT_A_WALL);
List<int> notWallFlags(6, NOT_A_WALL);
label tetNotWall = fv_encode_elem_header
(
FV_TET_ELEM_ID, notWallFlags.begin()
@ -181,7 +181,7 @@ Foam::fieldviewTopology::fieldviewTopology
const faceList& allFaces = mesh.faces();
labelList wallFlags(6);
List<int> wallFlags(6);
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[celli];

View file

@ -395,7 +395,8 @@ void Foam::tecplotWriter::writeConnectivity
INTEGER4 NumFaceNodes = 2*pp.nEdges();
// All faces (=edges) have 2 nodes
List<INTEGER4> FaceNodeCounts(NumFaces, 2);
List<INTEGER4> FaceNodeCounts(NumFaces);
FaceNodeCounts = 2;
List<INTEGER4> FaceNodes(NumFaceNodes);
label nodeI = 0;

View file

@ -53,7 +53,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void Foam::writeFuns::swapWord(label& word32)
void Foam::writeFuns::swapWord(int32_t& word32)
{
char* mem = reinterpret_cast<char*>(&word32);
@ -67,7 +67,7 @@ void Foam::writeFuns::swapWord(label& word32)
}
void Foam::writeFuns::swapWords(const label nWords, label* words32)
void Foam::writeFuns::swapWords(const label nWords, int32_t* words32)
{
for (label i = 0; i < nWords; i++)
{
@ -85,9 +85,10 @@ void Foam::writeFuns::write
{
if (binary)
{
# ifdef LITTLEENDIAN
swapWords(fField.size(), reinterpret_cast<label*>(fField.begin()));
# endif
#ifdef LITTLEENDIAN
swapWords(fField.size(), reinterpret_cast<int32_t*>(fField.begin()));
#endif
os.write
(
reinterpret_cast<char*>(fField.begin()),
@ -134,9 +135,13 @@ void Foam::writeFuns::write
{
if (binary)
{
# ifdef LITTLEENDIAN
swapWords(elems.size(), reinterpret_cast<label*>(elems.begin()));
# endif
#ifdef LITTLEENDIAN
swapWords
(
(sizeof(label)/4)*elems.size(),
reinterpret_cast<int32_t*>(elems.begin())
);
#endif
os.write
(
reinterpret_cast<char*>(elems.begin()),

View file

@ -55,10 +55,11 @@ class writeFuns
{
// Private member functions
// Swap halves of word.
//- Swap halves of word
static void swapWord(int32_t& word32);
static void swapWord(label& word32);
static void swapWords(const label nWords, label* words32);
//- Swap halves of word
static void swapWords(const label nWords, int32_t* words32);
public:

View file

@ -640,9 +640,9 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
label lineLabel, starCellId, cellFaceId, starRegion, configNumber;
word patchType;
labelList mapToFoamPatchId(1000, -1);
labelList nPatchFaces(1000, 0);
labelList origRegion(1000, 0);
labelList mapToFoamPatchId(1000, label(-1));
labelList nPatchFaces(1000, label(0));
labelList origRegion(1000, label(0));
patchTypes_.setSize(1000);
// this is what we seem to need

View file

@ -154,7 +154,7 @@ void Foam::mgMeshLevel::makeChild() const
);
// MGridGen agglomeration options.
List<int> options(4, 0);
List<int> options(4);
options[0] = 4; // globular agglom
options[1] = 6; // objective F3 and F2
options[2] = 128; // debugging output level

View file

@ -46,8 +46,8 @@ namespace Foam
void Foam::decompositionMethod::calcCSR
(
const labelListList& cellCells,
List<int>& adjncy,
List<int>& xadj
List<label>& adjncy,
List<label>& xadj
)
{
// Count number of internal faces
@ -88,8 +88,8 @@ void Foam::decompositionMethod::calcCSR
void Foam::decompositionMethod::calcCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
List<label>& adjncy,
List<label>& xadj
)
{
// Make Metis CSR (Compressed Storage Format) storage
@ -185,8 +185,8 @@ void Foam::decompositionMethod::calcCSR
void Foam::decompositionMethod::calcDistributedCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
List<label>& adjncy,
List<label>& xadj
)
{
// Create global cell numbers
@ -210,7 +210,7 @@ void Foam::decompositionMethod::calcDistributedCSR
// Get renumbered owner on other side of coupled faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<int> globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
forAll(patches, patchI)
{
@ -239,7 +239,7 @@ void Foam::decompositionMethod::calcDistributedCSR
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Number of faces per cell
List<int> nFacesPerCell(mesh.nCells(), 0);
List<label> nFacesPerCell(mesh.nCells(), 0);
// Number of coupled faces
label nCoupledFaces = 0;
@ -272,7 +272,7 @@ void Foam::decompositionMethod::calcDistributedCSR
xadj.setSize(mesh.nCells() + 1);
int freeAdj = 0;
label freeAdj = 0;
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
{

View file

@ -63,8 +63,8 @@ protected:
static void calcCSR
(
const labelListList& globalCellCells,
List<int>& adjncy,
List<int>& xadj
List<label>& adjncy,
List<label>& xadj
);
//- Helper: convert local connectivity from the mesh
@ -73,8 +73,8 @@ protected:
static void calcCSR
(
const polyMesh& mesh,
List<int>& adjncy,
List<int>& xadj
List<label>& adjncy,
List<label>& xadj
);
//- Helper: convert mesh connectivity into distributed CSR
@ -82,8 +82,8 @@ protected:
static void calcDistributedCSR
(
const polyMesh&,
List<int>& adjncy,
List<int>& xadj
List<label>& adjncy,
List<label>& xadj
);
//- Helper: determine (non-parallel) cellCells from mesh

View file

@ -54,10 +54,10 @@ namespace Foam
Foam::label Foam::metisDecomp::decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
)
{
// Method of decomposition
@ -65,7 +65,7 @@ Foam::label Foam::metisDecomp::decompose
// k-way: multi-level k-way
word method("k-way");
int numCells = xadj.size()-1;
label numCells = xadj.size()-1;
// decomposition options. 0 = use defaults
idx_t options[METIS_NOPTIONS];
@ -76,10 +76,10 @@ Foam::label Foam::metisDecomp::decompose
Field<real_t> processorWeights;
// cell weights (so on the vertices of the dual)
List<int> cellWeights;
List<label> cellWeights;
// face weights (so on the edges of the dual)
List<int> faceWeights;
List<label> faceWeights;
// Check for externally provided cellweights and if so initialise weights
@ -177,7 +177,7 @@ Foam::label Foam::metisDecomp::decompose
{
Info<< "metisDecomp : Using cell-based weights." << endl;
IOList<int> cellIOWeights
IOList<label> cellIOWeights
(
IOobject
(
@ -200,17 +200,17 @@ Foam::label Foam::metisDecomp::decompose
}
}
int nProcs = nProcessors_;
label nProcs = nProcessors_;
// output: cell -> processor addressing
finalDecomp.setSize(numCells);
// output: number of cut edges
int edgeCut = 0;
label edgeCut = 0;
// Vertex weight info
int* vwgtPtr = nullptr;
int* adjwgtPtr = nullptr;
label* vwgtPtr = nullptr;
label* adjwgtPtr = nullptr;
if (cellWeights.size())
{
@ -221,7 +221,7 @@ Foam::label Foam::metisDecomp::decompose
adjwgtPtr = faceWeights.begin();
}
int one = 1;
label one = 1;
if (method == "recursive")
{
@ -229,8 +229,8 @@ Foam::label Foam::metisDecomp::decompose
(
&numCells, // num vertices in graph
&one,
const_cast<List<int>&>(xadj).begin(), // indexing into adjncy
const_cast<List<int>&>(adjncy).begin(), // neighbour info
const_cast<List<label>&>(xadj).begin(), // indexing into adjncy
const_cast<List<label>&>(adjncy).begin(), // neighbour info
vwgtPtr, // vertexweights
nullptr,
adjwgtPtr, // no edgeweights
@ -248,8 +248,8 @@ Foam::label Foam::metisDecomp::decompose
(
&numCells, // num vertices in graph
&one,
const_cast<List<int>&>(xadj).begin(), // indexing into adjncy
const_cast<List<int>&>(adjncy).begin(), // neighbour info
const_cast<List<label>&>(xadj).begin(), // indexing into adjncy
const_cast<List<label>&>(adjncy).begin(), // neighbour info
vwgtPtr, // vertexweights
nullptr,
adjwgtPtr, // no edgeweights
@ -300,8 +300,8 @@ Foam::labelList Foam::metisDecomp::decompose
<< exit(FatalError);
}
List<int> adjncy;
List<int> xadj;
List<label> adjncy;
List<label> xadj;
calcCSR
(
mesh_,
@ -310,7 +310,7 @@ Foam::labelList Foam::metisDecomp::decompose
);
// Decompose using default weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose(adjncy, xadj, pointWeights, finalDecomp);
// Copy back to labelList
@ -348,8 +348,8 @@ Foam::labelList Foam::metisDecomp::decompose
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
List<label> adjncy;
List<label> xadj;
{
// Get cellCells on coarse mesh.
labelListList cellCells;
@ -365,7 +365,7 @@ Foam::labelList Foam::metisDecomp::decompose
}
// Decompose using default weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose(adjncy, xadj, coarseWeights, finalDecomp);
@ -406,12 +406,12 @@ Foam::labelList Foam::metisDecomp::decompose
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
List<label> adjncy;
List<label> xadj;
calcCSR(globalCellCells, adjncy, xadj);
// Decompose using default weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose(adjncy, xadj, cWeights, finalDecomp);
// Copy back to labelList

View file

@ -63,10 +63,10 @@ class metisDecomp
label decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cellWeights,
List<int>& finalDecomp
List<label>& finalDecomp
);

View file

@ -59,20 +59,20 @@ namespace Foam
//- Does prevention of 0 cell domains and calls parmetis.
Foam::label Foam::parMetisDecomp::decompose
(
Field<int>& xadj,
Field<int>& adjncy,
Field<label>& xadj,
Field<label>& adjncy,
const pointField& cellCentres,
Field<int>& cellWeights,
Field<int>& faceWeights,
const List<int>& options,
List<int>& finalDecomp
Field<label>& cellWeights,
Field<label>& faceWeights,
const List<label>& options,
List<label>& finalDecomp
)
{
// C style numbering
int numFlag = 0;
label numFlag = 0;
// Number of dimensions
int nDims = 3;
label nDims = 3;
if (cellCentres.size() != xadj.size()-1)
@ -85,14 +85,14 @@ Foam::label Foam::parMetisDecomp::decompose
// Get number of cells on all processors
List<int> nLocalCells(Pstream::nProcs());
List<label> nLocalCells(Pstream::nProcs());
nLocalCells[Pstream::myProcNo()] = xadj.size()-1;
Pstream::gatherList(nLocalCells);
Pstream::scatterList(nLocalCells);
// Get cell offsets.
List<int> cellOffsets(Pstream::nProcs()+1);
int nGlobalCells = 0;
List<label> cellOffsets(Pstream::nProcs()+1);
label nGlobalCells = 0;
forAll(nLocalCells, procI)
{
cellOffsets[procI] = nGlobalCells;
@ -102,7 +102,7 @@ Foam::label Foam::parMetisDecomp::decompose
// Convert pointField into the data type parMetis expects (float or double)
Field<real_t> xyz(3*cellCentres.size());
int compI = 0;
label compI = 0;
forAll(cellCentres, cellI)
{
const point& cc = cellCentres[cellI];
@ -120,7 +120,7 @@ Foam::label Foam::parMetisDecomp::decompose
// Number of cells to send to the next processor
// (is same as number of cells next processor has to receive)
List<int> nSendCells(Pstream::nProcs(), 0);
List<label> nSendCells(Pstream::nProcs(), 0);
for (label procI = nLocalCells.size()-1; procI >=1; procI--)
{
@ -137,11 +137,11 @@ Foam::label Foam::parMetisDecomp::decompose
// Receive cells from previous processor
IPstream fromPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
Field<int> prevXadj(fromPrevProc);
Field<int> prevAdjncy(fromPrevProc);
Field<label> prevXadj(fromPrevProc);
Field<label> prevAdjncy(fromPrevProc);
Field<real_t> prevXyz(fromPrevProc);
Field<int> prevCellWeights(fromPrevProc);
Field<int> prevFaceWeights(fromPrevProc);
Field<label> prevCellWeights(fromPrevProc);
Field<label> prevFaceWeights(fromPrevProc);
if (prevXadj.size() != nSendCells[Pstream::myProcNo()-1])
{
@ -172,34 +172,34 @@ Foam::label Foam::parMetisDecomp::decompose
// Send cells to next processor
OPstream toNextProc(Pstream::blocking, Pstream::myProcNo()+1);
int nCells = nSendCells[Pstream::myProcNo()];
int startCell = xadj.size()-1 - nCells;
int startFace = xadj[startCell];
int nFaces = adjncy.size()-startFace;
label nCells = nSendCells[Pstream::myProcNo()];
label startCell = xadj.size()-1 - nCells;
label startFace = xadj[startCell];
label nFaces = adjncy.size()-startFace;
// Send for all cell data: last nCells elements
// Send for all face data: last nFaces elements
toNextProc
<< Field<int>::subField(xadj, nCells, startCell)-startFace
<< Field<int>::subField(adjncy, nFaces, startFace)
<< Field<label>::subField(xadj, nCells, startCell)-startFace
<< Field<label>::subField(adjncy, nFaces, startFace)
<< SubField<real_t>(xyz, nDims*nCells, nDims*startCell)
<<
(
cellWeights.size()
? static_cast<const Field<int>&>
? static_cast<const Field<label>&>
(
Field<int>::subField(cellWeights, nCells, startCell)
Field<label>::subField(cellWeights, nCells, startCell)
)
: Field<int>(0)
: Field<label>(0)
)
<<
(
faceWeights.size()
? static_cast<const Field<int>&>
? static_cast<const Field<label>&>
(
Field<int>::subField(faceWeights, nFaces, startFace)
Field<label>::subField(faceWeights, nFaces, startFace)
)
: Field<int>(0)
: Field<label>(0)
);
// Remove data that has been sent
@ -248,9 +248,9 @@ Foam::label Foam::parMetisDecomp::decompose
}
// Weight info
int wgtFlag = 0;
int* vwgtPtr = nullptr;
int* adjwgtPtr = nullptr;
label wgtFlag = 0;
label* vwgtPtr = nullptr;
label* adjwgtPtr = nullptr;
if (cellWeights.size())
{
@ -265,7 +265,7 @@ Foam::label Foam::parMetisDecomp::decompose
// Number of weights or balance constraints
int nCon = 1;
label nCon = 1;
// Per processor, per constraint the weight
Field<real_t> tpwgts(nCon*nProcessors_, 1./nProcessors_);
// Imbalance tolerance
@ -282,8 +282,10 @@ Foam::label Foam::parMetisDecomp::decompose
finalDecomp.setSize(nLocalCells[Pstream::myProcNo()]);
// output: number of cut edges
int edgeCut = 0;
label edgeCut = 0;
// Number of parts
label nProcs = nProcessors_;
ParMETIS_V3_PartGeomKway
(
@ -297,10 +299,10 @@ Foam::label Foam::parMetisDecomp::decompose
&nDims,
xyz.begin(),
&nCon,
&nProcessors_, // nParts
&nProcs, // nParts
tpwgts.begin(),
ubvec.begin(),
const_cast<List<int>&>(options).begin(),
const_cast<List<label>&>(options).begin(),
&edgeCut,
finalDecomp.begin(),
&comm
@ -315,7 +317,7 @@ Foam::label Foam::parMetisDecomp::decompose
{
IPstream fromNextProc(Pstream::blocking, Pstream::myProcNo()+1);
List<int> nextFinalDecomp(fromNextProc);
List<label> nextFinalDecomp(fromNextProc);
if (nextFinalDecomp.size() != nSendCells[Pstream::myProcNo()])
{
@ -334,10 +336,10 @@ Foam::label Foam::parMetisDecomp::decompose
{
OPstream toPrevProc(Pstream::blocking, Pstream::myProcNo()-1);
int nToPrevious = nSendCells[Pstream::myProcNo()-1];
label nToPrevious = nSendCells[Pstream::myProcNo()-1];
toPrevProc <<
SubList<int>
SubList<label>
(
finalDecomp,
nToPrevious,
@ -399,9 +401,9 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Connections
Field<int> adjncy;
Field<label> adjncy;
// Offsets into adjncy
Field<int> xadj;
Field<label> xadj;
calcDistributedCSR
(
mesh_,
@ -411,16 +413,16 @@ Foam::labelList Foam::parMetisDecomp::decompose
// decomposition options. 0 = use defaults
List<int> options(3, 0);
List<label> options(3, label(0));
//options[0] = 1; // don't use defaults but use values below
//options[1] = -1; // full debug info
//options[2] = 15; // random number seed
// cell weights (so on the vertices of the dual)
Field<int> cellWeights;
Field<label> cellWeights;
// face weights (so on the edges of the dual)
Field<int> faceWeights;
Field<label> faceWeights;
// Check for externally provided cellweights and if so initialise weights
@ -527,7 +529,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
faceWeights.setSize(adjncy.size());
// Assume symmetric weights. Keep same ordering as adjncy.
List<int> nFacesPerCell(mesh_.nCells(), 0);
List<label> nFacesPerCell(mesh_.nCells(), 0);
// Handle internal faces
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
@ -581,7 +583,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Do actual decomposition
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
xadj,
@ -636,7 +638,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Get renumbered owner region on other side of coupled faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<int> globalNeighbour(mesh_.nFaces()-mesh_.nInternalFaces());
List<label> globalNeighbour(mesh_.nFaces()-mesh_.nInternalFaces());
forAll(patches, patchI)
{
@ -781,24 +783,24 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Make Metis Distributed CSR (Compressed Storage Format) storage
// Connections
Field<int> adjncy;
Field<label> adjncy;
// Offsets into adjncy
Field<int> xadj;
Field<label> xadj;
calcCSR(globalCellCells, adjncy, xadj);
// decomposition options. 0 = use defaults
List<int> options(3, 0);
List<label> options(3, label(0));
//options[0] = 1; // don't use defaults but use values below
//options[1] = -1; // full debug info
//options[2] = 15; // random number seed
// cell weights (so on the vertices of the dual)
Field<int> cellWeights;
Field<label> cellWeights;
// face weights (so on the edges of the dual)
Field<int> faceWeights;
Field<label> faceWeights;
// Check for externally provided cellweights and if so initialise weights
@ -860,7 +862,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Do actual decomposition
List<int> finalDecomp;
List<label> finalDecomp;
decompose
(
xadj,

View file

@ -72,14 +72,14 @@ class parMetisDecomp
label decompose
(
Field<int>& xadj,
Field<int>& adjncy,
Field<label>& xadj,
Field<label>& adjncy,
const pointField& cellCentres,
Field<int>& cellWeights,
Field<int>& faceWeights,
const List<int>& options,
Field<label>& cellWeights,
Field<label>& faceWeights,
const List<label>& options,
List<int>& finalDecomp
List<label>& finalDecomp
);

View file

@ -164,11 +164,11 @@ void Foam::scotchDecomp::check(const int retVal, const char* str)
// Call scotch with options from dictionary.
Foam::label Foam::scotchDecomp::decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
)
{
// Dump graph
@ -247,7 +247,7 @@ Foam::label Foam::scotchDecomp::decompose
// Graph
// ~~~~~
List<int> velotab;
List<label> velotab;
// Check for externally provided cellweights and if so initialise weights
@ -443,12 +443,12 @@ Foam::labelList Foam::scotchDecomp::decompose
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
List<label> adjncy;
List<label> xadj;
calcCSR(mesh_, adjncy, xadj);
// Decompose using default weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose(adjncy, xadj, pointWeights, finalDecomp);
// Copy back to labelList
@ -485,8 +485,8 @@ Foam::labelList Foam::scotchDecomp::decompose
// Make Metis CSR (Compressed Storage Format) storage
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
List<label> adjncy;
List<label> xadj;
{
// Get cellCells on coarse mesh.
labelListList cellCells;
@ -503,7 +503,7 @@ Foam::labelList Foam::scotchDecomp::decompose
}
// Decompose using weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose(adjncy, xadj, coarseWeights, finalDecomp);
// Rework back into decomposition for original mesh_
@ -543,12 +543,12 @@ Foam::labelList Foam::scotchDecomp::decompose
// adjncy : contains neighbours (= edges in graph)
// xadj(celli) : start of information in adjncy for celli
List<int> adjncy;
List<int> xadj;
List<label> adjncy;
List<label> xadj;
calcCSR(globalCellCells, adjncy, xadj);
// Decompose using weights
List<int> finalDecomp;
List<label> finalDecomp;
decompose(adjncy, xadj, cWeights, finalDecomp);
// Copy back to labelList

View file

@ -68,10 +68,10 @@ class scotchDecomp
label decompose
(
const List<int>& adjncy,
const List<int>& xadj,
const List<label>& adjncy,
const List<label>& xadj,
const scalarField& cWeights,
List<int>& finalDecomp
List<label>& finalDecomp
);

View file

@ -630,7 +630,14 @@ void Foam::addPatchCellLayer::setRefinement
{
labelList n(mesh_.nPoints(), 0);
IndirectList<label>(n, meshPoints) = nPointLayers;
syncTools::syncPointList(mesh_, n, maxEqOp<label>(), 0, false);
syncTools::syncPointList
(
mesh_,
n,
maxEqOp<label>(),
label(0),
false
);
// Non-synced
forAll(meshPoints, i)
@ -674,7 +681,7 @@ void Foam::addPatchCellLayer::setRefinement
mesh_,
nFromFace,
maxEqOp<label>(),
0,
label(0),
false
);
@ -1116,7 +1123,7 @@ void Foam::addPatchCellLayer::setRefinement
mesh_,
meshEdgeLayers,
maxEqOp<label>(),
0, // initial value
label(0), // initial value
false // no separation
);

View file

@ -707,7 +707,7 @@ void Foam::combineFaces::setRefinement
mesh_,
nPointFaces,
plusEqOp<label>(),
0, // null value
label(0), // null value
false // no separation
);

View file

@ -1379,7 +1379,7 @@ void Foam::directTopoChange::calcCellInflationMaps
{
label nCellsFromFaces = 0;
labelList cellsAroundFace(2, -1);
labelList cellsAroundFace(2, label(-1));
// Collect all still existing faces connected to this point.
forAllConstIter(Map<label>, cellFromFace_, iter)

View file

@ -1453,7 +1453,7 @@ void Foam::refinement::setRefinement(polyTopoChange& ref) const
mesh_,
pointLevel_,
maxEqOp<label>(),
0, // Null value
label(0), // Null value
true // Apply separation for parallel cyclics
);

View file

@ -1671,7 +1671,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
}
}
labelList cellsAroundFace(2, -1);
labelList cellsAroundFace(2, label(-1));
cellsAroundFace[0] = mesh.faceOwner()[ac[acI].masterFaceID()];

View file

@ -2406,7 +2406,7 @@ const changeMap dynamicTopoFvMesh::insertCells(const label mIndex)
(
pointJ,
meshJ.oldPoints_[pItJ.key()],
labelList(1, -1)
labelList(1, label(-1))
)
);
@ -2500,7 +2500,7 @@ const changeMap dynamicTopoFvMesh::insertCells(const label mIndex)
(
pointI,
meshI.oldPoints_[pItI.key()],
labelList(1, -1)
labelList(1, label(-1))
)
);
@ -3053,7 +3053,7 @@ const changeMap dynamicTopoFvMesh::insertCells(const label mIndex)
// - Set an invalid number so that
// an entry is made in facesFromFaces,
// while faceParents is empty.
setFaceMapping(fI(), labelList(1, -1));
setFaceMapping(fI(), labelList(1, label(-1)));
}
else
{

View file

@ -91,7 +91,7 @@ void dynamicTopoFvMesh::computeMapping
if (skipMapping)
{
// Dummy map from cell[0]
masterObjects = labelList(1, 0);
masterObjects = labelList(1, label(0));
cellWeights_[cellI].setSize(1, 1.0);
cellCentres_[cellI].setSize(1, vector::zero);
}
@ -248,7 +248,7 @@ void dynamicTopoFvMesh::computeMapping
{
// Set dummy masters, so that the conventional
// faceMapper doesn't crash-and-burn
masterObjects = labelList(1, 0);
masterObjects = labelList(1, label(0));
continue;
}
@ -256,7 +256,7 @@ void dynamicTopoFvMesh::computeMapping
if (skipMapping)
{
// Dummy map from patch[0]
masterObjects = labelList(1, 0);
masterObjects = labelList(1, label(0));
faceWeights_[faceI].setSize(1, 1.0);
faceCentres_[faceI].setSize(1, vector::zero);
}

View file

@ -1901,7 +1901,7 @@ void dynamicTopoFvMesh::threadedMeshReOrdering
reOrderPtr[3].set(0, &cellZoneMap);
// Set the thread scheduling sequence
labelList reOrderSeq(4, -1);
labelList reOrderSeq(4, label(-1));
// Points, cells, faces and edges (in that order)
reOrderSeq[0] = 0;

View file

@ -110,7 +110,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
bool found;
label replaceFace = -1, retainFace = -1;
face tmpQuadFace(4), tmpTriFace(3);
labelList tmpQFEdges(4, -1), tmpTFEdges(3, -1);
labelList tmpQFEdges(4, label(-1)), tmpTFEdges(3, label(-1));
FixedList<label,7> newFaceIndex(-1), newEdgeIndex(-1);
FixedList<edge,4> commonEdges(edge(-1, -1));
FixedList<label,4> cornerEdgeIndex(-1), commonEdgeIndex(-1);
@ -455,7 +455,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
// Fill the masterMap with points that
// we seek maps for...
FixedList<labelList, 2> slaveEdges(labelList(2, -1));
FixedList<labelList, 2> slaveEdges(labelList(2, label(-1)));
forAll(slaveEdges, edgeI)
{
@ -597,7 +597,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
// Write out VTK files prior to change
if (debug > 3)
{
labelList cellHull(2, -1);
labelList cellHull(2, label(-1));
cellHull[0] = owner_[fIndex];
cellHull[1] = neighbour_[fIndex];
@ -632,7 +632,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
otherEdgePoint[0] = commonEdges[0].otherVertex(nextToOtherPoint[0]);
otherEdgePoint[1] = commonEdges[1].otherVertex(nextToOtherPoint[1]);
labelList mP(2, -1);
labelList mP(2, label(-1));
// Set mapping for this point
mP[0] = commonEdges[0][0];
@ -1000,7 +1000,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
);
// Create / modify edges...
labelList tmpTriEdgeFaces(3, -1);
labelList tmpTriEdgeFaces(3, label(-1));
// The edge bisecting the zeroth boundary triangular face
tmpTriEdgeFaces[0] = c0BdyIndex[0];
@ -1125,7 +1125,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
newCells[0]
);
labelList tmpBiEdgeFaces(2, -1);
labelList tmpBiEdgeFaces(2, label(-1));
// The edge bisecting the face
tmpTriEdgeFaces[0] = newFaceIndex[3];
@ -1636,7 +1636,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
);
// Create / modify edges...
labelList tmpQuadEdgeFaces(4, -1);
labelList tmpQuadEdgeFaces(4, label(-1));
// The internal edge bisecting the face
tmpQuadEdgeFaces[0] = fIndex;
@ -2197,7 +2197,7 @@ const changeMap dynamicTopoFvMesh::bisectQuadFace
// Write out VTK files after change
if (debug > 3)
{
labelList cellHull(4, -1);
labelList cellHull(4, label(-1));
cellHull[0] = owner_[fIndex];
cellHull[1] = neighbour_[fIndex];
@ -2838,9 +2838,9 @@ const changeMap dynamicTopoFvMesh::bisectEdge
// Hull variables
face tmpTriFace(3);
edge origEdge(edges_[eIndex]);
labelList tmpEdgeFaces(3,-1);
labelList tmpIntEdgeFaces(4,-1);
labelList tmpFaceEdges(3,-1);
labelList tmpEdgeFaces(3, label(-1));
labelList tmpIntEdgeFaces(4, label(-1));
labelList tmpFaceEdges(3, label(-1));
// Build vertexHull for this edge
labelList vertexHull;
@ -2848,9 +2848,9 @@ const changeMap dynamicTopoFvMesh::bisectEdge
// Size up the hull lists
label m = vertexHull.size();
labelList cellHull(m, -1);
labelList faceHull(m, -1);
labelList edgeHull(m, -1);
labelList cellHull(m, label(-1));
labelList faceHull(m, label(-1));
labelList edgeHull(m, label(-1));
labelListList ringEntities(4, labelList(m, -1));
// Construct a hull around this edge
@ -2917,7 +2917,7 @@ const changeMap dynamicTopoFvMesh::bisectEdge
}
}
labelList mP(2, -1);
labelList mP(2, label(-1));
// Set mapping for this point
mP[0] = edges_[eIndex][0];
@ -3108,7 +3108,7 @@ const changeMap dynamicTopoFvMesh::bisectEdge
tmpTriFace,
addedCellIndices[indexI],
-1,
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -3188,7 +3188,7 @@ const changeMap dynamicTopoFvMesh::bisectEdge
tmpTriFace,
addedCellIndices[prevI],
addedCellIndices[indexI],
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -3278,7 +3278,7 @@ const changeMap dynamicTopoFvMesh::bisectEdge
tmpTriFace,
addedCellIndices[0],
addedCellIndices[indexI],
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -3370,7 +3370,7 @@ const changeMap dynamicTopoFvMesh::bisectEdge
tmpTriFace,
addedCellIndices[prevI],
-1,
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -4941,7 +4941,7 @@ const changeMap dynamicTopoFvMesh::addCellLayer
addedCells.insert(cIndex, labelPair(newCellIndex, 0));
}
labelList mP(2, -1);
labelList mP(2, label(-1));
forAll(patchFaces, indexI)
{
@ -5211,7 +5211,7 @@ const changeMap dynamicTopoFvMesh::addCellLayer
}
// Configure faceEdges for the new vertical face
labelList newVFaceEdges(4, -1);
labelList newVFaceEdges(4, label(-1));
newVFaceEdges[0] = beIndex;
newVFaceEdges[1] = newHEdgeIndex;

View file

@ -2471,7 +2471,7 @@ const changeMap dynamicTopoFvMesh::collapseQuadFace
}
// Ensure proper orientation for the two retained faces
FixedList<label,2> cellCheck(0);
FixedList<label,2> cellCheck(label(0));
if (owner_[faceToThrow[0]] == c0)
{
@ -3142,7 +3142,7 @@ const changeMap dynamicTopoFvMesh::collapseQuadFace
}
// Fill-in candidate mapping information
labelList mC(2, -1);
labelList mC(2, label(-1));
mC[0] = c0, mC[1] = c1;
// Now that all old / new cells possess correct connectivity,
@ -4781,7 +4781,10 @@ const changeMap dynamicTopoFvMesh::collapseEdge
// Check whether points of the edge lies on a boundary
const FixedList<bool,2> edgeBoundary = checkEdgeBoundary(eIndex);
FixedList<label, 2> nBoundCurves(0), nProcCurves(0), checkPoints(-1);
FixedList<label, 2>
nBoundCurves(label(0)),
nProcCurves(label(0)),
checkPoints(label(-1));
// Decide on collapseCase
label collapseCase = -1;

View file

@ -717,7 +717,7 @@ const changeMap dynamicTopoFvMesh::swapQuadFace
// Write out VTK files before change
if (debug > 3)
{
labelList cellHull(2, -1);
labelList cellHull(2, label(-1));
cellHull[0] = c0;
cellHull[1] = c1;
@ -1041,7 +1041,7 @@ const changeMap dynamicTopoFvMesh::swapQuadFace
edges_[commonEdgeIndex[1]] = newEdges[1];
// Fill-in mapping information
labelList mC(2, -1);
labelList mC(2, label(-1));
mC[0] = c0; mC[1] = c1;
forAll(mC, cellI)
@ -1056,7 +1056,7 @@ const changeMap dynamicTopoFvMesh::swapQuadFace
// Write out VTK files after change
if (debug > 3)
{
labelList cellHull(2, -1);
labelList cellHull(2, label(-1));
cellHull[0] = c0;
cellHull[1] = c1;
@ -3080,7 +3080,7 @@ const changeMap dynamicTopoFvMesh::swap32
newTriFace,
newCellIndex[0],
newCellIndex[1],
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -3099,8 +3099,8 @@ const changeMap dynamicTopoFvMesh::swap32
// For 2-2 swaps, two faces are introduced
label nE = 0, nBf = 0;
FixedList<label,2> nBE(0);
FixedList<labelList,2> bdyFaceEdges(labelList(3, -1));
FixedList<label,2> nBE(label(0));
FixedList<labelList,2> bdyFaceEdges(labelList(3, label(-1)));
// Fill-in information for the two new cells,
// and correct info on existing neighbouring cells
@ -3111,14 +3111,14 @@ const changeMap dynamicTopoFvMesh::swap32
// For a 2-2 swap on a boundary edge,
// add two boundary faces and an edge
label newEdgeIndex = -1;
labelList oldBdyFaceIndex(2, -1), newBdyFaceIndex(2, -1);
labelList oldBdyFaceIndex(2, label(-1)), newBdyFaceIndex(2, label(-1));
if (edgePatch > -1)
{
// Temporary local variables
label facePatch = -1;
edge newEdge(-1, -1);
FixedList<label,2> nBEdge(0);
FixedList<label,2> nBEdge(label(0));
FixedList<FixedList<label,2>,2> bdyEdges;
FixedList<face,2> newBdyTriFace(face(3));
@ -3204,7 +3204,7 @@ const changeMap dynamicTopoFvMesh::swap32
newBdyTriFace[0],
newCellIndex[1],
-1,
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -3220,7 +3220,7 @@ const changeMap dynamicTopoFvMesh::swap32
newBdyTriFace[1],
newCellIndex[0],
-1,
labelList(3, -1)
labelList(3, label(-1))
)
);
@ -3232,7 +3232,7 @@ const changeMap dynamicTopoFvMesh::swap32
newTetCell[1][nF1++] = newBdyFaceIndex[0];
// Add an edgeFaces entry
labelList newBdyEdgeFaces(3, -1);
labelList newBdyEdgeFaces(3, label(-1));
newBdyEdgeFaces[0] = newBdyFaceIndex[0];
newBdyEdgeFaces[1] = newFaceIndex;
newBdyEdgeFaces[2] = newBdyFaceIndex[1];

View file

@ -362,7 +362,7 @@ void topoPatchMapper::calcAddressing() const
if (isA<processorPolyPatch>(patch_.patch()))
{
// Artificially map from face[0] of this patch.
addr[faceI] = labelList(1, 0);
addr[faceI] = labelList(1, label(0));
continue;
}

View file

@ -1248,7 +1248,7 @@ void mesquiteMotionSolver::initArrays()
label nCellPoints = 0, nFacePoints = 0;
// Construct shape recognizers
FixedList<label, 4> nTypes(0);
FixedList<label, 4> nTypes(label(0));
FixedList<autoPtr<cellMatcher>, 4> matcher;
FixedList<Mesquite::EntityTopology, 4> cellType;
@ -2513,7 +2513,7 @@ void mesquiteMotionSolver::initMesquiteParallelArrays()
nSharedPoints[pI] = nProcPoints;
// Initialize type sizes
FixedList<label, 4> nTypes(0);
FixedList<label, 4> nTypes(label(0));
// Set an initial capacity for cell types
myTypes[pI].setCapacity(50);

View file

@ -521,7 +521,7 @@ Foam::faMesh::faMesh
{
label curMeshEdge = meshEdges[edgeI];
labelList curEdgePatchIDs(2, -1);
labelList curEdgePatchIDs(2, label(-1));
label patchI = -1;
@ -1054,13 +1054,13 @@ void Foam::faMesh::addFaPatches(const List<faPatch*>& p)
}
Foam::label Foam::faMesh::comm() const
int Foam::faMesh::comm() const
{
return comm_;
}
Foam::label& Foam::faMesh::comm()
int& Foam::faMesh::comm()
{
return comm_;
}

View file

@ -116,7 +116,7 @@ class faMesh
// Communication support
//- Communicator used for parallel communication
label comm_;
int comm_;
// Demand-driven data
@ -380,10 +380,10 @@ public:
// Communication support
//- Return communicator used for parallel communication
label comm() const;
int comm() const;
//- Return communicator used for parallel communication
label& comm();
int& comm();
// Access

View file

@ -56,7 +56,7 @@ processorFaPatch::~processorFaPatch()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::processorFaPatch::comm() const
int Foam::processorFaPatch::comm() const
{
return boundaryMesh().mesh().comm();
}

View file

@ -211,7 +211,7 @@ public:
// Communications support
//- Return communicator used for communication
virtual label comm() const;
virtual int comm() const;
//- Return message tag to use for communication
virtual int tag() const;

View file

@ -94,7 +94,7 @@ void Foam::fvSurfaceMapper::calcAddressing() const
{
if (max(addr[faceI]) >= oldNInternal)
{
addr[faceI] = labelList(1, 0);
addr[faceI] = labelList(1, label(0));
w[faceI] = scalarList(1, 1.0);
}
}

View file

@ -1279,7 +1279,7 @@ template <class Type>
void Foam::treeNode<Type>::writeOBJ
(
Ostream& os,
const label level,
const int level,
label& vertNo
) const
{

View file

@ -278,7 +278,7 @@ public:
// Updates: start
const treeLeaf<Type>* findLeafLine
(
const label level,
const int level,
const Type& shapes,
point& start,
const point& end
@ -314,7 +314,7 @@ public:
void writeOBJ
(
Ostream& os,
const label level,
const int level,
label& vertNo
) const;

View file

@ -157,7 +157,7 @@ Foam::label Foam::IPstream::read
// Check size of message read
label messageSize;
int messageSize;
MPI_Get_count(&status, MPI_BYTE, &messageSize);
if (messageSize > bufSize)

View file

@ -65,7 +65,7 @@ class IPstream
const label comm_;
//- Message size
label messageSize_;
int messageSize_;
// Private member functions

View file

@ -311,8 +311,13 @@ void Foam::Pstream::allocatePstreamCommunicator
// Set the number of processes to the actual number
int numProcs;
MPI_Comm_size(PstreamGlobals::MPICommunicators_[index], &numProcs);
procIDs_[index] = identity(numProcs);
}
//procIDs_[index] = identity(numProcs);
procIDs_[index].setSize(numProcs);
forAll(procIDs_[index], i)
{
procIDs_[index][i] = i;
}
}
else
{
// Create new group
@ -905,7 +910,7 @@ Foam::Pstream::treeCommunication_(10);
// Allocate a serial communicator. This gets overwritten in parallel mode
// (by Pstream::setParRun())
Foam::Pstream::communicator serialComm(-1, Foam::labelList(1, 0), false);
Foam::Pstream::communicator serialComm(-1, Foam::labelList(1, Foam::label(0)), false);
// Number of processors at which the reduce algorithm changes from linear to
// tree

View file

@ -46,11 +46,17 @@ Foam::List<T> Foam::transform
template <class T>
void Foam::transformList
(
const tensorField& rotTensor,
UList<T>& field
)
void Foam::transformList(const tensor& rotTensor, UList<T>& field)
{
forAll(field, i)
{
field[i] = transform(rotTensor, field[i]);
}
}
template <class T>
void Foam::transformList(const tensorField& rotTensor, UList<T>& field)
{
if (rotTensor.size() == 1)
{
@ -79,11 +85,17 @@ void Foam::transformList
template <class T>
void Foam::transformList
(
const tensorField& rotTensor,
Map<T>& field
)
void Foam::transformList(const tensor& rotTensor, Map<T>& field)
{
forAllIter(typename Map<T>, field, iter)
{
iter() = transform(rotTensor[0], iter());
}
}
template <class T>
void Foam::transformList(const tensorField& rotTensor, Map<T>& field)
{
if (rotTensor.size() == 1)
{
@ -105,11 +117,17 @@ void Foam::transformList
template <class T>
void Foam::transformList
(
const tensorField& rotTensor,
EdgeMap<T>& field
)
void Foam::transformList(const tensor& rotTensor, EdgeMap<T>& field)
{
forAllIter(typename EdgeMap<T>, field, iter)
{
iter() = transform(rotTensor[0], iter());
}
}
template <class T>
void Foam::transformList(const tensorField& rotTensor, EdgeMap<T>& field)
{
if (rotTensor.size() == 1)
{

View file

@ -60,33 +60,80 @@ List<T> transform
//- Apply transformation to list. Either single transformation tensor
// or one tensor per element.
template<class T>
void transformList(const tensor&, UList<T>&);
template<class T>
void transformList(const tensorField&, UList<T>&);
template<class T>
void transformList(const tensor&, Map<T>&);
template<class T>
void transformList(const tensorField&, Map<T>&);
template<class T>
void transformList(const tensor&, EdgeMap<T>&);
template<class T>
void transformList(const tensorField&, EdgeMap<T>&);
// Specialisations for bool
template<>
inline void transformList(const tensorField&, UList<label>&)
inline void transformList(const tensor&, UList<bool>&)
{}
template<>
inline void transformList(const tensorField&, UList<bool>&)
{}
template<>
inline void transformList(const tensor&, Map<bool>&)
{}
template<>
inline void transformList(const tensorField&, Map<bool>&)
{}
template<>
inline void transformList(const tensor&, EdgeMap<bool>&)
{}
template<>
inline void transformList(const tensorField&, EdgeMap<bool>&)
{}
// Specialisations for label
template<>
inline void transformList(const tensor&, labelUList&)
{}
template<>
inline void transformList(const tensorField&, labelUList&)
{}
template<>
inline void transformList(const tensor&, Map<label>&)
{}
template<>
inline void transformList(const tensorField&, Map<label>&)
{}
template<>
inline void transformList(const tensor&, EdgeMap<label>&)
{}
template<>
inline void transformList(const tensorField&, EdgeMap<label>&)
{}
// Specialisations for scalar
template<>
inline void transformList(const tensor&, UList<scalar>&)
{}
template<>
inline void transformList(const tensorField&, UList<scalar>&)
{}
template<>
inline void transformList(const tensor&, Map<scalar>&)
{}
template<>
inline void transformList(const tensorField&, Map<scalar>&)
{}
template<>
inline void transformList(const tensor&, EdgeMap<scalar>&)
{}
template<>
inline void transformList(const tensorField&, EdgeMap<scalar>&)
{}

View file

@ -81,18 +81,18 @@ inline bool operator==
const debug::controlSwitches<T>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator==
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator==
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
);
template<class T>
@ -102,18 +102,18 @@ inline bool operator!=
const debug::controlSwitches<T>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator!=
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator!=
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
);
template<class T>
@ -123,18 +123,18 @@ inline bool operator>=
const debug::controlSwitches<T>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator>=
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator>=
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
);
template<class T>
@ -144,18 +144,18 @@ inline bool operator>
const debug::controlSwitches<T>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator>
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator>
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
);
template<class T>
@ -165,18 +165,18 @@ inline bool operator<=
const debug::controlSwitches<T>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator<=
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator<=
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
);
template<class T>
@ -186,11 +186,11 @@ inline bool operator<
const debug::controlSwitches<T>& rhs
);
template<class T>
template<class T1, class T2>
inline bool operator<
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
);
template<class T>

View file

@ -41,33 +41,33 @@ inline const T Foam::debug::controlSwitches<T>::operator&(const T& rhs)
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class T>
template<class T1, class T2>
inline bool Foam::operator==
(
const debug::controlSwitches<T>& lhs,
const debug::controlSwitches<T>& rhs
const debug::controlSwitches<T1>& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs() == rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator==
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs == rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator==
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
)
{
return lhs() == rhs;
@ -85,22 +85,22 @@ inline bool Foam::operator!=
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator!=
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs != rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator!=
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
)
{
return lhs() != rhs;
@ -118,22 +118,22 @@ inline bool Foam::operator>=
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator>=
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs >= rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator>=
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
)
{
return lhs() >= rhs;
@ -151,22 +151,22 @@ inline bool Foam::operator>
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator>
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs > rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator>
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
)
{
return lhs() > rhs;
@ -184,22 +184,22 @@ inline bool Foam::operator<=
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator<=
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs <= rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator<=
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
)
{
return lhs() <= rhs;
@ -217,22 +217,22 @@ inline bool Foam::operator<
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator<
(
const T& lhs,
const debug::controlSwitches<T>& rhs
const T1& lhs,
const debug::controlSwitches<T2>& rhs
)
{
return lhs < rhs();
}
template<class T>
template<class T1, class T2>
inline bool Foam::operator<
(
const debug::controlSwitches<T>& lhs,
const T& rhs
const debug::controlSwitches<T1>& lhs,
const T2& rhs
)
{
return lhs() < rhs;

View file

@ -130,7 +130,7 @@ void Foam::BlockLduMatrix<Type>::updateInterfaces
// Try and consume interfaces as they become available
bool allUpdated = false;
for (label i = 0; i < Pstream::nPollProcInterfaces; i++)
for (int i = 0; i < Pstream::nPollProcInterfaces; i++)
{
allUpdated = true;

View file

@ -59,7 +59,7 @@ Foam::autoPtr<Foam::crMatrix> Foam::lduInterface::prolongationTransfer
);
// Dummy return to make the compiler happy
return autoPtr<crMatrix>(new crMatrix(1, 1, labelList(1, 0)));
return autoPtr<crMatrix>(NULL);
}

View file

@ -70,7 +70,7 @@ class lduPrimitiveMesh
lduSchedule patchSchedule_;
//- Communicator to use for parallel communication
const label comm_;
const int comm_;
// Private Member Functions
@ -93,7 +93,7 @@ public:
const label nCells,
const unallocLabelList& l,
const unallocLabelList& u,
const label comm
const int comm
)
:
lduAddressing(nCells),
@ -109,7 +109,7 @@ public:
const label nCells,
labelList& l,
labelList& u,
const label comm,
const int comm,
bool reUse
)
:
@ -203,7 +203,7 @@ public:
}
//- Return communicator used for parallel communication
virtual label comm() const
virtual int comm() const
{
return comm_;
}

View file

@ -88,7 +88,7 @@ void Foam::pointPatchMapper::calcAddressing() const
else
{
// Inserted point. Map from point0 (arbitrary choice)
addr[i] = labelList(1, 0);
addr[i] = labelList(1, label(0));
w[i] = scalarList(1, 1.0);
}
}

View file

@ -202,7 +202,7 @@ void Foam::cellMapper::calcAddressing() const
if (addr[cellI].empty())
{
// Mapped from a dummy cell
addr[cellI] = labelList(1, 0);
addr[cellI] = labelList(1, label(0));
w[cellI] = scalarList(1, 1.0);
insertedCells[nInsertedCells] = cellI;

View file

@ -177,7 +177,7 @@ void Foam::faceMapper::calcAddressing() const
if (addr[faceI].empty())
{
// Mapped from a dummy face
addr[faceI] = labelList(1, 0);
addr[faceI] = labelList(1, label(0));
w[faceI] = scalarList(1, 1.0);
insertedFaces[nInsertedFaces] = faceI;

View file

@ -138,7 +138,7 @@ void Foam::pointMapper::calcAddressing() const
if (addr[pointI].size() == 0)
{
// Mapped from a dummy point. Take point 0 with weight 1.
addr[pointI] = labelList(1, 0);
addr[pointI] = labelList(1, label(0));
w[pointI] = scalarList(1, 1.0);
insertedPoints[nInsertedPoints] = pointI;

View file

@ -823,7 +823,7 @@ inline Cmpt det(const TensorN<Cmpt, length>& t)
}
// Handle +/- sign switch
result += pow(-1, i)*t(i, 0)*det(subMatrix);
result += pow(label(-1), i)*t(i, 0)*det(subMatrix);
}
return result;

View file

@ -70,6 +70,12 @@ inline tmp<tensorField> rotationTensor
}
inline label transform(const tensor&, const bool i)
{
return i;
}
inline label transform(const tensor&, const label i)
{
return i;

View file

@ -106,7 +106,7 @@ makeCompactCellFaceAddressingAndFaceWeights
Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
(
label& nCoarseCells,
int& nCoarseCells,
const label minSize,
const label maxSize,
const lduAddressing& fineAddressing,
@ -135,7 +135,7 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
);
// MGridGen agglomeration options.
labelList options(4, 0);
List<int> options(4);
options[0] = 4; // globular agglom
options[1] = 6; // objective F3 and F2
options[2] = 128; // debugging output level
@ -143,7 +143,7 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
// output: cell -> processor addressing
List<int> finalAgglom(nFineCells);
List<label> finalAgglom(nFineCells);
int nMoves = -1;
# ifdef WM_DP

View file

@ -95,7 +95,7 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
while (nCreatedLevels < maxLevels_ - 1)
{
label nCoarseCells = -1;
int nCoarseCells = -1;
tmp<labelField> finalAgglomPtr = agglomerate
(

View file

@ -74,7 +74,7 @@ class MGridGenGAMGAgglomeration
//- Calculate and return agglomeration
tmp<labelField> agglomerate
(
label& nCoarseCells,
int& nCoarseCells,
const label minSize,
const label maxSize,
const lduAddressing& fineAddressing,

View file

@ -128,7 +128,7 @@ void Foam::DsmcCloud<ParcelType>::initialise
// record the vertex labels of each.
scalarList cTetVFracs(nTets, 0.0);
List<labelList> tetPtIs(nTets, labelList(3,-1));
List<labelList> tetPtIs(nTets, labelList(3, label(-1)));
// Keep track of which tet this is.
label tet = 0;

View file

@ -1799,7 +1799,7 @@ void Foam::autoLayerDriver::getPatchDisplacement
meshPoints,
nPointFaces,
plusEqOp<label>(),
0, // null value
label(0), // null value
false // no separation
);
@ -2292,7 +2292,7 @@ void Foam::autoLayerDriver::setupLayerInfoTruncation
pp.meshPoints(),
nPatchPointLayers,
maxEqOp<label>(),
0, // null value
label(0), // null value
false // no separation
);
}

View file

@ -589,7 +589,7 @@ void Foam::autoLayerDriver::findIsolatedRegions
pp.meshPoints(),
isolatedPoint,
plusEqOp<label>(),
0, // null value
label(0), // null value
false // no separation
);
@ -734,7 +734,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
meshPoints,
nPointFaces,
plusEqOp<label>(),
0, // null value
label(0), // null value
false // no separation
);

View file

@ -290,7 +290,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
pp.meshPoints(),
nBoundary,
plusEqOp<label>(), // combine op
0, // null value
label(0), // null value
false // no separation
);
@ -385,7 +385,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
mesh,
globalNum,
plusEqOp<label>(), // combine op
0, // null value
label(0), // null value
false // no separation
);

View file

@ -1959,7 +1959,7 @@ void Foam::meshRefinement::updateMesh
);
// Update surfaceIndex
updateList(map.faceMap(), -1, surfaceIndex_);
updateList(map.faceMap(), label(-1), surfaceIndex_);
// Update cached intersection information
updateIntersections(changedFaces);
@ -1972,7 +1972,7 @@ void Foam::meshRefinement::updateMesh
if (userFaceData_[i].first() == KEEPALL)
{
// extend list with face-from-face data
updateList(map.faceMap(), -1, data);
updateList(map.faceMap(), label(-1), data);
}
else if (userFaceData_[i].first() == MASTERONLY)
{

View file

@ -687,7 +687,7 @@ Foam::List<Foam::labelPair> Foam::meshRefinement::filterDuplicateFaces
mesh_,
nBafflesPerEdge,
plusEqOp<label>(), // in-place add
0, // initial value
label(0), // initial value
false // no separation
);
@ -1830,7 +1830,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
mesh_,
pointBaffle,
maxEqOp<label>(),
-1, // null value
label(-1), // null value
false // no separation
);

View file

@ -498,7 +498,7 @@ void extrudeLayer::createNewVertices()
DynList<label> edgeGroup;
edgeGroup.setSize(dEdges.size());
edgeGroup = -1;
edgeGroup = label(-1);
//- check edge connections and store all edges which can be reached
//- over other edges into the same group
@ -538,7 +538,7 @@ void extrudeLayer::createNewVertices()
//- find face groups from the groups assigned to dual edges
DynList<label> faceGroups;
faceGroups.setSize(pointFaces.sizeOfRow(pointI));
faceGroups = -1;
faceGroups = label(-1);
forAllRow(pointFaces, pointI, pfI)
{
@ -618,7 +618,7 @@ void extrudeLayer::createNewVertices()
//- assign groups to faces and cells
DynList<label> faceGroup;
faceGroup.setSize(pointFaces.sizeOfRow(pointI));
faceGroup = -1;
faceGroup = label(-1);
label group(0);
@ -1114,7 +1114,7 @@ void extrudeLayer::createLayerCells()
//- find labels of points
DynList<label> origFacePoints;
origFacePoints.setSize(pointFaces.sizeOfRow(pointI));
origFacePoints = -1;
origFacePoints = label(-1);
forAllRow(pointFaces, pointI, pfI)
{

View file

@ -885,7 +885,7 @@ void refineBoundaryLayers::refineCornerHexCell::generateNewPoints()
forAll(cellPoints_[i], j)
{
cellPoints_[i][j].setSize(nLayersK_+1);
cellPoints_[i][j] = -1;
cellPoints_[i][j] = label(-1);
}
}

View file

@ -250,7 +250,7 @@ void refineBoundaryLayers::refineFace
forAll(facePoints, i)
{
facePoints[i].setSize(nLayersDir1+1);
facePoints[i] = -1;
facePoints[i] = label(-1);
}
//- add points in the matrix

View file

@ -269,7 +269,7 @@ bool refineBoundaryLayers::analyseLayers()
{
if( allZMin[patchI] ^ allZMax[patchI] )
{
nLayersAtPatch[patchI] = -1;
nLayersAtPatch[patchI] = label(-1);
layerAtPatch_[patchI].clear();
}
}
@ -599,7 +599,7 @@ void refineBoundaryLayers::generateNewVertices()
//- on edges of the mesh
DynList<label> numPointsAtThread;
numPointsAtThread.setSize(nThreads);
numPointsAtThread = 0;
numPointsAtThread = label(0);
# ifdef USE_OMP
# pragma omp parallel for num_threads(nThreads) schedule(static, 1)

View file

@ -100,6 +100,11 @@ public:
//- Construct given size
explicit inline DynList(const label);
#if WM_LABEL_SIZE == 64
//- Construct given size
explicit inline DynList(const int);
#endif
//- Construct from given size and defualt value
explicit inline DynList(const label, const T&);

View file

@ -102,6 +102,17 @@ inline Foam::DynList<T, staticSize>::DynList(const label s)
setSize(s);
}
#if WM_LABEL_SIZE == 64
template<class T, Foam::label staticSize>
inline Foam::DynList<T, staticSize>::DynList(const int s)
:
UList<T>(staticData_, staticSize),
nextFree_(0)
{
setSize(s);
}
#endif
template<class T, Foam::label staticSize>
inline Foam::DynList<T, staticSize>::DynList(const label s, const T& val)
:

View file

@ -23,7 +23,7 @@ License
Description
\*----------------------p-----------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "decomposeCells.H"
#include "helperFunctions.H"
@ -56,7 +56,7 @@ void decomposeCells::findAddressingForCell
forAll(faceEdges, feI)
{
faceEdges[feI].setSize(faces[c[feI]].size());
faceEdges[feI] = -1;
faceEdges[feI] = label(-1);
}
forAll(c, fI)

View file

@ -316,7 +316,7 @@ label groupMarking
//- ones into a new group
DynList<label> globalGroupLabel;
globalGroupLabel.setSize(nGroups);
globalGroupLabel = -1;
globalGroupLabel = label(-1);
//- reduce the information about the groups
label counter(0);

View file

@ -1056,7 +1056,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

@ -488,7 +488,7 @@ inline void zipOpenChain(DynList<edge>& bEdges)
}
bool closed(true);
DynList<label> openVertices(2);
DynList<label> openVertices(label(2));
forAll(chainVertices, pI)
if( nAppearances[pI] == 1 )
{

View file

@ -351,7 +351,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

@ -133,7 +133,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

@ -135,7 +135,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

@ -84,12 +84,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;
@ -133,7 +133,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 )
{
@ -230,7 +230,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 )
{
@ -308,7 +308,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 )
{
@ -380,7 +380,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

@ -97,7 +97,7 @@ inline meshOctreeCubeCoordinates meshOctreeCubeCoordinates::refineForPosition
) const
{
//- create new boxes in z-order fashion
FixedList<label, 3> addPos(0);
FixedList<label, 3> addPos(label(0));
if( i & 1 )
addPos[0] = 1;
if( i & 2 )

View file

@ -50,7 +50,7 @@ void meshUntangler::cutRegion::findNewEdges()
const DynList<edge, 128>& edges = *edgesPtr_;
newEdgeLabel_.setSize(edges.size());
newEdgeLabel_ = -1;
newEdgeLabel_ = label(-1);
forAll(edges, eI)
{

View file

@ -72,7 +72,7 @@ void meshUntangler::cutRegion::findNewFaces()
<< " consisting of edges " << f << endl;
# endif
pointUsage = 0;
pointUsage = label(0);
DynList<label, 8> newFace;
@ -144,7 +144,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

@ -58,7 +58,7 @@ bool meshUntangler::cutRegion::findNewVertices
const DynList<point, 64>& points = *pointsPtr_;
newVertexLabel_.setSize(points.size());
newVertexLabel_ = -1;
newVertexLabel_ = label(-1);
vertexDistance_.setSize(points.size());
@ -118,7 +118,7 @@ void meshUntangler::cutRegion::removeCoincidentVertices()
DynList<edge, 128>& edges = *edgesPtr_;
DynList<label, 64> newLabelForPoint;
newLabelForPoint.setSize(points.size());
newLabelForPoint = -1;
newLabelForPoint = label(-1);
bool found(false);
forAll(points, pI)
@ -150,7 +150,7 @@ void meshUntangler::cutRegion::removeCoincidentVertices()
}
//- remove edges which contain the same vertex
newEdgeLabel_ = -1;
newEdgeLabel_ = label(-1);
label edgeLabel(0);
cEdgesPtr_ = new DynList<edge, 128>();

View file

@ -83,7 +83,7 @@ void meshUntangler::cutRegion::tieBreak(const DynList<label, 8>& f)
DynList<label, 64> vertexRegion;
vertexRegion.setSize(fv.size());
vertexRegion = 0;
vertexRegion = label(0);
label region(1);
forAll(fv, vI)
@ -176,7 +176,7 @@ void meshUntangler::cutRegion::tieBreak(const DynList<label, 8>& f)
//- create new points
const DynList<point, 64>& points = *pointsPtr_;
cPtsPtr_ = new DynList<point, 64>();
newVertexLabel_ = -1;
newVertexLabel_ = label(-1);
origNumVertices_ = 0;
forAll(points, pI)
if( vertexTypes_[pI] )

View file

@ -1520,7 +1520,7 @@ bool edgeExtractor::checkConcaveEdgeCells()
DynList<label, 2> nFacesInPatch;
nFacesInPatch.setSize(2);
nFacesInPatch = 0;
nFacesInPatch = label(0);
DynList<bool, 2> hasPatchPoints;
hasPatchPoints.setSize(2);

View file

@ -211,7 +211,7 @@ void edgeExtractor::faceEvaluator::neiFacesProcs
const VRWGraph& faceEdges = mse.faceEdges();
neiProcs.setSize(faceEdges.sizeOfRow(bfI));
neiProcs = Pstream::myProcNo();
neiProcs = label(Pstream::myProcNo());
if( Pstream::parRun() )
{

View file

@ -91,7 +91,7 @@ void Foam::adaptiveOverlapFringe::suitabilityFractionSlope
forAllConstIter(FIFOStack<iterationData>, iterHist, it)
{
iterSum += it().iteration();
iterSquaredSum += pow(it().iteration(), 2);
iterSquaredSum += pow(it().iteration(), label(2));
suitabilitySum += it().suitability();
iterXSuitabilitySum += it().iteration()*it().suitability();
}

View file

@ -487,7 +487,7 @@ void solidInterface::makeProcessorPatchFacesMap() const
new labelListList
(
mesh_.boundary().size(),
labelList(0,-1)
labelList()
);
processorPatchMapPtr_ =
new labelList

View file

@ -142,7 +142,7 @@ void Foam::tetPolyPatchMapper::calcAddressing() const
}
else
{
addr[nAddr] = labelList(1, 0);
addr[nAddr] = labelList(1, label(0));
}
w[nAddr] = scalarList(1, 1.0);

View file

@ -116,13 +116,13 @@ tetPolyMesh::~tetPolyMesh()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::tetPolyMesh::comm() const
int Foam::tetPolyMesh::comm() const
{
return comm_;
}
Foam::label& Foam::tetPolyMesh::comm()
int& Foam::tetPolyMesh::comm()
{
return comm_;
}

View file

@ -139,7 +139,7 @@ class tetPolyMesh
label cellOffset_;
//- Communicator used for parallel communication
label comm_;
int comm_;
// Demand-driven data
@ -376,10 +376,10 @@ public:
// Communication support
//- Return communicator used for parallel communication
label comm() const;
int comm() const;
//- Return communicator used for parallel communication
label& comm();
int& comm();
// Edit

View file

@ -55,7 +55,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
absorptionEmissionModel(dict, mesh),
coeffsDict_((dict.subDict(typeName + "Coeffs"))),
speciesNames_(0),
specieIndex_(0),
specieIndex_(label(0)),
lookUpTable_
(
fileName(coeffsDict_.lookup("lookUpTableFileName")),

View file

@ -55,7 +55,7 @@ Foam::radiation::wideBandAbsorptionEmission::wideBandAbsorptionEmission
absorptionEmissionModel(dict, mesh),
coeffsDict_((dict.subDict(typeName + "Coeffs"))),
speciesNames_(0),
specieIndex_(0),
specieIndex_(label(0)),
lookUpTable_
(
fileName(coeffsDict_.lookup("lookUpTableFileName")),

Some files were not shown because too many files have changed in this diff Show more