52 #ifdef CODI_AD_REVERSE
54 const objectRegistry& db =
mesh_.thisDb();
63 for (label comp = 0; comp < 3; comp++)
65 state[cellI][comp].setGradient(0.0);
69 forAll(state.boundaryField(), patchI)
71 if (state.boundaryFieldRef()[patchI].type() ==
"fixedValue")
73 forAll(state.boundaryField()[patchI], faceI)
75 for (label comp = 0; comp < 3; comp++)
77 state.boundaryFieldRef()[patchI][faceI][comp].setGradient(0.0);
81 else if (state.boundaryFieldRef()[patchI].type() ==
"fixedGradient")
83 fixedGradientFvPatchField<vector>& patchBC =
84 refCast<fixedGradientFvPatchField<vector>>(state.boundaryFieldRef()[patchI]);
85 vectorField& grad =
const_cast<vectorField&
>(patchBC.gradient());
88 for (label comp = 0; comp < 3; comp++)
90 grad[idxI][comp].setGradient(0.0);
104 state[cellI].setGradient(0.0);
107 forAll(state.boundaryField(), patchI)
109 if (state.boundaryFieldRef()[patchI].type() ==
"fixedValue")
111 forAll(state.boundaryField()[patchI], faceI)
113 state.boundaryFieldRef()[patchI][faceI].setGradient(0.0);
116 else if (state.boundaryFieldRef()[patchI].type() ==
"fixedGradient")
118 fixedGradientFvPatchField<scalar>& patchBC =
119 refCast<fixedGradientFvPatchField<scalar>>(state.boundaryFieldRef()[patchI]);
120 scalarField& grad =
const_cast<scalarField&
>(patchBC.gradient());
123 grad[idxI].setGradient(0.0);
136 state[cellI].setGradient(0.0);
139 forAll(state.boundaryField(), patchI)
141 if (state.boundaryFieldRef()[patchI].type() ==
"fixedValue")
143 forAll(state.boundaryField()[patchI], faceI)
145 state.boundaryFieldRef()[patchI][faceI].setGradient(0.0);
148 else if (state.boundaryFieldRef()[patchI].type() ==
"fixedGradient")
150 fixedGradientFvPatchField<scalar>& patchBC =
151 refCast<fixedGradientFvPatchField<scalar>>(state.boundaryFieldRef()[patchI]);
152 scalarField& grad =
const_cast<scalarField&
>(patchBC.gradient());
155 grad[idxI].setGradient(0.0);
168 state[faceI].setGradient(0.0);
171 forAll(state.boundaryField(), patchI)
173 forAll(state.boundaryField()[patchI], faceI)
175 state.boundaryFieldRef()[patchI][faceI].setGradient(0.0);
180 pointField meshPoints(
mesh_.points());
184 for (label comp = 0; comp < 3; comp++)
186 meshPoints[pointI][comp].setGradient(0.0);
191 fvMesh&
mesh =
const_cast<fvMesh&
>(
mesh_);
192 mesh.movePoints(meshPoints);
221 const objectRegistry& db =
mesh_.thisDb();
222 PetscScalar* stateVecArray;
223 VecGetArray(stateVec, &stateVecArray);
232 for (label comp = 0; comp < 3; comp++)
281 assignValueCheckAD(stateVecArray[localIdx], state.boundaryField()[patchIdx][faceIdx]);
285 VecRestoreArray(stateVec, &stateVecArray);
311 const objectRegistry& db =
mesh_.thisDb();
320 for (label comp = 0; comp < 3; comp++)
323 state[cellI][comp] = states[localIdx];
336 state[cellI] = states[localIdx];
348 state[cellI] = states[localIdx];
362 state[faceI] = states[localIdx];
369 state.boundaryFieldRef()[patchIdx][faceIdx] = states[localIdx];
398 const objectRegistry& db =
mesh_.thisDb();
399 const PetscScalar* stateVecArray;
400 VecGetArrayRead(stateVec, &stateVecArray);
409 for (label comp = 0; comp < 3; comp++)
412 state[cellI][comp] = stateVecArray[localIdx];
425 state[cellI] = stateVecArray[localIdx];
437 state[cellI] = stateVecArray[localIdx];
451 state[faceI] = stateVecArray[localIdx];
458 state.boundaryFieldRef()[patchIdx][faceIdx] = stateVecArray[localIdx];
462 VecRestoreArrayRead(stateVec, &stateVecArray);
489 pointField meshPoints(
mesh_.points());
493 for (label comp = 0; comp < 3; comp++)
496 meshPoints[pointI][comp] = volCoords[localIdx];
501 fvMesh&
mesh =
const_cast<fvMesh&
>(
mesh_);
502 mesh.movePoints(meshPoints);
530 const PetscScalar* xvVecArray;
531 VecGetArrayRead(xvVec, &xvVecArray);
533 pointField meshPoints(
mesh_.points());
537 for (label comp = 0; comp < 3; comp++)
540 meshPoints[pointI][comp] = xvVecArray[localIdx];
544 VecRestoreArrayRead(xvVec, &xvVecArray);
547 fvMesh&
mesh =
const_cast<fvMesh&
>(
mesh_);
548 mesh.movePoints(meshPoints);
576 PetscScalar* xvVecArray;
577 VecGetArray(xvVec, &xvVecArray);
581 for (label comp = 0; comp < 3; comp++)
588 VecRestoreArray(xvVec, &xvVecArray);
615 const objectRegistry& db =
mesh_.thisDb();
616 PetscScalar* stateResVecArray;
617 VecGetArray(resVec, &stateResVecArray);
626 for (label comp = 0; comp < 3; comp++)
675 assignValueCheckAD(stateResVecArray[localIdx], stateRes.boundaryField()[patchIdx][faceIdx]);
679 VecRestoreArray(resVec, &stateResVecArray);
705 const objectRegistry& db =
mesh_.thisDb();
706 const PetscScalar* stateResVecArray;
707 VecGetArrayRead(resVec, &stateResVecArray);
716 for (label comp = 0; comp < 3; comp++)
719 stateRes[cellI][comp] = stateResVecArray[localIdx];
732 stateRes[cellI] = stateResVecArray[localIdx];
744 stateRes[cellI] = stateResVecArray[localIdx];
758 stateRes[faceI] = stateResVecArray[localIdx];
765 stateRes.boundaryFieldRef()[patchIdx][faceIdx] = stateResVecArray[localIdx];
769 VecRestoreArrayRead(resVec, &stateResVecArray);
790 mesh_.time().timeName(),
792 IOobject::READ_IF_PRESENT,
796 dimensionedVector(
"U", dimensionSet(0, 1, -1, 0, 0, 0, 0), vector::zero),
797 zeroGradientFvPatchField<vector>::typeName);
798 forAll(
U.boundaryField(), patchI)
800 if (
U.boundaryFieldRef()[patchI].type() ==
"pressureInletVelocity")
824 if (DAUtility::isInList<word>(
"pressureInletVelocity",
specialBCs))
827 volVectorField&
U(
const_cast<volVectorField&
>(
828 mesh_.thisDb().lookupObject<volVectorField>(
"U")));
829 U.correctBoundaryConditions();
867 const objectRegistry& db =
mesh_.thisDb();
869 label setTurbWallBCs = 0;
870 label useWallFunction = 0;
873 dictionary bcDict =
allOptions.subDict(
"primalBC");
875 forAll(bcDict.toc(), idxI)
877 word bcKey = bcDict.toc()[idxI];
879 if (bcKey ==
"useWallFunction")
882 useWallFunction = bcDict.getLabel(
"useWallFunction");
885 else if (bcKey ==
"MRF")
888 scalar omegaNew = bcDict.getScalar(
"MRF");
890 scalar& omega =
const_cast<scalar&
>(
MRF.getOmegaRef());
895 Info <<
"Setting MRF omega to " << omegaNew << endl;
900 else if (bcKey ==
"fvSource")
903 dictionary subDict = bcDict.subDict(
"fvSource");
904 scalar fvSourceVal = subDict.getScalar(
"value");
905 label compI = subDict.getLabel(
"comp");
907 volVectorField&
fvSource =
const_cast<volVectorField&
>(
908 db.lookupObject<volVectorField>(
"fvSource"));
912 fvSource[cellI][compI] = fvSourceVal;
918 fvSource.boundaryFieldRef()[patchI][faceI][compI] = fvSourceVal;
921 fvSource.correctBoundaryConditions();
925 Info <<
"Setting fvSource to " << fvSourceVal << endl;
930 else if (bcKey ==
"transport:nu")
933 scalar nu = bcDict.getScalar(
"transport:nu");
934 volScalarField& nuField =
const_cast<volScalarField&
>(
935 db.lookupObject<volScalarField>(
"nu"));
940 forAll(nuField.boundaryField(), patchI)
942 forAll(nuField.boundaryField()[patchI], faceI)
944 nuField.boundaryFieldRef()[patchI][faceI] = nu;
947 nuField.correctBoundaryConditions();
951 Info <<
"Setting transportProperties nu to " << nu << endl;
956 else if (bcKey ==
"thermo:mu")
959 scalar
mu = bcDict.getScalar(
"thermo:mu");
960 volScalarField& muField =
const_cast<volScalarField&
>(
961 db.lookupObject<volScalarField>(
"thermo:mu"));
966 forAll(muField.boundaryField(), patchI)
968 forAll(muField.boundaryField()[patchI], faceI)
970 muField.boundaryFieldRef()[patchI][faceI] =
mu;
973 muField.correctBoundaryConditions();
977 Info <<
"Setting thermalphysicalProperties mu to " <<
mu << endl;
983 dictionary bcSubDict = bcDict.subDict(bcKey);
986 bcSubDict.readEntry<wordList>(
"patches", patches);
987 word variable = bcSubDict.getWord(
"variable");
989 bcSubDict.readEntry<scalarList>(
"value", value);
994 word patch = patches[idxI];
997 if (value.size() == 1)
999 if (!db.foundObject<volScalarField>(variable))
1003 Info << variable <<
" not found, skip it." << endl;
1008 volScalarField& state(
const_cast<volScalarField&
>(
1009 db.lookupObject<volScalarField>(variable)));
1013 Info <<
"Setting primal boundary conditions..." << endl;
1014 Info <<
"Setting " << variable <<
" = " << value[0] <<
" at " << patch << endl;
1017 label patchI =
mesh_.boundaryMesh().findPatchID(patch);
1020 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1022 if (state.boundaryFieldRef()[patchI].type() ==
"fixedValue")
1024 forAll(state.boundaryFieldRef()[patchI], faceI)
1026 state.boundaryFieldRef()[patchI][faceI] = value[0];
1029 else if (state.boundaryFieldRef()[patchI].type() ==
"inletOutlet"
1030 || state.boundaryFieldRef()[patchI].type() ==
"outletInlet")
1033 forAll(state.boundaryFieldRef()[patchI], faceI)
1035 state.boundaryFieldRef()[patchI][faceI] = value[0];
1038 mixedFvPatchField<scalar>& inletOutletPatch =
1039 refCast<mixedFvPatchField<scalar>>(state.boundaryFieldRef()[patchI]);
1041 inletOutletPatch.refValue() = value[0];
1043 else if (state.boundaryFieldRef()[patchI].type() ==
"fixedGradient")
1045 fixedGradientFvPatchField<scalar>& patchBC =
1046 refCast<fixedGradientFvPatchField<scalar>>(state.boundaryFieldRef()[patchI]);
1047 scalarField& grad =
const_cast<scalarField&
>(patchBC.gradient());
1050 grad[idxI] = value[0];
1055 FatalErrorIn(
"") <<
"only support fixedValues, inletOutlet, "
1056 <<
"outletInlet, fixedGradient!" << abort(FatalError);
1060 else if (value.size() == 3)
1062 if (!db.foundObject<volVectorField>(variable))
1066 Info << variable <<
" not found, skip it." << endl;
1071 volVectorField& state(
const_cast<volVectorField&
>(
1072 db.lookupObject<volVectorField>(variable)));
1074 vector valVec = {value[0], value[1], value[2]};
1077 Info <<
"Setting primal boundary conditions..." << endl;
1078 Info <<
"Setting " << variable <<
" = (" << value[0] <<
" "
1079 << value[1] <<
" " << value[2] <<
") at " << patch << endl;
1082 label patchI =
mesh_.boundaryMesh().findPatchID(patch);
1085 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1087 if (state.boundaryFieldRef()[patchI].type() ==
"fixedValue")
1089 forAll(state.boundaryFieldRef()[patchI], faceI)
1091 state.boundaryFieldRef()[patchI][faceI] = valVec;
1094 else if (state.boundaryFieldRef()[patchI].type() ==
"inletOutlet"
1095 || state.boundaryFieldRef()[patchI].type() ==
"outletInlet")
1098 forAll(state.boundaryFieldRef()[patchI], faceI)
1100 state.boundaryFieldRef()[patchI][faceI] = valVec;
1103 mixedFvPatchField<vector>& inletOutletPatch =
1104 refCast<mixedFvPatchField<vector>>(state.boundaryFieldRef()[patchI]);
1105 inletOutletPatch.refValue() = valVec;
1107 else if (state.boundaryFieldRef()[patchI].type() ==
"fixedGradient")
1109 fixedGradientFvPatchField<vector>& patchBC =
1110 refCast<fixedGradientFvPatchField<vector>>(state.boundaryFieldRef()[patchI]);
1111 vectorField& grad =
const_cast<vectorField&
>(patchBC.gradient());
1114 grad[idxI][0] = value[0];
1115 grad[idxI][1] = value[1];
1116 grad[idxI][2] = value[2];
1121 FatalErrorIn(
"") <<
"only support fixedValues, inletOutlet, "
1122 <<
"fixedGradient, and tractionDisplacement!"
1123 << abort(FatalError);
1129 FatalErrorIn(
"") <<
"value should be a list of either 1 (scalar) "
1130 <<
"or 3 (vector) elements" << abort(FatalError);
1139 IOdictionary turbDict(
1141 "turbulenceProperties",
1142 mesh_.time().constant(),
1144 IOobject::MUST_READ,
1148 dictionary coeffDict(turbDict.subDict(
"RAS"));
1149 word turbModelType = word(coeffDict[
"RASModel"]);
1153 wordReList SAModelWordReList {
1154 {
"SpalartAllmaras.*", wordRe::REGEX}};
1155 wordRes SAModelWordRes(SAModelWordReList);
1158 if (db.foundObject<volScalarField>(
"nut"))
1161 volScalarField& nut(
const_cast<volScalarField&
>(
1162 db.lookupObject<volScalarField>(
"nut")));
1164 forAll(nut.boundaryField(), patchI)
1166 if (
mesh_.boundaryMesh()[patchI].type() ==
"wall")
1170 Info <<
"Setting nut wall BC for "
1171 <<
mesh_.boundaryMesh()[patchI].name() <<
". ";
1174 if (useWallFunction)
1177 if (SAModelWordRes(turbModelType))
1179 nut.boundaryFieldRef().set(
1181 fvPatchField<scalar>::New(
1182 "nutUSpaldingWallFunction",
1183 mesh_.boundary()[patchI],
1188 Info <<
"BCType=nutUSpaldingWallFunction" << endl;
1193 nut.boundaryFieldRef().set(
1195 fvPatchField<scalar>::New(
1197 mesh_.boundary()[patchI],
1202 Info <<
"BCType=nutkWallFunction" << endl;
1208 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1210 scalar wallVal = nut[0];
1211 forAll(nut.boundaryFieldRef()[patchI], faceI)
1214 nut.boundaryFieldRef()[patchI][faceI] = wallVal;
1220 nut.boundaryFieldRef().set(
1222 fvPatchField<scalar>::New(
1223 "nutLowReWallFunction",
1224 mesh_.boundary()[patchI],
1229 Info <<
"BCType=nutLowReWallFunction" << endl;
1234 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1236 forAll(nut.boundaryFieldRef()[patchI], faceI)
1239 nut.boundaryFieldRef()[patchI][faceI] = 1e-14;
1248 if (db.foundObject<volScalarField>(
"k"))
1251 volScalarField&
k(
const_cast<volScalarField&
>(
1252 db.lookupObject<volScalarField>(
"k")));
1254 forAll(
k.boundaryField(), patchI)
1256 if (
mesh_.boundaryMesh()[patchI].type() ==
"wall")
1260 Info <<
"Setting k wall BC for "
1261 <<
mesh_.boundaryMesh()[patchI].name() <<
". ";
1264 if (useWallFunction)
1267 k.boundaryFieldRef().set(
1269 fvPatchField<scalar>::New(
"kqRWallFunction",
mesh_.boundary()[patchI],
k));
1273 Info <<
"BCType=kqRWallFunction" << endl;
1278 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1280 scalar wallVal =
k[0];
1281 forAll(
k.boundaryFieldRef()[patchI], faceI)
1283 k.boundaryFieldRef()[patchI][faceI] = wallVal;
1289 k.boundaryFieldRef().set(
1291 fvPatchField<scalar>::New(
"fixedValue",
mesh_.boundary()[patchI],
k));
1295 Info <<
"BCType=fixedValue" << endl;
1300 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1302 forAll(
k.boundaryFieldRef()[patchI], faceI)
1304 k.boundaryFieldRef()[patchI][faceI] = 1e-14;
1313 if (db.foundObject<volScalarField>(
"omega"))
1316 volScalarField& omega(
const_cast<volScalarField&
>(
1317 db.lookupObject<volScalarField>(
"omega")));
1319 forAll(omega.boundaryField(), patchI)
1321 if (
mesh_.boundaryMesh()[patchI].type() ==
"wall")
1325 Info <<
"Setting omega wall BC for "
1326 <<
mesh_.boundaryMesh()[patchI].name() <<
". ";
1330 omega.boundaryFieldRef().set(
1332 fvPatchField<scalar>::New(
"omegaWallFunction",
mesh_.boundary()[patchI], omega));
1336 Info <<
"BCType=omegaWallFunction" << endl;
1341 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1343 scalar wallVal = omega[0];
1344 forAll(omega.boundaryFieldRef()[patchI], faceI)
1346 omega.boundaryFieldRef()[patchI][faceI] = wallVal;
1354 if (db.foundObject<volScalarField>(
"epsilon"))
1357 volScalarField& epsilon(
const_cast<volScalarField&
>(
1358 db.lookupObject<volScalarField>(
"epsilon")));
1360 forAll(epsilon.boundaryField(), patchI)
1362 if (
mesh_.boundaryMesh()[patchI].type() ==
"wall")
1367 Info <<
"Setting epsilon wall BC for "
1368 <<
mesh_.boundaryMesh()[patchI].name() <<
". ";
1371 if (useWallFunction)
1373 epsilon.boundaryFieldRef().set(
1375 fvPatchField<scalar>::New(
"epsilonWallFunction",
mesh_.boundary()[patchI], epsilon));
1379 Info <<
"BCType=epsilonWallFunction" << endl;
1384 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1386 scalar wallVal = epsilon[0];
1387 forAll(epsilon.boundaryFieldRef()[patchI], faceI)
1389 epsilon.boundaryFieldRef()[patchI][faceI] = wallVal;
1395 epsilon.boundaryFieldRef().set(
1397 fvPatchField<scalar>::New(
"fixedValue",
mesh_.boundary()[patchI], epsilon));
1401 Info <<
"BCType=fixedValue" << endl;
1406 if (
mesh_.boundaryMesh()[patchI].size() > 0)
1408 forAll(epsilon.boundaryFieldRef()[patchI], faceI)
1410 epsilon.boundaryFieldRef()[patchI][faceI] = 1e-14;
1421 scalarList& stateList,
1422 scalarList& stateBoundaryList)
const
1447 const objectRegistry& db =
mesh_.thisDb();
1449 label localBFaceI = 0;
1458 for (label comp = 0; comp < 3; comp++)
1461 stateList[localIdx] = state[cellI][comp];
1465 forAll(state.boundaryField(), patchI)
1467 if (state.boundaryField()[patchI].size() > 0)
1469 forAll(state.boundaryField()[patchI], faceI)
1471 for (label comp = 0; comp < 3; comp++)
1473 stateBoundaryList[localBFaceI] = state.boundaryField()[patchI][faceI][comp];
1489 stateList[localIdx] = state[cellI];
1492 forAll(state.boundaryField(), patchI)
1494 if (state.boundaryField()[patchI].size() > 0)
1496 forAll(state.boundaryField()[patchI], faceI)
1498 stateBoundaryList[localBFaceI] = state.boundaryField()[patchI][faceI];
1513 stateList[localIdx] = state[cellI];
1516 forAll(state.boundaryField(), patchI)
1518 if (state.boundaryField()[patchI].size() > 0)
1520 forAll(state.boundaryField()[patchI], faceI)
1522 stateBoundaryList[localBFaceI] = state.boundaryField()[patchI][faceI];
1539 stateList[localIdx] = state[faceI];
1546 stateList[localIdx] = state.boundaryField()[patchIdx][faceIdx];
1553 const scalarList& stateList,
1554 const scalarList& stateBoundaryList,
1555 const label oldTimeLevel)
const
1580 const objectRegistry& db =
mesh_.thisDb();
1582 label localBFaceI = 0;
1584 if (oldTimeLevel > 2 || oldTimeLevel < 0)
1586 FatalErrorIn(
"") <<
"oldTimeLevel not valid!"
1587 << abort(FatalError);
1595 label maxOldTimes = state.nOldTimes();
1597 if (maxOldTimes >= oldTimeLevel)
1601 for (label comp = 0; comp < 3; comp++)
1604 if (oldTimeLevel == 0)
1606 state[cellI][comp] = stateList[localIdx];
1608 else if (oldTimeLevel == 1)
1610 state.oldTime()[cellI][comp] = stateList[localIdx];
1612 else if (oldTimeLevel == 2)
1614 state.oldTime().oldTime()[cellI][comp] = stateList[localIdx];
1619 forAll(state.boundaryField(), patchI)
1621 if (state.boundaryField()[patchI].size() > 0)
1623 forAll(state.boundaryField()[patchI], faceI)
1625 for (label comp = 0; comp < 3; comp++)
1627 if (oldTimeLevel == 0)
1629 state.boundaryFieldRef()[patchI][faceI][comp] =
1630 stateBoundaryList[localBFaceI];
1632 else if (oldTimeLevel == 1)
1634 state.oldTime().boundaryFieldRef()[patchI][faceI][comp] =
1635 stateBoundaryList[localBFaceI];
1637 else if (oldTimeLevel == 2)
1639 state.oldTime().oldTime().boundaryFieldRef()[patchI][faceI][comp] =
1640 stateBoundaryList[localBFaceI];
1655 label maxOldTimes = state.nOldTimes();
1657 if (maxOldTimes >= oldTimeLevel)
1663 if (oldTimeLevel == 0)
1665 state[cellI] = stateList[localIdx];
1667 else if (oldTimeLevel == 1)
1669 state.oldTime()[cellI] = stateList[localIdx];
1671 else if (oldTimeLevel == 2)
1673 state.oldTime().oldTime()[cellI] = stateList[localIdx];
1677 forAll(state.boundaryField(), patchI)
1679 if (state.boundaryField()[patchI].size() > 0)
1681 forAll(state.boundaryField()[patchI], faceI)
1683 if (oldTimeLevel == 0)
1685 state.boundaryFieldRef()[patchI][faceI] =
1686 stateBoundaryList[localBFaceI];
1688 else if (oldTimeLevel == 1)
1690 state.oldTime().boundaryFieldRef()[patchI][faceI] =
1691 stateBoundaryList[localBFaceI];
1693 else if (oldTimeLevel == 2)
1695 state.oldTime().oldTime().boundaryFieldRef()[patchI][faceI] =
1696 stateBoundaryList[localBFaceI];
1710 label maxOldTimes = state.nOldTimes();
1712 if (maxOldTimes >= oldTimeLevel)
1718 if (oldTimeLevel == 0)
1720 state[cellI] = stateList[localIdx];
1722 else if (oldTimeLevel == 1)
1724 state.oldTime()[cellI] = stateList[localIdx];
1726 else if (oldTimeLevel == 2)
1728 state.oldTime().oldTime()[cellI] = stateList[localIdx];
1732 forAll(state.boundaryField(), patchI)
1734 if (state.boundaryField()[patchI].size() > 0)
1736 forAll(state.boundaryField()[patchI], faceI)
1738 if (oldTimeLevel == 0)
1740 state.boundaryFieldRef()[patchI][faceI] =
1741 stateBoundaryList[localBFaceI];
1743 else if (oldTimeLevel == 1)
1745 state.oldTime().boundaryFieldRef()[patchI][faceI] =
1746 stateBoundaryList[localBFaceI];
1748 else if (oldTimeLevel == 2)
1750 state.oldTime().oldTime().boundaryFieldRef()[patchI][faceI] =
1751 stateBoundaryList[localBFaceI];
1765 label maxOldTimes = state.nOldTimes();
1767 if (maxOldTimes >= oldTimeLevel)
1776 if (oldTimeLevel == 0)
1778 state[faceI] = stateList[localIdx];
1780 else if (oldTimeLevel == 1)
1782 state.oldTime()[faceI] = stateList[localIdx];
1784 else if (oldTimeLevel == 2)
1786 state.oldTime().oldTime()[faceI] = stateList[localIdx];
1794 if (oldTimeLevel == 0)
1796 state.boundaryFieldRef()[patchIdx][faceIdx] =
1797 stateList[localIdx];
1799 else if (oldTimeLevel == 1)
1801 state.oldTime().boundaryFieldRef()[patchIdx][faceIdx] =
1802 stateList[localIdx];
1804 else if (oldTimeLevel == 2)
1806 state.oldTime().oldTime().boundaryFieldRef()[patchIdx][faceIdx] =
1807 stateList[localIdx];