Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-11-28 13:03:03 +00:00
69 changed files with 330 additions and 4643556 deletions

View File

@ -1,6 +1,6 @@
Info<< "Constructing single cell mesh" << nl << endl; Info<< "Constructing single cell mesh" << nl << endl;
labelList owner(6, 0); labelList owner(6, label(0));
labelList neighbour(0); labelList neighbour(0);
pointField points(8); pointField points(8);

View File

@ -0,0 +1,58 @@
{
#include "continuityErrs.H"
wordList pcorrTypes
(
p_rgh.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
forAll (p_rgh.boundaryField(), i)
{
if (p_rgh.boundaryField()[i].fixesValue())
{
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
(
"pcorr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("pcorr", p_rgh.dimensions(), 0.0),
pcorrTypes
);
dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
adjustPhi(phi, U, pcorr);
fvc::makeAbsolute(phi, U);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pcorrEqn
(
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
);
pcorrEqn.setReference(pRefCell, pRefValue);
pcorrEqn.solve();
if (pimple.finalNonOrthogonalIter())
{
phi -= pcorrEqn.flux();
phiAbs = phi;
fvc::makeRelative(phi, U);
}
}
#include "continuityErrs.H"
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1456,7 +1456,7 @@ void setCouplingInfo
{ {
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> newPatches(patches.size(), NULL); List<polyPatch*> newPatches(patches.size(), static_cast<polyPatch*>(NULL));
forAll(zoneToPatch, zoneI) forAll(zoneToPatch, zoneI)
{ {

View File

@ -244,8 +244,8 @@ void Foam::domainDecomposition::decomposeMesh()
{ {
label nInterfaces = interPatchFaces[procI].size(); label nInterfaces = interPatchFaces[procI].size();
subPatchIDs[procI].setSize(nInterfaces, labelList(1, -1)); subPatchIDs[procI].setSize(nInterfaces, labelList(1, label(-1)));
subPatchStarts[procI].setSize(nInterfaces, labelList(1, 0)); subPatchStarts[procI].setSize(nInterfaces, labelList(1, label(0)));
} }
// Processor boundaries from split cyclics // Processor boundaries from split cyclics
@ -319,7 +319,7 @@ void Foam::domainDecomposition::decomposeMesh()
{ {
label nIntfcs = interPatchFaces[procI].size(); label nIntfcs = interPatchFaces[procI].size();
subPatchIDs[procI].setSize(nIntfcs, labelList(1, patchi)); subPatchIDs[procI].setSize(nIntfcs, labelList(1, patchi));
subPatchStarts[procI].setSize(nIntfcs, labelList(1, 0)); subPatchStarts[procI].setSize(nIntfcs, labelList(1, label(0)));
} }
} }
} }

View File

@ -114,7 +114,7 @@ Foam::fieldviewTopology::fieldviewTopology
// Mark all faces that are to be seen as wall for particle // Mark all faces that are to be seen as wall for particle
// tracking and all cells that use one or more of these walls // tracking and all cells that use one or more of these walls
labelList wallFace(mesh.nFaces(), NOT_A_WALL); List<int> wallFace(mesh.nFaces(), NOT_A_WALL);
boolList wallCell(mesh.nCells(), false); boolList wallCell(mesh.nCells(), false);
if (setWallInfo) if (setWallInfo)
@ -149,20 +149,20 @@ Foam::fieldviewTopology::fieldviewTopology
const cellModel& hex = *(cellModeller::lookup("hex")); const cellModel& hex = *(cellModeller::lookup("hex"));
// Pre calculate headers for cells not on walls // 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 unsigned int tetNotWall = fv_encode_elem_header
( (
FV_TET_ELEM_ID, notWallFlags.begin() FV_TET_ELEM_ID, notWallFlags.begin()
); );
label pyrNotWall = fv_encode_elem_header unsigned int pyrNotWall = fv_encode_elem_header
( (
FV_PYRA_ELEM_ID, notWallFlags.begin() FV_PYRA_ELEM_ID, notWallFlags.begin()
); );
label prismNotWall = fv_encode_elem_header unsigned int prismNotWall = fv_encode_elem_header
( (
FV_PRISM_ELEM_ID, notWallFlags.begin() FV_PRISM_ELEM_ID, notWallFlags.begin()
); );
label hexNotWall = fv_encode_elem_header unsigned int hexNotWall = fv_encode_elem_header
( (
FV_HEX_ELEM_ID, notWallFlags.begin() FV_HEX_ELEM_ID, notWallFlags.begin()
); );
@ -179,7 +179,7 @@ Foam::fieldviewTopology::fieldviewTopology
const faceList& allFaces = mesh.faces(); const faceList& allFaces = mesh.faces();
labelList wallFlags(6); List<int> wallFlags(6);
forAll(cellShapes, celli) forAll(cellShapes, celli)
{ {
const cellShape& cellShape = cellShapes[celli]; const cellShape& cellShape = cellShapes[celli];

View File

@ -55,13 +55,13 @@ class fieldviewTopology
// Private data // Private data
//- Hexes in fieldview format //- Hexes in fieldview format
labelList hexLabels_; List<int> hexLabels_;
labelList prismLabels_; List<int> prismLabels_;
labelList pyrLabels_; List<int> pyrLabels_;
labelList tetLabels_; List<int> tetLabels_;
//- Number of non-hex/prism/pyr/tet labels //- Number of non-hex/prism/pyr/tet labels
label nPoly_; label nPoly_;
@ -108,22 +108,22 @@ public:
// Access // Access
const labelList& hexLabels() const const List<int>& hexLabels() const
{ {
return hexLabels_; return hexLabels_;
} }
const labelList& prismLabels() const const List<int>& prismLabels() const
{ {
return prismLabels_; return prismLabels_;
} }
const labelList& pyrLabels() const const List<int>& pyrLabels() const
{ {
return pyrLabels_; return pyrLabels_;
} }
const labelList& tetLabels() const const List<int>& tetLabels() const
{ {
return tetLabels_; return tetLabels_;
} }

View File

@ -332,7 +332,7 @@ int main(int argc, char *argv[])
vectorField normals(2*nFeatEds, vector::zero); vectorField normals(2*nFeatEds, vector::zero);
vectorField edgeDirections(nFeatEds, vector::zero); vectorField edgeDirections(nFeatEds, vector::zero);
labelListList edgeNormals(nFeatEds, labelList(2, -1)); labelListList edgeNormals(nFeatEds, labelList(2, label(-1)));
triSurfaceSearch querySurf1(surf1); triSurfaceSearch querySurf1(surf1);
triSurfaceSearch querySurf2(surf2); triSurfaceSearch querySurf2(surf2);

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "HashTable.H" #include "HashTable.H"
#include "uLabel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -47,7 +48,7 @@ Foam::label Foam::HashTableCore::canonicalSize(const label size)
} }
// enforce power of two // enforce power of two
unsigned int goodSize = size; uLabel goodSize = size;
if (goodSize & (goodSize - 1)) if (goodSize & (goodSize - 1))
{ {

View File

@ -68,7 +68,7 @@ class UIPstream
const bool clearAtEnd_; const bool clearAtEnd_;
label messageSize_; int messageSize_;
// Private Member Functions // Private Member Functions

View File

@ -222,7 +222,7 @@ int Foam::UPstream::myProcNo_(0);
bool Foam::UPstream::parRun_(false); bool Foam::UPstream::parRun_(false);
// List of process IDs // List of process IDs
Foam::List<int> Foam::UPstream::procIDs_(1, 0); Foam::List<int> Foam::UPstream::procIDs_(label(1), 0);
// Standard transfer message type // Standard transfer message type
int Foam::UPstream::msgType_(1); int Foam::UPstream::msgType_(1);

View File

@ -278,7 +278,7 @@ Foam::Time::Time
writeControl_(wcTimeStep), writeControl_(wcTimeStep),
writeInterval_(GREAT), writeInterval_(GREAT),
secondaryWriteControl_(wcTimeStep), secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax), secondaryWriteInterval_(labelMax/10.0), // bit less to allow calculations
purgeWrite_(0), purgeWrite_(0),
writeOnce_(false), writeOnce_(false),
subCycling_(false), subCycling_(false),
@ -370,7 +370,7 @@ Foam::Time::Time
writeControl_(wcTimeStep), writeControl_(wcTimeStep),
writeInterval_(GREAT), writeInterval_(GREAT),
secondaryWriteControl_(wcTimeStep), secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax), secondaryWriteInterval_(labelMax/10.0),
purgeWrite_(0), purgeWrite_(0),
writeOnce_(false), writeOnce_(false),
subCycling_(false), subCycling_(false),
@ -465,7 +465,7 @@ Foam::Time::Time
writeControl_(wcTimeStep), writeControl_(wcTimeStep),
writeInterval_(GREAT), writeInterval_(GREAT),
secondaryWriteControl_(wcTimeStep), secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax), secondaryWriteInterval_(labelMax/10.0),
purgeWrite_(0), purgeWrite_(0),
writeOnce_(false), writeOnce_(false),
subCycling_(false), subCycling_(false),
@ -562,7 +562,7 @@ Foam::Time::Time
writeControl_(wcTimeStep), writeControl_(wcTimeStep),
writeInterval_(GREAT), writeInterval_(GREAT),
secondaryWriteControl_(wcTimeStep), secondaryWriteControl_(wcTimeStep),
secondaryWriteInterval_(labelMax), secondaryWriteInterval_(labelMax/10.0),
purgeWrite_(0), purgeWrite_(0),
writeOnce_(false), writeOnce_(false),
subCycling_(false), subCycling_(false),

View File

@ -75,6 +75,28 @@ template<class T>
void transformList(const tensorField&, EdgeMap<T>&); void transformList(const tensorField&, EdgeMap<T>&);
// Specialisations for bool
template<>
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<> template<>
inline void transformList(const tensor&, labelUList&) inline void transformList(const tensor&, labelUList&)
{} {}
@ -95,6 +117,7 @@ inline void transformList(const tensorField&, EdgeMap<label>&)
{} {}
// Specialisations for scalar
template<> template<>
inline void transformList(const tensor&, UList<scalar>&) inline void transformList(const tensor&, UList<scalar>&)
{} {}

View File

@ -137,7 +137,7 @@ void Foam::pointMapper::calcAddressing() const
if (addr[pointI].empty()) if (addr[pointI].empty())
{ {
// Mapped from a dummy point. Take point 0 with weight 1. // 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); w[pointI] = scalarList(1, 1.0);
insertedPoints[nInsertedPoints] = pointI; insertedPoints[nInsertedPoints] = pointI;

View File

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

View File

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

View File

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

View File

@ -147,7 +147,7 @@ bool Foam::pointZone::checkParallelSync(const bool report) const
maxZone[pointI] = index(); maxZone[pointI] = index();
minZone[pointI] = index(); minZone[pointI] = index();
} }
syncTools::syncPointList(mesh, maxZone, maxEqOp<label>(), -1); syncTools::syncPointList(mesh, maxZone, maxEqOp<label>(), label(-1));
syncTools::syncPointList(mesh, minZone, minEqOp<label>(), labelMax); syncTools::syncPointList(mesh, minZone, minEqOp<label>(), labelMax);
bool error = false; bool error = false;

View File

@ -318,7 +318,7 @@ void Foam::globalIndexAndTransform::determineTransforms()
void Foam::globalIndexAndTransform::determineTransformPermutations() void Foam::globalIndexAndTransform::determineTransformPermutations()
{ {
label nTransformPermutations = pow(3, transforms_.size()); label nTransformPermutations = pow(label(3), transforms_.size());
transformPermutations_.setSize(nTransformPermutations); transformPermutations_.setSize(nTransformPermutations);

View File

@ -151,7 +151,7 @@ Foam::globalIndexAndTransform::decodeTransformIndex
const label transformIndex const label transformIndex
) const ) const
{ {
FixedList<label, 3> permutation(0); FixedList<label, 3> permutation(label(0));
label t = transformIndex; label t = transformIndex;
if (nIndependentTransforms() > 0) if (nIndependentTransforms() > 0)
@ -520,7 +520,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
} }
// Number of selected transformations // Number of selected transformations
label nSelTrans = pow(2, nUsedTrans) - 1; label nSelTrans = pow(label(2), nUsedTrans) - 1;
// Pout<< nl << permutation << nl << endl; // Pout<< nl << permutation << nl << endl;

View File

@ -42,6 +42,8 @@ Description
namespace Foam namespace Foam
{ {
//template<class Type> class Hash;
//template<> class Hash<label>;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class Hash Declaration Class Hash Declaration
@ -70,30 +72,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Hash specialization for hashing pointer addresses.
// Treat a pointer like a long.
// This should work for both 32-bit and 64-bit pointers.
template<>
class Hash<void*>
{
public:
Hash()
{}
unsigned operator()(const void* const& p, unsigned seed) const
{
return Hash<long>()(long(p), seed);
}
unsigned operator()(const void* const& p) const
{
return Hash<long>()(long(p));
}
};
//- Hash specialization for hashing labels //- Hash specialization for hashing labels
template<> template<>
class Hash<Foam::label> class Hash<Foam::label>
@ -121,6 +99,30 @@ public:
}; };
//- Hash specialization for hashing pointer addresses.
// Treat a pointer like a long.
// This should work for both 32-bit and 64-bit pointers.
template<>
class Hash<void*>
{
public:
Hash()
{}
unsigned operator()(const void* const& p, unsigned seed) const
{
return Hash<long>()(long(p), seed);
}
unsigned operator()(const void* const& p) const
{
return Hash<long>()(long(p));
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -53,6 +53,28 @@ pTraits<label>::pTraits(Istream& is)
} }
#if (FOAM_LABEL_MAX != INT_MAX)
const char* const pTraits<int>::typeName = "int";
const int pTraits<int>::zero = 0;
const int pTraits<int>::one = 1;
const int pTraits<int>::min = INT_MIN;
const int pTraits<int>::max = INT_MAX;
const char* pTraits<int>::componentNames[] = { "x" };
pTraits<int>::pTraits(const int& p)
:
p_(p)
{}
pTraits<int>::pTraits(Istream& is)
{
is >> p_;
}
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Raise one label to the power of another (overloaded function call) // Raise one label to the power of another (overloaded function call)

View File

@ -47,6 +47,9 @@ Description
# define FOAM_LABEL_MAX 2000000000 # define FOAM_LABEL_MAX 2000000000
#endif #endif
#include "pTraits.H"
#include "direction.H"
#if INT_MAX > FOAM_LABEL_MAX #if INT_MAX > FOAM_LABEL_MAX
@ -126,8 +129,8 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "pTraits.H" //#include "pTraits.H"
#include "direction.H" //#include "direction.H"
namespace Foam namespace Foam
{ {
@ -188,6 +191,66 @@ public:
}; };
// For convenience's sake always define pTraits<int> (so even if label != int)
#if (FOAM_LABEL_MAX != INT_MAX)
//- template specialization for pTraits<int>
template<>
class pTraits<int>
{
int p_;
public:
//- Component type
typedef int cmptType;
// Member constants
enum
{
dim = 3, //!< Dimensionality of space
rank = 0, //!< Rank of int is 0
nComponents = 1 //!< Number of components in int is 1
};
// Static data members
static const char* const typeName;
static const char* componentNames[];
static const int zero;
static const int one;
static const int min;
static const int max;
// Constructors
//- Construct from primitive
explicit pTraits(const int&);
//- Construct from Istream
pTraits(Istream&);
// Member Functions
//- Access to the int value
operator int() const
{
return p_;
}
//- Access to the int value
operator int&()
{
return p_;
}
};
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Raise one label to the power of another //- Raise one label to the power of another
@ -214,6 +277,7 @@ MAXMIN(char, char, char)
MAXMIN(short, short, short) MAXMIN(short, short, short)
MAXMIN(int, int, int) MAXMIN(int, int, int)
MAXMIN(long, long, long) MAXMIN(long, long, long)
MAXMIN(long, long, int)
MAXMIN(long long, long long, long long) MAXMIN(long long, long long, long long)
MAXMIN(unsigned char, unsigned char, unsigned char) MAXMIN(unsigned char, unsigned char, unsigned char)

View File

@ -48,7 +48,7 @@ class Ostream;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Return a string representation of a long //- Return a string representation of a long
word name(long); word name(const long);
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //

View File

@ -37,7 +37,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::word Foam::name(long val) Foam::word Foam::name(const long val)
{ {
std::ostringstream buf; std::ostringstream buf;
buf << val; buf << val;

View File

@ -42,9 +42,9 @@ SeeAlso
#if FOAM_LABEL64 #if FOAM_LABEL64
# define FOAM_ULABEL_MAX 18000000000000000000 # define FOAM_ULABEL_MAX 18000000000000000000u
#else #else
# define FOAM_ULABEL_MAX 4000000000 # define FOAM_ULABEL_MAX 4000000000u
#endif #endif

View File

@ -57,6 +57,12 @@ inline tensor rotationTensor
} }
inline label transform(const tensor&, const bool i)
{
return i;
}
inline label transform(const tensor&, const label i) inline label transform(const tensor&, const label i)
{ {
return i; return i;

View File

@ -259,7 +259,7 @@ Foam::label Foam::UIPstream::read
// Check size of message read // Check size of message read
label messageSize; int messageSize;
MPI_Get_count(&status, MPI_BYTE, &messageSize); MPI_Get_count(&status, MPI_BYTE, &messageSize);
if (debug) if (debug)

View File

@ -260,7 +260,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
// Combustion progress variable (c). // Combustion progress variable (c).
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
List<label> productsIndex(2, -1); List<label> productsIndex(2, label(-1));
{ {
label i = 0; label i = 0;
forAll (this->singleMixture_.specieProd(), specieI) forAll (this->singleMixture_.specieProd(), specieI)

View File

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

View File

@ -862,7 +862,7 @@ void Foam::addPatchCellLayer::setRefinement
{ {
labelList n(mesh_.nPoints(), 0); labelList n(mesh_.nPoints(), 0);
UIndirectList<label>(n, meshPoints) = nPointLayers; UIndirectList<label>(n, meshPoints) = nPointLayers;
syncTools::syncPointList(mesh_, n, maxEqOp<label>(), 0); syncTools::syncPointList(mesh_, n, maxEqOp<label>(), label(0));
// Non-synced // Non-synced
forAll(meshPoints, i) forAll(meshPoints, i)
@ -906,7 +906,7 @@ void Foam::addPatchCellLayer::setRefinement
mesh_, mesh_,
nFromFace, nFromFace,
maxEqOp<label>(), maxEqOp<label>(),
0 label(0)
); );
forAll(nPointLayers, i) forAll(nPointLayers, i)
@ -1418,7 +1418,7 @@ void Foam::addPatchCellLayer::setRefinement
mesh_, mesh_,
meshEdgeLayers, meshEdgeLayers,
maxEqOp<label>(), maxEqOp<label>(),
0 // initial value label(0) // initial value
); );
forAll(meshEdges, edgeI) forAll(meshEdges, edgeI)

View File

@ -714,7 +714,7 @@ void Foam::combineFaces::setRefinement
mesh_, mesh_,
nPointFaces, nPointFaces,
plusEqOp<label>(), plusEqOp<label>(),
0 // null value label(0) // null value
); );
// Remove all unused points. Store position if undoable. // Remove all unused points. Store position if undoable.

View File

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

View File

@ -239,8 +239,14 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
break; break;
} }
label cI = label cI = generationCells_
generationCells_[rnd.position(0, generationCells_.size() - 1)]; [
rnd.position
(
label(0),
generationCells_.size() - 1
)
];
// Pick a particle at random from the cell - if there are // Pick a particle at random from the cell - if there are
// none, insert one at the cell centre. Otherwise, split an // none, insert one at the cell centre. Otherwise, split an
@ -268,7 +274,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
} }
else else
{ {
label cPI = rnd.position(0, cellOccupancy[cI].size() - 1); label cPI = rnd.position(label(0), cellOccupancy[cI].size() - 1);
// This has to be a reference to the pointer so that it // This has to be a reference to the pointer so that it
// can be set to NULL when the particle is deleted. // can be set to NULL when the particle is deleted.

View File

@ -1255,7 +1255,7 @@ void Foam::autoLayerDriver::getPatchDisplacement
meshPoints, meshPoints,
nPointFaces, nPointFaces,
plusEqOp<label>(), plusEqOp<label>(),
0 // null value label(0) // null value
); );
forAll(pointNormals, i) forAll(pointNormals, i)
@ -1954,7 +1954,7 @@ void Foam::autoLayerDriver::setupLayerInfoTruncation
pp.meshPoints(), pp.meshPoints(),
nPatchPointLayers, nPatchPointLayers,
maxEqOp<label>(), maxEqOp<label>(),
0 // null value label(0) // null value
); );
} }
} }

