From 13810fb96ecd26911c400a9098b415492c352565 Mon Sep 17 00:00:00 2001 From: Marc Hirschvogel Date: Wed, 25 Sep 2024 10:34:24 +0200 Subject: [PATCH] Fix for constraints --- src/ambit_fe/variationalform.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ambit_fe/variationalform.py b/src/ambit_fe/variationalform.py index 124a50d..7cfe9a7 100644 --- a/src/ambit_fe/variationalform.py +++ b/src/ambit_fe/variationalform.py @@ -150,20 +150,20 @@ def deltaW_ext_membrane(self, F, Fdot, a, params, dboundary, ivar=None, fibfnc=N if active is not None: tau = ivar['tau_a'] + if actweight is not None: + w_act = actweight + else: + w_act = 1.0 if params['active_stress']['dir']=='cl': c0, l0 = fibfnc[0], fibfnc[1] omega, iota, gamma = params['active_stress']['omega'], params['active_stress']['iota'], params['active_stress']['gamma'] - S_act = tau * ( omega*ufl.outer(c0,c0) + iota*ufl.outer(l0,l0) + 2.*gamma*ufl.sym(ufl.outer(c0,l0)) ) - dS_act = omega*ufl.outer(c0,c0) + iota*ufl.outer(l0,l0) + 2.*gamma*ufl.sym(ufl.outer(c0,l0)) + S_act = w_act * tau * ( omega*ufl.outer(c0,c0) + iota*ufl.outer(l0,l0) + 2.*gamma*ufl.sym(ufl.outer(c0,l0)) ) + dS_act = w_act * omega*ufl.outer(c0,c0) + iota*ufl.outer(l0,l0) + 2.*gamma*ufl.sym(ufl.outer(c0,l0)) elif params['active_stress']['dir']=='iso': - S_act = tau * self.I - dS_act = self.I + S_act = w_act * tau * self.I + dS_act = w_act * self.I else: ValueError("Unknown ative stress dir!") - if actweight is not None: - w_act = actweight - else: - w_act = 1.0 # wall thickness - can be constant or a field wall_thickness = params['h0'] @@ -261,7 +261,7 @@ def deltaW_ext_membrane(self, F, Fdot, a, params, dboundary, ivar=None, fibfnc=N # add active stress if active is not None: - S += w_act * S_act + S += S_act # 1st PK stress P = FS P = Fmod * S