243 std::unique_ptr<Foam::dictionary>(
new Foam::dictionary(
"meshDict"));
245 Foam::dictionary fmfle(
"FoamFile");
246 fmfle.add(
"version",
"2.0");
247 fmfle.add(
"format",
"ascii");
248 fmfle.add(
"class",
"dictionary");
249 fmfle.add(
"location",
"\"system\"");
250 fmfle.add(
"object",
"meshDict");
263 meshDict_->add(
"boundaryCellSizeRefinementThickness",
277 Foam::dictionary boundaryLayrs(
"boundaryLayers");
278 boundaryLayrs.add(
"nLayers", boundaryLayer.blNLyr);
279 boundaryLayrs.add(
"thicknessRatio", boundaryLayer.blThkRto);
280 if (boundaryLayer.maxFrstLyrThk > 0.0)
281 boundaryLayrs.add(
"maxFirstLayerThickness", boundaryLayer.maxFrstLyrThk);
283 if (boundaryLayer.alwDiscont) boundaryLayrs.add(
"allowDiscontinuity", 1);
286 if (!boundaryLayer.blPatches.empty()) {
287 Foam::dictionary patchBoundaryLayers(
"patchBoundaryLayers");
288 for (
auto pt = (boundaryLayer.blPatches).begin();
289 pt != (boundaryLayer.blPatches).end(); pt++) {
290 Foam::dictionary tmpDict1(pt->patchName);
291 if (pt->alwDiscont) tmpDict1.add(
"allowDiscontinuity", 1);
292 if ((pt->maxFrstLyrThk) > 0)
293 tmpDict1.add(
"maxFirstLayerThickness", pt->maxFrstLyrThk);
294 if ((pt->blNLyr) > 0) tmpDict1.add(
"nLayers", pt->blNLyr);
295 if ((pt->blThkRto) > 0) tmpDict1.add(
"thicknessRatio", pt->blThkRto);
296 patchBoundaryLayers.add(Foam::word(
"\"" + pt->patchName +
"\""),
299 boundaryLayrs.add(
"patchBoundaryLayers", patchBoundaryLayers);
301 meshDict_->add(
"boundaryLayers", boundaryLayrs);
305 Foam::dictionary objectRefinements(
"objectRefinements");
309 Foam::dictionary tmpDict1(ref->name);
310 for (
auto prm = (ref->params).begin(); prm != (ref->params).end();
312 tmpDict1.add(Foam::word(prm->first), Foam::word(prm->second));
314 objectRefinements.add(Foam::word(ref->name), tmpDict1);
316 meshDict_->add(
"objectRefinements", objectRefinements);
320 Foam::dictionary localRefinement(
"localRefinement");
324 Foam::dictionary tmpDict1(pt->patchName);
325 if ((pt->aditRefLvls) > 0)
326 tmpDict1.add(
"additionalRefinementLevels", pt->aditRefLvls);
327 if ((pt->refThickness) > 0)
328 tmpDict1.add(
"refinementThickness", pt->refThickness);
329 if ((pt->cellSize) > 0) tmpDict1.add(
"cellSize", pt->cellSize);
330 localRefinement.add(Foam::word(
"\"" + pt->patchName +
"\""), tmpDict1);
332 meshDict_->add(
"localRefinement", localRefinement);
336 Foam::dictionary renameBoundary(
"renameBoundary");
339 renameBoundary.add(
"defaultName", Foam::word((renBndry).defName));
340 renameBoundary.add(
"defaultType", Foam::word((renBndry).defType));
342 Foam::dictionary tmpDict1(
"newPatchNames");
344 for (
auto pt = (renBndry).newPatches.begin();
345 pt != (renBndry).newPatches.end(); pt++) {
346 Foam::dictionary tmpDict2(pt->name);
347 tmpDict2.add(
"newName", Foam::word(pt->newName));
348 tmpDict2.add(
"type", Foam::word(pt->newType));
349 tmpDict1.add(Foam::word(
"\"" + pt->name +
"\""), tmpDict2);
351 renameBoundary.add(
"newPatchNames", tmpDict1);
352 meshDict_->add(
"renameBoundary", renameBoundary);
357 Foam::fileName cfmeshDict_ =
"system/meshDict";
358 Foam::OFstream outcfmeshDict_(cfmeshDict_);
359 Foam::IOobject::writeBanner(outcfmeshDict_);
std::unique_ptr< Foam::dictionary > meshDict_
jsoncons::optional< cfmBoundaryLayer > boundaryLayers
jsoncons::optional< cfmRenBndry > renBndry
double bndryCellSizeRefThk
std::vector< cfmLclRefPatch > refPatches
std::vector< cfmObjRef > objRefLst