View File

@ -587,7 +587,7 @@ void Foam::autoLayerDriver::findIsolatedRegions
pp.meshPoints(), pp.meshPoints(),
isolatedPoint, isolatedPoint,
plusEqOp<label>(), plusEqOp<label>(),
0 // null value label(0) // null value
); );
// stop layer growth on isolated faces // stop layer growth on isolated faces
@ -730,7 +730,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
meshPoints, meshPoints,
nPointFaces, nPointFaces,
plusEqOp<label>(), plusEqOp<label>(),
0 // null value label(0) // null value
); );
forAll(pointNormals, i) forAll(pointNormals, i)

View File

@ -220,7 +220,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
pp.meshPoints(), pp.meshPoints(),
nBoundary, nBoundary,
plusEqOp<label>(), // combine op plusEqOp<label>(), // combine op
0 // null value label(0) // null value
); );
forAll(avgBoundary, i) forAll(avgBoundary, i)
@ -295,7 +295,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
mesh, mesh,
globalNum, globalNum,
plusEqOp<label>(), // combine op plusEqOp<label>(), // combine op
0 // null value label(0) // null value
); );
avgInternal.setSize(meshPoints.size()); avgInternal.setSize(meshPoints.size());

View File

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

View File

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

View File

@ -45,7 +45,7 @@ template <class Type, class TrackingData>
Foam::scalar Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01; Foam::scalar Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01;
template <class Type, class TrackingData> template <class Type, class TrackingData>
Foam::label Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345; int Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345;
namespace Foam namespace Foam
{ {

View File

@ -240,7 +240,7 @@ class FaceCellWave
//- Used as default trackdata value to satisfy default template //- Used as default trackdata value to satisfy default template
// argument. // argument.
static label dummyTrackData_; static int dummyTrackData_;
public: public:

View File

@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template <class Type, class TrackingData> template <class Type, class TrackingData>
Foam::label Foam::MeshWave<Type, TrackingData>::dummyTrackData_ = 12345; int Foam::MeshWave<Type, TrackingData>::dummyTrackData_ = 12345;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -81,7 +81,7 @@ class MeshWave
//- Used as default trackdata value to satisfy default template //- Used as default trackdata value to satisfy default template
// argument. // argument.
static label dummyTrackData_; static int dummyTrackData_;
public: public:

View File

@ -41,7 +41,7 @@ template <class Type, class TrackingData>
Foam::scalar Foam::PointEdgeWave<Type, TrackingData>::propagationTol_ = 0.01; Foam::scalar Foam::PointEdgeWave<Type, TrackingData>::propagationTol_ = 0.01;
template <class Type, class TrackingData> template <class Type, class TrackingData>
Foam::label Foam::PointEdgeWave<Type, TrackingData>::dummyTrackData_ = 12345; int Foam::PointEdgeWave<Type, TrackingData>::dummyTrackData_ = 12345;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -96,7 +96,7 @@ class PointEdgeWave
//- Used as default trackdata value to satisfy default template //- Used as default trackdata value to satisfy default template
// argument. // argument.
static label dummyTrackData_; static int dummyTrackData_;
// Private data // Private data

View File

@ -58,7 +58,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
absorptionEmissionModel(dict, mesh), absorptionEmissionModel(dict, mesh),
coeffsDict_((dict.subDict(typeName + "Coeffs"))), coeffsDict_((dict.subDict(typeName + "Coeffs"))),
speciesNames_(0), speciesNames_(0),
specieIndex_(0), specieIndex_(label(0)),
lookUpTablePtr_(), lookUpTablePtr_(),
thermo_(mesh.lookupObject<basicThermo>("thermophysicalProperties")), thermo_(mesh.lookupObject<basicThermo>("thermophysicalProperties")),
EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))), EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))),

