Feb25

class febio_python.feb._feb_25.Feb25(tree: ElementTree | None = None, root: Element | None = None, filepath: str | Path | None = None)[source]
add_boundary_conditions(boundary_conditions: List[BoundaryCondition]) None[source]

Adds boundary conditions to Boundary.

Parameters:

boundary_conditions (list of BoundaryCondition) – List of boundary condition objects.

add_discrete_materials(materials: List[DiscreteMaterial]) None[source]

Adds discrete materials to Discrete.

Parameters:

materials (list of Material) – List of Material objects, each containing an ID, type, parameters, name, and attributes.

add_discrete_sets(discrete_sets: List[DiscreteSet]) None[source]

Adds discrete sets to Geometry, appending to existing discrete sets if they share the same name.

Parameters:

discrete_sets (list of DiscreteSet) – List of DiscreteSet objects, each containing a name and element IDs.

add_element_data(element_data: List[ElementData]) None[source]

Adds element data to MeshData, appending to existing element data if they share the same element set.

Parameters:

element_data (list of ElementData) – List of ElementData objects, each containing an element set, name, and data.

add_element_sets(elementsets: List[ElementSet]) None[source]

Adds element sets to Geometry, appending to existing element sets if they share the same name.

Parameters:

elementsets (list of ElementSet) – List of ElementSet objects, each containing a name and element IDs.

add_elements(elements: List[Elements]) None[source]

Adds elements to Geometry, appending to existing elements if they share the same name. Automatically detects the highest element ID to ensure unique IDs for new elements.

Parameters:

elements (list of Elements) – List of Elements objects, each containing name, material, type, and connectivity.

Raises:

ValueError – If any element connectivity does not meet expected format or length.

add_load_curves(load_curves: List[LoadCurve]) None[source]

Adds load curves to LoadData, appending to existing load curves if they share the same ID.

Parameters:

load_curves (list of LoadCurve) – List of LoadCurve objects, each containing an ID, type, and data.

add_materials(materials: List[Material]) None[source]

Adds materials to Material, appending to existing materials if they share the same ID.

Parameters:

materials (list of Material) – List of Material objects, each containing an ID, type, parameters, name, and attributes.

add_nodal_data(nodal_data: List[NodalData]) None[source]

Adds nodal data to MeshData

Parameters:

nodal_data (list of NodalData) – List of NodalData objects, each containing a node set, name, and data.

add_nodal_loads(nodal_loads: List[NodalLoad]) None[source]

Adds nodal loads to Loads.

Parameters:

nodal_loads (list of NodalLoad) – List of NodalLoad objects, each containing a boundary condition, node set, scale, and load curve.

add_node_sets(nodesets: List[NodeSet]) None[source]

Adds node sets to Geometry, appending to existing node sets if they share the same name.

Parameters:

nodesets (list of NodeSet) – List of NodeSet objects, each containing a name and node IDs.

add_nodes(nodes: List[Nodes]) None[source]

Adds nodes to Geometry, appending to existing nodes if they share the same name. Automatically detects the highest node ID to ensure unique IDs for new nodes.

Parameters:

nodes (list of Nodes) – List of Nodes objects, each containing a name and coordinates.

Raises:

ValueError – If any node coordinates do not consist of three elements.

add_surface_data(surface_data: List[SurfaceData]) None[source]

Adds surface data to MeshData, appending to existing surface data if they share the same surface set.

Parameters:

surface_data (list of SurfaceData) – List of SurfaceData objects, each containing a surface set, name, and data.

add_surface_loads(pressure_loads: List[SurfaceLoad]) None[source]

Adds pressure loads to Loads.

Parameters:

pressure_loads (list of SurfaceLoad) – List of SurfaceLoad objects, each containing a surface, attributes, and multiplier.

add_surface_sets(surfacesets: List[SurfaceSet]) None[source]

Adds surface sets to Geometry, appending to existing surface sets if they share the same name.

Parameters:

