polyfoammesh.core.boundary_reader
Functions
|
|
|
|
|
|
|
|
|
Rename a patch in |
|
Rename the patch entry in every |
Classes
|
- class polyfoammesh.core.boundary_reader.PatchInfo(name, patch_type, n_faces, start_face)[source]
Bases:
object
- polyfoammesh.core.boundary_reader.rename_boundary_patch(case_dir, old_name, new_name)[source]
Rename a patch in
constant/polyMesh/boundaryand back the file up.The generated-mesh rename path (the mandate’s “rinominare dopo il meshing”): validates the new name (non-empty, no structural/quote/whitespace chars, not already in use), copies
boundarytoboundary.bak(only if no backup exists yet, so the ORIGINAL is never overwritten), then rewrites the single standalone patch-name line. Everything else in the file — nFaces, startFace, type, physicalType, inGroups — is preserved byte-for-byte.Raises
FileNotFoundErrorwhen the case has no boundary file andValueErroron an invalid/missing/duplicate name.
- polyfoammesh.core.boundary_reader.rename_patch_in_fields(case_dir, old_name, new_name)[source]
Rename the patch entry in every
0/field’s boundaryField block.Renaming only
constant/polyMesh/boundaryis not enough: a field that still lists the old patch name makes OpenFOAM (and BaramFlow) abort on load with “cannot find patchField entry for <patch>”, and the BaramFlow export validation refuses the case (user report: missing-files popup after renaming patches). Each touched file is backed up to<name>.bakonce, like the boundary rewrite does. Best effort: unreadable files are skipped. Returns the files changed.