1313import FrictionEnergy
1414import SpringEnergy
1515
16- def step_forward (x , e , v , m , vol , IB , mu_lame , lam , n , o , contact_area , mu , is_DBC , DBC , DBC_v , DBC_limit , h , tol ):
16+
17+
18+
19+ def step_forward (x , e , v , m , vol , IB , mu_lame , lam , n , o , contact_area , mu , is_DBC , DBC , DBC_v , DBC_limit , DBC_stiff_ ,h , tol ):
1720 x_tilde = x + v * h # implicit Euler predictive position
1821 x_n = copy .deepcopy (x )
1922 mu_lambda = BarrierEnergy .compute_mu_lambda (x , n , o , contact_area , mu ) # compute mu * lambda for each node using x^n
@@ -23,7 +26,7 @@ def step_forward(x, e, v, m, vol, IB, mu_lame, lam, n, o, contact_area, mu, is_D
2326 DBC_target .append (x_n [DBC [i ]] + h * DBC_v [i ])
2427 else :
2528 DBC_target .append (x_n [DBC [i ]])
26- DBC_stiff = 1000 # initialize stiffness for DBC springs
29+ DBC_stiff = DBC_stiff_ [ 0 ]
2730
2831 # Newton loop
2932 iter = 0
@@ -35,7 +38,8 @@ def step_forward(x, e, v, m, vol, IB, mu_lame, lam, n, o, contact_area, mu, is_D
3538
3639 if (LA .norm (p , inf ) / h <= tol ) & (sum (DBC_satisfied ) != len (DBC )):
3740 # increase DBC stiffness and recompute energy value record
38- DBC_stiff *= 2
41+ DBC_stiff_ [0 ] *= 2
42+ DBC_stiff = DBC_stiff_ [0 ]
3943 E_last = IP_val (x , e , x_tilde , m , vol , IB , mu_lame , lam , n , o , contact_area , (x - x_n ) / h , mu_lambda , DBC , DBC_target , DBC_stiff , h )
4044
4145 # filter line search
0 commit comments