surfacesets (list of SurfaceSet) – List of SurfaceSet objects, each containing a name and node IDs.

clear(nodes=True, elements=True, surfaces=True, volumes=True, nodesets=True, surfacesets=True, elementsets=True, materials=True, nodal_loads=True, pressure_loads=True, loadcurves=True, boundary_conditions=True, nodal_data=True, surface_data=True, element_data=True) None[source]

Clears the FEBio model of all data, based on the specified options.

Parameters:
  • nodes (bool) – Remove all nodes.

  • elements (bool) – Remove all elements.

  • surfaces (bool) – Remove all surface elements.

  • volumes (bool) – Remove all volume elements.

  • nodesets (bool) – Remove all node sets.

  • surfacesets (bool) – Remove all surface sets.

  • elementsets (bool) – Remove all element sets.

  • materials (bool) – Remove all materials.

  • nodal_loads (bool) – Remove all nodal loads.

  • pressure_loads (bool) – Remove all pressure loads.

  • loadcurves (bool) – Remove all load curves.

  • boundary_conditions (bool) – Remove all boundary conditions.

  • nodal_data (bool) – Remove all nodal data.

  • surface_data (bool) – Remove all surface data.

  • element_data (bool) – Remove all element data.

clear_boundary_conditions() None[source]

Removes all boundary conditions from Boundary.

clear_discrete_materials() None[source]

Removes all discrete materials from Discrete.

clear_discrete_sets() None[source]

Removes all discrete sets from Geometry.

clear_element_data() None[source]

Removes all element data from MeshData.

clear_element_sets() None[source]

Removes all element sets from Geometry.

clear_elements() None[source]

Removes all elements from Geometry.

clear_load_curves() None[source]

Removes all load curves from LoadData.

clear_materials() None[source]

Removes all materials from Material.

clear_nodal_data() None[source]

Removes all nodal data from MeshData.

clear_nodal_loads() None[source]

Removes all nodal loads from Loads.

clear_node_sets() None[source]

Removes all node sets from Geometry.

clear_nodes() None[source]

Removes all nodes from Geometry.

clear_surface_data() None[source]

Removes all surface data from MeshData.

clear_surface_elements() None[source]

Removes all surface elements from Geometry.

clear_surface_loads() None[source]

Removes all pressure loads from Loads.

clear_surface_sets() None[source]

Removes all surface sets from Geometry.

clear_volume_elements() None[source]

Removes all volume elements from Geometry.

get_element_sets(dtype=<class 'numpy.int64'>) List[ElementSet][source]

Returns a dict with keys representing node set names and values representing corresponding node ids as a numpy array of specified dtype. :param dtype: Numpy dtype. :type dtype: np.dtype

Returns:

[ElementSet(name, node_ids)]

Return type:

list

get_node_sets(dtype=<class 'numpy.int64'>) List[NodeSet][source]

Returns a dict with keys representing node set names and values representing corresponding node ids as a numpy array of specified dtype. :param dtype: Numpy dtype. :type dtype: np.dtype

Returns:

[Nodeset(name, node_ids)]

Return type:

list

get_surface_sets(dtype=<class 'numpy.int64'>) List[SurfaceSet][source]

Returns a dict with keys representing node set names and values representing corresponding node ids as a numpy array of specified dtype. :param dtype: Numpy dtype. :type dtype: np.dtype

Returns:

[SurfaceSet(name, node_ids)]

Return type:

list

remove_all_surface_elements() None[source]

Removes all surface elements from Geometry.

remove_all_volume_elements() None[source]

Removes all volume elements from Geometry.

remove_boundary_conditions(types: List[str], bc: List[str] | None = None) None[source]

Removes boundary conditions from Boundary by type and optionally fiter type by boundary condition. e.g. remove_boundary_conditions([“fix”], [“BC1”]), instead of removing all fix conditions, only BC1 will be removed.

Parameters:
  • types (list of str) – List of boundary condition types to remove.

  • bc (list of str) – List of boundary conditions to remove.

remove_discrete_materials(ids: List[str | int]) None[source]

Removes discrete materials from Discrete by ID, name or type.

Parameters:

ids (list of int) – List of discrete material IDs, types, remove.

remove_discrete_sets(names: List[str]) None[source]

Removes discrete sets from Geometry by name.

Parameters:

names (list of str) – List of discrete set names to remove.

remove_element_data(elementsets_or_names: List[str]) None[source]

Removes element data from MeshData by elem_set or name.

Parameters:

elementsets_or_names (list of str) – List of element sets or names to remove.

remove_element_sets(names: List[str]) None[source]

Removes element sets from Geometry by name.

Parameters:

names (list of str) – List of element set names to remove.

remove_elements(names: List[str]) None[source]

Removes elements from Geometry by name.

Parameters:

names (list of str) – List of element names to remove.

remove_load_curves(ids: List[int]) None[source]

Removes load curves from LoadData by ID.

Parameters:

ids (list of int) – List of load curve IDs to remove.

remove_materials(ids: List[str | int]) None[source]

Removes materials from Material by ID, name or type.

Parameters:

ids (list of int) – List of material IDs, types, remove.

remove_nodal_data(nodesets_or_names: List[str]) None[source]

Removes nodal data from MeshData by node_set or name.

Parameters:

nodesets_or_names (list of str) – List of node sets or names to remove.

remove_nodal_loads(bc_or_node_sets: List[str]) None[source]

Removes nodal loads from Loads by boundary condition or node set.

Parameters:

bc_or_node_sets (list of str) – List of boundary conditions or node sets to remove.

remove_node_sets(names: List[str]) None[source]

Removes node sets from Geometry by name.

Parameters:

names (list of str) – List of node set names to remove.

remove_nodes(names: List[str]) None[source]

Removes nodes from Geometry by name.

Parameters:

names (list of str) – List of node names to remove.

remove_surface_data(surfacesets_or_names: List[str]) None[source]

Removes surface data from MeshData by surf_set or name.

Parameters:

surfacesets_or_names (list of str) – List of surface sets or names to remove.

remove_surface_loads(surfaces: List[str]) None[source]

Removes pressure loads from Loads by surface.

Parameters:

surfaces (list of str) – List of surfaces to remove.

remove_surface_sets(names: List[str]) None[source]

Removes surface sets from Geometry by name.

Parameters:

names (list of str) – List of surface set names to remove.

setup_controls(analysis_type='static', time_steps=10, step_size=0.1, max_refs=15, max_ups=10, diverge_reform=1, reform_each_time_step=1, dtol=0.001, etol=0.01, rtol=0, lstol=0.9, min_residual=1e-20, qnmethod='BFGS', rhoi=0, dtmin=0.01, dtmax=0.1, max_retries=5, opt_iter=10, must_points=False, integration_rule_ut4=False, integration_rule_ut4_alpha=0.05, integration_rule_ut4_iso_stap=True, **control_settings)[source]

Set up or replace the control settings in an FEBio .feb file.

Parameters:
  • analysis_type (str) – Type of analysis (e.g., ‘static’).

  • time_steps (int) – Number of time steps.

  • step_size (float) – Time step size.

  • max_refs (int) – Maximum number of reformations.

  • max_ups (int) – Maximum number of updates.

  • diverge_reform (int) – Flag for divergence reform.

  • reform_each_time_step (int) – Flag to reform each time step.

  • dtol (float) – Displacement tolerance.

  • etol (float) – Energy tolerance.

  • rtol (float) – Residual tolerance.

  • lstol (float) – Line search tolerance.

  • min_residual (float) – Minimum residual.

  • qnmethod (int) – Quasi-Newton method.

  • rhoi (int) – Rhoi parameter.

  • dtmin (float) – Minimum time step size.

  • dtmax (float) – Maximum time step size.

  • max_retries (int) – Maximum retries.

  • opt_iter (int) – Optimal iterations.

  • **control_settings – Additional control settings to add to the control element. Any nested elements should be passed as dictionaries.

setup_globals(T=0, R=0, Fc=0)[source]

Set up or replace the globals settings in an FEBio .feb file.

Parameters:
  • T (float) – Temperature constant.

  • R (float) – Universal gas constant.

  • Fc (float) – Force constant.

Returns:

None

setup_output(variables=None)[source]

Set up or replace the output settings in an FEBio .feb file.

Parameters:

variables (list of str) – List of variables to output. If None, defaults to a predefined set.

Returns:

None

update_boundary_conditions(boundary_conditions: List[FixCondition | RigidBodyCondition | BoundaryCondition]) None[source]

Updates boundary conditions in Boundary, replacing existing boundary conditions with the same type.

Parameters:

boundary_conditions (list of Union[FixCondition, RigidBodyCondition, BoundaryCondition]) – List of boundary condition objects.

update_element_data(element_data: List[ElementData]) None[source]

Updates element data in MeshData by element set, replacing existing element data with the same element set.

Parameters:

element_data (list of ElementData) – List of ElementData objects, each containing an element set, name, and data.

update_element_sets(elementsets: List[ElementSet]) None[source]

Updates element sets in Geometry by name, replacing existing element sets with the same name.

Parameters:

elementsets (list of ElementSet) – List of ElementSet objects, each containing a name and element IDs.

update_elements(elements: List[Elements]) None[source]

Updates elements in Geometry by name, replacing existing elements with the same name.

Parameters:

elements (list of Elements) – List of Elements objects, each containing name, material, type, and connectivity.

update_load_curves(load_curves: List[LoadCurve]) None[source]

Updates load curves in LoadData by ID, replacing existing load curves with the same ID.

Parameters:

load_curves (list of LoadCurve) – List of LoadCurve objects, each containing an ID, type, and data.

update_materials(materials: List[Material]) None[source]

Updates materials in Material by ID, replacing existing materials with the same ID.

Parameters:

materials (list of Material) – List of Material objects, each containing an ID, type, parameters, name, and attributes.

update_nodal_data(nodal_data: List[NodalData]) None[source]

Updates nodal data in MeshData by node set, replacing existing nodal data with the same node set.

Parameters:

nodal_data (list of NodalData) – List of NodalData objects, each containing a node set, name, and data.

update_nodal_loads(nodal_loads: List[NodalLoad]) None[source]

Updates nodal loads in Loads by node set, replacing existing nodal loads with the same node set.

Parameters:

nodal_loads (list of NodalLoad) – List of NodalLoad objects, each containing a boundary condition, node set, scale, and load curve.

update_node_sets(nodesets: List[NodeSet]) None[source]

Updates node sets in Geometry by name, replacing existing node sets with the same name.

Parameters:

nodesets (list of NodeSet) – List of NodeSet objects, each containing a name and node IDs.

update_nodes(nodes: List[Nodes]) None[source]

Updates nodes in Geometry by name, replacing existing nodes with the same name.

Parameters:

nodes (list of Nodes) – List of Nodes objects, each containing a name and coordinates.

update_surface_data(surface_data: List[SurfaceData]) None[source]

Updates surface data in MeshData by surface set, replacing existing surface data with the same surface set.

Parameters:

surface_data (list of SurfaceData) – List of SurfaceData objects, each containing a surface set, name, and data.

update_surface_loads(pressure_loads: List[SurfaceLoad]) None[source]

Updates pressure loads in Loads by surface, replacing existing pressure loads with the same surface.

Parameters:

pressure_loads (list of SurfaceLoad) – List of SurfaceLoad objects, each containing a surface, attributes, and multiplier.

update_surface_sets(surfacesets: List[SurfaceSet]) None[source]

Updates surface sets in Geometry by name, replacing existing surface sets with the same name.

Parameters:

surfacesets (list of SurfaceSet) – List of SurfaceSet objects, each containing a name and node IDs.