From 8db545992ff6651587f87b895cc1533b125a2c71 Mon Sep 17 00:00:00 2001 From: srosenbu Date: Mon, 22 Jan 2024 13:37:32 +0100 Subject: [PATCH] doctstring --- src/fenics_constitutive/conversion.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fenics_constitutive/conversion.py b/src/fenics_constitutive/conversion.py index 6161917..739181c 100644 --- a/src/fenics_constitutive/conversion.py +++ b/src/fenics_constitutive/conversion.py @@ -4,13 +4,16 @@ __all__ = ["strain_from_grad_u"] def strain_from_grad_u(grad_u: np.ndarray, constraint: Constraint) -> np.ndarray: - """Compute the Mandel-strain from the gradient of displacement. + """ + Compute the Mandel-strain from the gradient of displacement (or increments of both + quantities). Parameters: grad_u: Gradient of displacement field. + constraint: Constraint that the model is implemented for. Returns: - Strain tensor. + Numpy array containing the strain for all IPs. """ strain_dim = constraint.stress_strain_dim() n_gauss = int(grad_u.size / (constraint.geometric_dim()**2)) @@ -72,6 +75,6 @@ def strain_from_grad_u(grad_u: np.ndarray, constraint: Constraint) -> np.ndarray strain_view[:,4] = 1/2**0.5 * (grad_u_view[:,5] + grad_u_view[:,7]) strain_view[:,5] = 1/2**0.5 * (grad_u_view[:,2] + grad_u_view[:,6]) case _: - raise NotImplementedError("Only full constraint implemented") + raise NotImplementedError("Constraint not supported.") return strain \ No newline at end of file