Commit db8a8404 authored by Vaggelis Papoutsis's avatar Vaggelis Papoutsis Committed by Mark Olesen
Browse files

COMP: BFGS and SR1 failed to compile with SP

- Failed due to double*Matrix<float> multiplication.

Style changes

- use SquareMatrix with Identity on construction

- use Zero in constructors

- remove trailing space and semi-colons
parent 8ece5f7a
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2004-2019 OpenCFD Ltd.
Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -223,7 +223,7 @@ private:
// Private Member Functions
//- No copy construct and assignment
//- No copy construct
smoothDelta(const smoothDelta&) = delete;
//- No copy assignment
......
......@@ -66,10 +66,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
ATCModel(const ATCModel&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const ATCModel&) = delete;
......
......@@ -60,10 +60,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
ATCUaGradU(const ATCUaGradU&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const ATCUaGradU&) = delete;
......
......@@ -60,10 +60,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
ATCstandard(const ATCstandard&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const ATCstandard&) = delete;
......
......@@ -61,10 +61,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
cancelATC(const cancelATC&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const cancelATC&) = delete;
......
......@@ -63,10 +63,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
faceCells(const faceCells&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const faceCells&) = delete;
......
......@@ -63,10 +63,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
pointCells(const pointCells&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const pointCells&) = delete;
......
......@@ -25,7 +25,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::zeroATCcells
......@@ -61,10 +60,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
zeroATCcells(const zeroATCcells&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const zeroATCcells&) = delete;
......
......@@ -125,7 +125,7 @@ Foam::adjointInletVelocityFvPatchVectorField::valueBoundaryCoeffs
const tmp<scalarField>&
) const
{
return tmp<Field<vector>>::New(this->size(), pTraits<vector>::zero);
return tmp<Field<vector>>::New(this->size(), Zero);
}
......
......@@ -167,7 +167,7 @@ Foam::adjointOutletVelocityFluxFvPatchVectorField::valueInternalCoeffs
const tmp<scalarField>&
) const
{
return tmp<Field<vector>>::New(this->size(), pTraits<vector>::zero);
return tmp<Field<vector>>::New(this->size(), Zero);
}
......@@ -177,7 +177,7 @@ Foam::adjointOutletVelocityFluxFvPatchVectorField::valueBoundaryCoeffs
const tmp<scalarField>&
) const
{
return tmp<Field<vector>>::New(this->size(), pTraits<vector>::zero);
return tmp<Field<vector>>::New(this->size(), Zero);
}
......@@ -185,7 +185,7 @@ Foam::tmp<Foam::Field<Foam::vector>>
Foam::adjointOutletVelocityFluxFvPatchVectorField::
gradientBoundaryCoeffs() const
{
return tmp<Field<vector>>::New(this->size(), pTraits<vector>::zero);
return tmp<Field<vector>>::New(this->size(), Zero);
}
......@@ -193,7 +193,7 @@ Foam::tmp<Foam::Field<Foam::vector>>
Foam::adjointOutletVelocityFluxFvPatchVectorField::
gradientInternalCoeffs() const
{
return tmp<Field<vector>>::New(this->size(), pTraits<vector>::zero);
return tmp<Field<vector>>::New(this->size(), Zero);
}
......
......@@ -193,7 +193,7 @@ void Foam::adjointWallVelocityFvPatchVectorField::updateCoeffs()
// Tangential adjoint velocity in the t1 direction depends on the primal
// wall function used
vectorField Uap_t1(patch().size(), vector::zero);
vectorField Uap_t1(patch().size(), Zero);
typedef Foam::nutUSpaldingWallFunctionFvPatchScalarField
SAwallFunctionPatchField;
......
......@@ -100,7 +100,7 @@ Foam::adjointZeroInletFvPatchField<Type>::valueBoundaryCoeffs
const tmp<scalarField>&
) const
{
return tmp<Field<Type>>::New(this->size(), pTraits<Type>::zero);
return tmp<Field<Type>>::New(this->size(), Zero);
}
......
......@@ -62,13 +62,13 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
boundaryAdjointContribution
(
const boundaryAdjointContribution&
) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const boundaryAdjointContribution&) = delete;
......
......@@ -67,13 +67,13 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
boundaryAdjointContributionIncompressible
(
const boundaryAdjointContributionIncompressible&
) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=
(
const boundaryAdjointContributionIncompressible&
......
......@@ -38,9 +38,8 @@ Foam::boundaryAdjointContributionIncompressible::sumContributions
)
{
// Objective function contribution
tmp<Field<returnType>> tdJtotdvar
(new Field<returnType>(patch_.size(), pTraits<returnType>::zero));
Field<returnType>& dJtotdvar = tdJtotdvar.ref();
auto tdJtotdvar = tmp<Field<returnType>>::New(patch_.size(), Zero);
auto& dJtotdvar = tdJtotdvar.ref();
// Get weighthed contribution
for (sourceType& funcI : sourceList)
......
......@@ -41,7 +41,7 @@ namespace Foam
tensor deltaBoundary::tensorCrossVector(const tensor& T, const vector& v)
{
// The correct approach when T is not a diagonal tensor
tensor res(tensor::zero);
tensor res(Zero);
vector vec1(T.xx(), T.yx(), T.zx());
vector res1(vec1 ^ v);
res.xx() = res1.x(); res.yx() = res1.y(); res.zx() = res1.z();
......@@ -74,12 +74,12 @@ vectorField deltaBoundary::makeFaceCentresAndAreas_d
const pointField& p_d
)
{
vector fCtrs_d(vector::zero);
vector fAreas_d(vector::zero);
vector unitVector_d(vector::zero);
vector fCtrs_d(Zero);
vector fAreas_d(Zero);
vector unitVector_d(Zero);
// Container field to return results
vectorField deltaVecs(3, vector::zero);
vectorField deltaVecs(3, Zero);
label nPoints = p.size();
......@@ -103,12 +103,12 @@ vectorField deltaBoundary::makeFaceCentresAndAreas_d
}
else
{
vector sumN(vector::zero);
vector sumN_d(vector::zero);
scalar sumA = Zero;
scalar sumA_d = Zero;
vector sumAc = vector::zero;
vector sumAc_d = vector::zero;
vector sumN(Zero);
vector sumN_d(Zero);
scalar sumA(0);
scalar sumA_d(0);
vector sumAc(Zero);
vector sumAc_d(Zero);
point fCentre = p[0];
point fCentre_d = p_d[0];
......@@ -182,12 +182,12 @@ tensorField deltaBoundary::makeFaceCentresAndAreas_d
)
{
label nPoints = p.size();
tensor fCtrs_d(tensor::zero);
tensor fAreas_d(tensor::zero);
tensor unitVector_d(tensor::zero);
tensor fCtrs_d(Zero);
tensor fAreas_d(Zero);
tensor unitVector_d(Zero);
// Container field to return results
tensorField deltaVecs(3, tensor::zero);
tensorField deltaVecs(3, Zero);
// If the face is a triangle, do a direct calculation for efficiency
// and to avoid round-off error-related problems
......@@ -209,12 +209,12 @@ tensorField deltaBoundary::makeFaceCentresAndAreas_d
}
else
{
vector sumN(vector::zero);
tensor sumN_d(tensor::zero);
scalar sumA = Zero;
vector sumA_d(vector::zero);
vector sumAc(vector::zero);
tensor sumAc_d(tensor::zero);
vector sumN(Zero);
tensor sumN_d(Zero);
scalar sumA(0);
vector sumA_d(Zero);
vector sumAc(Zero);
tensor sumAc_d(Zero);
point fCentre = p[0];
tensor fCentre_d = p_d[0];
......@@ -287,18 +287,18 @@ tmp<tensorField> deltaBoundary::cellCenters_d(const label pointI)
const labelListList& pointCells(mesh_.pointCells());
const labelList& pointCellsI(pointCells[pointI]);
const pointField& points(mesh_.points());
tmp<tensorField> tC_d(new tensorField(pointCellsI.size(), tensor::zero));
tensorField& C_d(tC_d.ref());
auto tC_d = tmp<tensorField>::New(pointCellsI.size(), Zero);
auto& C_d = tC_d.ref();
const labelList& pointFaces(mesh_.pointFaces()[pointI]);
tensorField Cf_d(pointFaces.size(), tensor::zero);
tensorField Sf_d(pointFaces.size(), tensor::zero);
tensorField Cf_d(pointFaces.size(), Zero);
tensorField Sf_d(pointFaces.size(), Zero);
forAll(pointFaces, pfI)
{
const label pointFaceI = pointFaces[pfI];
const face& faceI = mesh_.faces()[pointFaceI];
tensorField p_d(faceI.size(), tensor::zero);
tensorField p_d(faceI.size(), Zero);
forAll(faceI, pI)
{
if (faceI[pI] == pointI)
......@@ -321,10 +321,10 @@ tmp<tensorField> deltaBoundary::cellCenters_d(const label pointI)
{
const label pointCellI = pointCellsI[pcI];
const cell& cellI(mesh_.cells()[pointCellI]);
vectorField fAreas(cellI.size(), vector::zero);
vectorField fCtrs(cellI.size(), vector::zero);
tensorField fAreas_d(cellI.size(), tensor::zero);
tensorField fCtrs_d(cellI.size(), tensor::zero);
vectorField fAreas(cellI.size(), Zero);
vectorField fCtrs(cellI.size(), Zero);
tensorField fAreas_d(cellI.size(), Zero);
tensorField fCtrs_d(cellI.size(), Zero);
forAll(cellI, fI)
{
const label globalFaceI = cellI[fI];
......
......@@ -70,10 +70,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
deltaBoundary(const deltaBoundary&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const deltaBoundary&) = delete;
//- Compute tensor-vector products
......
......@@ -51,8 +51,8 @@ pT deltaBoundary::makeCellCentres_d
// First estimate the approximate cell centre as the average of
// face centres
vector cEst(vector::zero);
vector cellCtrs(vector::zero);
vector cEst(Zero);
vector cellCtrs(Zero);
scalar cellVols(Zero);
pT cEst_d(pTraits<pT>::zero);
pT cellCtrs_d(pTraits<pT>::zero);
......
......@@ -77,10 +77,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
displacementMethod(const displacementMethod&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const displacementMethod&) = delete;
......
......@@ -69,13 +69,13 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
//- No copy construct
displacementMethoddisplacementLaplacian
(
const displacementMethoddisplacementLaplacian&
) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const displacementMethoddisplacementLaplacian&) = delete;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment