Commit 53eda1c4 authored by Mark Olesen's avatar Mark Olesen

ENH: use boolVector for NURBS3DVolume constraints

- same as FixedList<bool,3> for I/O
parent 5e954d28
......@@ -499,7 +499,7 @@ void Foam::NURBS3DVolume::continuityRealatedConfinement()
// preserve continuity at the boundary of the parameterized space
forAll(confineUMinCPs_, iCPu)
{
const FixedList<bool, 3>& 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<bool, 3>& 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<bool, 3>& 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<bool, 3>& 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<bool, 3>& 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<bool, 3>& 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<bool, 3>& 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<boolListList3>
dict.getOrDefaultCompat<boolVectorList>
(
"confineUMinCPs", {{"boundUMinCPs", 1912}}, boolListList3(0)
"confineUMinCPs", {{"boundUMinCPs", 1912}}, boolVectorList()
)
),
confineUMaxCPs_
(
dict.getOrDefaultCompat<boolListList3>
dict.getOrDefaultCompat<boolVectorList>
(
"confineUMaxCPs", {{"boundUMaxCPs", 1912}}, boolListList3(0)
"confineUMaxCPs", {{"boundUMaxCPs", 1912}}, boolVectorList()
)
),
confineVMinCPs_
(
dict.getOrDefaultCompat<boolListList3>
dict.getOrDefaultCompat<boolVectorList>
(
"confineVMinCPs", {{"boundVMinCPs", 1912}}, boolListList3(0)
"confineVMinCPs", {{"boundVMinCPs", 1912}}, boolVectorList()
)
),
confineVMaxCPs_
(
dict.getOrDefaultCompat<boolListList3>
dict.getOrDefaultCompat<boolVectorList>
(
"confineVMaxCPs", {{"boundVMaxCPs", 1912}}, boolListList3(0)
"confineVMaxCPs", {{"boundVMaxCPs", 1912}}, boolVectorList()
)
),
confineWMinCPs_
(
dict.getOrDefaultCompat<boolListList3>
dict.getOrDefaultCompat<boolVectorList>
(
"confineWMinCPs", {{"boundWMinCPs", 1912}}, boolListList3(0)
"confineWMinCPs", {{"boundWMinCPs", 1912}}, boolVectorList()
)
),
confineWMaxCPs_
(
dict.getOrDefaultCompat<boolListList3>
dict.getOrDefaultCompat<boolVectorList>
(
"confineWMaxCPs", {{"boundWMaxCPs", 1912}}, boolListList3(0)
"confineWMaxCPs", {{"boundWMaxCPs", 1912}}, boolVectorList()
)
),
activeControlPoints_(0), //zero here, execute sanity checks first
......
......@@ -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<FixedList<bool, 3>> boolListList3;
typedef List<boolVector> 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<bool, 3>&);
void confineControlPoint(const label cpI, const boolVector&);
//- Create folders to store cps and derivatives
void makeFolders();
......
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