56 const label nCPsU = basisU_.nCPs();
57 const label nCPsV = basisV_.nCPs();
59 return k*nCPsU*nCPsV + j*nCPsU + i;
69 <<
"Attempting to recompute points residing within control boxes"
86 Info<<
"Control Points bounds \n"
87 <<
"\tX1 : (" << lowerX <<
" " << upperX <<
")\n"
88 <<
"\tX2 : (" << lowerY <<
" " << upperY <<
")\n"
89 <<
"\tX3 : (" << lowerZ <<
" " << upperZ <<
")\n" <<
endl;
94 const vector& pointI = meshPoints[pI];
97 pointI.
x() >= lowerX && pointI.
x() <= upperX
98 && pointI.
y() >= lowerY && pointI.
y() <= upperY
99 && pointI.
z() >= lowerZ && pointI.
z() <= upperZ
103 reverseMap[pI] =
count;
112 Info<<
"Initially found " <<
count <<
" points inside control boxes"
122 scalar timeBef = mesh_.time().elapsedCpuTime();
124 if (parametricCoordinatesPtr_.valid())
127 <<
"Attempting to recompute parametric coordinates"
132 labelList& reverseMap = reverseMapPtr_();
134 parametricCoordinatesPtr_.reset
140 "parametricCoordinates" + name_,
141 mesh_.time().timeName(),
150 vectorField& paramCoors = parametricCoordinatesPtr_().primitiveFieldRef();
155 parametricCoordinatesPtr_().typeHeaderOk<pointVectorField>(
true)
163 Info<<
"Reading parametric coordinates from file" <<
endl;
164 IOobject& header = parametricCoordinatesPtr_().ref();
165 parametricCoordinatesPtr_() =
179 const label globalPointIndex = map[pI];
182 actualMap[curIndex] = map[pI];
183 reverseMap[globalPointIndex] = curIndex;
188 reverseMap[globalPointIndex] = -1;
196 Info<<
"Read non-zero parametric coordinates for " << curIndex
197 <<
" points" <<
endl;
206 scalar minX1 =
min(cps_.component(0));
207 scalar maxX1 =
max(cps_.component(0));
208 scalar minX2 =
min(cps_.component(1));
209 scalar maxX2 =
max(cps_.component(1));
210 scalar minX3 =
min(cps_.component(2));
211 scalar maxX3 =
max(cps_.component(2));
213 scalar oneOverDenomX(1./(maxX1 - minX1));
214 scalar oneOverDenomY(1./(maxX2 - minX2));
215 scalar oneOverDenomZ(1./(maxX3 - minX3));
219 const label globalPI = map[pI];
220 paramCoors[globalPI].x() = (
points[pI].x() - minX1)*oneOverDenomX;
221 paramCoors[globalPI].y() = (
points[pI].y() - minX2)*oneOverDenomY;
222 paramCoors[globalPI].z() = (
points[pI].z() - minX3)*oneOverDenomZ;
227 boolList dropOffPoints(map.size(),
false);
228 label nDropedPoints(0);
236 Info<<
"Mapping of mesh points to parametric space for box " << name_
239 label maxIterNeeded(0);
243 label nBoundIters(0);
244 vector res(GREAT, GREAT, GREAT);
247 const label globalPI = map[pI];
248 vector& uVec = paramCoors[globalPI];
249 vector& coorPointI = splinesBasedCoors[pI];
250 uVec += ((
inv(JacobianUVW(uVec))) & (
points[pI] - coorPointI));
258 if (nBoundIters > nMaxBound_)
260 dropOffPoints[pI] =
true;
281 <<
"Mapping to parametric space for point " << pI
282 <<
" failed." <<
endl
283 <<
"Residual after " << maxIter_ + 1 <<
" iterations : "
285 <<
"parametric coordinates " << paramCoors[map[pI]]
287 <<
"Local system coordinates " <<
points[pI] <<
endl
288 <<
"Threshold residual per direction : " << tolerance_
291 maxIterNeeded =
max(maxIterNeeded, iter);
295 label nParameterizedPoints = map.size() - nDropedPoints;
301 map.
setSize(nParameterizedPoints);
306 if (!dropOffPoints[pI])
308 map[curIndex] = mapOld[pI];
309 reverseMap[mapOld[pI]] = curIndex;
315 reverseMap[mapOld[pI]] = -1;
321 Info<<
"Found " << nDropedPoints
322 <<
" to discard from morphing boxes" <<
endl;
323 Info<<
"Keeping " << nParameterizedPoints
324 <<
" parameterized points in boxes" <<
endl;
327 scalar maxDiff(-GREAT);
328 forAll(splinesBasedCoors, pI)
331 mag(splinesBasedCoors[pI] - localSystemCoordinates_[map[pI]]);
338 scalar timeAft = mesh_.time().elapsedCpuTime();
339 Info<<
"\tMapping completed in " << timeAft - timeBef <<
" seconds"
341 Info<<
"\tMax iterations per point needed to compute parametric "
343 << maxIterNeeded <<
endl;
344 Info<<
"\tMax difference between original mesh points and "
345 <<
"parameterized ones "
357 computeParametricCoordinates(
points);
368 bool boundPoint(
false);
370 if (vec.
x() < scalar(0))
375 if (vec.
y() < scalar(0))
380 if (vec.
z() < scalar(0))
409 mkDir(mesh_.time().globalPath()/
"optimisation"/cpsFolder_);
416 label nCPs = cps_.size();
417 activeControlPoints_ =
boolList(nCPs,
true);
418 activeDesignVariables_ =
boolList(3*nCPs,
true);
421 confineBoundaryControlPoints();
424 continuityRealatedConfinement();
427 confineControlPointsDirections();
431 forAll(activeControlPoints_, cpI)
435 !activeDesignVariables_[3*cpI]
436 && !activeDesignVariables_[3*cpI + 1]
437 && !activeDesignVariables_[3*cpI + 2]
440 activeControlPoints_[cpI] =
false;
448 const label nCPsU = basisU_.nCPs();
449 const label nCPsV = basisV_.nCPs();
450 const label nCPsW = basisW_.nCPs();
453 if (confineBoundaryControlPoints_)
456 for (label iCPw = 0; iCPw < nCPsW; iCPw += nCPsW - 1)
458 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
460 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
462 confineControlPoint(getCPID(iCPu, iCPv, iCPw));
467 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
469 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
471 for (label iCPu = 0; iCPu < nCPsU; iCPu += nCPsU - 1)
473 confineControlPoint(getCPID(iCPu, iCPv, iCPw));
478 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
480 for (label iCPv = 0; iCPv < nCPsV; iCPv += nCPsV - 1)
482 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
484 confineControlPoint(getCPID(iCPu, iCPv, iCPw));
494 const label nCPsU = basisU_.nCPs();
495 const label nCPsV = basisV_.nCPs();
496 const label nCPsW = basisW_.nCPs();
500 forAll(confineUMinCPs_, iCPu)
504 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
506 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
508 confineControlPoint(getCPID(iCPu, iCPv, iCPw), confineSlice);
513 forAll(confineUMaxCPs_, sliceI)
516 label iCPu = nCPsU - 1 - sliceI;
518 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
520 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
522 confineControlPoint(getCPID(iCPu, iCPv, iCPw), confineSlice);
529 forAll(confineVMinCPs_, iCPv)
533 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
535 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
537 confineControlPoint(getCPID(iCPu, iCPv, iCPw), confineSlice);
542 forAll(confineVMaxCPs_, sliceI)
545 label iCPv = nCPsV - 1 - sliceI;
547 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
549 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
551 confineControlPoint(getCPID(iCPu, iCPv, iCPw), confineSlice);
558 forAll(confineWMinCPs_, iCPw)
562 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
564 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
566 confineControlPoint(getCPID(iCPu, iCPv, iCPw), confineSlice);
571 forAll(confineWMaxCPs_, sliceI)
574 label iCPw = nCPsW - 1 - sliceI;
576 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
578 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
580 confineControlPoint(getCPID(iCPu, iCPv, iCPw), confineSlice);
589 for (label cpI = 0; cpI < cps_.size(); ++cpI)
591 if (confineUMovement_) activeDesignVariables_[3*cpI] =
false;
592 if (confineVMovement_) activeDesignVariables_[3*cpI + 1] =
false;
593 if (confineWMovement_) activeDesignVariables_[3*cpI + 2] =
false;
600 if (cpI < 0 || cpI > cps_.size() -1)
603 <<
"Attempted to confine control point movement for a control point "
604 <<
" ID which is out of bounds"
609 activeDesignVariables_[3*cpI] =
false;
610 activeDesignVariables_[3*cpI + 1] =
false;
611 activeDesignVariables_[3*cpI + 2] =
false;
622 if (cpI < 0 || cpI > cps_.size() -1)
625 <<
"Attempted to confine control point movement for a control point "
626 <<
" ID which is out of bounds"
631 if (confineDirections[0]) activeDesignVariables_[3*cpI] =
false;
632 if (confineDirections[1]) activeDesignVariables_[3*cpI + 1] =
false;
633 if (confineDirections[2]) activeDesignVariables_[3*cpI + 2] =
false;
644 bool computeParamCoors
657 reverseMapPtr_(
nullptr),
658 parametricCoordinatesPtr_(
nullptr),
659 localSystemCoordinates_(mesh_.nPoints(),
Zero),
664 "confineUMovement", {{
"confineX1movement", 1912}}, false
671 "confineVMovement", {{
"confineX2movement", 1912}}, false
678 "confineWMovement", {{
"confineX3movement", 1912}}, false
681 confineBoundaryControlPoints_
689 "confineUMinCPs", {{
"boundUMinCPs", 1912}}, boolListList3(0)
696 "confineUMaxCPs", {{
"boundUMaxCPs", 1912}}, boolListList3(0)
703 "confineVMinCPs", {{
"boundVMinCPs", 1912}}, boolListList3(0)
710 "confineVMaxCPs", {{
"boundVMaxCPs", 1912}}, boolListList3(0)
717 "confineWMinCPs", {{
"boundWMinCPs", 1912}}, boolListList3(0)
724 "confineWMaxCPs", {{
"boundWMaxCPs", 1912}}, boolListList3(0)
727 activeControlPoints_(0),
728 activeDesignVariables_(0),
729 cpsFolder_(
"controlPoints"),
738 (confineUMinCPs_.size() + confineUMaxCPs_.size() >= basisU_.nCPs())
739 || (confineVMinCPs_.size() + confineVMaxCPs_.size() >= basisV_.nCPs())
740 || (confineWMinCPs_.size() + confineWMaxCPs_.size() >= basisW_.nCPs())
744 <<
"Number of control point slices to be kept frozen at "
745 <<
"the boundaries is invalid \n"
746 <<
"Number of control points in u " << basisU_.nCPs() <<
"\n"
747 <<
"Number of control points in v " << basisV_.nCPs() <<
"\n"
748 <<
"Number of control points in w " << basisW_.nCPs() <<
"\n"
752 word controlPointsDefinition(
dict.
get<word>(
"controlPointsDefinition"));
755 if (controlPointsDefinition ==
"fromFile")
757 Info<<
"Reading control points from file " <<
endl;
762 name_ +
"cpsBsplines" + mesh_.time().timeName(),
763 mesh_.time().caseConstant(),
772 cpsDict.readEntry(
"controlPoints", cps_);
773 if (cps_.size() != (basisU_.nCPs()*basisV_.nCPs()*basisW_.nCPs()))
776 <<
"Number of control points does not agree with "
777 <<
"nCPsU*nCPv*nCPsW"
783 else if (controlPointsDefinition ==
"axisAligned")
785 const label nCPsU = basisU_.nCPs();
786 const label nCPsV = basisV_.nCPs();
787 const label nCPsW = basisW_.nCPs();
789 cps_.setSize(nCPsU * nCPsV * nCPsW);
795 for (label iCPw = 0; iCPw < nCPsW; ++iCPw)
797 for (label iCPv = 0; iCPv < nCPsV; ++iCPv)
799 for (label iCPu = 0; iCPu < nCPsU; ++iCPu)
801 cps_[getCPID(iCPu, iCPv, iCPw)] =
804 +scalar(iCPu)/scalar(nCPsU - 1)
805 *(upperBounds.x()-lowerBounds.x())
809 +scalar(iCPv)/scalar(nCPsV - 1)
810 *(upperBounds.y()-lowerBounds.y())
814 +scalar(iCPw)/scalar(nCPsW - 1)
815 *(upperBounds.z()-lowerBounds.z())
824 <<
"Unknown controlPointsDefinition type "
825 << controlPointsDefinition
827 <<
"Valid types are : axisAligned, fromFile" <<
endl
830 determineActiveDesignVariablesAndPoints();
841 bool computeParamCoors
846 Info<<
"NURBS3DVolume type : " << modelType <<
endl;
848 auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
850 if (!cstrIter.found())
857 *dictionaryConstructorTablePtr_
874 const label degreeU = basisU_.degree();
875 const label degreeV = basisV_.degree();
876 const label degreeW = basisW_.degree();
878 const label nCPsU = basisU_.nCPs();
879 const label nCPsV = basisV_.nCPs();
880 const label nCPsW = basisW_.nCPs();
884 for (label iCPw = 0; iCPw < nCPsW; ++iCPw)
886 for (label iCPv = 0; iCPv < nCPsV; ++iCPv)
888 for (label iCPu = 0; iCPu < nCPsU; ++iCPu)
891 cps_[getCPID(iCPu, iCPv, iCPw)]
892 *basisU_.basisDerivativeU(iCPu, degreeU, u)
893 *basisV_.basisValue(iCPv, degreeV, v)
894 *basisW_.basisValue(iCPw, degreeW, w);
910 const label degreeU = basisU_.degree();
911 const label degreeV = basisV_.degree();
912 const label degreeW = basisW_.degree();
914 const label nCPsU = basisU_.nCPs();
915 const label nCPsV = basisV_.nCPs();
916 const label nCPsW = basisW_.nCPs();
920 for (label iCPw = 0; iCPw < nCPsW; ++iCPw)
922 for (label iCPv = 0; iCPv < nCPsV; ++iCPv)
924 for (label iCPu = 0; iCPu < nCPsU; ++iCPu)
927 cps_[getCPID(iCPu, iCPv, iCPw)]
928 *basisU_.basisValue(iCPu, degreeU, u)
929 *basisV_.basisDerivativeU(iCPv, degreeV, v)
930 *basisW_.basisValue(iCPw, degreeW, w);
946 const label degreeU = basisU_.degree();
947 const label degreeV = basisV_.degree();
948 const label degreeW = basisW_.degree();
950 const label nCPsU = basisU_.nCPs();
951 const label nCPsV = basisV_.nCPs();
952 const label nCPsW = basisW_.nCPs();
956 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
958 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
960 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
963 cps_[getCPID(iCPu, iCPv, iCPw)]
964 *basisU_.basisValue(iCPu, degreeU, u)
965 *basisV_.basisValue(iCPv, degreeV, v)
966 *basisW_.basisDerivativeU(iCPw, degreeW, w);
980 const scalar u = uVector.
x();
981 const scalar v = uVector.
y();
982 const scalar w = uVector.
z();
984 vector uDeriv = volumeDerivativeU(u, v, w);
985 vector vDeriv = volumeDerivativeV(u, v, w);
986 vector wDeriv = volumeDerivativeW(u, v, w);
1010 const scalar u = uVector.
x();
1011 const scalar v = uVector.
y();
1012 const scalar w = uVector.
z();
1014 const label nCPsU = basisU_.nCPs();
1015 const label nCPsV = basisV_.nCPs();
1017 const label degreeU = basisU_.degree();
1018 const label degreeV = basisV_.degree();
1019 const label degreeW = basisW_.degree();
1021 label iCPw = cpI/label(nCPsU*nCPsV);
1022 label iCPv = (cpI - iCPw*nCPsU*nCPsV)/nCPsU;
1023 label iCPu = (cpI - iCPw*nCPsU*nCPsV - iCPv*nCPsU);
1029 basisU_.basisValue(iCPu, degreeU, u)
1030 *basisV_.basisValue(iCPv, degreeV, v)
1031 *basisW_.basisValue(iCPw, degreeW, w);
1046 const vectorField& parametricCoordinates = getParametricCoordinates();
1048 forAll(controlPointDerivs, cpI)
1050 forAll(sensitivityPatchIDs, pI)
1052 const label patchI = sensitivityPatchIDs[pI];
1059 const label whichPointInBox = reverseMapPtr_()[
globalIndex];
1063 if (whichPointInBox != -1)
1065 controlPointDerivs[cpI] +=
1084 return controlPointDerivs;
1095 computeControlPointSensitivities
1113 const vectorField& parametricCoordinates = getParametricCoordinates();
1117 const labelList& reverseMap = reverseMapPtr_();
1119 forAll(controlPointDerivs, cpI)
1121 forAll(sensitivityPatchIDs, pI)
1123 const label patchI = sensitivityPatchIDs[pI];
1125 const label patchStart =
patch.start();
1131 const face& fGlobal = mesh_.faces()[fI + patchStart];
1138 const label whichPointInBox = reverseMap[
globalIndex];
1141 if (whichPointInBox != -1)
1145 facePointDerivs[pI] =
1147 * volumeDerivativeCP
1162 controlPointDerivs[cpI] += patchSens[fI] & fCtrs_d;
1170 return controlPointDerivs;
1184 const vectorField& parametricCoordinates = getParametricCoordinates();
1188 const labelList& reverseMap = reverseMapPtr_();
1191 const label patchStart =
patch.start();
1195 const face& fGlobal = mesh_.faces()[fI + patchStart];
1202 const label whichPointInBox = reverseMap[
globalIndex];
1205 if (whichPointInBox != -1)
1209 facePointDerivs[pI] =
1225 cpSens += faceSens[fI] & fCtrs_d;
1238 bool DimensionedNormalSens
1248 const label patchStart = ppatch.
start();
1249 const labelList& reverseMap = reverseMapPtr_();
1252 const vectorField& parametricCoordinates = getParametricCoordinates();
1257 const face& fGlobal = mesh_.faces()[fI + patchStart];
1264 const label whichPointInBox = reverseMap[
globalIndex];
1267 if (whichPointInBox != -1)
1271 facePointDerivs[pI] =
1289 if (DimensionedNormalSens)
1291 dndbSens[fI] = dNdbSens[1];
1295 dndbSens[fI] = dNdbSens[2];
1310 const vectorField& parametricCoordinates = getParametricCoordinates();
1318 auto& dxdb = tdxdb.ref();
1323 const label whichPointInBox = reverseMapPtr_()[
globalIndex];
1326 if (whichPointInBox != -1)
1349 const vectorField& parametricCoordinates = getParametricCoordinates();
1353 const label patchStart =
patch.start();
1357 auto& dxdb = tdxdb.ref();
1364 const face& fGlobal = mesh_.faces()[fI + patchStart];
1371 const label whichPointInBox = reverseMapPtr_()[
globalIndex];
1374 if (whichPointInBox != -1)
1378 facePointDerivs[pI] =
1405 const label degreeU = basisU_.degree();
1406 const label degreeV = basisV_.degree();
1407 const label degreeW = basisW_.degree();
1409 const label nCPsU = basisU_.nCPs();
1410 const label nCPsV = basisV_.nCPs();
1411 const label nCPsW = basisW_.nCPs();
1413 const label
nPoints = mapPtr_().size();
1415 auto&
points = tpoints.ref();
1419 const label globalPI = mapPtr_()[pI];
1420 const scalar u = uVector[globalPI].x();
1421 const scalar v = uVector[globalPI].y();
1422 const scalar w = uVector[globalPI].z();
1423 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
1425 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
1427 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
1430 cps_[getCPID(iCPu, iCPv, iCPw)]
1431 *basisU_.basisValue(iCPu, degreeU, u)
1432 *basisV_.basisValue(iCPv, degreeV, v)
1433 *basisW_.basisValue(iCPw, degreeW, w);
1448 const label degreeU = basisU_.degree();
1449 const label degreeV = basisV_.degree();
1450 const label degreeW = basisW_.degree();
1452 const label nCPsU = basisU_.nCPs();
1453 const label nCPsV = basisV_.nCPs();
1454 const label nCPsW = basisW_.nCPs();
1456 const scalar u = uVector.
x();
1457 const scalar v = uVector.
y();
1458 const scalar w = uVector.
z();
1461 for (label iCPw = 0; iCPw < nCPsW; iCPw++)
1463 for (label iCPv = 0; iCPv < nCPsV; iCPv++)
1465 for (label iCPu = 0; iCPu < nCPsU; iCPu++)
1468 cps_[getCPID(iCPu, iCPv, iCPw)]
1469 *basisU_.basisValue(iCPu, degreeU, u)
1470 *basisV_.basisValue(iCPv, degreeV, v)
1471 *basisW_.basisValue(iCPw, degreeW, w);
1486 const vectorField& paramCoors = getParametricCoordinates();
1490 cps_ += controlPointsMovement;
1491 writeCps(
"cpsBsplines"+mesh_.time().timeName());
1496 const vectorField& parameterizedPoints = tparameterizedPoints();
1503 forAll(parameterizedPoints, pI)
1505 newPoints[map[pI]] = transformPointToCartesian(parameterizedPoints[pI]);
1509 updateLocalCoordinateSystem(newPoints);
1511 <<
"Max mesh movement equal to "
1525 const vectorField& paramCoors = getParametricCoordinates();
1528 cps_ += controlPointsMovement;
1530 writeCps(
"cpsBsplines"+mesh_.time().timeName());
1538 for (
const label patchI : patchesToBeMoved)
1545 const label whichPointInBox = reverseMapPtr_()[
globalIndex];
1548 if (whichPointInBox != -1)
1551 transformPointToCartesian
1563 updateLocalCoordinateSystem(newPoints);
1565 <<
"Max mesh movement equal to "
1574 if (cps_.size() != newCps.size())
1577 <<
"Attempting to replace control points with a set of "
1590 forAll(controlPointsMovement, cpI)
1592 if (!activeDesignVariables_[3*cpI])
1594 controlPointsMovement[cpI].x() =
Zero;
1596 if (!activeDesignVariables_[3*cpI + 1])
1598 controlPointsMovement[cpI].y() =
Zero;
1600 if (!activeDesignVariables_[3*cpI + 2])
1602 controlPointsMovement[cpI].z() =
Zero;
1617 const vectorField& paramCoors = getParametricCoordinates();
1619 cps_ += controlPointsMovement;
1621 scalar maxDisplacement(
Zero);
1622 for (
const label patchI : patchesToBeMoved)
1629 const label whichPointInBox = reverseMapPtr_()[
globalIndex];
1632 if (whichPointInBox != -1)
1635 transformPointToCartesian
1654 return maxDisplacement;
1660 if (mapPtr_.empty())
1662 findPointsInBox(localSystemCoordinates_);
1666 new vectorField(localSystemCoordinates_, mapPtr_())
1675 if (mapPtr_.empty())
1677 findPointsInBox(localSystemCoordinates_);
1686 if (reverseMapPtr_.empty())
1688 findPointsInBox(localSystemCoordinates_);
1691 return reverseMapPtr_();
1698 if (parametricCoordinatesPtr_.empty())
1702 if (mapPtr_.empty())
1704 findPointsInBox(localSystemCoordinates_);
1706 computeParametricCoordinates(getPointsInBox()());
1709 return parametricCoordinatesPtr_();
1716 const vectorField& parametricCoordinates = getParametricCoordinates();
1726 mesh_.time().timeName(),
1762 const vectorField& parametricCoordinates = getParametricCoordinates();
1772 mesh_.time().timeName(),
1803 const label cellI = pointCellsI[cI];
1804 DxDb[cellI] += C_d[cI] & pointDxDb;
1809 forAll(mesh_.boundary(), pI)
1812 if (!isA<coupledFvPatch>(
patch))
1827 label nU(basisU_.nCPs());
1834 nU = (nU - 1)/2 + 1;
1842 label nV(basisV_.nCPs());
1849 nV = (nV - 1)/2 + 1;
1857 label nW(basisW_.nCPs());
1864 nW = (nW - 1)/2 + 1;
1872 const label nCPsU = basisU_.nCPs();
1873 const label nCPsV = basisV_.nCPs();
1876 forAll(cpsInCartesian, cpI)
1878 cpsInCartesian[cpI] = transformPointToCartesian(cps_[cpI]);
1881 Info<<
"Writing control point positions to file" <<
endl;
1885 OFstream cpsFile(
"optimisation"/cpsFolder_/name_ + baseName +
".csv");
1888 <<
"\"Points : 0\", \"Points : 1\", \"Points : 2\","
1889 <<
"\"i\", \"j\", \"k\","
1890 <<
"\"active : 0\", \"active : 1\", \"active : 2\"" <<
endl;
1892 forAll(cpsInCartesian, cpI)
1894 const label iCPw = cpI/label(nCPsU*nCPsV);
1895 const label iCPv = (cpI - iCPw*nCPsU*nCPsV)/nCPsU;
1896 const label iCPu = (cpI - iCPw*nCPsU*nCPsV - iCPv*nCPsU);
1899 << cpsInCartesian[cpI].x() <<
", "
1900 << cpsInCartesian[cpI].y() <<
", "
1901 << cpsInCartesian[cpI].z() <<
", "
1905 << activeDesignVariables_[3*cpI] <<
", "
1906 << activeDesignVariables_[3*cpI + 1] <<
", "
1907 << activeDesignVariables_[3*cpI + 2] <<
endl;
1921 name_ +
"cpsBsplines" + mesh_.time().timeName(),
1922 mesh_.time().caseConstant(),
1931 cpsDict.
add(
"controlPoints", cps_);
1934 cpsDict.regIOobject::writeObject
1945 parametricCoordinatesPtr_().write();