From 9f7f49839b0e6164906aa0731eb656a2cded5878 Mon Sep 17 00:00:00 2001 From: Gerard Capes Date: Thu, 26 Mar 2026 12:37:14 +0000 Subject: [PATCH] Add zero_normal_stress load case - Rename previous `null` loadcase to `zero deformation` - Add new load case for zero normal stress --- matflow/param_classes/load.py | 37 +++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/matflow/param_classes/load.py b/matflow/param_classes/load.py index 0125c017..cec5e669 100644 --- a/matflow/param_classes/load.py +++ b/matflow/param_classes/load.py @@ -277,7 +277,7 @@ def example_uniaxial(cls) -> Self: ) @classmethod - def null( + def zero_deformation( cls, total_time: float | int, num_increments: int, @@ -286,7 +286,7 @@ def null( target_def_grad = np.eye(3) - _method_name = "null" + _method_name = "zero_deformation" _method_args = { "total_time": total_time, "num_increments": num_increments, @@ -298,6 +298,30 @@ def null( target_def_grad=target_def_grad, ) + @classmethod + def zero_normal_stress( + cls, + total_time: float | int, + num_increments: int, + ) -> Self: + """A zero normal stress load step""" + + target_def_grad = np.ma.masked_array(np.zeros((3, 3)), mask=np.eye(3)) + stress = np.ma.masked_array(np.zeros((3, 3)), mask=np.logical_not(np.eye(3))) + + _method_name = "zero_normal_stress" + _method_args = { + "total_time": total_time, + "num_increments": num_increments, + } + + return cls( + total_time=total_time, + num_increments=num_increments, + target_def_grad=target_def_grad, + stress=stress, + ) + @classmethod def uniaxial( cls, @@ -1142,9 +1166,14 @@ def create_damask_loading_plan(self) -> list[dict[str, Any]]: return load_steps @classmethod - def null(cls, **kwargs) -> Self: + def zero_deformation(cls, **kwargs) -> Self: """A zero deformation load case""" - return cls(steps=[LoadStep.null(**kwargs)]) + return cls(steps=[LoadStep.zero_deformation(**kwargs)]) + + @classmethod + def zero_normal_stress(cls, **kwargs) -> Self: + """A zero normal stress load case""" + return cls(steps=[LoadStep.zero_normal_stress(**kwargs)]) @classmethod def uniaxial(cls, **kwargs) -> Self: