Feb40¶
- class febio_python.feb._feb_40.Feb40(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 Union[FixCondition, RigidBodyCondition, BoundaryCondition]) – List of boundary condition namedtuples.
- 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, each containing an ID, type, parameters, name, and attributes.
- add_nodal_data(nodal_data: List[NodalData]) None [source]¶
Adds nodal data to MeshData, appending to existing nodal data if they share the same node set.
- Parameters:
nodal_data (list of NodalData) – List of NodalData namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, each containing a surface set, name, and data.
- add_surface_loads(pressure_loads: List[SurfaceLoad]) None [source]¶
Adds pressure loads to Loads, appending to existing pressure loads if they share the same surface.
- Parameters:
pressure_loads (list of SurfaceLoad) – List of SurfaceLoad namedtuples, 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 namedtuples, 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.
- 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_boundary_conditions(types: List[str], names: List[str] | None = None) None [source]¶
Removes boundary conditions from the Boundary section by type and optionally filters type by name. e.g., remove_boundary_conditions([“fix”], [“FixedDisplacement01”]), instead of removing all fix conditions, only “FixedDisplacement01” will be removed.
- Parameters:
types (list of str) – List of boundary condition types to remove.
names (list of str) – Optional list of boundary condition names to specifically target for removal.
- 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_mesh_domains(identifiers: List[str]) None [source]¶
Removes domains from MeshDomains by id, name, or material.
- Parameters:
identifiers (list of str) – List of ids, names, or materials to 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(name_or_dof_or_node_sets: List[str]) None [source]¶
Removes nodal loads from Loads by name, degrees of freedom, or node set.
- Parameters:
name_or_dof_or_node_sets (list of str) – List of names, degrees of freedom, 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='STATIC', time_steps=10, step_size=0.1, plot_zero_state: bool = True, plot_range=(0, 1), plot_level='PLOT_MAJOR_ITRS', output_level='OUTPUT_MAJOR_ITRS', plot_stride=1, output_stride=1, adaptor_re_solve=1, solver_type='solid', symmetric_stiffness='symmetric', equation_scheme='staggered', equation_order='default', optimize_bw=0, lstol=0.75, lsmin=0.01, lsiter=5, max_refs=15, check_zero_diagonal=0, zero_diagonal_tol=0, force_partition=0, reform_each_time_step=1, reform_augment=0, diverge_reform=1, min_residual=1e-20, max_residual=0, dtol=0.001, etol=0.01, rtol=0, alpha=1, beta=0.25, gamma=0.5, logSolve=0, arc_length=0, arc_length_scale=0, qn_method_type='BFGS', max_ups=10, max_buffer_size=0, cycle_buffer=1, cmax=100000, qnmethod=0, rhoi=0, time_stepper_type='default', max_retries=5, opt_iter=10, dtmin=0.01, dtmax=0.1, aggressiveness=0, cutback=0.5, dtforce=0, **control_settings)[source]¶
Set up control settings in an FEBio .feb file.
- Parameters:
analysis (str) – Analysis type.
time_steps (int) – Number of time steps.
step_size (float) – Size of each time step.
plot_zero_state (bool) – Whether to plot zero state.
plot_range (tuple) – Range of plot.
plot_level (str) – Level of plot.
output_level (str) – Level of output.
plot_stride (int) – Plot stride.
output_stride (int) – Output stride.
adaptor_re_solve (int) – Adaptor resolve setting.
solver_type (str) – Type of solver.
symmetric_stiffness (str) – Symmetric stiffness setting.
equation_scheme (str) – Equation scheme.
equation_order (str) – Equation order.
optimize_bw (int) – Optimize bandwidth.
lstol (float) – Line search tolerance.
lsmin (float) – Minimum line search.
lsiter (int) – Line search iterations.
max_refs (int) – Maximum refinements.
check_zero_diagonal (int) – Check zero diagonal.
zero_diagonal_tol (int) – Zero diagonal tolerance.
force_partition (int) – Force partition.
reform_each_time_step (int) – Reform each time step.
reform_augment (int) – Reform augment.
diverge_reform (int) – Diverge reform.
min_residual (float) – Minimum residual.
max_residual (int) – Maximum residual.
dtol (float) – Displacement tolerance.
etol (float) – Energy tolerance.
rtol (int) – Residual tolerance.
alpha (int) – Alpha value.
beta (float) – Beta value.
gamma (float) – Gamma value.
logSolve (int) – Log solve setting.
arc_length (int) – Arc length.
arc_length_scale (int) – Arc length scale.
qn_method_type (str) – Quasi-Newton method type.
max_ups (int) – Maximum ups.
max_buffer_size (int) – Maximum buffer size.
cycle_buffer (int) – Cycle buffer.
cmax (int) – Maximum cycles.
qnmethod (int) – Quasi-Newton method.
rhoi (int) – Rho I.
time_stepper_type (str) – Time stepper type.
max_retries (int) – Maximum retries.
opt_iter (int) – Optimizer iterations.
dtmin (float) – Minimum time step.
dtmax (float) – Maximum time step.
aggressiveness (int) – Aggressiveness level.
cutback (float) – Cutback value.
dtforce (int) – Force time step.
control_settings (dict) – Additional control settings.
- setup_globals(T=0, P=0, R=0, Fc=0)[source]¶
Set up or replace the globals settings in an FEBio .feb file.
- Parameters:
T (float) – Temperature constant.
P (float) – Pressure 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 namedtuples.
- 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, each containing an ID, type, parameters, name, and attributes.
- update_mesh_domains(domains: List[GenericDomain | ShellDomain]) None [source]¶
Updates mesh domains in MeshDomains by name, replacing existing mesh domains with the same name.
- Parameters:
domains (list of Union[GenericDomain, ShellDomain]) – List of domain namedtuples.
- 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, 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 namedtuples, each containing a name and node IDs.