gcc-4.8 compilation updates. Andreas Feymark

This commit is contained in:
Hrvoje Jasak 2013-09-18 09:19:52 +01:00
parent 5a18de14fb
commit 30b35bab83
26 changed files with 287 additions and 162 deletions

View file

@ -37,7 +37,7 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchTypeField
makeTemplatePointPatchTypeField
(
tetPolyPatchVectorField,
tractionTetPolyPatchVectorField

View file

@ -69,14 +69,13 @@ void Foam::UPtrList<T>::setSize(const label newSize)
{
clear();
}
else if (newSize < oldSize)
else if (newSize != oldSize)
{
ptrs_.setSize(newSize);
}
else if (newSize > oldSize)
{
ptrs_.setSize(newSize);
if (newSize > oldSize)
{
// set new elements to NULL
for (register label i = oldSize; i < newSize; i++)
{

View file

@ -689,8 +689,7 @@ template<class Type>
template<class Form, class Cmpt, int nCmpt>
void Field<Type>::operator=(const VectorSpace<Form,Cmpt,nCmpt>& vs)
{
typedef VectorSpace<Form,Cmpt,nCmpt> VSType;
TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs)
TFOR_ALL_F_OP_S(Type, *this, =, (VectorSpace<Form,Cmpt,nCmpt>), vs)
}

View file

@ -589,21 +589,7 @@ const PointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>& operator+
#endif
#define makePointPatchTypeFieldTypeName(typePatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0);
#define makePointPatchFieldsTypeName(typePatchField, pointPatchType) \
\
makePointPatchTypeFieldTypeName(typePatchField##pointPatchType##ScalarField); \
makePointPatchTypeFieldTypeName(typePatchField##pointPatchType##VectorField); \
makePointPatchTypeFieldTypeName(typePatchField##pointPatchType##SphericalTensorField); \
makePointPatchTypeFieldTypeName(typePatchField##pointPatchType##SymmTensorField); \
makePointPatchTypeFieldTypeName(typePatchField##pointPatchType##TensorField);
#define makePointPatchTypeField(PatchTypeField, typePatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
#define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
\
addToRunTimeSelectionTable \
( \
@ -623,33 +609,85 @@ addToRunTimeSelectionTable \
);
#define makePointPatchTypeFieldTypeName(typePatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0);
#define makePointPatchFieldsTypeName(typePatchField, pointPatchType) \
\
makePointPatchTypeFieldTypeName \
( \
typePatchField##pointPatchType##ScalarField \
); \
\
makePointPatchTypeFieldTypeName \
( \
typePatchField##pointPatchType##VectorField \
); \
\
makePointPatchTypeFieldTypeName \
( \
typePatchField##pointPatchType##SphericalTensorField \
); \
\
makePointPatchTypeFieldTypeName \
( \
typePatchField##pointPatchType##SymmTensorField \
); \
\
makePointPatchTypeFieldTypeName \
( \
typePatchField##pointPatchType##TensorField \
);
#define makePointPatchTypeField(PatchTypeField, typePatchTypeField) \
\
defineTypeNameAndDebug(typePatchTypeField, 0); \
\
addToPointPatchFieldRunTimeSelection \
( \
PatchTypeField, typePatchTypeField \
);
#define makeTemplatePointPatchTypeField(PatchTypeField, typePatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
\
addToPointPatchFieldRunTimeSelection \
( \
PatchTypeField, typePatchTypeField \
);
#define makePointPatchFields(type, pointPatch, pointPatchType) \
\
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatch##ScalarField, \
type##pointPatchType##ScalarField \
); \
\
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatch##VectorField, \
type##pointPatchType##VectorField \
); \
\
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatch##SphericalTensorField, \
type##pointPatchType##SphericalTensorField \
); \
\
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatch##SymmTensorField, \
type##pointPatchType##SymmTensorField \
); \
\
makePointPatchTypeField \
makeTemplatePointPatchTypeField \
( \
pointPatch##TensorField, \
type##pointPatchType##TensorField \
@ -683,10 +721,24 @@ typedef Type##PointPatchField \
<pointPatch##Field, mesh, patchPatch, typePointPatch, matrixType, vector> \
type##pointPatchType##VectorField; \
typedef Type##PointPatchField \
<pointPatch##Field, mesh, patchPatch, typePointPatch, matrixType, sphericalTensor>\
< \
pointPatch##Field, \
mesh, \
patchPatch, \
typePointPatch, \
matrixType, \
sphericalTensor \
> \
type##pointPatchType##SphericalTensorField; \
typedef Type##PointPatchField \
<pointPatch##Field, mesh, patchPatch, typePointPatch, matrixType, symmTensor>\
< \
pointPatch##Field, \
mesh, \
patchPatch, \
typePointPatch, \
matrixType, \
symmTensor \
> \
type##pointPatchType##SymmTensorField; \
typedef Type##PointPatchField \
<pointPatch##Field, mesh, patchPatch, typePointPatch, matrixType, tensor> \

View file

@ -639,10 +639,7 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
// Matrix restriction done!
typedef CoeffField<Type> TypeCoeffField;
typedef Field<Type> TypeField;
typedef typename TypeCoeffField::scalarTypeField scalarTypeField;
typedef typename TypeCoeffField::linearTypeField linearTypeField;
typedef typename TypeCoeffField::squareTypeField squareTypeField;
TypeCoeffField& coarseUpper = coarseMatrix.upper();

View file

@ -57,12 +57,6 @@ void Foam::BlockGaussSeidelPrecon<Type>::BlockSweep
// Klas Jareteg: 2013-02-10:
// Must transfer data between the different CPUs. Notes on the Jacobi
// iteration style can be seen in GaussSeidelSolver.C
typedef CoeffField<Type> TypeCoeffField;
typedef Field<Type> TypeField;
typedef typename TypeCoeffField::scalarTypeField scalarTypeField;
typedef typename TypeCoeffField::linearTypeField linearTypeField;
typedef typename TypeCoeffField::squareTypeField squareTypeField;
for (label sweep = 0; sweep < nSweeps_; sweep++)
{
@ -172,12 +166,6 @@ void Foam::BlockGaussSeidelPrecon<Type>::BlockSweep
// Klas Jareteg: 2013-02-10:
// Must transfer data between the different CPUs. Notes on the Jacobi
// iteration style can be seen in GaussSeidelSolver.C
typedef CoeffField<Type> TypeCoeffField;
typedef Field<Type> TypeField;
typedef typename TypeCoeffField::scalarTypeField scalarTypeField;
typedef typename TypeCoeffField::linearTypeField linearTypeField;
typedef typename TypeCoeffField::squareTypeField squareTypeField;
for (label sweep = 0; sweep < nSweeps_; sweep++)
{

View file

@ -56,9 +56,7 @@ Foam::tmp<Foam::CoeffField<Type> > Foam::GAMGInterface::agglomerateBlockCoeffs
CoeffField<Type>& coarseCoeffs = tcoarseCoeffs();
typedef CoeffField<Type> TypeCoeffField;
typedef Field<Type> TypeField;
typedef typename TypeCoeffField::scalarTypeField scalarTypeField;
typedef typename TypeCoeffField::linearTypeField linearTypeField;
typedef typename TypeCoeffField::squareTypeField squareTypeField;

View file

@ -37,7 +37,12 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, calculatedFvPatch##Type##Field);
\
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
calculatedFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -88,9 +88,14 @@ void cyclicFvPatchField<Type>::updateInterfaceMatrix \
#define doMakePatchTypeField(type, Type, args...) \
\
VectorNMatrixInterfaceFunc(type) \
\
makePatchTypeField(fvPatch##Type##Field, cyclicFvPatch##Type##Field);
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
cyclicFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -35,7 +35,12 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, emptyFvPatch##Type##Field);
\
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
emptyFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -35,7 +35,12 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, fixedGradientFvPatch##Type##Field);
\
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
fixedGradientFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -35,7 +35,12 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, fixedValueFvPatch##Type##Field);
\
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
fixedValueFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -103,9 +103,14 @@ void processorFvPatchField<Type>::updateInterfaceMatrix \
#define doMakePatchTypeField(type, Type, args...) \
\
VectorNMatrixInterfaceFunc(type) \
\
makePatchTypeField(fvPatch##Type##Field, processorFvPatch##Type##Field);
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
processorFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -69,9 +69,14 @@ const \
#define doMakePatchTypeField(type, Type, args...) \
\
makeVectorTensorNWedgeFuncDefs(type) \
\
makePatchTypeField(fvPatch##Type##Field, wedgeFvPatch##Type##Field);
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
wedgeFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -35,7 +35,12 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#define doMakePatchTypeField(type, Type, args...) \
makePatchTypeField(fvPatch##Type##Field, zeroGradientFvPatch##Type##Field);
\
makeTemplatePatchTypeField \
( \
fvPatch##Type##Field, \
zeroGradientFvPatch##Type##Field \
);
forAllVectorNTypes(doMakePatchTypeField)

View file

@ -179,7 +179,10 @@ void eMesh::calcEdgePoints() const
// If a boundary point is present, that must begin the list.
// NOTE: Will work only on tetrahedral meshes!
# ifdef FULLDEBUG
bool found;
# endif
label faceIndex = -1;
label cellIndex = -1;
const labelList& owner = mesh_.faceOwner();
@ -246,7 +249,9 @@ void eMesh::calcEdgePoints() const
const cell& cellToCheck = cells[cellIndex];
# ifdef FULLDEBUG
found = false;
# endif
// Assuming tet-cells,
// Loop through edgeFaces and get the next face
@ -259,7 +264,11 @@ void eMesh::calcEdgePoints() const
)
{
faceIndex = cellToCheck[0];
# ifdef FULLDEBUG
found = true;
# endif
break;
}
@ -270,7 +279,11 @@ void eMesh::calcEdgePoints() const
)
{
faceIndex = cellToCheck[1];
# ifdef FULLDEBUG
found = true;
# endif
break;
}
@ -281,7 +294,11 @@ void eMesh::calcEdgePoints() const
)
{
faceIndex = cellToCheck[2];
# ifdef FULLDEBUG
found = true;
# endif
break;
}
@ -292,7 +309,11 @@ void eMesh::calcEdgePoints() const
)
{
faceIndex = cellToCheck[3];
# ifdef FULLDEBUG
found = true;
# endif
break;
}
}

View file

@ -73,7 +73,7 @@ void surfaceDisplacementPointPatchVectorField::calcProjection
const scalar projectLen = mag(mesh.bounds().max()-mesh.bounds().min());
// For case of fixed projection vector:
vector projectVec;
vector projectVec(vector::zero);
if (projectMode_ == FIXEDNORMAL)
{
vector n = projectDir_/mag(projectDir_);

View file

@ -33,7 +33,7 @@ License
namespace Foam
{
makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
makeTemplatePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View file

@ -35,8 +35,17 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchTypeField(fvPatchVectorField, fixedNormalSlipFvPatchVectorField);
makePatchTypeField(fvPatchTensorField, fixedNormalSlipFvPatchTensorField);
makeTemplatePatchTypeField
(
fvPatchVectorField,
fixedNormalSlipFvPatchVectorField
);
makeTemplatePatchTypeField
(
fvPatchTensorField,
fixedNormalSlipFvPatchTensorField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -540,21 +540,7 @@ public:
#endif
#define makePatchTypeFieldTypeName(type) \
\
defineNamedTemplateTypeNameAndDebug(type, 0);
#define makePatchFieldsTypeName(type) \
\
makePatchTypeFieldTypeName(type##FvPatchScalarField); \
makePatchTypeFieldTypeName(type##FvPatchVectorField); \
makePatchTypeFieldTypeName(type##FvPatchSphericalTensorField); \
makePatchTypeFieldTypeName(type##FvPatchSymmTensorField); \
makePatchTypeFieldTypeName(type##FvPatchTensorField);
#define makePatchTypeField(PatchTypeField, typePatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
\
addToRunTimeSelectionTable \
( \
@ -574,17 +560,55 @@ addToRunTimeSelectionTable \
);
#define makePatchTypeFieldTypeName(type) \
\
defineNamedTemplateTypeNameAndDebug(type, 0);
#define makePatchFieldsTypeName(type) \
\
makePatchTypeFieldTypeName(type##FvPatchScalarField); \
makePatchTypeFieldTypeName(type##FvPatchVectorField); \
makePatchTypeFieldTypeName(type##FvPatchSphericalTensorField); \
makePatchTypeFieldTypeName(type##FvPatchSymmTensorField); \
makePatchTypeFieldTypeName(type##FvPatchTensorField);
#define makePatchTypeField(PatchTypeField, typePatchTypeField) \
\
defineTypeNameAndDebug(typePatchTypeField, 0); \
\
addToPatchFieldRunTimeSelection \
( \
PatchTypeField, typePatchTypeField \
);
#define makeTemplatePatchTypeField(PatchTypeField, typePatchTypeField) \
\
defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
\
addToPatchFieldRunTimeSelection \
( \
PatchTypeField, typePatchTypeField \
);
#define makePatchFields(type) \
\
makePatchTypeField(fvPatchScalarField, type##FvPatchScalarField); \
makePatchTypeField(fvPatchVectorField, type##FvPatchVectorField); \
makePatchTypeField \
makeTemplatePatchTypeField(fvPatchScalarField, type##FvPatchScalarField); \
makeTemplatePatchTypeField(fvPatchVectorField, type##FvPatchVectorField); \
makeTemplatePatchTypeField \
( \
fvPatchSphericalTensorField, \
type##FvPatchSphericalTensorField \
); \
makePatchTypeField(fvPatchSymmTensorField, type##FvPatchSymmTensorField); \
makePatchTypeField(fvPatchTensorField, type##FvPatchTensorField);
makeTemplatePatchTypeField \
( \
fvPatchSymmTensorField, \
type##FvPatchSymmTensorField \
); \
makeTemplatePatchTypeField(fvPatchTensorField, type##FvPatchTensorField);
#define makePatchTypeFieldTypedefs(type) \

View file

@ -30,5 +30,6 @@ $(amg)/coarseAmgLevel.C
amgPolicy = $(amg)/amgPolicy
$(amgPolicy)/amgPolicy.C
$(amgPolicy)/pamgPolicy.C
$(amgPolicy)/aamgPolicy.C
LIB = $(FOAM_LIBBIN)/liblduSolvers

View file

@ -140,7 +140,7 @@ void Foam::coarseAmgLevel::restrictResidual
// Calculate residual
scalarField::subField resBuf(xBuffer, x.size());
scalarField& res = reinterpret_cast<scalarField&>(resBuf);
scalarField& res = const_cast<scalarField&>(resBuf.operator const scalarField&());
residual(x, b, cmpt, res);
@ -274,7 +274,7 @@ void Foam::coarseAmgLevel::scaleX
matrixPtr_->matrix().Amul
(
reinterpret_cast<scalarField&>(Ax),
const_cast<scalarField&>(Ax.operator const scalarField&()),
x,
matrixPtr_->coupleBouCoeffs(),
matrixPtr_->interfaceFields(),

View file

@ -40,7 +40,7 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchTypeField
makeTemplatePointPatchTypeField
(
tetPolyPatchVectorField,
componentMixedTetPolyPatchVectorField

View file

@ -141,7 +141,7 @@ defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary);
#define addChemistryReaderType(SS, Thermo) \
\
defineNamedTemplateTypeNameAndDebug(SS, 0); \
defineTypeNameAndDebug(SS, 0); \
\
chemistryReader<Thermo>::adddictionaryConstructorToTable<SS> \
add##SS##Thermo##ConstructorToTable_;

View file

@ -98,7 +98,7 @@ class janafThermo
public:
static const int nCoeffs_ = 7;
typedef scalar coeffArray[7];
typedef FixedList<scalar, nCoeffs_> coeffArray;
private:

View file

@ -45,11 +45,8 @@ inline Foam::janafThermo<equationOfState>::janafThermo
Thigh_(Thigh),
Tcommon_(Tcommon)
{
for (register label coefLabel=0; coefLabel<nCoeffs_; coefLabel++)
{
highCpCoeffs_[coefLabel] = highCpCoeffs[coefLabel];
lowCpCoeffs_[coefLabel] = lowCpCoeffs[coefLabel];
}
highCpCoeffs_ == highCpCoeffs;
lowCpCoeffs_ == lowCpCoeffs;
}