Skip to content
Snippets Groups Projects
Commit 82205291 authored by Vaggelis Papoutsis's avatar Vaggelis Papoutsis
Browse files

ENH: volBSplinesBase: added function returning box ID

given a global control point ID
parent de78cf6d
Branches
Tags
No related merge requests found
......@@ -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% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment