Skip to content

boundary_absorber

boundary_absorber

Rectangular absorbing-boundary augmentation for assembled meshes.

Attributes

FEMORA_MAX_NDF module-attribute

FEMORA_MAX_NDF = 9

Classes

Model

Model(**kwargs)

Root runtime object for Femora model construction, assembly, and export.

Initialize a Femora Model instance.

Parameters:

Name Type Description Default
**kwargs

Keyword arguments including: - model_name (str): Name of the model - model_path (str): Path to save the model

{}
Methods:
set_nodetag_start
set_nodetag_start(start_tag: int) -> None

Set the starting tag number for nodes in exported TCL.

Parameters:

Name Type Description Default
start_tag int

First node tag to use (must be >= 1)

required
set_eletag_start
set_eletag_start(start_tag: int) -> None

Set the starting tag number for elements in exported TCL.

Parameters:

Name Type Description Default
start_tag int

First element tag to use (must be >= 1)

required
set_start_core_tag
set_start_core_tag(start_tag: int) -> None

Set the starting tag number for cores in exported TCL.

Parameters:

Name Type Description Default
start_tag int

First core tag to use (must be >= 0)

required
export_to_tcl
export_to_tcl(filename=None, progress_callback=None, decimals=5)

Export the model to a TCL file

Parameters:

Name Type Description Default
filename str

The filename to export to. If None, uses model_name in model_path

None
progress_callback callable

Callback function to report progress. If None, uses tqdm progress bar.

None

Returns:

Name Type Description
bool

True if export was successful, False otherwise

Raises:

Type Description
ValueError

If no filename is provided and model_name/model_path are not set

export_to_vtk
export_to_vtk(filename=None, write_info_json=False, indent=2)

Export the model to a vtk file

Parameters:

Name Type Description Default
filename str

The filename to export to. If None, uses model_name in model_path

None
write_info_json bool

When True, also write a lightweight sidecar JSON file.

False
indent int

JSON indentation level for sidecar info.

2

Returns:

Name Type Description
bool

True if export was successful, False otherwise

export_to_json
export_to_json(filename=None, indent=2)

Export a lightweight structural snapshot of the model to JSON.

Parameters:

Name Type Description Default
filename str

The filename to export to. If None, uses model_name in model_path

None
indent int

JSON indentation level. Defaults to 2.

2

Returns:

Name Type Description
bool

True if export was successful

set_model_info
set_model_info(model_name=None, model_path=None)

Update model information

Parameters:

Name Type Description Default
model_name str

New model name

None
model_path str

New model path

None
set_results_folder
set_results_folder(folder_name)

Set the results folder for the model This method updates the results folder where simulation results will be stored.

Parameters:

Name Type Description Default
folder_name str

path to the results folder

required
get_results_folder
get_results_folder()

Get the current results folder path

Returns:

Name Type Description
str

The path to the results folder

get_femora_parts
get_femora_parts() -> list[dict]

Return a read-only snapshot of source parts registered for VTK export.

print_info
print_info()

Print information about the current model on the console

Returns:

Type Description

None

get_max_ele_tag
get_max_ele_tag()

Get the maximum element tag in the assembled mesh

Returns:

Type Description

positive int: maximum element tag

-1: if no mesh is assembled

get_max_node_tag
get_max_node_tag()

Get the maximum node tag in the assembled mesh

Returns:

Type Description

positive int: maximum node tag

-1: if no mesh is assembled

get_start_ele_tag
get_start_ele_tag()

Get the start element tag

Returns:

Name Type Description
int

start element tag

get_start_node_tag
get_start_node_tag()

Get the start node tag

Returns:

Name Type Description
int

start node tag

clear_model
clear_model()

Clear the current model and reset all components to their initial state. This method wipes the current mesh, materials, elements, constraints, and all other components, allowing you to start fresh without needing to create a new Model instance.

Functions:

_suppress_vtk_clip_warning

_suppress_vtk_clip_warning()

Suppress noisy VTK clip warnings for the rectangular absorber path.

_normalize_absorber_kwargs

_normalize_absorber_kwargs(*, num_layers: Optional[int] = None, num_partitions: Optional[int] = None, partition_algo: Optional[str] = None, geometry: Optional[str] = None, boundary_type: Optional[str] = None, rayleigh_damping: Optional[float] = None, match_damping: Optional[bool] = None, progress_callback: Optional[Callable] = None, **legacy_kwargs) -> dict

Normalize and validate keyword arguments for boundary absorber creation.

Parameters:

Name Type Description Default
num_layers Optional[int]

Number of absorbing cell layers.

None
num_partitions Optional[int]

Number of domain partitions/cores for parallel processing.

None
partition_algo Optional[str]

Partitioning algorithm. Must be "kd-tree" or "metis".

None
geometry Optional[str]

Boundary layer geometry. Must be "Rectangular" or "Cylindrical".

None
boundary_type Optional[str]

Boundary absorber formulation type. One of "PML", "Rayleigh", or "ASDA".

None
rayleigh_damping Optional[float]

Rayleigh damping factor. Defaults to 0.95.

None
match_damping Optional[bool]

If True, matches existing model damping rather than applying new.

None
progress_callback Optional[Callable]

Optional callback receiving float values to track progress.

None
**legacy_kwargs

Legacy snakeCase/camelCase arguments for backward compatibility.

{}

Returns:

Type Description
dict

A dictionary of normalized and validated parameter values.

Raises:

Type Description
TypeError

If required parameters are missing.

ValueError

If argument values are mathematically invalid or unsupported.

NotImplementedError

If unsupported experimental formulations are requested.

apply_rectangular_absorbing_layer

apply_rectangular_absorbing_layer(mesh_maker: 'Model', config: dict) -> bool

Apply a registered rectangular absorbing layer to the assembled mesh.

This function augments the assembled PyVista grid with PML or Rayleigh absorbing layers at the model boundaries (left, right, front, back, bottom) and registers the corresponding OpenSees elements and node constraints.

Parameters:

Name Type Description Default
mesh_maker 'Model'

The Model instance whose assembled mesh is to be augmented.

required
config dict

Dictionary containing normalized absorber parameters.

required

Returns:

Type Description
bool

True if the absorbing boundary was applied successfully.

Raises:

Type Description
ValueError

If no assembled mesh is found, if partitioning parameters are inconsistent, or if boundary element types or materials are incompatible.