View File

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

View File

@ -100,7 +100,7 @@ tmp<volScalarField> kkLOmega::fTaul
lambdaEff*omega_ lambdaEff*omega_
+ dimensionedScalar + dimensionedScalar
( (
"ROTVSMALL", "ROOTVSMALL",
dimLength*inv(dimTime), dimLength*inv(dimTime),
ROOTVSMALL ROOTVSMALL
) )
@ -194,6 +194,7 @@ tmp<volScalarField> kkLOmega::gammaNAT
); );
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
kkLOmega::kkLOmega kkLOmega::kkLOmega
@ -670,7 +671,7 @@ void kkLOmega::correct()
alphaT(lambdaEff, fv(sqr(fw)*kt_/nu()/(omega_ + omegaMin_)), ktS) alphaT(lambdaEff, fv(sqr(fw)*kt_/nu()/(omega_ + omegaMin_)), ktS)
); );
// By pass s0urce term divided by kl_ // By pass source term divided by kl_
const dimensionedScalar fwMin("SMALL", dimless, ROOTVSMALL); const dimensionedScalar fwMin("SMALL", dimless, ROOTVSMALL);

View File

@ -136,6 +136,7 @@ class kkLOmega
const volScalarField& fNatCrit const volScalarField& fNatCrit
) const; ) const;
protected: protected:
// Protected data // Protected data

