diff --git a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C index f8396174de..908ed1ced2 100644 --- a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C +++ b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.C @@ -499,7 +499,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement() // preserve continuity at the boundary of the parameterized space forAll(confineUMinCPs_, iCPu) { - const FixedList& confineSlice = confineUMinCPs_[iCPu]; + const boolVector& confineSlice = confineUMinCPs_[iCPu]; // Control points at the start of the parameterized space for (label iCPw = 0; iCPw < nCPsW; iCPw++) { @@ -512,7 +512,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement() forAll(confineUMaxCPs_, sliceI) { - const FixedList& confineSlice = confineUMaxCPs_[sliceI]; + const boolVector& confineSlice = confineUMaxCPs_[sliceI]; label iCPu = nCPsU - 1 - sliceI; // Control points at the end of the parameterized space for (label iCPw = 0; iCPw < nCPsW; iCPw++) @@ -528,7 +528,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement() // preserve continuity at the boundary of the parameterized space forAll(confineVMinCPs_, iCPv) { - const FixedList& confineSlice = confineVMinCPs_[iCPv]; + const boolVector& confineSlice = confineVMinCPs_[iCPv]; // Control points at the start of the parameterized space for (label iCPw = 0; iCPw < nCPsW; iCPw++) { @@ -541,7 +541,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement() forAll(confineVMaxCPs_, sliceI) { - const FixedList& confineSlice = confineVMaxCPs_[sliceI]; + const boolVector& confineSlice = confineVMaxCPs_[sliceI]; label iCPv = nCPsV - 1 - sliceI; // Control points at the end of the parameterized space for (label iCPw = 0; iCPw < nCPsW; iCPw++) @@ -557,7 +557,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement() // preserve continuity at the boundary of the parameterized space forAll(confineWMinCPs_, iCPw) { - const FixedList& confineSlice = confineWMinCPs_[iCPw]; + const boolVector& confineSlice = confineWMinCPs_[iCPw]; // Control points at the start of the parameterized space for (label iCPv = 0; iCPv < nCPsV; iCPv++) { @@ -570,7 +570,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement() forAll(confineWMaxCPs_, sliceI) { - const FixedList& confineSlice = confineWMaxCPs_[sliceI]; + const boolVector& confineSlice = confineWMaxCPs_[sliceI]; label iCPw = nCPsW - 1 - sliceI; // Control points at the end of the parameterized space for (label iCPv = 0; iCPv < nCPsV; iCPv++) @@ -616,7 +616,7 @@ void Foam::NURBS3DVolume::confineControlPoint(const label cpI) void Foam::NURBS3DVolume::confineControlPoint ( const label cpI, - const FixedList& confineDirections + const boolVector& confineDirections ) { if (cpI < 0 || cpI > cps_.size() -1) @@ -628,9 +628,9 @@ void Foam::NURBS3DVolume::confineControlPoint } else { - if (confineDirections[0]) activeDesignVariables_[3*cpI] = false; - if (confineDirections[1]) activeDesignVariables_[3*cpI + 1] = false; - if (confineDirections[2]) activeDesignVariables_[3*cpI + 2] = false; + if (confineDirections.x()) activeDesignVariables_[3*cpI] = false; + if (confineDirections.y()) activeDesignVariables_[3*cpI + 1] = false; + if (confineDirections.z()) activeDesignVariables_[3*cpI + 2] = false; } } @@ -684,44 +684,44 @@ Foam::NURBS3DVolume::NURBS3DVolume ), confineUMinCPs_ ( - dict.getOrDefaultCompat + dict.getOrDefaultCompat ( - "confineUMinCPs", {{"boundUMinCPs", 1912}}, boolListList3(0) + "confineUMinCPs", {{"boundUMinCPs", 1912}}, boolVectorList() ) ), confineUMaxCPs_ ( - dict.getOrDefaultCompat + dict.getOrDefaultCompat ( - "confineUMaxCPs", {{"boundUMaxCPs", 1912}}, boolListList3(0) + "confineUMaxCPs", {{"boundUMaxCPs", 1912}}, boolVectorList() ) ), confineVMinCPs_ ( - dict.getOrDefaultCompat + dict.getOrDefaultCompat ( - "confineVMinCPs", {{"boundVMinCPs", 1912}}, boolListList3(0) + "confineVMinCPs", {{"boundVMinCPs", 1912}}, boolVectorList() ) ), confineVMaxCPs_ ( - dict.getOrDefaultCompat + dict.getOrDefaultCompat ( - "confineVMaxCPs", {{"boundVMaxCPs", 1912}}, boolListList3(0) + "confineVMaxCPs", {{"boundVMaxCPs", 1912}}, boolVectorList() ) ), confineWMinCPs_ ( - dict.getOrDefaultCompat + dict.getOrDefaultCompat ( - "confineWMinCPs", {{"boundWMinCPs", 1912}}, boolListList3(0) + "confineWMinCPs", {{"boundWMinCPs", 1912}}, boolVectorList() ) ), confineWMaxCPs_ ( - dict.getOrDefaultCompat + dict.getOrDefaultCompat ( - "confineWMaxCPs", {{"boundWMaxCPs", 1912}}, boolListList3(0) + "confineWMaxCPs", {{"boundWMaxCPs", 1912}}, boolVectorList() ) ), activeControlPoints_(0), //zero here, execute sanity checks first diff --git a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.H b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.H index 67dd94c23b..9e4d4c7cd0 100644 --- a/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.H +++ b/src/optimisation/adjointOptimisation/adjoint/parameterization/NURBS/NURBS3DVolume/NURBS3DVolume/NURBS3DVolume.H @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2007-2019 PCOpt/NTUA Copyright (C) 2013-2019 FOSS GP - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,6 +55,7 @@ SourceFiles #define NURBS3DVolume_H #include "NURBSbasis.H" +#include "boolVector.H" #include "pointMesh.H" #include "pointPatchField.H" #include "pointPatchFieldsFwd.H" @@ -73,9 +74,9 @@ class NURBS3DVolume { protected: - // Protected data + // Protected Data - typedef List> boolListList3; + typedef List boolVectorList; //- NURBS basis functions const fvMesh& mesh_; @@ -121,17 +122,17 @@ protected: label confineBoundaryControlPoints_; //- Which movement components to freeze in each plane - boolListList3 confineUMinCPs_; + boolVectorList confineUMinCPs_; - boolListList3 confineUMaxCPs_; + boolVectorList confineUMaxCPs_; - boolListList3 confineVMinCPs_; + boolVectorList confineVMinCPs_; - boolListList3 confineVMaxCPs_; + boolVectorList confineVMaxCPs_; - boolListList3 confineWMinCPs_; + boolVectorList confineWMinCPs_; - boolListList3 confineWMaxCPs_; + boolVectorList confineWMaxCPs_; //- Which of the cps are moved in an optimisation boolList activeControlPoints_; @@ -186,7 +187,7 @@ protected: void confineControlPoint(const label cpI); //- Confine specific movements for a prescribed control point - void confineControlPoint(const label cpI, const FixedList&); + void confineControlPoint(const label cpI, const boolVector&); //- Create folders to store cps and derivatives void makeFolders();