pyoomph.equations.solid module
- class pyoomph.equations.solid.BaseDeformableSolidEquations(mass_density=0, bulkforce=0, coordinate_space=None, first_order_time_derivative=False, scale_for_FSI=False, modulus_for_scaling=None, isotropic_growth_factor=1, pressure_space='DL', with_error_estimator=False, overdamped=False)[source]
Bases:
BaseMovingMeshEquationsBase class of the deformable solid equations, providing the inertia and bulk force terms and the scaling of the mesh (displacement) test function.
Note
Scaling to set on problem level. By default the mesh test function is scaled with
scale_factor("temporal")**2/(scale_factor("mass_density")*scale_factor("spatial")), somass_density– no field of the system – must be set byproblem.set_scaling(mass_density=...). Passingmodulus_for_scalingreplaces it by an elastic modulus, andscale_for_FSIreplaces it byscale_factor("pressure"), which then likewise has to be set on problem level unless the solid solves for a pressure field of its own (incompressible constitutive law).
- class pyoomph.equations.solid.BaseSolidConstitutiveLaw(use_subexpressions=True, use_inverse_routine=True, active_deformation=None)[source]
Bases:
objectBase class for solid constitutive laws. The method get_sigma must be implemented in derived classes.
- Parameters:
use_subexpressions – Use subexpressions for the tensor entries. Defaults to True.
use_inverse_routine (
bool) – Use a specific routine for the inversion of the metric tensor. It cannot be used when requiring Hessians, e.g. for bifurcation tracking. Defaults to True.active_deformation (
Expression|None) – Optional active deformation gradient F_a (multiplicative Kroener-Lee/growth split). The rest metric becomes F_a^T*g*F_a, i.e. strains are measured relative to an intrinsically deformed state - muscle-like actuation, anisotropic growth, swelling. May depend on the Lagrangian coordinates, time or other fields. Only F_a^T*F_a enters, so rotational parts of F_a are irrelevant. Since it only modifies the constitutive law, it exerts no net force or torque on a free body. See also active_fiber_deformation. Defaults to None.
- get_gij(dim, isotropic_growth_factor=1)[source]
Returns the covariant metric tensor of the undeformed configuration. Without growth and active deformation, this is the identity matrix in Cartesian coordinates. An active deformation gradient F_a turns it into the pulled-back rest metric F_a^T*g*F_a.
- get_sigma(dim, isotropic_growth_factor=1, pressure_var=None)[source]
Returns the second Piola-Kirchhoff stress tensor. The method must be implemented in derived classes.
- Parameters:
dim (
int) – Element dimension.isotropic_growth_factor (
Expression|GiNaC_GlobalParam|int|float|None) – Expression or numerical value representing the isotropic growth factor. Defaults to 1.pressure_var (
Expression|None) – Pressure variable for incompressible cases. Defaults to None.
- Return type:
- is_incompressible()[source]
If this returns True, the constitutive law is incompressible. This means that the determinant of the deformation gradient is equal to the determinant of the undeformed configuration. The solid equations will then introduce a pressure variable that is used to enforce this condition.
- Return type:
bool
- class pyoomph.equations.solid.DeformableSolidEquations(constitutive_law, mass_density=0, bulkforce=0, coordinate_space=None, first_order_time_derivative=False, pressure_space='DL', with_error_estimator=False, isotropic_growth_factor=1, modulus_for_scaling=None, scale_for_FSI=False, overdamped=False)[source]
Bases:
BaseDeformableSolidEquationsNonlinear solid elasticity equations for deformable solids. Requires a constitutive law, which gives the particular material properties.
- Args:
constitutive_law: Particular solid constitutive law, which must be derived from BaseSolidConstitutiveLaw. mass_density: Mass density (relevant for the inertia term in temporal dynamics). Defaults to 0. bulkforce: Bulk force density (in the undeformed frame!). Defaults to 0. coordinate_space: Space to use for the mesh. Defaults to None. first_order_time_derivative: If set, a velocity is explicitly introduced, reducing the maximum time derivative order to unity (good for eigenanalysis). Defaults to False. pressure_space: If the constitutive law is incompressible, a pressure field is required. This controls the space of the pressure. Defaults to “DL”. with_error_estimator: If set, error estimators based on the strain are introduced. Defaults to False. isotropic_growth_factor: Factor of growing with respect to the undeformed configuration. Defaults to 1. modulus_for_scaling: By default, nondimensionalization is made with respect to the scales
mass_density,spatialandtemporal. Here, you can set a reference Young’s modulus to nondimensionalize with respect to this instead. Defaults to None. scale_for_FSI: If set, the scaling of the test function agrees with the scaling of the velocity test function ([X]/[P]). This is important to balance the tractions correctly
Note
Scaling to set on problem level. Unless
modulus_for_scalingorscale_for_FSIis given, the mesh test function is scaled with the non-field scalemass_density, i.e.problem.set_scaling(mass_density=...)is required. SeeBaseDeformableSolidEquations.
- class pyoomph.equations.solid.FSIConnection(*, velocity_offset=0)[source]
Bases:
InterfaceEquationsCan be added to the fluid side of a fluid-structure interaction interface to couple the mesh deformation and the velocity.
- Parameters:
velocity_offset (
Expression|GiNaC_GlobalParam|int|float) – An offset to the velocity. You can e.g. add/substract a normal velocity to allow for fluid penetration into the solid.
- class pyoomph.equations.solid.GeneralizedHookeanSolidConstitutiveLaw(E=1, nu=0.4, use_subexpressions=True, use_inverse_routine=True, active_deformation=None)[source]
Bases:
BaseSolidConstitutiveLawGeneralized Hookean solid constitutive law.
- Parameters:
E (
Expression|GiNaC_GlobalParam|int|float) – Young’s modulusnu (
Expression|GiNaC_GlobalParam|int|float) – Poisson’s ratiouse_subexpressions (bool, optional) – Use subexpressions for the tensor entries. Defaults to True.
use_inverse_routine (
bool) – Use a specific routine for the inversion of the metric tensor. It cannot be used when requiring Hessians, e.g. for bifurcation tracking. Defaults to True.active_deformation (
Expression|None) – Active deformation gradient F_a, see BaseSolidConstitutiveLaw. Defaults to None.
- class pyoomph.equations.solid.IncompressibleHookeanSolidConstitutiveLaw(E=1, use_subexpressions=True, use_inverse_routine=True, active_deformation=None)[source]
Bases:
IncompressibleSolidConstitutiveLawIncompressible Hookean solid constitutive law. :type E:
Expression|GiNaC_GlobalParam|int|float:param E: Young’s modulus :type use_subexpressions: bool, optional :param use_subexpressions: Use subexpressions for the tensor entries. Defaults to True. :type use_subexpressions: bool, optional :param use_inverse_routine: Use a specific routine for the inversion of the metric tensor. It cannot be used when requiring Hessians, e.g. for bifurcation tracking. Defaults to True. :type use_inverse_routine:bool:param active_deformation: Active deformation gradient F_a, see BaseSolidConstitutiveLaw. Note that the incompressibility constraint det G = det g then enforces the actual volume to follow det F_a - use a volume-preserving F_a (e.g. active_fiber_deformation with isochoric_dim) for pure actuation. Defaults to None. :type active_deformation:Expression|None
- class pyoomph.equations.solid.IncompressibleSolidConstitutiveLaw(use_subexpressions=True, use_inverse_routine=True, active_deformation=None)[source]
Bases:
BaseSolidConstitutiveLawBase class for incompressible solid constitutive laws. The method get_sigma must be implemented in derived classes.
- class pyoomph.equations.solid.LinearElasticitySolidEquations(E, nu, mass_density=0, bulkforce=0, coordinate_space=None, first_order_time_derivative=False, scale_for_FSI=False, modulus_for_scaling=None, isotropic_growth_factor=1, pressure_space='DL', with_error_estimator=False)[source]
Bases:
BaseDeformableSolidEquationsLinear elasticity, i.e. the Cauchy stress
E/(1+nu)*(nu/(1-2*nu)*trace(eps)+eps)of the linearized straineps=sym(grad(u,lagrangian=True)). Fornu=Noneornu=1/2, the incompressible limit is solved with a pressure Lagrange multiplier instead.See
BaseDeformableSolidEquationsfor the scalings that must be set on problem level.- Parameters:
E (
Expression|GiNaC_GlobalParam|int|float) – Young’s modulus.nu (
Expression|GiNaC_GlobalParam|int|float|None) – Poisson’s ratio.Noneor1/2selects the incompressible formulation.mass_density – Mass density, relevant for the inertia term. Defaults to 0.
bulkforce – Bulk force density (in the undeformed frame!). Defaults to 0.
coordinate_space – Space to use for the mesh. Defaults to None.
first_order_time_derivative – If set, a velocity is explicitly introduced, reducing the maximum time derivative order to unity (good for eigenanalysis). Defaults to False.
scale_for_FSI – Scale the mesh test function as the velocity test function ([X]/[P]), which balances the tractions of a coupled fluid correctly. Defaults to False.
modulus_for_scaling – Reference modulus to nondimensionalize with, instead of the mass density. Defaults to None.
isotropic_growth_factor (
Expression|GiNaC_GlobalParam|int|float) – Factor of growing with respect to the undeformed configuration.pressure_space (
Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']) – Space of the pressure field in the incompressible case. Defaults to “DL”.with_error_estimator – If set, error estimators based on the strain are introduced.
- class pyoomph.equations.solid.SolidNormalTraction(P)[source]
Bases:
SolidTractionImposes a normal traction on the solid interface. This is used to apply pressure loads on the solid surface.
- Parameters:
P (
Expression|GiNaC_GlobalParam|int|float) – Pressure to apply
- class pyoomph.equations.solid.SolidTraction(T)[source]
Bases:
InterfaceEquationsImposes a traction vector on the solid interface.
- Parameters:
T (
Expression|GiNaC_GlobalParam|int|float) – traction to apply
- pyoomph.equations.solid.active_fiber_deformation(direction, stretch, isochoric_dim=None)[source]
Active deformation gradient for a single fiber family: F_a = stretch*(d⊗d) + t*(1-d⊗d) with the normalized fiber direction d, i.e. an intrinsic stretch along the (possibly spatially varying) direction. With isochoric_dim set to the problem dimension, the transverse factor t=stretch^(-1/(dim-1)) compensates the volume (muscle-like, det F_a=1 within the element dimension); otherwise t=1 and det F_a=stretch (growth along the fiber).
- Parameters:
direction (
Expression) – Fiber direction (any nonzero vector expression, normalized internally). May vary in space, e.g. follow a midline.stretch (
Expression|GiNaC_GlobalParam|int|float) – Intrinsic stretch factor along the fiber, e.g. 1+kappa*Y for a bending actuation.isochoric_dim (
int|None) – If set, compensate transversally so the activation is volume-preserving in this dimension. Defaults to None.
- Return type: