Skip to content
Snippets Groups Projects
Commit 2048959b authored by Vaggelis Papoutsis's avatar Vaggelis Papoutsis Committed by Andrew Heather
Browse files

ENH: volBSplinesBase: added function returning box ID

given a global control point ID
parent 7192cc92
Branches
Tags
1 merge request!368Updates for the adjoint optimisation library
......@@ -187,6 +187,24 @@ labelList volBSplinesBase::getStartCpID() const
}
label volBSplinesBase::findBoxID(const label cpI) const
{
const labelList startCPID(getStartCpID());
for (label iBox = 0; iBox < startCPID.size() - 1 ; ++iBox)
{
if (cpI >= startCPID[iBox] || cpI < startCPID[iBox + 1])
{
return iBox;
}
}
FatalErrorInFunction
<< "Invalid control point ID " << cpI << endl
<< exit(FatalError);
return -1;
}
const Foam::labelList& volBSplinesBase::getActiveDesignVariables() const
{
return activeDesignVariables_;
......
......@@ -129,6 +129,9 @@ public:
//- Get start CP ID for each box
labelList getStartCpID() const;
//- Find box of certain control point
label findBoxID(const label cpI) const;
//- Get active design variables
const labelList& getActiveDesignVariables() const;
......
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