Model
Model
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 |
{}
|
Attributes
ground_motion
instance-attribute
pattern
instance-attribute
pattern = PatternManager(mesh_maker=self, time_series_manager=time_series, ground_motion_manager=ground_motion)
Methods:
set_nodetag_start
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 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 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 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 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 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
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 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 the current results folder path
Returns:
| Name | Type | Description |
|---|---|---|
str |
The path to the results folder |
get_femora_parts
Return a read-only snapshot of source parts registered for VTK export.
_register_femora_part
_assign_femora_part_data
_assign_femora_part_data(mesh, *, kind: str, name: str, source_tag: int | None = None) -> FemoraPart
print_info
Print information about the current model on the console
Returns:
| Type | Description |
|---|---|
|
None |
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 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 the start element tag
Returns:
| Name | Type | Description |
|---|---|---|
int |
start element tag |
get_start_node_tag
Get the start node tag
Returns:
| Name | Type | Description |
|---|---|---|
int |
start node tag |