MechanicsDynaWriter#

class ansys.health.heart.writer.mechanics_writer.MechanicsDynaWriter(model: ansys.health.heart.models.HeartModel, settings: ansys.health.heart.settings.settings.SimulationSettings | None = None)#

Bases: ansys.health.heart.writer.base_writer.BaseDynaWriter

Class for preparing the input for a mechanics LS-DYNA simulation.

Overview#

update

Update the keyword database.

write_robin_bc

Create Robin boundary condition on a given surface.

kw_database

Collection of keyword decks relevant for mechanics.

set_flow_area

Flag indicating if the flow area is set for control volume.

Import detail#

from ansys.health.heart.writer.mechanics_writer import MechanicsDynaWriter

Attribute detail#

MechanicsDynaWriter.kw_database#

Collection of keyword decks relevant for mechanics.

MechanicsDynaWriter.set_flow_area: bool = True#

Flag indicating if the flow area is set for control volume.

Method detail#

MechanicsDynaWriter.update(dynain_name: str | None = None, robin_bcs: list[Callable] = None) None#

Update the keyword database.

Parameters:
dynain_namestr, default: None

Dynain file from stress-free configuration computation.

robin_bcslist[Callable], default: None

List of lambda functions to apply Robin-type coundary conditions.

Notes

You do not need to write mesh files if a Dynain file is given.

MechanicsDynaWriter.write_robin_bc(robin_type: Literal['spring', 'damper'], constant: float, surface: pyvista.PolyData, normal: numpy.ndarray | None = None) list#

Create Robin boundary condition on a given surface.

Parameters:
robin_typeLiteral[“spring”, “damper”]

Create spring or damper.

constantfloat

Stiffness (MPa/mm) or viscosity (MPa/mm*ms).

surfacepv.PolyData

Surface to apply boundary condition to. It must contain point data _global-point-ids. It is scaled by the nodal area and point data scale factor if it exists.

normalnp.ndarray, default: None

Normal values. If no normal values are given, nodal normals are used.

Returns:
list

List of the DYNA input deck.