polyfoammesh.gui.params_panel

Classes

ParamChangeCommand(key, old_val, new_val, panel)

ParamsPanel([parent])

class polyfoammesh.gui.params_panel.ParamChangeCommand(key, old_val, new_val, panel)[source]

Bases: QUndoCommand

Parameters:
undo(self, /) → None[source]
redo(self, /) → None[source]
class polyfoammesh.gui.params_panel.ParamsPanel(parent=None)[source]

Bases: QWidget

mesh_params_changed
run_meshing
reset_all
load_step_requested
cancel_meshing
unit_changed
param_changed
suggestion_completed
pick_refinement_requested
add_box_requested
refinements_changed
refinement_selection_changed

Index of the selected manual refinement BOX (0-based, boxes only), or -1 when the selection is a sphere/nothing. Lets the main window highlight the matching box in the 3D viewer.

set_undo_stack(stack)[source]
Parameters:

stack (QUndoStack)

is_expert_mode()[source]
Return type:

bool

set_expert_mode(enabled)[source]
Return type:

None

Parameters:

enabled (bool)

set_bbox(dx, dy, dz)[source]
Parameters:
set_suggest_meshes(meshes)[source]
Return type:

None

Parameters:

meshes (list)

set_cell_estimate(text)[source]
Parameters:

text (str)

set_geometry_cell_estimate(low, nominal, high)[source]

Set the pre-mesh estimate computed by the full pipeline.

The main window knows patch-specific refinement sizes, so its estimate is more representative than the panel-only volume fallback. Keep it as the source for the slider label too.

Parameters:
set_real_cell_count(count)[source]
Parameters:

count (int)

get_mesh_params()[source]
Return type:

dict

set_bl_enabled(enabled)[source]
Return type:

None

Parameters:

enabled (bool)

get_bl_enabled()[source]
Return type:

bool

get_bl_params()[source]
Return type:

dict | None

get_bl_apply_all()[source]
Return type:

bool

get_surface_resolution()[source]

Curvature-following preset derived from the Detail slider.

The slider already tells the app how fine the user wants the mesh; the curvature resolution follows it automatically (very coarse / coarse -> Coarse, medium -> Medium, fine / very fine -> Fine / Very fine). Callers pass it to gmsh_wrapper, which scales the curvature angular error accordingly.

Return type:

str

get_reuse_cached_mesh()[source]

Mesh-cache reuse is AUTOMATIC (no user knob): a cached tet mesh is reused whenever the sizing inputs are unchanged.

Return type:

bool

get_bl_wall_size_floor()[source]

Wall cell-size floor (metres) coupling the BL stack to the mesh.

stack / 5 capped at 10% of the geometry extent, or 0.0 (off) when BL is disabled. Returns 0.0 on any failure so meshing never blocks on this hint machinery.

Return type:

float

get_poly_conversion()[source]
Return type:

bool

get_detail_level()[source]

5-level detail derived from the 0..20 cell-count slider.

Return type:

str

get_target_cells()[source]

Target cell count driven by the Mesh Fineness slider.

Return type:

int

set_current_tab(index)[source]
Return type:

None

Parameters:

index (int)

get_mesher_type()[source]
Return type:

str

get_adaptive_sizing_enabled()[source]
Return type:

bool

get_max_cells_target()[source]

Target cell count (polymesh) — driven by the Mesh Fineness slider.

Return type:

int

get_manual_refinements()[source]

Return list of {centre, radius, cell_size} from manual zone entries.

Return type:

list[dict]

add_refinement_from_pick(cx, cy, cz)[source]

Add a refinement zone from a 3D pick — prompts for radius and cell size.

Parameters:
add_refinement_box(box)[source]

Add a box entry to the manual-refinement list.

Return type:

None

Parameters:

box (dict)

set_refinement_boxes(boxes)[source]

Replace the stored box entries after a viewer drag (same order).

Return type:

None

Parameters:

boxes (list)

selected_refinement_box_index()[source]

Index (among boxes) of the currently selected row, or -1.

Return type:

int

get_parallel_params()[source]

(enabled, n_cores) for MPI-parallel cartesianMesh.

Return type:

tuple[bool, int]

get_max_cell()[source]
Return type:

float

get_min_cell()[source]
Return type:

float

get_scale_factor()[source]
Return type:

float

get_patch_names()[source]

Names of the currently loaded geometry patches.

The viewer’s patch table is the single editable patch list; this panel no longer owns a patch widget (it was redundant). Names are derived from the meshes handed to set_suggest_meshes(), so callers that only need a count (e.g. enabling “Generate Mesh”) keep working unchanged.

Return type:

list[str]

set_case_dir(path)[source]
Parameters:

path (str)

set_meshing_enabled(enabled)[source]
Parameters:

enabled (bool)

cancel_button()[source]

The Cancel control, embedded by the main window below Reset All.

Return type:

QPushButton

set_all_enabled(enabled)[source]
Parameters:

enabled (bool)

set_meshing_state(running)[source]
Parameters:

running (bool)

trigger_meshing()[source]
get_openmp_params()[source]
Return type:

tuple[str, int | None]

save_params(s)[source]
restore_params(s)[source]
staticMetaObject = PySide6.QtCore.QMetaObject("ParamsPanel" inherits "QWidget": Methods:   #33 type=Signal, signature=mesh_params_changed(QVariantMap), parameters=QVariantMap   #34 type=Signal, signature=run_meshing()   #35 type=Signal, signature=reset_all()   #36 type=Signal, signature=load_step_requested()   #37 type=Signal, signature=cancel_meshing()   #38 type=Signal, signature=unit_changed(QString), parameters=QString   #39 type=Signal, signature=param_changed(QString,PyObject), parameters=QString, PyObject   #40 type=Signal, signature=suggestion_completed(QString), parameters=QString   #41 type=Signal, signature=pick_refinement_requested()   #42 type=Signal, signature=add_box_requested()   #43 type=Signal, signature=refinements_changed(PyObject), parameters=PyObject   #44 type=Signal, signature=refinement_selection_changed(int), parameters=int )