diff --git a/applications/solvers/stressAnalysis/stressFemFoam/femStress/tractionTetPolyPatchVectorField.C b/applications/solvers/stressAnalysis/stressFemFoam/femStress/tractionTetPolyPatchVectorField.C index 96202ad1e..87ce7aa2e 100644 --- a/applications/solvers/stressAnalysis/stressFemFoam/femStress/tractionTetPolyPatchVectorField.C +++ b/applications/solvers/stressAnalysis/stressFemFoam/femStress/tractionTetPolyPatchVectorField.C @@ -37,7 +37,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makePointPatchTypeField +makeTemplatePointPatchTypeField ( tetPolyPatchVectorField, tractionTetPolyPatchVectorField diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C index 31126d887..8d0332a71 100644 --- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C +++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C @@ -69,14 +69,13 @@ void Foam::UPtrList::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++) { diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 714678de4..5878180c8 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -689,8 +689,7 @@ template template void Field::operator=(const VectorSpace& vs) { - typedef VectorSpace VSType; - TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs) + TFOR_ALL_F_OP_S(Type, *this, =, (VectorSpace), vs) } diff --git a/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H b/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H index c465ca906..563ff98b4 100644 --- a/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H +++ b/src/OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H @@ -589,21 +589,7 @@ const PointPatchField& 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 \ \ type##pointPatchType##VectorField; \ typedef Type##PointPatchField \ - \ + < \ + pointPatch##Field, \ + mesh, \ + patchPatch, \ + typePointPatch, \ + matrixType, \ + sphericalTensor \ + > \ type##pointPatchType##SphericalTensorField; \ typedef Type##PointPatchField \ - \ + < \ + pointPatch##Field, \ + mesh, \ + patchPatch, \ + typePointPatch, \ + matrixType, \ + symmTensor \ + > \ type##pointPatchType##SymmTensorField; \ typedef Type##PointPatchField \ \ diff --git a/src/OpenFOAM/matrices/blockLduMatrix/BlockAmg/BlockAmgPolicy/BlockAamgPolicy.C b/src/OpenFOAM/matrices/blockLduMatrix/BlockAmg/BlockAmgPolicy/BlockAamgPolicy.C index 39eaf70e4..e99747bc1 100644 --- a/src/OpenFOAM/matrices/blockLduMatrix/BlockAmg/BlockAmgPolicy/BlockAamgPolicy.C +++ b/src/OpenFOAM/matrices/blockLduMatrix/BlockAmg/BlockAmgPolicy/BlockAamgPolicy.C @@ -639,10 +639,7 @@ Foam::BlockAamgPolicy::restrictMatrix() const // Matrix restriction done! typedef CoeffField TypeCoeffField; - typedef Field TypeField; - typedef typename TypeCoeffField::scalarTypeField scalarTypeField; - typedef typename TypeCoeffField::linearTypeField linearTypeField; typedef typename TypeCoeffField::squareTypeField squareTypeField; TypeCoeffField& coarseUpper = coarseMatrix.upper(); diff --git a/src/OpenFOAM/matrices/blockLduMatrix/BlockLduPrecons/BlockGaussSeidelPrecon/BlockGaussSeidelPrecon.C b/src/OpenFOAM/matrices/blockLduMatrix/BlockLduPrecons/BlockGaussSeidelPrecon/BlockGaussSeidelPrecon.C index 699808bd2..cd1418582 100644 --- a/src/OpenFOAM/matrices/blockLduMatrix/BlockLduPrecons/BlockGaussSeidelPrecon/BlockGaussSeidelPrecon.C +++ b/src/OpenFOAM/matrices/blockLduMatrix/BlockLduPrecons/BlockGaussSeidelPrecon/BlockGaussSeidelPrecon.C @@ -57,12 +57,6 @@ void Foam::BlockGaussSeidelPrecon::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 TypeCoeffField; - typedef Field 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::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 TypeCoeffField; - typedef Field TypeField; - - typedef typename TypeCoeffField::scalarTypeField scalarTypeField; - typedef typename TypeCoeffField::linearTypeField linearTypeField; - typedef typename TypeCoeffField::squareTypeField squareTypeField; for (label sweep = 0; sweep < nSweeps_; sweep++) { diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceTemplates.C index e668e25a1..c91fcb04d 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceTemplates.C @@ -56,9 +56,7 @@ Foam::tmp > Foam::GAMGInterface::agglomerateBlockCoeffs CoeffField& coarseCoeffs = tcoarseCoeffs(); typedef CoeffField TypeCoeffField; - typedef Field TypeField; - typedef typename TypeCoeffField::scalarTypeField scalarTypeField; typedef typename TypeCoeffField::linearTypeField linearTypeField; typedef typename TypeCoeffField::squareTypeField squareTypeField; diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/calculatedFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/calculatedFvPatchVectorNFields.C index 4a45fe8cd..6eb0e6371 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/calculatedFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/calculatedFvPatchVectorNFields.C @@ -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) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/cyclicFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/cyclicFvPatchVectorNFields.C index 9b2e388df..b0695124a 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/cyclicFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/cyclicFvPatchVectorNFields.C @@ -88,9 +88,14 @@ void cyclicFvPatchField::updateInterfaceMatrix \ #define doMakePatchTypeField(type, Type, args...) \ - VectorNMatrixInterfaceFunc(type) \ \ - makePatchTypeField(fvPatch##Type##Field, cyclicFvPatch##Type##Field); +VectorNMatrixInterfaceFunc(type) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + cyclicFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/emptyFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/emptyFvPatchVectorNFields.C index 3ff48fce7..2eeee9458 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/emptyFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/emptyFvPatchVectorNFields.C @@ -34,8 +34,13 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -#define doMakePatchTypeField(type, Type, args...) \ - makePatchTypeField(fvPatch##Type##Field, emptyFvPatch##Type##Field); +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + emptyFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/fixedGradientFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/fixedGradientFvPatchVectorNFields.C index c8cce1b91..34a9e8ee2 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/fixedGradientFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/fixedGradientFvPatchVectorNFields.C @@ -34,8 +34,13 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -#define doMakePatchTypeField(type, Type, args...) \ - makePatchTypeField(fvPatch##Type##Field, fixedGradientFvPatch##Type##Field); +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + fixedGradientFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/fixedValueFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/fixedValueFvPatchVectorNFields.C index 9d1549ba6..7de70589c 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/fixedValueFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/fixedValueFvPatchVectorNFields.C @@ -34,8 +34,13 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -#define doMakePatchTypeField(type, Type, args...) \ - makePatchTypeField(fvPatch##Type##Field, fixedValueFvPatch##Type##Field); +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + fixedValueFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/processorFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/processorFvPatchVectorNFields.C index fe27e47f4..45e5bf371 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/processorFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/processorFvPatchVectorNFields.C @@ -103,9 +103,14 @@ void processorFvPatchField::updateInterfaceMatrix \ #define doMakePatchTypeField(type, Type, args...) \ - VectorNMatrixInterfaceFunc(type) \ \ - makePatchTypeField(fvPatch##Type##Field, processorFvPatch##Type##Field); +VectorNMatrixInterfaceFunc(type) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + processorFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/wedgeFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/wedgeFvPatchVectorNFields.C index d93b59bea..45c904646 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/wedgeFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/wedgeFvPatchVectorNFields.C @@ -34,44 +34,49 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -#define makeVectorTensorNWedgeFuncDefs(Type) \ -template<> \ -tmp > wedgeFvPatchField::snGrad() const \ -{ \ - return tmp > \ - ( \ - new Field(size(), pTraits::zero) \ - ); \ -} \ - \ -template<> \ -void wedgeFvPatchField::evaluate( \ - const Pstream::commsTypes commsType \ -) \ -{ \ - if (!updated()) \ - { \ - updateCoeffs(); \ - } \ - \ - operator==(patchInternalField()); \ -} \ - \ -template<> \ -tmp > wedgeFvPatchField::snGradTransformDiag()\ -const \ -{ \ - return tmp > \ - ( \ - new Field(this->size(), pTraits::zero) \ - ); \ +#define makeVectorTensorNWedgeFuncDefs(Type) \ +template<> \ +tmp > wedgeFvPatchField::snGrad() const \ +{ \ + return tmp > \ + ( \ + new Field(size(), pTraits::zero) \ + ); \ +} \ + \ +template<> \ +void wedgeFvPatchField::evaluate( \ + const Pstream::commsTypes commsType \ +) \ +{ \ + if (!updated()) \ + { \ + updateCoeffs(); \ + } \ + \ + operator==(patchInternalField()); \ +} \ + \ +template<> \ +tmp > wedgeFvPatchField::snGradTransformDiag() \ +const \ +{ \ + return tmp > \ + ( \ + new Field(this->size(), pTraits::zero) \ + ); \ } -#define doMakePatchTypeField(type, Type, args...) \ - makeVectorTensorNWedgeFuncDefs(type) \ - \ - makePatchTypeField(fvPatch##Type##Field, wedgeFvPatch##Type##Field); +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeVectorTensorNWedgeFuncDefs(type) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + wedgeFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/VectorN/finiteVolume/fields/fvPatchFields/zeroGradientFvPatchVectorNFields.C b/src/VectorN/finiteVolume/fields/fvPatchFields/zeroGradientFvPatchVectorNFields.C index eaef2b777..1fe28c9b6 100644 --- a/src/VectorN/finiteVolume/fields/fvPatchFields/zeroGradientFvPatchVectorNFields.C +++ b/src/VectorN/finiteVolume/fields/fvPatchFields/zeroGradientFvPatchVectorNFields.C @@ -34,8 +34,13 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -#define doMakePatchTypeField(type, Type, args...) \ - makePatchTypeField(fvPatch##Type##Field, zeroGradientFvPatch##Type##Field); +#define doMakePatchTypeField(type, Type, args...) \ + \ +makeTemplatePatchTypeField \ +( \ + fvPatch##Type##Field, \ + zeroGradientFvPatch##Type##Field \ +); forAllVectorNTypes(doMakePatchTypeField) diff --git a/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/eMesh/eMeshDemandDrivenData.C b/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/eMesh/eMeshDemandDrivenData.C index 90fa060b4..d6b18b0d8 100644 --- a/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/eMesh/eMeshDemandDrivenData.C +++ b/src/dynamicMesh/dynamicFvMesh/dynamicTopoFvMesh/eMesh/eMeshDemandDrivenData.C @@ -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; } } diff --git a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C index 3b9c52b79..77dd319f4 100644 --- a/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C +++ b/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C @@ -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_); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index c705ed9cb..7f8f42dfc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -33,7 +33,7 @@ License namespace Foam { - makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); + makeTemplatePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C index fbdf5f97e..49554e9ad 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C @@ -35,8 +35,17 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makePatchTypeField(fvPatchVectorField, fixedNormalSlipFvPatchVectorField); -makePatchTypeField(fvPatchTensorField, fixedNormalSlipFvPatchTensorField); +makeTemplatePatchTypeField +( + fvPatchVectorField, + fixedNormalSlipFvPatchVectorField +); + +makeTemplatePatchTypeField +( + fvPatchTensorField, + fixedNormalSlipFvPatchTensorField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index cc57c91cf..ec5b7bf01 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -540,60 +540,84 @@ 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); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, typePatchTypeField, patch \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, \ - typePatchTypeField, \ - patchMapper \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - PatchTypeField, typePatchTypeField, dictionary \ +#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \ + \ +addToRunTimeSelectionTable \ +( \ + PatchTypeField, typePatchTypeField, patch \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + PatchTypeField, \ + typePatchTypeField, \ + patchMapper \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + PatchTypeField, typePatchTypeField, dictionary \ ); -#define makePatchFields(type) \ - \ -makePatchTypeField(fvPatchScalarField, type##FvPatchScalarField); \ -makePatchTypeField(fvPatchVectorField, type##FvPatchVectorField); \ -makePatchTypeField \ -( \ - fvPatchSphericalTensorField, \ - type##FvPatchSphericalTensorField \ -); \ -makePatchTypeField(fvPatchSymmTensorField, type##FvPatchSymmTensorField); \ -makePatchTypeField(fvPatchTensorField, type##FvPatchTensorField); +#define makePatchTypeFieldTypeName(type) \ + \ +defineNamedTemplateTypeNameAndDebug(type, 0); -#define makePatchTypeFieldTypedefs(type) \ - \ -typedef type##FvPatchField type##FvPatchScalarField; \ -typedef type##FvPatchField type##FvPatchVectorField; \ -typedef type##FvPatchField \ - type##FvPatchSphericalTensorField; \ -typedef type##FvPatchField type##FvPatchSymmTensorField; \ +#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) \ + \ +makeTemplatePatchTypeField(fvPatchScalarField, type##FvPatchScalarField); \ +makeTemplatePatchTypeField(fvPatchVectorField, type##FvPatchVectorField); \ +makeTemplatePatchTypeField \ +( \ + fvPatchSphericalTensorField, \ + type##FvPatchSphericalTensorField \ +); \ +makeTemplatePatchTypeField \ +( \ + fvPatchSymmTensorField, \ + type##FvPatchSymmTensorField \ +); \ +makeTemplatePatchTypeField(fvPatchTensorField, type##FvPatchTensorField); + + +#define makePatchTypeFieldTypedefs(type) \ + \ +typedef type##FvPatchField type##FvPatchScalarField; \ +typedef type##FvPatchField type##FvPatchVectorField; \ +typedef type##FvPatchField \ + type##FvPatchSphericalTensorField; \ +typedef type##FvPatchField type##FvPatchSymmTensorField; \ typedef type##FvPatchField type##FvPatchTensorField; diff --git a/src/lduSolvers/Make/files b/src/lduSolvers/Make/files index 7d891ced3..6408c9737 100644 --- a/src/lduSolvers/Make/files +++ b/src/lduSolvers/Make/files @@ -30,5 +30,6 @@ $(amg)/coarseAmgLevel.C amgPolicy = $(amg)/amgPolicy $(amgPolicy)/amgPolicy.C $(amgPolicy)/pamgPolicy.C +$(amgPolicy)/aamgPolicy.C LIB = $(FOAM_LIBBIN)/liblduSolvers diff --git a/src/lduSolvers/amg/coarseAmgLevel.C b/src/lduSolvers/amg/coarseAmgLevel.C index c4eec008d..a089c5b55 100644 --- a/src/lduSolvers/amg/coarseAmgLevel.C +++ b/src/lduSolvers/amg/coarseAmgLevel.C @@ -140,7 +140,7 @@ void Foam::coarseAmgLevel::restrictResidual // Calculate residual scalarField::subField resBuf(xBuffer, x.size()); - scalarField& res = reinterpret_cast(resBuf); + scalarField& res = const_cast(resBuf.operator const scalarField&()); residual(x, b, cmpt, res); @@ -274,7 +274,7 @@ void Foam::coarseAmgLevel::scaleX matrixPtr_->matrix().Amul ( - reinterpret_cast(Ax), + const_cast(Ax.operator const scalarField&()), x, matrixPtr_->coupleBouCoeffs(), matrixPtr_->interfaceFields(), diff --git a/src/tetFiniteElement/fields/tetPolyPatchFields/derived/componentMixed/componentMixedTetPolyPatchVectorField.C b/src/tetFiniteElement/fields/tetPolyPatchFields/derived/componentMixed/componentMixedTetPolyPatchVectorField.C index 3aec631a4..544bef211 100644 --- a/src/tetFiniteElement/fields/tetPolyPatchFields/derived/componentMixed/componentMixedTetPolyPatchVectorField.C +++ b/src/tetFiniteElement/fields/tetPolyPatchFields/derived/componentMixed/componentMixedTetPolyPatchVectorField.C @@ -40,7 +40,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -makePointPatchTypeField +makeTemplatePointPatchTypeField ( tetPolyPatchVectorField, componentMixedTetPolyPatchVectorField diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H index 680e18c2e..674d6bace 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H @@ -133,18 +133,18 @@ defineTemplateRunTimeSelectionTable(chemistryReader, dictionary); #define makeChemistryReaderType(SS, Thermo) \ \ - defineNamedTemplateTypeNameAndDebug(SS, 0); \ +defineNamedTemplateTypeNameAndDebug(SS, 0); \ \ - chemistryReader::adddictionaryConstructorToTable > \ - add##SS##Thermo##ConstructorToTable_; +chemistryReader::adddictionaryConstructorToTable > \ + add##SS##Thermo##ConstructorToTable_; #define addChemistryReaderType(SS, Thermo) \ \ - defineNamedTemplateTypeNameAndDebug(SS, 0); \ +defineTypeNameAndDebug(SS, 0); \ \ - chemistryReader::adddictionaryConstructorToTable \ - add##SS##Thermo##ConstructorToTable_; +chemistryReader::adddictionaryConstructorToTable \ + add##SS##Thermo##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H index 03fd65867..b0cc66ef7 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H @@ -98,7 +98,7 @@ class janafThermo public: static const int nCoeffs_ = 7; - typedef scalar coeffArray[7]; + typedef FixedList coeffArray; private: diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H index 853d90711..7dcaefb8c 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H @@ -45,11 +45,8 @@ inline Foam::janafThermo::janafThermo Thigh_(Thigh), Tcommon_(Tcommon) { - for (register label coefLabel=0; coefLabel