mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use Zero when zero-initializing types
- makes the intent clearer and avoids the need for additional
constructor casting. Eg,
labelList(10, Zero) vs. labelList(10, 0)
scalarField(10, Zero) vs. scalarField(10, scalar(0))
vectorField(10, Zero) vs. vectorField(10, vector::zero)
This commit is contained in:
@ -29,8 +29,8 @@
|
||||
);
|
||||
}
|
||||
|
||||
scalarList Y0(nSpecie, 0.0);
|
||||
scalarList X0(nSpecie, 0.0);
|
||||
scalarList Y0(nSpecie, Zero);
|
||||
scalarList X0(nSpecie, Zero);
|
||||
|
||||
dictionary fractions(initialConditions.subDict("fractions"));
|
||||
if (fractionBasis == "mole")
|
||||
|
||||
@ -44,7 +44,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
||||
psiName_("thermo:psi"),
|
||||
muName_("thermo:mu"),
|
||||
accommodationCoeff_(1.0),
|
||||
Twall_(p.size(), 0.0),
|
||||
Twall_(p.size(), Zero),
|
||||
gamma_(1.4)
|
||||
{
|
||||
refValue() = 0.0;
|
||||
|
||||
@ -45,7 +45,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||
muName_("thermo:mu"),
|
||||
tauMCName_("tauMC"),
|
||||
accommodationCoeff_(1.0),
|
||||
Uwall_(p.size(), vector(0.0, 0.0, 0.0)),
|
||||
Uwall_(p.size(), Zero),
|
||||
thermalCreep_(true),
|
||||
curvature_(true)
|
||||
{}
|
||||
|
||||
@ -12,7 +12,7 @@ PtrList<radiation::radiationModel> radiation(fluidRegions.size());
|
||||
|
||||
List<scalar> initialMassFluid(fluidRegions.size());
|
||||
List<label> pRefCellFluid(fluidRegions.size(), -1);
|
||||
List<scalar> pRefValueFluid(fluidRegions.size(), 0.0);
|
||||
List<scalar> pRefValueFluid(fluidRegions.size(), Zero);
|
||||
List<bool> frozenFlowFluid(fluidRegions.size(), false);
|
||||
|
||||
PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
|
||||
|
||||
@ -248,7 +248,7 @@ forAll(fluidRegions, i)
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fluidRegions[i],
|
||||
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
|
||||
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
List<scalar> cumulativeContErr(fluidRegions.size(), 0.0);
|
||||
List<scalar> cumulativeContErr(fluidRegions.size(), Zero);
|
||||
|
||||
@ -11,7 +11,7 @@ labelListList donorCell(mesh.nInternalFaces());
|
||||
scalarListList weightCellCells(mesh.nInternalFaces());
|
||||
|
||||
// Interpolated HbyA faces
|
||||
vectorField UIntFaces(mesh.nInternalFaces(), vector::zero);
|
||||
vectorField UIntFaces(mesh.nInternalFaces(), Zero);
|
||||
|
||||
// Determine receptor neighbour cells
|
||||
labelList receptorNeigCell(mesh.nInternalFaces(), -1);
|
||||
@ -23,7 +23,7 @@ labelList receptorNeigCell(mesh.nInternalFaces(), -1);
|
||||
|
||||
label nZones = gMax(zoneID)+1;
|
||||
PtrList<fvMeshSubset> meshParts(nZones);
|
||||
labelList nCellsPerZone(nZones, 0);
|
||||
labelList nCellsPerZone(nZones, Zero);
|
||||
|
||||
// A mesh subset for each zone
|
||||
forAll(meshParts, zonei)
|
||||
@ -173,7 +173,7 @@ labelList receptorNeigCell(mesh.nInternalFaces(), -1);
|
||||
}
|
||||
|
||||
// contravariant U
|
||||
vectorField U1Contrav(mesh.nInternalFaces(), vector::zero);
|
||||
vectorField U1Contrav(mesh.nInternalFaces(), Zero);
|
||||
|
||||
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf());
|
||||
|
||||
@ -192,7 +192,8 @@ forAll(isNeiInterpolatedFace, faceI)
|
||||
if (cellId != -1)
|
||||
{
|
||||
const vector& n = faceNormals[faceI];
|
||||
vector n1 = vector::zero;
|
||||
vector n1(Zero);
|
||||
|
||||
// 2-D cases
|
||||
if (mesh.nSolutionD() == 2)
|
||||
{
|
||||
|
||||
@ -266,7 +266,7 @@ void VoFPatchTransfer::correct
|
||||
getModelProperty<scalarField>
|
||||
(
|
||||
"patchTransferredMasses",
|
||||
scalarField(patchTransferredMasses_.size(), 0)
|
||||
scalarField(patchTransferredMasses_.size(), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -302,7 +302,7 @@ void VoFPatchTransfer::patchTransferredMassTotals
|
||||
getModelProperty<scalarField>
|
||||
(
|
||||
"patchTransferredMasses",
|
||||
scalarField(patchTransferredMasses_.size(), 0)
|
||||
scalarField(patchTransferredMasses_.size(), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -48,8 +48,8 @@ Foam::DTRMParticle::DTRMParticle
|
||||
)
|
||||
:
|
||||
particle(mesh, is, readFields, newFormat),
|
||||
p0_(point::zero),
|
||||
p1_(point::zero),
|
||||
p0_(Zero),
|
||||
p1_(Zero),
|
||||
I0_(0),
|
||||
I_(0),
|
||||
dA_(0),
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::vector Foam::radiation::noReflection::R
|
||||
const vector& n
|
||||
) const
|
||||
{
|
||||
return (vector::zero);
|
||||
return vector::zero;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
kappaEff = thermo->kappa() + rho*cp*turbulence->nut()/Prt;
|
||||
|
||||
pDivU = dimensionedScalar("pDivU", p.dimensions()/dimTime, 0.0);
|
||||
pDivU = dimensionedScalar("pDivU", p.dimensions()/dimTime, Zero);
|
||||
|
||||
if (thermo->pDivU())
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ fixedMultiPhaseHeatFluxFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
q_(p.size(), 0.0),
|
||||
q_(p.size(), Zero),
|
||||
relax_(1.0)
|
||||
{}
|
||||
|
||||
@ -131,9 +131,9 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const scalarField& Tp = *this;
|
||||
|
||||
scalarField A(Tp.size(), scalar(0));
|
||||
scalarField B(Tp.size(), scalar(0));
|
||||
scalarField Q(Tp.size(), scalar(0));
|
||||
scalarField A(Tp.size(), Zero);
|
||||
scalarField B(Tp.size(), Zero);
|
||||
scalarField Q(Tp.size(), Zero);
|
||||
|
||||
forAll(fluid.phases(), phasei)
|
||||
{
|
||||
|
||||
@ -43,7 +43,7 @@ tractionDisplacementFvPatchVectorField
|
||||
:
|
||||
fixedGradientFvPatchVectorField(p, iF),
|
||||
traction_(p.size(), Zero),
|
||||
pressure_(p.size(), 0.0)
|
||||
pressure_(p.size(), Zero)
|
||||
{
|
||||
fvPatchVectorField::operator=(patchInternalField());
|
||||
gradient() = Zero;
|
||||
|
||||
@ -43,7 +43,7 @@ tractionDisplacementCorrectionFvPatchVectorField
|
||||
:
|
||||
fixedGradientFvPatchVectorField(p, iF),
|
||||
traction_(p.size(), Zero),
|
||||
pressure_(p.size(), 0.0)
|
||||
pressure_(p.size(), Zero)
|
||||
{
|
||||
fvPatchVectorField::operator=(patchInternalField());
|
||||
gradient() = Zero;
|
||||
|
||||
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "cll1:" << cll1 << endl;
|
||||
|
||||
// Resize and assign row by row
|
||||
labelList row0(2, label(0));
|
||||
labelList row0(2, Zero);
|
||||
labelList row1(3, label(1));
|
||||
|
||||
labelList rowSizes(2);
|
||||
|
||||
@ -94,7 +94,7 @@ int main(int argc, char *argv[])
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector(vector::zero)
|
||||
dimensionedVector(Zero)
|
||||
);
|
||||
|
||||
fld.boundaryFieldRef()[0] == function1().value(x0);
|
||||
|
||||
@ -61,7 +61,7 @@ void testMapDistribute()
|
||||
// Send all ones to processor indicated by .first()
|
||||
|
||||
// Count how many to send
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
labelList nSend(Pstream::nProcs(), Zero);
|
||||
forAll(complexData, i)
|
||||
{
|
||||
label procI = complexData[i].first();
|
||||
|
||||
@ -404,7 +404,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
|
||||
// Test masterPoints
|
||||
|
||||
{
|
||||
labelList nMasters(mesh.nPoints(), 0);
|
||||
labelList nMasters(mesh.nPoints(), Zero);
|
||||
|
||||
bitSet isMasterPoint(syncTools::getMasterPoints(mesh));
|
||||
|
||||
@ -480,7 +480,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
|
||||
// Test masterEdges
|
||||
|
||||
{
|
||||
labelList nMasters(edges.size(), 0);
|
||||
labelList nMasters(edges.size(), Zero);
|
||||
|
||||
bitSet isMasterEdge(syncTools::getMasterEdges(mesh));
|
||||
|
||||
@ -549,7 +549,7 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
|
||||
// Test masterFaces
|
||||
|
||||
{
|
||||
labelList nMasters(mesh.nFaces(), 0);
|
||||
labelList nMasters(mesh.nFaces(), Zero);
|
||||
|
||||
bitSet isMasterFace(syncTools::getMasterFaces(mesh));
|
||||
|
||||
|
||||
@ -606,7 +606,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
List<pointEdgeCollapse> allPointInfo;
|
||||
const globalIndex globalPoints(mesh.nPoints());
|
||||
labelList pointPriority(mesh.nPoints(), 0);
|
||||
labelList pointPriority(mesh.nPoints(), Zero);
|
||||
|
||||
cutter.consistentCollapse
|
||||
(
|
||||
|
||||
@ -263,7 +263,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
labelList(mesh.nCells(), 0)
|
||||
labelList(mesh.nCells(), Zero)
|
||||
);
|
||||
|
||||
if (readLevel)
|
||||
|
||||
@ -752,7 +752,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
labelList(mesh.nCells(), 0)
|
||||
labelList(mesh.nCells(), Zero)
|
||||
);
|
||||
|
||||
label maxLevel = max(refLevel);
|
||||
|
||||
@ -542,7 +542,7 @@ int main(int argc, char *argv[])
|
||||
// Now split the boundary faces into external and internal faces. All
|
||||
// faces go into faceZones and external faces go into patches.
|
||||
List<faceList> patchFaces(slPatchCells.size());
|
||||
labelList patchNFaces(slPatchCells.size(), 0);
|
||||
labelList patchNFaces(slPatchCells.size(), Zero);
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
const faceList& bFaces = boundary[patchi];
|
||||
|
||||
@ -936,7 +936,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
labelListList cellFaces(nCells);
|
||||
|
||||
labelList nFacesInCell(nCells, 0);
|
||||
labelList nFacesInCell(nCells, Zero);
|
||||
|
||||
forAll(cellFaces, celli)
|
||||
{
|
||||
|
||||
@ -911,7 +911,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
List<pointEdgeCollapse> allPointInfo;
|
||||
const globalIndex globalPoints(mesh.nPoints());
|
||||
labelList pointPriority(mesh.nPoints(), 0);
|
||||
labelList pointPriority(mesh.nPoints(), Zero);
|
||||
|
||||
collapser.consistentCollapse
|
||||
(
|
||||
|
||||
@ -219,7 +219,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
}
|
||||
|
||||
// Current face count per cell.
|
||||
labelList nCellFaces(eCells.size(), 0);
|
||||
labelList nCellFaces(eCells.size(), Zero);
|
||||
|
||||
|
||||
label facei = 0;
|
||||
|
||||
@ -2053,11 +2053,11 @@ int main(int argc, char *argv[])
|
||||
// Count how many patches on special edges of extrudePatch are necessary
|
||||
// - zoneXXX_sides
|
||||
// - zoneXXX_zoneYYY
|
||||
labelList zoneSidePatch(zoneNames.size(), 0);
|
||||
labelList zoneSidePatch(zoneNames.size(), Zero);
|
||||
// Patch to use for minZone
|
||||
labelList zoneZonePatch_min(zoneNames.size()*zoneNames.size(), 0);
|
||||
labelList zoneZonePatch_min(zoneNames.size()*zoneNames.size(), Zero);
|
||||
// Patch to use for maxZone
|
||||
labelList zoneZonePatch_max(zoneNames.size()*zoneNames.size(), 0);
|
||||
labelList zoneZonePatch_max(zoneNames.size()*zoneNames.size(), Zero);
|
||||
|
||||
countExtrudePatches
|
||||
(
|
||||
|
||||
@ -285,7 +285,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
List<pointEdgeCollapse> allPointInfo;
|
||||
const globalIndex globalPoints(mesh().nPoints());
|
||||
labelList pointPriority(mesh().nPoints(), 0);
|
||||
labelList pointPriority(mesh().nPoints(), Zero);
|
||||
|
||||
collapser.consistentCollapse
|
||||
(
|
||||
|
||||
@ -44,7 +44,7 @@ Foam::DistributedDelaunayMesh<Triangulation>::buildMap
|
||||
// ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// 1. Count
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
labelList nSend(Pstream::nProcs(), Zero);
|
||||
|
||||
forAll(toProc, i)
|
||||
{
|
||||
|
||||
@ -77,7 +77,7 @@ void Foam::PrintTable<KeyType, DataType>::print
|
||||
label largestKeyLength = 6;
|
||||
label largestDataLength = 0;
|
||||
|
||||
List<label> largestProcSize(Pstream::nProcs(), 0);
|
||||
labelList largestProcSize(Pstream::nProcs(), Zero);
|
||||
|
||||
forAll(procData, proci)
|
||||
{
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::backgroundMeshDecomposition::buildMap
|
||||
// ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// 1. Count
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
labelList nSend(Pstream::nProcs(), Zero);
|
||||
|
||||
forAll(toProc, i)
|
||||
{
|
||||
@ -337,7 +337,7 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
(
|
||||
cellsToRemove,
|
||||
exposedFaces,
|
||||
labelList(exposedFaces.size(), 0), // patchID dummy
|
||||
labelList(exposedFaces.size(), Zero), // patchID dummy
|
||||
meshMod
|
||||
);
|
||||
|
||||
@ -793,8 +793,8 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
|
||||
meshCutter_
|
||||
(
|
||||
mesh_,
|
||||
labelList(mesh_.nCells(), 0),
|
||||
labelList(mesh_.nPoints(), 0)
|
||||
labelList(mesh_.nCells(), Zero),
|
||||
labelList(mesh_.nPoints(), Zero)
|
||||
),
|
||||
boundaryFacesPtr_(),
|
||||
bFTreePtr_(),
|
||||
|
||||
@ -1063,7 +1063,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
||||
|
||||
// Check for cells with one internal face only
|
||||
|
||||
labelList nInternalFaces(pMesh.nCells(), label(0));
|
||||
labelList nInternalFaces(pMesh.nCells(), Zero);
|
||||
|
||||
for (label fI = 0; fI < pMesh.nInternalFaces(); fI++)
|
||||
{
|
||||
|
||||
@ -902,7 +902,7 @@ void Foam::conformalVoronoiMesh::createMultipleEdgePointGroup
|
||||
const List<extendedFeatureEdgeMesh::sideVolumeType>& normalVolumeTypes =
|
||||
feMesh.normalVolumeTypes();
|
||||
|
||||
labelList nNormalTypes(4, label(0));
|
||||
labelList nNormalTypes(4, Zero);
|
||||
|
||||
forAll(edNormalIs, edgeNormalI)
|
||||
{
|
||||
|
||||
@ -210,7 +210,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
||||
//
|
||||
// // From all Delaunay vertices to cell (positive index)
|
||||
// // or patch face (negative index)
|
||||
// labelList vertexToDualAddressing(number_of_vertices(), 0);
|
||||
// labelList vertexToDualAddressing(number_of_vertices(), Zero);
|
||||
//
|
||||
// forAll(cellToDelaunayVertex, celli)
|
||||
// {
|
||||
@ -525,7 +525,7 @@ void Foam::conformalVoronoiMesh::reorderPoints
|
||||
Info<< incrIndent << indent << "Reordering points into internal/external"
|
||||
<< endl;
|
||||
|
||||
labelList oldToNew(points.size(), label(0));
|
||||
labelList oldToNew(points.size(), Zero);
|
||||
|
||||
// Find points that are internal
|
||||
for (label fI = nInternalFaces; fI < faces.size(); ++fI)
|
||||
@ -611,7 +611,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
||||
const fvMesh& sortMesh = sortMeshPtr();
|
||||
|
||||
// Rotation on new faces.
|
||||
labelList rotation(faces.size(), label(0));
|
||||
labelList rotation(faces.size(), Zero);
|
||||
labelList faceMap(faces.size(), label(-1));
|
||||
|
||||
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
|
||||
@ -660,7 +660,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
||||
patchDicts[patchi].get<label>("startFace");
|
||||
|
||||
labelList patchFaceMap(nPatchFaces, label(-1));
|
||||
labelList patchFaceRotation(nPatchFaces, label(0));
|
||||
labelList patchFaceRotation(nPatchFaces, Zero);
|
||||
|
||||
bool changed = refCast<const processorPolyPatch>(pp).order
|
||||
(
|
||||
|
||||
@ -83,7 +83,7 @@ bool Foam::conformalVoronoiMesh::distributeBackground(const Triangulation& mesh)
|
||||
|
||||
meshSearch cellSearch(bMesh, polyMesh::FACE_PLANES);
|
||||
|
||||
labelList cellVertices(bMesh.nCells(), label(0));
|
||||
labelList cellVertices(bMesh.nCells(), Zero);
|
||||
|
||||
for
|
||||
(
|
||||
|
||||
@ -613,7 +613,7 @@ Foam::Field<bool> Foam::conformationSurfaces::inside
|
||||
const pointField& samplePts
|
||||
) const
|
||||
{
|
||||
return wellInside(samplePts, scalarField(samplePts.size(), 0.0));
|
||||
return wellInside(samplePts, scalarField(samplePts.size(), Zero));
|
||||
}
|
||||
|
||||
|
||||
@ -622,7 +622,7 @@ bool Foam::conformationSurfaces::inside
|
||||
const point& samplePt
|
||||
) const
|
||||
{
|
||||
return wellInside(pointField(1, samplePt), scalarField(1, 0))[0];
|
||||
return wellInside(pointField(1, samplePt), scalarField(1, Zero))[0];
|
||||
}
|
||||
|
||||
|
||||
@ -631,7 +631,7 @@ Foam::Field<bool> Foam::conformationSurfaces::outside
|
||||
const pointField& samplePts
|
||||
) const
|
||||
{
|
||||
return wellOutside(samplePts, scalarField(samplePts.size(), 0.0));
|
||||
return wellOutside(samplePts, scalarField(samplePts.size(), Zero));
|
||||
}
|
||||
|
||||
|
||||
@ -640,7 +640,7 @@ bool Foam::conformationSurfaces::outside
|
||||
const point& samplePt
|
||||
) const
|
||||
{
|
||||
return wellOutside(pointField(1, samplePt), scalarField(1, 0))[0];
|
||||
return wellOutside(pointField(1, samplePt), scalarField(1, Zero))[0];
|
||||
//return !inside(samplePt);
|
||||
}
|
||||
|
||||
|
||||
@ -416,7 +416,7 @@ bool Foam::autoDensity::fillBox
|
||||
|
||||
pointField linePoints(nLine, Zero);
|
||||
|
||||
scalarField lineSizes(nLine, 0.0);
|
||||
scalarField lineSizes(nLine, Zero);
|
||||
|
||||
for (label i = 0; i < surfRes_; i++)
|
||||
{
|
||||
|
||||
@ -113,7 +113,7 @@ Foam::searchableBoxFeatures::features() const
|
||||
surfacePoints[treeBoundBox::edges[eI].end()]
|
||||
- surfacePoints[treeBoundBox::edges[eI].start()];
|
||||
|
||||
normalDirections[eI] = labelList(2, label(0));
|
||||
normalDirections[eI] = labelList(2, Zero);
|
||||
for (label j = 0; j < 2; ++j)
|
||||
{
|
||||
const vector cross =
|
||||
|
||||
@ -131,7 +131,7 @@ Foam::searchablePlateFeatures::features() const
|
||||
surface().points()()[edges[eI].end()]
|
||||
- surface().points()()[edges[eI].start()];
|
||||
|
||||
normalDirections[eI] = labelList(2, label(0));
|
||||
normalDirections[eI] = labelList(2, Zero);
|
||||
for (label j = 0; j < 2; ++j)
|
||||
{
|
||||
const vector cross =
|
||||
|
||||
@ -108,9 +108,9 @@ autoPtr<refinementSurfaces> createRefinementSurfaces
|
||||
|
||||
labelList regionOffset(surfi);
|
||||
|
||||
labelList globalMinLevel(surfi, 0);
|
||||
labelList globalMaxLevel(surfi, 0);
|
||||
labelList globalLevelIncr(surfi, 0);
|
||||
labelList globalMinLevel(surfi, Zero);
|
||||
labelList globalMaxLevel(surfi, Zero);
|
||||
labelList globalLevelIncr(surfi, Zero);
|
||||
PtrList<dictionary> globalPatchInfo(surfi);
|
||||
List<Map<label>> regionMinLevel(surfi);
|
||||
List<Map<label>> regionMaxLevel(surfi);
|
||||
@ -263,8 +263,8 @@ autoPtr<refinementSurfaces> createRefinementSurfaces
|
||||
}
|
||||
|
||||
// Rework surface specific information into information per global region
|
||||
labelList minLevel(nRegions, 0);
|
||||
labelList maxLevel(nRegions, 0);
|
||||
labelList minLevel(nRegions, Zero);
|
||||
labelList maxLevel(nRegions, Zero);
|
||||
labelList gapLevel(nRegions, -1);
|
||||
PtrList<dictionary> patchInfo(nRegions);
|
||||
|
||||
|
||||
@ -319,7 +319,7 @@ Foam::label Foam::checkTopology
|
||||
|
||||
if (allTopology)
|
||||
{
|
||||
labelList nInternalFaces(mesh.nCells(), 0);
|
||||
labelList nInternalFaces(mesh.nCells(), Zero);
|
||||
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
|
||||
@ -577,7 +577,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Add faces to faceZones
|
||||
labelList nFaces(mesh.faceZones().size(), 0);
|
||||
labelList nFaces(mesh.faceZones().size(), Zero);
|
||||
forAll(faceToZoneID, facei)
|
||||
{
|
||||
label zoneID = faceToZoneID[facei];
|
||||
|
||||
@ -550,7 +550,7 @@ int main(int argc, char *argv[])
|
||||
// Dump duplicated points (if any)
|
||||
const labelList& pointMap = map().pointMap();
|
||||
|
||||
labelList nDupPerPoint(map().nOldPoints(), 0);
|
||||
labelList nDupPerPoint(map().nOldPoints(), Zero);
|
||||
|
||||
pointSet dupPoints(mesh, "duplicatedPoints", 100);
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ Foam::mirrorFvMesh::mirrorFvMesh
|
||||
}
|
||||
|
||||
// Mirror boundary faces patch by patch
|
||||
labelList newPatchSizes(boundary().size(), 0);
|
||||
labelList newPatchSizes(boundary().size(), Zero);
|
||||
labelList newPatchStarts(boundary().size(), -1);
|
||||
|
||||
forAll(boundaryMesh(), patchi)
|
||||
|
||||
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
{
|
||||
// Number of (master)faces per edge
|
||||
labelList nMasterFaces(patch.nEdges(), 0);
|
||||
labelList nMasterFaces(patch.nEdges(), Zero);
|
||||
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
|
||||
@ -130,8 +130,8 @@ void getBand
|
||||
scalar& sumSqrIntersect // scalar to avoid overflow
|
||||
)
|
||||
{
|
||||
labelList cellBandwidth(nCells, 0);
|
||||
scalarField nIntersect(nCells, 0.0);
|
||||
labelList cellBandwidth(nCells, Zero);
|
||||
scalarField nIntersect(nCells, Zero);
|
||||
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
|
||||
@ -1149,7 +1149,7 @@ label findCorrespondingRegion
|
||||
)
|
||||
{
|
||||
// Per region the number of cells in zoneI
|
||||
labelList cellsInZone(nCellRegions, 0);
|
||||
labelList cellsInZone(nCellRegions, Zero);
|
||||
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
@ -1267,7 +1267,7 @@ void matchRegions
|
||||
getZoneID(mesh, cellZones, zoneID, neiZoneID);
|
||||
|
||||
// Sizes per cellzone
|
||||
labelList zoneSizes(cellZones.size(), 0);
|
||||
labelList zoneSizes(cellZones.size(), Zero);
|
||||
{
|
||||
List<wordList> zoneNames(Pstream::nProcs());
|
||||
zoneNames[Pstream::myProcNo()] = cellZones.names();
|
||||
@ -1753,7 +1753,7 @@ int main(int argc, char *argv[])
|
||||
// Sizes per region
|
||||
// ~~~~~~~~~~~~~~~~
|
||||
|
||||
labelList regionSizes(nCellRegions, 0);
|
||||
labelList regionSizes(nCellRegions, Zero);
|
||||
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
|
||||
@ -244,7 +244,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
label nInterfaces = interPatchFaces[proci].size();
|
||||
|
||||
subPatchIDs[proci].setSize(nInterfaces, labelList(1, label(-1)));
|
||||
subPatchStarts[proci].setSize(nInterfaces, labelList(1, label(0)));
|
||||
subPatchStarts[proci].setSize(nInterfaces, labelList(1, Zero));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ void Foam::domainDecomposition::processInterCyclics
|
||||
{
|
||||
label nIntfcs = interPatchFaces[proci].size();
|
||||
subPatchIDs[proci].setSize(nIntfcs, labelList(1, patchi));
|
||||
subPatchStarts[proci].setSize(nIntfcs, labelList(1, label(0)));
|
||||
subPatchStarts[proci].setSize(nIntfcs, labelList(1, Zero));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ Foam::faMeshDecomposition::faMeshDecomposition
|
||||
faceToProc_(nFaces()),
|
||||
procFaceLabels_(nProcs_),
|
||||
procMeshEdgesMap_(nProcs_),
|
||||
procNInternalEdges_(nProcs_, 0),
|
||||
procNInternalEdges_(nProcs_, Zero),
|
||||
procPatchEdgeLabels_(nProcs_),
|
||||
procPatchPointAddressing_(nProcs_),
|
||||
procPatchEdgeAddressing_(nProcs_),
|
||||
@ -991,7 +991,7 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
||||
|
||||
// Memory management
|
||||
{
|
||||
labelList pointsUsage(nPoints(), 0);
|
||||
labelList pointsUsage(nPoints(), Zero);
|
||||
|
||||
// Globally shared points are the ones used by more than 2 processors
|
||||
// Size the list approximately and gather the points
|
||||
|
||||
@ -2671,7 +2671,7 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
|
||||
label nDestProcs = 1;
|
||||
labelList finalDecomp = labelList(mesh.nCells(), 0);
|
||||
labelList finalDecomp = labelList(mesh.nCells(), Zero);
|
||||
|
||||
redistributeAndWrite
|
||||
(
|
||||
|
||||
@ -819,7 +819,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
||||
// Find the total number of zones
|
||||
// Each zone will take the patch name
|
||||
// Number of zones per patch ... zero zones should be skipped
|
||||
labelList nZones(pbMesh.size(), 0);
|
||||
labelList nZones(pbMesh.size(), Zero);
|
||||
|
||||
// Per global zone number the average face centre position
|
||||
List<DynamicList<point>> zoneCentre(pbMesh.size());
|
||||
@ -862,7 +862,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
||||
|
||||
nZones[patchi] = pZones.nZones();
|
||||
|
||||
labelList zoneNFaces(pZones.nZones(), 0);
|
||||
labelList zoneNFaces(pZones.nZones(), Zero);
|
||||
|
||||
// Create storage for additional zone centres
|
||||
forAll(zoneNFaces, zonei)
|
||||
|
||||
@ -121,7 +121,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Calculate starting ids for particles on each processor
|
||||
List<label> startIds(numIds.size(), 0);
|
||||
labelList startIds(numIds.size(), Zero);
|
||||
for (label i = 0; i < numIds.size()-1; i++)
|
||||
{
|
||||
startIds[i+1] += startIds[i] + numIds[i];
|
||||
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "\n Generating " << nTracks << " tracks" << endl;
|
||||
|
||||
// Determine length of each track
|
||||
labelList trackLengths(nTracks, 0);
|
||||
labelList trackLengths(nTracks, Zero);
|
||||
forAll(particleToTrack, i)
|
||||
{
|
||||
const label trackI = particleToTrack[i];
|
||||
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const scalarField& age = tage();
|
||||
|
||||
List<label> trackSamples(nTracks, 0);
|
||||
labelList trackSamples(nTracks, Zero);
|
||||
|
||||
forAll(particleToTrack, i)
|
||||
{
|
||||
|
||||
@ -44,4 +44,4 @@
|
||||
filePtr.reset(new OFstream(fName));
|
||||
}
|
||||
|
||||
scalarField samples(nIntervals, 0);
|
||||
scalarField samples(nIntervals, Zero);
|
||||
|
||||
@ -485,7 +485,7 @@ int main(int argc, char *argv[])
|
||||
#include "shootRays.H"
|
||||
|
||||
// Calculate number of visible faces from local index
|
||||
labelList nVisibleFaceFaces(nCoarseFaces, 0);
|
||||
labelList nVisibleFaceFaces(nCoarseFaces, Zero);
|
||||
|
||||
forAll(rayStartFace, i)
|
||||
{
|
||||
@ -628,7 +628,7 @@ int main(int argc, char *argv[])
|
||||
0.0
|
||||
);
|
||||
|
||||
scalarList patchArea(totalPatches, 0.0);
|
||||
scalarList patchArea(totalPatches, Zero);
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ Foam::tabulatedWallFunctions::general::interpolationTypeNames_
|
||||
|
||||
void Foam::tabulatedWallFunctions::general::invertTable()
|
||||
{
|
||||
scalarList Rey(uPlus_.size(), 0.0);
|
||||
scalarList Rey(uPlus_.size(), Zero);
|
||||
|
||||
// Calculate Reynolds number
|
||||
forAll(uPlus_, i)
|
||||
|
||||
@ -1242,7 +1242,7 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
|
||||
label nFeatEds = inter.cutEdges().size();
|
||||
|
||||
DynamicList<vector> normals(2*nFeatEds);
|
||||
vectorField edgeDirections(nFeatEds, vector::zero);
|
||||
vectorField edgeDirections(nFeatEds, Zero);
|
||||
DynamicList<extendedFeatureEdgeMesh::sideVolumeType> normalVolumeTypes
|
||||
(
|
||||
2*nFeatEds
|
||||
|
||||
@ -80,7 +80,7 @@ labelList countBins
|
||||
{
|
||||
scalar dist = nBins/(max - min);
|
||||
|
||||
labelList binCount(nBins, 0);
|
||||
labelList binCount(nBins, Zero);
|
||||
|
||||
forAll(vals, i)
|
||||
{
|
||||
@ -444,7 +444,7 @@ int main(int argc, char *argv[])
|
||||
// ~~~~~~~~~~~~
|
||||
|
||||
{
|
||||
labelList regionSize(surf.patches().size(), 0);
|
||||
labelList regionSize(surf.patches().size(), Zero);
|
||||
|
||||
forAll(surf, facei)
|
||||
{
|
||||
@ -541,7 +541,7 @@ int main(int argc, char *argv[])
|
||||
faces
|
||||
),
|
||||
"illegal",
|
||||
scalarField(subSurf.size(), 0.0),
|
||||
scalarField(subSurf.size(), Zero),
|
||||
false // face based data
|
||||
);
|
||||
}
|
||||
@ -580,7 +580,7 @@ int main(int argc, char *argv[])
|
||||
// ~~~~~~~~~~~~~~~~
|
||||
|
||||
{
|
||||
scalarField triQ(surf.size(), 0);
|
||||
scalarField triQ(surf.size(), Zero);
|
||||
forAll(surf, facei)
|
||||
{
|
||||
const labelledTri& f = surf[facei];
|
||||
|
||||
@ -141,7 +141,7 @@ tmp<vectorField> calcPointNormals
|
||||
{
|
||||
const labelListList& edgeFaces = s.edgeFaces();
|
||||
|
||||
labelList nNormals(s.nPoints(), 0);
|
||||
labelList nNormals(s.nPoints(), Zero);
|
||||
forAll(edgeStat, edgeI)
|
||||
{
|
||||
if (edgeStat[edgeI] != surfaceFeatures::NONE)
|
||||
@ -355,10 +355,10 @@ tmp<scalarField> avg
|
||||
const scalarField& edgeWeights
|
||||
)
|
||||
{
|
||||
tmp<scalarField> tres(new scalarField(s.nPoints(), 0.0));
|
||||
tmp<scalarField> tres(new scalarField(s.nPoints(), Zero));
|
||||
scalarField& res = tres.ref();
|
||||
|
||||
scalarField sumWeight(s.nPoints(), 0.0);
|
||||
scalarField sumWeight(s.nPoints(), Zero);
|
||||
|
||||
const edgeList& edges = s.edges();
|
||||
|
||||
@ -499,7 +499,7 @@ void lloydsSmoothing
|
||||
const pointField& points = s.points();
|
||||
|
||||
vectorField pointSum(s.nPoints(), Zero);
|
||||
labelList nPointSum(s.nPoints(), 0);
|
||||
labelList nPointSum(s.nPoints(), Zero);
|
||||
|
||||
forAll(edges, edgeI)
|
||||
{
|
||||
|
||||
@ -49,18 +49,18 @@ namespace Foam
|
||||
Foam::SIBS::SIBS(const ODESystem& ode, const dictionary& dict)
|
||||
:
|
||||
ODESolver(ode, dict),
|
||||
a_(iMaxX_, 0.0),
|
||||
alpha_(kMaxX_, 0.0),
|
||||
d_p_(n_, kMaxX_, 0.0),
|
||||
x_p_(kMaxX_, 0.0),
|
||||
err_(kMaxX_, 0.0),
|
||||
a_(iMaxX_, Zero),
|
||||
alpha_(kMaxX_, Zero),
|
||||
d_p_(n_, kMaxX_, Zero),
|
||||
x_p_(kMaxX_, Zero),
|
||||
err_(kMaxX_, Zero),
|
||||
|
||||
yTemp_(n_, 0.0),
|
||||
ySeq_(n_, 0.0),
|
||||
yErr_(n_, 0.0),
|
||||
yTemp_(n_, Zero),
|
||||
ySeq_(n_, Zero),
|
||||
yErr_(n_, Zero),
|
||||
dydx0_(n_),
|
||||
dfdx_(n_, 0.0),
|
||||
dfdy_(n_, 0.0),
|
||||
dfdx_(n_, Zero),
|
||||
dfdy_(n_, Zero),
|
||||
first_(1),
|
||||
epsOld_(-1.0)
|
||||
{}
|
||||
|
||||
@ -119,7 +119,7 @@ Foam::label Foam::Distribution<Type>::index
|
||||
// Underflow of this List, storage increase and remapping
|
||||
// required
|
||||
|
||||
List<scalar> newCmptDistribution(2*cmptDistribution.size(), 0.0);
|
||||
List<scalar> newCmptDistribution(2*cmptDistribution.size(), Zero);
|
||||
|
||||
label sOld = cmptDistribution.size();
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ Foam::labelListList Foam::invertOneToMany
|
||||
const labelUList& map
|
||||
)
|
||||
{
|
||||
labelList sizes(len, 0);
|
||||
labelList sizes(len, Zero);
|
||||
|
||||
for (const label newIdx : map)
|
||||
{
|
||||
|
||||
@ -695,7 +695,7 @@ void Foam::invertManyToMany
|
||||
)
|
||||
{
|
||||
// The output list sizes
|
||||
labelList sizes(len, 0);
|
||||
labelList sizes(len, Zero);
|
||||
|
||||
for (const InputIntListType& sublist : input)
|
||||
{
|
||||
|
||||
@ -42,6 +42,13 @@ inline Foam::SortableList<T>::SortableList(const label size)
|
||||
{}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline Foam::SortableList<T>::SortableList(const label size, const zero)
|
||||
:
|
||||
List<T>(size, zero())
|
||||
{}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline Foam::SortableList<T>::SortableList(const label size, const T& val)
|
||||
:
|
||||
|
||||
@ -71,7 +71,11 @@ public:
|
||||
// The indices remain empty until the list is sorted
|
||||
inline explicit SortableList(const label size);
|
||||
|
||||
//- Construct given size and initial value. Sort later on
|
||||
//- Construct zero-initialized with given size, sort later.
|
||||
// The indices remain empty until the list is sorted
|
||||
inline SortableList(const label size, const zero);
|
||||
|
||||
//- Construct given size and initial value, sorting later.
|
||||
// The indices remain empty until the list is sorted
|
||||
inline SortableList(const label size, const T& val);
|
||||
|
||||
|
||||
@ -796,7 +796,7 @@ Foam::label Foam::decomposedBlockData::calcNumProcs
|
||||
(
|
||||
reinterpret_cast<const char*>(&nSendProcs),
|
||||
List<int>(nProcs, sizeof(nSendProcs)),
|
||||
List<int>(nProcs, 0),
|
||||
List<int>(nProcs, Zero),
|
||||
reinterpret_cast<char*>(&n),
|
||||
sizeof(n),
|
||||
comm
|
||||
|
||||
@ -58,7 +58,7 @@ void Foam::UPstream::setParRun(const label nProcs, const bool haveThreads)
|
||||
haveThreads_ = haveThreads;
|
||||
|
||||
freeCommunicator(UPstream::worldComm);
|
||||
label comm = allocateCommunicator(-1, labelList(1, label(0)), false);
|
||||
label comm = allocateCommunicator(-1, labelList(1, Zero), false);
|
||||
if (comm != UPstream::worldComm)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -382,7 +382,7 @@ Foam::UPstream::treeCommunication_(10);
|
||||
Foam::UPstream::communicator serialComm
|
||||
(
|
||||
-1,
|
||||
Foam::labelList(1, Foam::label(0)),
|
||||
Foam::labelList(1, Foam::Zero),
|
||||
false
|
||||
);
|
||||
|
||||
|
||||
@ -275,9 +275,9 @@ void Foam::Pstream::exchange
|
||||
List<char*> charRecvBufs(sendBufs.size());
|
||||
|
||||
labelList nRecv(sendBufs.size());
|
||||
labelList startRecv(sendBufs.size(), 0);
|
||||
labelList startRecv(sendBufs.size(), Zero);
|
||||
labelList nSend(sendBufs.size());
|
||||
labelList startSend(sendBufs.size(), 0);
|
||||
labelList startSend(sendBufs.size(), Zero);
|
||||
|
||||
for (label iter = 0; iter < nIter; iter++)
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::geometricZeroField
|
||||
|
||||
Description
|
||||
A class representing the concept of a GeometricField of 1 used to avoid
|
||||
A class representing the concept of a GeometricField of 0 used to avoid
|
||||
unnecessary manipulations for objects which are known to be zero at
|
||||
compile-time.
|
||||
|
||||
@ -57,6 +57,14 @@ class geometricZeroField
|
||||
|
||||
public:
|
||||
|
||||
// Public typedefs
|
||||
|
||||
typedef zeroField Internal;
|
||||
typedef zeroField Patch;
|
||||
typedef zeroFieldField Boundary;
|
||||
typedef zero cmptType;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
|
||||
@ -35,7 +35,7 @@ Foam::curve::curve
|
||||
const label l
|
||||
)
|
||||
:
|
||||
scalarField(l, 0.0),
|
||||
scalarField(l, Zero),
|
||||
name_(name),
|
||||
style_(style)
|
||||
{}
|
||||
|
||||
@ -54,7 +54,7 @@ Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
|
||||
)
|
||||
:
|
||||
IOobject(io),
|
||||
List<scalar>(2, 0.0),
|
||||
List<scalar>(2, Zero),
|
||||
x0_(0.0),
|
||||
dx_(1.0),
|
||||
log10_(false),
|
||||
@ -93,7 +93,7 @@ Foam::uniformInterpolationTable<Type>::uniformInterpolationTable
|
||||
IOobject::NO_WRITE,
|
||||
false // if used in BCs, could be used by multiple patches
|
||||
),
|
||||
List<scalar>(2, 0.0),
|
||||
List<scalar>(2, Zero),
|
||||
x0_(dict.get<scalar>("x0")),
|
||||
dx_(dict.get<scalar>("dx")),
|
||||
log10_(dict.lookupOrDefault<Switch>("log10", false)),
|
||||
|
||||
@ -41,7 +41,7 @@ void Foam::lduAddressing::calcLosort() const
|
||||
// Scan the neighbour list to find out how many times the cell
|
||||
// appears as a neighbour of the face. Done this way to avoid guessing
|
||||
// and resizing list
|
||||
labelList nNbrOfFace(size(), 0);
|
||||
labelList nNbrOfFace(size(), Zero);
|
||||
|
||||
const labelUList& nbr = upperAddr();
|
||||
|
||||
@ -136,7 +136,7 @@ void Foam::lduAddressing::calcLosortStart() const
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
losortStartPtr_ = new labelList(size() + 1, 0);
|
||||
losortStartPtr_ = new labelList(size() + 1, Zero);
|
||||
|
||||
labelList& lsrtStart = *losortStartPtr_;
|
||||
|
||||
@ -259,7 +259,7 @@ Foam::Tuple2<Foam::label, Foam::scalar> Foam::lduAddressing::band() const
|
||||
const labelUList& owner = lowerAddr();
|
||||
const labelUList& neighbour = upperAddr();
|
||||
|
||||
labelList cellBandwidth(size(), 0);
|
||||
labelList cellBandwidth(size(), Zero);
|
||||
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
|
||||
@ -178,7 +178,7 @@ Foam::scalarField& Foam::lduMatrix::lower()
|
||||
}
|
||||
else
|
||||
{
|
||||
lowerPtr_ = new scalarField(lduAddr().lowerAddr().size(), 0.0);
|
||||
lowerPtr_ = new scalarField(lduAddr().lowerAddr().size(), Zero);
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ Foam::scalarField& Foam::lduMatrix::diag()
|
||||
{
|
||||
if (!diagPtr_)
|
||||
{
|
||||
diagPtr_ = new scalarField(lduAddr().size(), 0.0);
|
||||
diagPtr_ = new scalarField(lduAddr().size(), Zero);
|
||||
}
|
||||
|
||||
return *diagPtr_;
|
||||
@ -207,7 +207,7 @@ Foam::scalarField& Foam::lduMatrix::upper()
|
||||
}
|
||||
else
|
||||
{
|
||||
upperPtr_ = new scalarField(lduAddr().lowerAddr().size(), 0.0);
|
||||
upperPtr_ = new scalarField(lduAddr().lowerAddr().size(), Zero);
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ Foam::scalarField& Foam::lduMatrix::lower(const label nCoeffs)
|
||||
}
|
||||
else
|
||||
{
|
||||
lowerPtr_ = new scalarField(nCoeffs, 0.0);
|
||||
lowerPtr_ = new scalarField(nCoeffs, Zero);
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ Foam::scalarField& Foam::lduMatrix::diag(const label size)
|
||||
{
|
||||
if (!diagPtr_)
|
||||
{
|
||||
diagPtr_ = new scalarField(size, 0.0);
|
||||
diagPtr_ = new scalarField(size, Zero);
|
||||
}
|
||||
|
||||
return *diagPtr_;
|
||||
@ -254,7 +254,7 @@ Foam::scalarField& Foam::lduMatrix::upper(const label nCoeffs)
|
||||
}
|
||||
else
|
||||
{
|
||||
upperPtr_ = new scalarField(nCoeffs, 0.0);
|
||||
upperPtr_ = new scalarField(nCoeffs, Zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -295,7 +295,7 @@ Foam::tmp<Foam::scalarField > Foam::lduMatrix::H1() const
|
||||
{
|
||||
tmp<scalarField > tH1
|
||||
(
|
||||
new scalarField(lduAddr().size(), 0.0)
|
||||
new scalarField(lduAddr().size(), Zero)
|
||||
);
|
||||
|
||||
if (lowerPtr_ || upperPtr_)
|
||||
|
||||
@ -70,7 +70,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
label maxNnbrs = 10;
|
||||
|
||||
// Number of faces for each coarse-cell
|
||||
labelList cCellnFaces(nCoarseCells, 0);
|
||||
labelList cCellnFaces(nCoarseCells, Zero);
|
||||
|
||||
// Setup initial packed storage for coarse-cell faces
|
||||
labelList cCellFaces(maxNnbrs*nCoarseCells);
|
||||
@ -260,7 +260,11 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
// Get reference to fine-level interfaces
|
||||
const lduInterfacePtrsList& fineInterfaces = interfaceLevel(fineLevelIndex);
|
||||
|
||||
nPatchFaces_.set(fineLevelIndex, new labelList(fineInterfaces.size(), 0));
|
||||
nPatchFaces_.set
|
||||
(
|
||||
fineLevelIndex,
|
||||
new labelList(fineInterfaces.size(), Zero)
|
||||
);
|
||||
labelList& nPatchFaces = nPatchFaces_[fineLevelIndex];
|
||||
|
||||
patchFaceRestrictAddressing_.set
|
||||
|
||||
@ -135,7 +135,7 @@ Foam::tmp<Foam::labelField> Foam::pairGAMGAgglomeration::agglomerate
|
||||
|
||||
// memory management
|
||||
{
|
||||
labelList nNbrs(nFineCells, 0);
|
||||
labelList nNbrs(nFineCells, Zero);
|
||||
|
||||
forAll(upperAddr, facei)
|
||||
{
|
||||
|
||||
@ -95,7 +95,7 @@ bool Foam::masterCoarsestGAMGProcAgglomeration::agglomerate()
|
||||
if (nProcs > 1)
|
||||
{
|
||||
// Processor restriction map: per processor the coarse processor
|
||||
labelList procAgglomMap(nProcs, 0);
|
||||
labelList procAgglomMap(nProcs, Zero);
|
||||
|
||||
// Master processor
|
||||
labelList masterProcs;
|
||||
|
||||
@ -150,7 +150,7 @@ Foam::procFacesGAMGProcAgglomeration::processorAgglomeration
|
||||
label singleCellMeshComm = UPstream::allocateCommunicator
|
||||
(
|
||||
mesh.comm(),
|
||||
labelList(1, label(0)) // only processor 0
|
||||
labelList(1, Zero) // only processor 0
|
||||
);
|
||||
|
||||
scalarField faceWeights;
|
||||
|
||||
@ -253,7 +253,7 @@ void Foam::GAMGSolver::agglomerateInterfaceCoefficients
|
||||
coarseInterfaceBouCoeffs.set
|
||||
(
|
||||
inti,
|
||||
new scalarField(nPatchFaces[inti], 0.0)
|
||||
new scalarField(nPatchFaces[inti], Zero)
|
||||
);
|
||||
agglomeration_.restrictField
|
||||
(
|
||||
@ -265,7 +265,7 @@ void Foam::GAMGSolver::agglomerateInterfaceCoefficients
|
||||
coarseInterfaceIntCoeffs.set
|
||||
(
|
||||
inti,
|
||||
new scalarField(nPatchFaces[inti], 0.0)
|
||||
new scalarField(nPatchFaces[inti], Zero)
|
||||
);
|
||||
agglomeration_.restrictField
|
||||
(
|
||||
|
||||
@ -80,7 +80,7 @@ Foam::tmp<Foam::scalarField> Foam::GAMGInterface::agglomerateCoeffs
|
||||
const scalarField& fineCoeffs
|
||||
) const
|
||||
{
|
||||
tmp<scalarField> tcoarseCoeffs(new scalarField(size(), 0.0));
|
||||
tmp<scalarField> tcoarseCoeffs(new scalarField(size(), Zero));
|
||||
scalarField& coarseCoeffs = tcoarseCoeffs.ref();
|
||||
|
||||
if (fineCoeffs.size() != faceRestrictAddressing_.size())
|
||||
|
||||
@ -221,7 +221,7 @@ void Foam::multiply
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
ans = scalarRectangularMatrix(A.m(), C.n(), scalar(0));
|
||||
ans = scalarRectangularMatrix(A.m(), C.n(), Zero);
|
||||
|
||||
for (label i=0; i<A.m(); i++)
|
||||
{
|
||||
@ -265,7 +265,7 @@ void Foam::multiply
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
ans = scalarRectangularMatrix(A.m(), C.n(), scalar(0));
|
||||
ans = scalarRectangularMatrix(A.m(), C.n(), Zero);
|
||||
|
||||
for (label i=0; i<A.m(); i++)
|
||||
{
|
||||
|
||||
@ -249,7 +249,7 @@ void Foam::multiply
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
ans = Matrix<Form, Type>(A.m(), B.n(), scalar(0));
|
||||
ans = Matrix<Form, Type>(A.m(), B.n(), Zero);
|
||||
|
||||
for (label i=0; i<A.m(); i++)
|
||||
{
|
||||
|
||||
@ -242,7 +242,7 @@ Foam::commSchedule::commSchedule
|
||||
|
||||
// Sort schedule_ by processor
|
||||
|
||||
labelList nProcScheduled(nProcs, 0);
|
||||
labelList nProcScheduled(nProcs, Zero);
|
||||
|
||||
// Count
|
||||
forAll(schedule_, i)
|
||||
|
||||
@ -152,7 +152,7 @@ Foam::labelList Foam::bandCompression
|
||||
)
|
||||
{
|
||||
// Count number of neighbours
|
||||
labelList numNbrs(offsets.size()-1, 0);
|
||||
labelList numNbrs(offsets.size()-1, Zero);
|
||||
forAll(numNbrs, celli)
|
||||
{
|
||||
label start = offsets[celli];
|
||||
|
||||
@ -132,7 +132,7 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder
|
||||
const labelUList& upper
|
||||
)
|
||||
{
|
||||
labelList nNbrs(nCells, 0);
|
||||
labelList nNbrs(nCells, Zero);
|
||||
|
||||
// Count number of upper neighbours
|
||||
forAll(lower, facei)
|
||||
@ -377,7 +377,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
|
||||
|
||||
label nOtherInterfaces = 0;
|
||||
labelList nCoupledFaces(nMeshes, 0);
|
||||
labelList nCoupledFaces(nMeshes, Zero);
|
||||
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; procMeshI++)
|
||||
{
|
||||
|
||||
@ -84,7 +84,7 @@ Foam::cellShape Foam::degenerateMatcher::match(const faceList& faces)
|
||||
return match
|
||||
(
|
||||
faces,
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell 0
|
||||
identity(faces.size()) // cell 0 consists of all faces
|
||||
);
|
||||
|
||||
@ -288,7 +288,7 @@ bool Foam::hexMatcher::isA(const faceList& faces)
|
||||
(
|
||||
true,
|
||||
faces, // all faces in mesh
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell label
|
||||
identity(faces.size()) // faces of cell 0
|
||||
);
|
||||
|
||||
@ -347,7 +347,7 @@ bool Foam::prismMatcher::isA(const faceList& faces)
|
||||
(
|
||||
true,
|
||||
faces, // all faces in mesh
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell label
|
||||
identity(faces.size()) // faces of cell 0
|
||||
);
|
||||
|
||||
@ -269,7 +269,7 @@ bool Foam::pyrMatcher::isA(const faceList& faces)
|
||||
(
|
||||
true,
|
||||
faces, // all faces in mesh
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell label
|
||||
identity(faces.size()) // faces of cell 0
|
||||
);
|
||||
|
||||
@ -228,7 +228,7 @@ bool Foam::tetMatcher::isA(const faceList& faces)
|
||||
(
|
||||
true,
|
||||
faces, // all faces in mesh
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell label
|
||||
identity(faces.size()) // faces of cell 0
|
||||
);
|
||||
|
||||
@ -274,7 +274,7 @@ bool Foam::tetWedgeMatcher::isA(const faceList& faces)
|
||||
(
|
||||
true,
|
||||
faces, // all faces in mesh
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell label
|
||||
identity(faces.size()) // faces of cell 0
|
||||
);
|
||||
|
||||
@ -374,7 +374,7 @@ bool Foam::wedgeMatcher::isA(const faceList& faces)
|
||||
(
|
||||
true,
|
||||
faces, // all faces in mesh
|
||||
labelList(faces.size(), 0), // cell 0 is owner of all faces
|
||||
labelList(faces.size(), Zero), // cell 0 is owner of all faces
|
||||
0, // cell label
|
||||
identity(faces.size()) // faces of cell 0
|
||||
);
|
||||
|
||||
@ -118,7 +118,7 @@ void Foam::pointMapper::calcAddressing() const
|
||||
{
|
||||
// Mapped from a single point
|
||||
addr[pointi] = labelList(1, cm[pointi]);
|
||||
w[pointi] = scalarList(1, 1.0);
|
||||
w[pointi] = scalarList(1, scalar(1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,8 +134,8 @@ void Foam::pointMapper::calcAddressing() const
|
||||
if (addr[pointi].empty())
|
||||
{
|
||||
// Mapped from a dummy point. Take point 0 with weight 1.
|
||||
addr[pointi] = labelList(1, label(0));
|
||||
w[pointi] = scalarList(1, 1.0);
|
||||
addr[pointi] = labelList(1, Zero);
|
||||
w[pointi] = scalarList(1, scalar(1));
|
||||
|
||||
insertedPoints[nInsertedPoints] = pointi;
|
||||
nInsertedPoints++;
|
||||
|
||||
@ -83,14 +83,14 @@ void Foam::pointPatchMapper::calcAddressing() const
|
||||
if (ppm[i] >= 0)
|
||||
{
|
||||
addr[i] = labelList(1, ppm[i]);
|
||||
w[i] = scalarList(1, 1.0);
|
||||
w[i] = scalarList(1, scalar(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Inserted point.
|
||||
///// Map from point0 (arbitrary choice)
|
||||
//addr[i] = labelList(1, label(0));
|
||||
//w[i] = scalarList(1, 1.0);
|
||||
//addr[i] = labelList(1, Zero);
|
||||
//w[i] = scalarList(1, scalar(1));
|
||||
hasUnmapped_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1234,7 +1234,7 @@ void Foam::globalMeshData::calcPointBoundaryFaces
|
||||
|
||||
// 1. Count
|
||||
|
||||
labelList nPointFaces(coupledPatch().nPoints(), 0);
|
||||
labelList nPointFaces(coupledPatch().nPoints(), Zero);
|
||||
|
||||
forAll(bMesh, patchi)
|
||||
{
|
||||
|
||||
@ -262,8 +262,8 @@ void Foam::cellMapper::calcAddressing() const
|
||||
if (addr[celli].empty())
|
||||
{
|
||||
// Mapped from a dummy cell
|
||||
addr[celli] = labelList(1, label(0));
|
||||
w[celli] = scalarList(1, 1.0);
|
||||
addr[celli] = labelList(1, Zero);
|
||||
w[celli] = scalarList(1, scalar(1));
|
||||
|
||||
insertedCells[nInsertedCells] = celli;
|
||||
nInsertedCells++;
|
||||
|
||||
@ -177,8 +177,8 @@ void Foam::faceMapper::calcAddressing() const
|
||||
if (addr[facei].empty())
|
||||
{
|
||||
// Mapped from a dummy face
|
||||
addr[facei] = labelList(1, label(0));
|
||||
w[facei] = scalarList(1, 1.0);
|
||||
addr[facei] = labelList(1, Zero);
|
||||
w[facei] = scalarList(1, scalar(1));
|
||||
|
||||
insertedFaces[nInsertedFaces] = facei;
|
||||
nInsertedFaces++;
|
||||
|
||||
@ -311,7 +311,7 @@ Foam::mapDistribute::mapDistribute
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Count per transformIndex
|
||||
label nTrafo = globalTransforms.transformPermutations().size();
|
||||
labelList nPerTransform(nTrafo, 0);
|
||||
labelList nPerTransform(nTrafo, Zero);
|
||||
forAll(transformedElements, i)
|
||||
{
|
||||
labelPair elem = transformedElements[i];
|
||||
@ -420,7 +420,7 @@ Foam::mapDistribute::mapDistribute
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Count per transformIndex
|
||||
label nTrafo = globalTransforms.transformPermutations().size();
|
||||
labelList nPerTransform(nTrafo, 0);
|
||||
labelList nPerTransform(nTrafo, Zero);
|
||||
forAll(transformedElements, celli)
|
||||
{
|
||||
const labelPairList& elems = transformedElements[celli];
|
||||
|
||||
@ -289,7 +289,7 @@ void Foam::mapDistributeBase::calcCompactAddressing
|
||||
compactMap.setSize(Pstream::nProcs());
|
||||
|
||||
// Count all (non-local) elements needed. Just for presizing map.
|
||||
labelList nNonLocal(Pstream::nProcs(), 0);
|
||||
labelList nNonLocal(Pstream::nProcs(), Zero);
|
||||
|
||||
forAll(elements, i)
|
||||
{
|
||||
@ -338,7 +338,7 @@ void Foam::mapDistributeBase::calcCompactAddressing
|
||||
compactMap.setSize(Pstream::nProcs());
|
||||
|
||||
// Count all (non-local) elements needed. Just for presizing map.
|
||||
labelList nNonLocal(Pstream::nProcs(), 0);
|
||||
labelList nNonLocal(Pstream::nProcs(), Zero);
|
||||
|
||||
forAll(cellCells, cellI)
|
||||
{
|
||||
@ -616,8 +616,8 @@ Foam::mapDistributeBase::mapDistributeBase
|
||||
}
|
||||
|
||||
// Per processor the number of samples we have to send/receive.
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
labelList nRecv(Pstream::nProcs(), 0);
|
||||
labelList nSend(Pstream::nProcs(), Zero);
|
||||
labelList nRecv(Pstream::nProcs(), Zero);
|
||||
|
||||
forAll(sendProcs, sampleI)
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ Foam::label Foam::polyMeshTetDecomposition::findSharedBasePoint
|
||||
|
||||
const point& oCc = pC[oCI];
|
||||
|
||||
List<scalar> tetQualities(2, 0.0);
|
||||
List<scalar> tetQualities(2, Zero);
|
||||
|
||||
forAll(f, faceBasePtI)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user