Commit 60efde8c authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'bug-writeMorpherCPs-IO' into 'master'

BUG: writeMorpherCPs expects a controlBoxes entry (#1538)

See merge request !321
parents 227a0f5d c413ec50
......@@ -45,33 +45,37 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
IOdictionary dict
const dictionary NURBSdict
(
IOobject
IOdictionary
(
"dynamicMeshDict",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
IOobject
(
"dynamicMeshDict",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).subDict("volumetricBSplinesMotionSolverCoeffs")
);
// Read box names and allocate size
wordList controlBoxes(NURBSdict.toc());
const dictionary& coeffDict =
dict.subDict("volumetricBSplinesMotionSolverCoeffs");
wordList controlBoxes(coeffDict.get<wordList>("controlBoxes"));
forAll(controlBoxes, iNURB)
for (const word& boxName : controlBoxes)
{
// Creating an object writes the control points in the
// constructor
NURBS3DVolume::New
(
coeffDict.subDict(controlBoxes[iNURB]),
mesh,
false // do not compute parametric coordinates
);
if (NURBSdict.isDict(boxName))
{
// Creating an object writes the control points in the
// constructor
NURBS3DVolume::New
(
NURBSdict.subDict(boxName),
mesh,
false // do not compute parametric coordinates
);
}
}
Info<< "End\n" << endl;
......
......@@ -7,6 +7,7 @@ resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
\cp $resourcesDir/param/sbend/* 0
\cp -r $resourcesDir/meshes/sbend/polyMesh constant
runApplication writeMorpherCPs
runApplication decomposePar
runParallel $(getApplication)
......
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