50 "void checkMeshDict::checkBasicSettings() const"
51 ) <<
"maxCellSize is negative! Cannot generate the mesh!!"
63 "void checkMeshDict::checkBasicSettings() const"
64 ) <<
"Boundary cell size is negative!!" <<
endl;
69 const scalar thickness =
79 "void checkMeshDict::checkBasicSettings() const"
80 ) <<
"Boundary cell size refinement thickness is negative!!"
95 "void checkMeshDict::checkBasicSettings() const"
96 ) <<
"Minimum cell size for automatic refinement is negative!!"
171 if(
dict.found(
"cellSize") )
179 "void checkMeshDict::checkLocalRefinementLevel() const"
180 ) <<
"Cell size for " << entries[dictI]
181 <<
" is negative" <<
endl;
184 else if(
dict.found(
"additionalRefinementLevels") )
186 const label nLevels =
193 "void checkMeshDict::checkLocalRefinementLevel() const"
194 ) <<
"Refinement level for " << entries[dictI]
195 <<
" is negative" <<
endl;
202 "void checkMeshDict::checkLocalRefinementLevel() const"
203 ) <<
"Cannot read keyword"
204 <<
" additionalRefinementLevels or cellSize"
208 if(
dict.found(
"refinementThickness") )
217 "void checkMeshDict::checkLocalRefinementLevel() const"
218 ) <<
"Refinement thickness for " << entries[dictI]
219 <<
" is negative" <<
endl;
228 "void checkMeshDict::checkLocalRefinementLevel() const"
285 forAll(refObjects, objectI)
287 const entry& objectEntry =
288 dict.lookupEntry(objectNames[objectI],
false,
false);
308 forAll(refObjects, objectI)
315 objectEntries[objectI].keyword(),
316 objectEntries[objectI].
dict()
324 if( refObjects[oI].refinementThickness() < 0.0 )
328 "void checkMeshDict::checkObjectRefinements() const"
329 ) <<
"Refinement thickness specified for object "
330 << refObjects[oI].name() <<
" is negative!!" <<
endl;
349 forAll(anisotropicObjects, objectI)
351 const entry& objectEntry =
352 dict.lookupEntry(objectNames[objectI],
false,
false);
354 anisotropicObjects.
set
376 forAll(surfaceSources, surfI)
378 if( surfaces.
isDict(surfaceSources[surfI]) )
381 surfaces.
subDict(surfaceSources[surfI]);
383 if(
dict.found(
"surfaceFile") )
390 "void checkMeshDict::checkSurfaceRefinements() const"
391 ) <<
"Surface file " << fName
392 <<
" does not exist or is not readable!!"
399 "void checkMeshDict::checkSurfaceRefinements() const"
400 ) <<
"Missing surfaceFile for entry "
404 if(
dict.found(
"cellSize") )
411 "void checkMeshDict::"
412 "checkSurfaceRefinements() const"
413 ) <<
"Cell size for entry " << surfaceSources[surfI]
414 <<
" is extremely small or negative!!"
417 else if(
dict.found(
"additionalRefinementLevels") )
426 "void checkMeshDict::"
427 "checkSurfaceRefinements() const"
428 ) <<
"Number refinement levels for entry "
429 << surfaceSources[surfI] <<
" is negative!!"
437 "void checkMeshDict::checkSurfaceRefinements() const"
438 ) <<
"Missing cellSize or additionalRefinementLevels"
439 <<
" for entry " << surfaceSources[surfI]
443 if(
dict.found(
"refinementThickness") )
451 "void checkMeshDict::"
452 "checkSurfaceRefinements() const"
453 ) <<
"Refinement thickness for entry "
454 << surfaceSources[surfI]
455 <<
" is extremely small or negative!!" <<
endl;
462 "void checkMeshDict::checkSurfaceRefinements() const"
463 ) <<
"Dictionary " << surfaceSources[surfI]
464 <<
" does not exist!!"
479 forAll(edgeMeshSources, emI)
481 if( edgeMeshes.
isDict(edgeMeshSources[emI]) )
484 edgeMeshes.
subDict(edgeMeshSources[emI]);
486 if(
dict.found(
"edgeFile") )
493 "void checkMeshDict::checkEdgeMeshRefinements() const"
494 ) <<
"Edge mesh file " << fName
495 <<
" does not exist or is not readable!!"
502 "void checkMeshDict::checkEdgeMeshRefinements() const"
503 ) <<
"Missing edgeFilw for entry "
507 if(
dict.found(
"cellSize") )
514 "void checkMeshDict::"
515 "checkEdgeMeshRefinements() const"
516 ) <<
"Cell size for entry " << edgeMeshSources[emI]
517 <<
" is extremely small or negative!!"
520 else if(
dict.found(
"additionalRefinementLevels") )
529 "void checkMeshDict::"
530 "checkEdgeMeshRefinements() const"
531 ) <<
"Number refinement levels for entry "
532 << edgeMeshSources[emI] <<
" is negative!!"
540 "void checkMeshDict::checkEdgeMeshRefinements() const"
541 ) <<
"Missing cellSize or additionalRefinementLevels"
542 <<
" for entry " << edgeMeshSources[emI]
546 if(
dict.found(
"refinementThickness") )
554 "void checkMeshDict::"
555 "checkEdgeMeshRefinements() const"
556 ) <<
"Refinement thickness for entry "
557 << edgeMeshSources[emI]
558 <<
" is extremely small or negative!!" <<
endl;
565 "void checkMeshDict::checkEdgeMeshRefinements() const"
566 ) <<
"Dictionary " << edgeMeshSources[emI]
567 <<
" does not exist!!"
581 if( bndLayers.
found(
"nLayers") )
585 if( bndLayers.
found(
"thicknessRatio") )
589 if( bndLayers.
found(
"maxFirstLayerThickness") )
595 if( bndLayers.
isDict(
"patchBoundaryLayers") )
598 bndLayers.
subDict(
"patchBoundaryLayers");
605 if( patchBndLayers.
isDict(pName) )
610 if( patchDict.
found(
"nLayers") )
614 if( patchDict.
found(
"thicknessRatio") )
618 if( patchDict.
found(
"maxFirstLayerThickness") )
622 if( patchDict.
found(
"allowDiscontinuity") )
629 Warning <<
"Cannot refine layer for patch "
636 if( bndLayers.
found(
"optimiseLayer") )
641 if( bndLayers.
found(
"optimisationParameters") )
644 bndLayers.
subDict(
"optimisationParameters");
646 if( optParams.
found(
"reCalculateNormals") )
651 if( optParams.
found(
"nSmoothNormals") )
653 const label nSmoothNormals =
656 if( nSmoothNormals < 0 )
659 "void checkMeshDict::checkBoundaryLayers() const"
660 ) <<
"nSmoothNormals must not be negative!"
664 if( optParams.
found(
"featureSizeFactor") )
666 const scalar featureSizeFactor =
669 if( featureSizeFactor >= 1.0 || featureSizeFactor < 0.0 )
672 "void checkMeshDict::checkBoundaryLayers() const"
673 ) <<
"Feature size factor is out"
677 if( optParams.
found(
"relThicknessTol") )
679 const scalar relThicknessTol =
682 if( relThicknessTol >= 1.0 || relThicknessTol < 0.0 )
685 "void checkMeshDict::checkBoundaryLayers() const"
686 ) <<
"Relative thickness tolerance is out"
690 if( optParams.
found(
"maxNumIterations") )
692 const label maxNumIterations =
695 if( maxNumIterations < 0 )
698 "void checkMeshDict::checkBoundaryLayers() const"
699 ) <<
"maxNumIterations must not be negative!"
711 if(
dict.found(
"newPatchNames") )
713 if(
dict.isDict(
"newPatchNames") )
726 "void checkMeshDict::checkRenameBoundary() const"
727 ) <<
"Entry " << pName
732 if( !
dict.found(
"newName") )
735 "void checkMeshDict::checkRenameBoundary() const"
736 ) <<
"Dictionary " << pName
737 <<
" does not contain a newName keyword"
745 dict.lookup(
"newPatchNames")
748 forAll(patchesToRename, patchI)
750 const word& pName = patchesToRename[patchI].keyword();
754 if( !
dict.found(
"newName") )
757 "void checkMeshDict::checkRenameBoundary() const"
758 ) <<
"Dictionary " << pName
759 <<
" does not contain a newName keyword"
792 const std::map<word, wordList>& patchesFromPatch
795 if( meshDict_.found(
"patchCellSize") )
799 if( meshDict_.isDict(
"patchCellSize") )
809 std::map<word, wordList>::const_iterator it =
810 patchesFromPatch.find(pName);
811 if( it == patchesFromPatch.end() )
814 const wordList& updatedPatchNames = it->second;
819 forAll(updatedPatchNames, nameI)
820 updatedPatchRefinement.
append
824 updatedPatchNames[nameI],
835 const word& pName = prl[prlI].patchName();
836 const scalar cellSize = prl[prlI].cellSize();
838 std::map<word, wordList>::const_iterator it =
839 patchesFromPatch.find(pName);
841 if( it == patchesFromPatch.end() )
844 const wordList& updatedPatchNames = it->second;
845 forAll(updatedPatchNames, nameI)
846 updatedPatchRefinement.
append
850 updatedPatchNames[nameI],
857 meshDict_.add(
"patchCellSize", updatedPatchRefinement,
true);
863 const std::map<word, wordList>&
871 const std::map<word, wordList>& patchesFromPatch
874 if( meshDict_.found(
"localRefinement") )
876 if( meshDict_.isDict(
"localRefinement") )
884 const word& pName = entries[dictI];
886 std::map<word, wordList>::const_iterator it =
887 patchesFromPatch.find(pName);
888 if( it == patchesFromPatch.end() )
891 const wordList& updatedPatchNames = it->second;
897 forAll(updatedPatchNames, nameI)
898 dict.
add(updatedPatchNames[nameI], copy);
909 const std::map<word, wordList>& patchesFromPatch
912 if( meshDict_.found(
"keepCellsIntersectingPatches") )
915 if( meshDict_.isDict(
"keepCellsIntersectingPatches") )
918 meshDict_.
subDict(
"keepCellsIntersectingPatches");
925 std::map<word, wordList>::const_iterator it =
926 patchesFromPatch.find(pName);
928 if( it == patchesFromPatch.end() )
930 updatedPatchNames.
append(pName);
934 const wordList& newPatchNames = it->second;
936 forAll(newPatchNames, nameI)
937 updatedPatchNames.
append(newPatchNames[nameI]);
942 wordList kcip(meshDict_.lookup(
"keepCellsIntersectingPatches"));
946 const word& pName = kcip[i];
948 std::map<word, wordList>::const_iterator it =
949 patchesFromPatch.find(pName);
951 if( it == patchesFromPatch.end() )
952 updatedPatchNames.
append(pName);
954 const wordList& newPatchNames = it->second;
956 forAll(newPatchNames, nameI)
957 updatedPatchNames.
append(newPatchNames[nameI]);
961 meshDict_.add(
"keepCellsIntersectingPatches", updatedPatchNames,
true);
968 const std::map<word, wordList>& patchesFromPatch
971 if( meshDict_.found(
"removeCellsIntersectingPatches") )
974 if( meshDict_.isDict(
"removeCellsIntersectingPatches") )
977 meshDict_.
subDict(
"removeCellsIntersectingPatches");
984 std::map<word, wordList>::const_iterator it =
985 patchesFromPatch.find(pName);
987 if( it == patchesFromPatch.end() )
989 updatedPatchNames.
append(pName);
993 const wordList& newPatchNames = it->second;
995 forAll(newPatchNames, nameI)
996 updatedPatchNames.
append(newPatchNames[nameI]);
1001 wordList kcip(meshDict_.lookup(
"removeCellsIntersectingPatches"));
1005 const word& pName = kcip[i];
1007 std::map<word, wordList>::const_iterator it =
1008 patchesFromPatch.find(pName);
1010 if( it == patchesFromPatch.end() )
1011 updatedPatchNames.
append(pName);
1013 const wordList& newPatchNames = it->second;
1015 forAll(newPatchNames, nameI)
1016 updatedPatchNames.
append(newPatchNames[nameI]);
1022 "removeCellsIntersectingPatches",
1031 const std::map<word, wordList>&
1039 const std::map<word, wordList>& patchesFromPatch
1042 if( meshDict_.isDict(
"boundaryLayers") )
1045 if( bndLayersDict.
isDict(
"patchBoundaryLayers") )
1048 bndLayersDict.
subDict(
"patchBoundaryLayers");
1050 const wordList patchLayers = patchBndLayers.
toc();
1052 forAll(patchLayers, patchI)
1054 const word& pName = patchLayers[patchI];
1058 const std::map<word, wordList>::const_iterator it =
1059 patchesFromPatch.find(pName);
1062 if( it != patchesFromPatch.end() )
1064 const wordList& newNames = it->second;
1068 patchBndLayers.
add(newNames[i],
dict);
1071 patchBndLayers.
remove(pName);
1080 const std::map<word, wordList>& patchesFromPatch,
1088 if( meshDict_.found(
"renameBoundary") )
1096 newDict.
add(
"defaultName",
name);
1103 newDict.
add(
"defaultType",
type);
1116 std::map<word, wordList>::const_iterator it;
1117 for(it=patchesFromPatch.begin();it!=patchesFromPatch.end();++it)
1119 const word& pName = it->first;
1120 const wordList& newNames = it->second;
1127 if( !patchDict.
found(
"newName") )
1129 if( !patchDict.
found(
"type") )
1132 const word newName(patchDict.
lookup(
"newName"));
1133 const word newType(patchDict.
lookup(
"type"));
1138 newPatchDict.
add(
"newName", newName);
1139 newPatchDict.
add(
"type", newType);
1141 newPatchesDict.
add(newNames[i], newPatchDict);
1152 newPatchDict.
add(
"newName", it->first);
1153 std::map<word, word>::const_iterator tIter =
1155 newPatchDict.
add(
"type", tIter->second);
1157 newPatchesDict.
add(newNames[i], newPatchDict);
1166 forAll(patchEntries, entryI)
1168 const word& pName = patchEntries[entryI].keyword();
1171 std::map<word, wordList>::const_iterator it =
1172 patchesFromPatch.find(pName);
1174 if( it == patchesFromPatch.end() )
1177 const wordList& newNames = it->second;
1180 newPatchesDict.
add(newNames[i], patchDict,
true);
1183 std::map<word, wordList>::const_iterator it;
1184 for(it=patchesFromPatch.begin();it!=patchesFromPatch.end();++it)
1186 const word& pName = it->first;
1187 const wordList& newNames = it->second;
1189 if( newPatchesDict.
found(pName) )
1198 newPatchDict.
add(
"newName", it->first);
1199 std::map<word, word>::const_iterator tIter =
1201 newPatchDict.
add(
"type", tIter->second);
1203 newPatchesDict.
add(newNames[i], newPatchDict);
1213 std::map<word, wordList>::const_iterator it;
1214 for(it=patchesFromPatch.begin();it!=patchesFromPatch.end();++it)
1216 const wordList& newPatchNames = it->second;
1220 const word& pName = newPatchNames[i];
1222 newPatchDict.
add(
"newName", it->first);
1223 std::map<word, word>::const_iterator tIter =
1225 newPatchDict.
add(
"type", tIter->second);
1227 newPatchesDict.
add(pName, newPatchDict);
1233 meshDict_.subDict(
"renameBoundary").clear();
1240 std::map<word, wordList>::const_iterator it;
1241 for(it=patchesFromPatch.begin();it!=patchesFromPatch.end();++it)
1243 const wordList& newPatchNames = it->second;
1247 const word& pName = newPatchNames[i];
1249 newPatchDict.
add(
"newName", it->first);
1250 std::map<word, word>::const_iterator tIter =
1252 newPatchDict.
add(
"type", tIter->second);
1254 newPatchesDict.
add(pName, newPatchDict);
1259 meshDict_.add(
"renameBoundary", newDict,
true);
1283 const std::map<word, wordList>& patchesFromPatch,
1285 const bool renamePatches
1288 updatePatchCellSize(patchesFromPatch);
1290 updateSubsetCellSize(patchesFromPatch);
1292 updateLocalRefinement(patchesFromPatch);
1294 updateKeepCellsIntersectingPatches(patchesFromPatch);
1296 updateRemoveCellsIntersectingPatches(patchesFromPatch);
1298 updateObjectRefinements(patchesFromPatch);
1300 updateBoundaryLayers(patchesFromPatch);
1303 updateRenameBoundary(patchesFromPatch,
patchTypes);