Commit 4e73d0e4 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge remote-tracking branch 'origin/master' into develop

parents a1fbe828 eb125303
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -108,7 +108,7 @@ void displacementMethodvolumetricBSplinesMotionSolver::boundControlField
// control points movement. Safe since the motionSolver can only be an
// volumetricBSplinesMotionSolver
refCast<volumetricBSplinesMotionSolver>
(motionPtr_()).boundControlPointsMovement(controlField);
(motionPtr_()).boundControlPointMovement(controlField);
}
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -142,12 +142,12 @@ void Foam::volumetricBSplinesMotionSolver::setControlPointsMovement
}
void Foam::volumetricBSplinesMotionSolver::boundControlPointsMovement
void Foam::volumetricBSplinesMotionSolver::boundControlPointMovement
(
vectorField& controlPointsMovement
)
{
volBSplinesBase_.boundControlPointsMovement(controlPointsMovement);
volBSplinesBase_.boundControlPointMovement(controlPointsMovement);
}
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -130,7 +130,7 @@ public:
void setControlPointsMovement(const vectorField& controlPointsMovement);
//- Bound control points movement
void boundControlPointsMovement(vectorField& controlPointsMovement);
void boundControlPointMovement(vectorField& controlPointsMovement);
};
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -86,10 +86,10 @@ void sensitivityVolBSplines::computeObjectiveContributions()
dSdbSens_[passedCPs + cpI] = dSdbSensCP;
dndbSens_[passedCPs + cpI] = dndbSensCP;
}
boxes[iNURB].boundControlPointMovement(dSdbSens_);
boxes[iNURB].boundControlPointMovement(dndbSens_);
passedCPs += nb;
}
volBSplinesBase_.boundControlPointMovement(dSdbSens_);
volBSplinesBase_.boundControlPointMovement(dndbSens_);
passedCPs = 0;
forAll(boxes, iNURB)
......@@ -106,9 +106,9 @@ void sensitivityVolBSplines::computeObjectiveContributions()
{
dxdbDirectSens_[passedCPs + cpI] = sensDxDbDirect[cpI];
}
boxes[iNURB].boundControlPointMovement(dxdbDirectSens_);
passedCPs += sensDxDbDirect.size();
}
volBSplinesBase_.boundControlPointMovement(dxdbDirectSens_);
}
}
......@@ -188,9 +188,8 @@ void sensitivityVolBSplines::assembleSensitivities()
flowSens_[passedCPs + cpI] = sens[cpI];
}
passedCPs += sens.size();
boxes[iNURB].boundControlPointMovement(flowSens_);
}
volBSplinesBase_.boundControlPointMovement(flowSens_);
// Contribution from objective function
// Note:
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -137,7 +137,7 @@ void sensitivityVolBSplinesFI::assembleSensitivities()
PtrList<NURBS3DVolume>& boxes = volBSplinesBase_.boxesRef();
forAll(boxes, iNURB)
{
label nb = boxes[iNURB].getControlPoints().size();
const label nb(boxes[iNURB].getControlPoints().size());
vectorField boxSensitivities(nb, Zero);
vectorField dxdbSens = boxes[iNURB].computeControlPointSensitivities
......@@ -278,13 +278,6 @@ void sensitivityVolBSplinesFI::assembleSensitivities()
}
// Zero sensitivities in non-active design variables
boxes[iNURB].boundControlPointMovement(flowSens_);
boxes[iNURB].boundControlPointMovement(dSdbSens_);
boxes[iNURB].boundControlPointMovement(dndbSens_);
boxes[iNURB].boundControlPointMovement(dVdbSens_);
boxes[iNURB].boundControlPointMovement(distanceSens_);
boxes[iNURB].boundControlPointMovement(dxdbDirectSens_);
boxes[iNURB].boundControlPointMovement(optionsSens_);
boxes[iNURB].boundControlPointMovement(boxSensitivities);
// Transfer sensitivities to global list
......@@ -299,6 +292,16 @@ void sensitivityVolBSplinesFI::assembleSensitivities()
// Increment number of passed sensitivities
passedCPs += nb;
}
// Zero non-active sensitivity components.
// For consistent output only, does not affect optimisation
volBSplinesBase_.boundControlPointMovement(flowSens_);
volBSplinesBase_.boundControlPointMovement(dSdbSens_);
volBSplinesBase_.boundControlPointMovement(dndbSens_);
volBSplinesBase_.boundControlPointMovement(dVdbSens_);
volBSplinesBase_.boundControlPointMovement(distanceSens_);
volBSplinesBase_.boundControlPointMovement(dxdbDirectSens_);
volBSplinesBase_.boundControlPointMovement(optionsSens_);
}
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -69,7 +69,7 @@ computeBoundaryMovement
}
// Bound control point movement for non-active CPs
volBSplinesBase_.boundControlPointsMovement(cpMovement_);
volBSplinesBase_.boundControlPointMovement(cpMovement_);
// Compute boundary movement
label passedCPs(0);
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -203,7 +203,7 @@ Foam::scalar Foam::volBSplinesBase::computeMaxBoundaryDisplacement
label pastControlPoints(0);
forAll(volume_, iNURB)
{
const label nb = volume_[iNURB].getControlPoints().size();
const label nb(volume_[iNURB].getControlPoints().size());
vectorField localControlPointsMovement(nb, Zero);
// Set localControlPointsMovement
......@@ -230,7 +230,7 @@ Foam::scalar Foam::volBSplinesBase::computeMaxBoundaryDisplacement
}
void Foam::volBSplinesBase::boundControlPointsMovement
void Foam::volBSplinesBase::boundControlPointMovement
(
vectorField& controlPointsMovement
)
......@@ -238,10 +238,10 @@ void Foam::volBSplinesBase::boundControlPointsMovement
label pastControlPoints(0);
forAll(volume_, iNURB)
{
label nb = volume_[iNURB].getControlPoints().size();
const label nb(volume_[iNURB].getControlPoints().size());
vectorField localControlPointsMovement(nb, Zero);
// set localControlPointsMovement
// Set localControlPointsMovement
forAll (localControlPointsMovement, iCPM)
{
localControlPointsMovement[iCPM] =
......@@ -250,7 +250,7 @@ void Foam::volBSplinesBase::boundControlPointsMovement
volume_[iNURB].boundControlPointMovement(localControlPointsMovement);
// transfer bounding back to controlPointMovement
// Transfer bounding back to controlPointMovement
forAll(localControlPointsMovement, iCPM)
{
controlPointsMovement[pastControlPoints + iCPM] =
......@@ -270,10 +270,10 @@ void Foam::volBSplinesBase::moveControlPoints
label pastControlPoints(0);
forAll(volume_, iNURB)
{
const label nb = volume_[iNURB].getControlPoints().size();
const label nb(volume_[iNURB].getControlPoints().size());
vectorField localControlPointsMovement(nb, Zero);
// set localControlPointsMovement
// Set localControlPointsMovement
forAll (localControlPointsMovement, iCPM)
{
localControlPointsMovement[iCPM] =
......
......@@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2007-2020 PCOpt/NTUA
Copyright (C) 2013-2020 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -141,7 +141,7 @@ public:
);
//- Bound control points movement
void boundControlPointsMovement(vectorField& controlPointsMovement);
void boundControlPointMovement(vectorField& controlPointsMovement);
//- Move control points. No effect on mesh
void moveControlPoints(const vectorField& controlPointsMovement);
......
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