52 Foam::scalar Foam::autoHexMeshDriver::getMergeDistance(
const scalar mergeTol)
55 const boundBox& meshBb = mesh_.
bounds();
56 scalar mergeDist = mergeTol * meshBb.
mag();
64 <<
"Overall mesh bounding box : " << meshBb <<
nl
65 <<
"Relative tolerance : " << mergeTol <<
nl
66 <<
"Absolute matching distance : " << mergeDist <<
nl
71 FatalErrorIn(
"autoHexMeshDriver::getMergeDistance(const scalar) const")
72 <<
"Your current settings specify ASCII writing with "
74 <<
"Your merging tolerance (" << mergeTol <<
") is finer than this."
76 <<
"Please change your writeFormat to binary"
77 <<
" or increase the writePrecision" << endl
78 <<
"or adjust the merge tolerance (-mergeTol)."
144 Foam::autoHexMeshDriver::autoHexMeshDriver
147 const bool overwrite,
154 debug_(readLabel(dict_.lookup(
"debug"))),
155 mergeDist_(getMergeDistance(
readScalar(dict_.lookup(
"mergeTolerance"))))
159 meshRefinement::debug = debug_;
160 autoHexMeshDriver::debug = debug_;
161 autoRefineDriver::debug = debug;
162 autoSnapDriver::debug = debug;
163 autoLayerDriver::debug = debug;
168 Info<<
"Overall cell limit : "
170 Info<<
"Per processor cell limit : "
172 Info<<
"Minimum number of cells to refine : "
174 Info<<
"Curvature : "
176 Info<<
"Layers between different refinement levels : "
188 Info<<
"Reading all geometry." <<
endl;
193 forAll(shellDicts, shellI)
198 shellDict.
remove(
"level");
199 shellDict.
remove(
"refineInside");
200 geometryDict.
add(
name, shellDict);
203 forAll(surfaceDicts, surfI)
208 surfDict.
remove(
"regions");
209 if (!surfDict.
found(
"name"))
211 surfDict.
add(
"name", name);
213 surfDict.
add(
"type", triSurfaceMesh::typeName);
214 geometryDict.
add(name, surfDict);
217 allGeometryPtr_.reset
226 mesh_.time().constant(),
236 Info<<
"Read geometry in = "
237 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
245 Info<<
"Reading surfaces and constructing search trees." <<
endl;
255 Info<<
"Read surfaces in = "
256 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
263 Info<<
"Reading refinement shells." <<
endl;
272 Info<<
"Read refinement shells in = "
273 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
282 Info<<
"Setting refinement level of surface to be consistent"
283 <<
" with shells." <<
endl;
284 surfacesPtr_().setMinLevelFields(shells());
285 Info<<
"Checked shell refinement in = "
286 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
299 <<
"Determining initial surface intersections" <<
nl
300 <<
"-----------------------------------------" <<
nl
304 meshRefinerPtr_.reset
315 Info<<
"Calculated surface intersections in = "
316 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
319 meshRefinerPtr_().printMeshInfo(debug_,
"Initial mesh");
321 meshRefinerPtr_().
write
324 mesh_.time().path()/meshRefinerPtr_().timeName()
334 <<
"Adding patches for surface regions" <<
nl
335 <<
"----------------------------------" <<
nl
339 globalToPatch_.setSize(surfaces().nRegions(), -1);
341 Info<<
"Patch\tRegion" <<
nl
345 const labelList& surfaceGeometry = surfaces().surfaces();
346 forAll(surfaceGeometry, surfI)
348 label geomI = surfaceGeometry[surfI];
350 const wordList& regNames = allGeometryPtr_().regionNames()[geomI];
352 Info<< surfaces().names()[surfI] <<
':' <<
nl <<
nl;
356 label patchI = meshRefinerPtr_().addMeshedPatch
359 wallPolyPatch::typeName
362 Info<< patchI <<
'\t' << regNames[i] <<
nl;
364 globalToPatch_[surfaces().globalRegion(surfI, i)] = patchI;
369 Info<<
"Added patches in = "
370 << mesh_.time().cpuTimeIncrement() <<
" s" <<
nl <<
endl;
429 "(const IOobject&, fvMesh&)")
430 <<
"You have selected decomposition method "
431 << decomposer.typeName
432 <<
" which is not parallel aware." << endl
433 <<
"Please select one that is (parMetis, hierarchical)"
457 meshRefinement::OBJINTERSECTIONS,
458 mesh_.time().path()/meshRefiner.
timeName()
461 Info<<
"Written mesh in = "
462 << mesh_.time().cpuTimeIncrement() <<
" s." <<
endl;
468 Switch wantRefine(dict_.lookup(
"doRefine"));
469 Switch wantSnap(dict_.lookup(
"doSnap"));
470 Switch wantLayers(dict_.lookup(
"doLayers"));
472 Info<<
"Do refinement : " << wantRefine <<
nl
473 <<
"Do snapping : " << wantSnap <<
nl
474 <<
"Do layers : " << wantLayers <<
nl
492 refineDriver.
doRefine(dict_, refineParams, wantSnap, motionDict);
495 writeMesh(
"Refined mesh");
512 snapDriver.
doSnap(snapDict, motionDict, snapParams);
515 writeMesh(
"Snapped mesh");
547 writeMesh(
"Layer mesh");