View File

@ -4,6 +4,10 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy propeller surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/propellerTip.obj.gz constant/triSurface/
# - meshing # - meshing
runApplication blockMesh runApplication blockMesh

View File

@ -22,14 +22,13 @@ boundaryField
{ {
inlet inlet
{ {
//type totalPressure; type uniformTotalPressure;
//p0 uniform 40; pressure table
(
type timeVaryingTotalPressure; (0 10)
(1 40)
);
p0 40; // only used for restarts p0 40; // only used for restarts
outOfBounds clamp;
fileName "$FOAM_CASE/constant/p0vsTime";
U U; U U;
phi phi; phi phi;
rho none; rho none;

View File

@ -1,4 +0,0 @@
(
(0 10)
(1 40)
)

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0";
object p; object p;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -23,50 +22,37 @@ boundaryField
{ {
inlet inlet
{ {
type timeVaryingTotalPressure; type uniformTotalPressure;
pressure table
(
(0 10)
(1 40)
);
p0 40; // only used for restarts
U U;
phi phi;
rho none; rho none;
psi none; psi none;
gamma 1; gamma 1;
p0 40;
fileName "$FOAM_CASE/constant/p0vsTime";
outOfBounds clamp;
value uniform 40; value uniform 40;
} }
outlet1 outlet1
{ {
type fixedValue; type fixedValue;
value uniform 10; value uniform 10;
} }
outlet2 outlet2
{ {
type fixedValue; type fixedValue;
value uniform 0; value uniform 0;
} }
baffles
{
type zeroGradient;
}
fan_half0
{
type fan;
patchType cyclic;
jump uniform 0;
f 2(100 -0.1);
value uniform 0;
}
fan_half1
{
type fan;
patchType cyclic;
jump uniform 0;
f 2(100 -0.1);
value uniform 0;
}
defaultFaces defaultFaces
{ {
type zeroGradient; type zeroGradient;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,4 +0,0 @@
(
(0 10)
(1 40)
)

View File

@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
# remove surface
\rm -f constant/triSurface/motorBike.obj.gz
rm -rf 0 > /dev/null 2>&1 rm -rf 0 > /dev/null 2>&1
cleanCase cleanCase

View File

@ -4,6 +4,8 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy motorbike surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
# Make dummy 0 directory # Make dummy 0 directory
mkdir 0 mkdir 0

View File

@ -0,0 +1,4 @@
Folder to house tri-surfaces
The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry
folder

View File

@ -28,7 +28,7 @@ addLayers false;
// - to 'snap' the mesh boundary to the surface // - to 'snap' the mesh boundary to the surface
geometry geometry
{ {
motorBike.stl motorBike.obj
{ {
type triSurfaceMesh; type triSurfaceMesh;
name motorBike; name motorBike;

View File

@ -3,6 +3,9 @@
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
# remove surface
\rm -f constant/triSurface/motorBike.obj.gz
rm -rf 0 > /dev/null 2>&1 rm -rf 0 > /dev/null 2>&1
cleanCase cleanCase

View File

@ -2,6 +2,9 @@
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy motorbike surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
cp -r 0.org 0 > /dev/null 2>&1 cp -r 0.org 0 > /dev/null 2>&1
runApplication blockMesh runApplication blockMesh

View File

@ -0,0 +1,4 @@
Folder to house tri-surfaces
The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry
folder

View File

@ -28,7 +28,7 @@ addLayers true;
// - to 'snap' the mesh boundary to the surface // - to 'snap' the mesh boundary to the surface
geometry geometry
{ {
motorBike.stl motorBike.obj
{ {
type triSurfaceMesh; type triSurfaceMesh;
name motorBike; name motorBike;

Binary file not shown.

Binary file not shown.