File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2013,6 +2013,7 @@ def update_gradient_JTDAJ(
2013
2013
dof_tri_row : wp .array (dtype = int ),
2014
2014
dof_tri_col : wp .array (dtype = int ),
2015
2015
# Data in:
2016
+ njmax_in : int ,
2016
2017
nefc_in : wp .array (dtype = int ),
2017
2018
efc_worldid_in : wp .array (dtype = int ),
2018
2019
efc_J_in : wp .array2d (dtype = float ),
@@ -2033,7 +2034,7 @@ def update_gradient_JTDAJ(
2033
2034
for i in range (nblocks_perblock ):
2034
2035
efcid = efcid_temp + i * dim_x
2035
2036
2036
- if efcid >= nefc :
2037
+ if efcid >= min ( nefc , njmax_in ) :
2037
2038
return
2038
2039
2039
2040
worldid = efc_worldid_in [efcid ]
@@ -2256,6 +2257,7 @@ def _update_gradient(m: types.Model, d: types.Data):
2256
2257
inputs = [
2257
2258
m .dof_tri_row ,
2258
2259
m .dof_tri_col ,
2260
+ d .njmax ,
2259
2261
d .nefc ,
2260
2262
d .efc .worldid ,
2261
2263
d .efc .J ,
You can’t perform that action at this time.
0 commit comments