Skip to content

Commit

Permalink
TST: improved settings
Browse files Browse the repository at this point in the history
  • Loading branch information
saullocastro committed Aug 2, 2024
1 parent 5e8c164 commit 6bf0eb0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
5 changes: 4 additions & 1 deletion tests/test_quad4r_linear_buckling_cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def test_linear_buckling_cylinder(mode=0):
quad.init_k_KG = init_k_KG
quad.update_rotation_matrix(ncoords_flatten, 0, 0, 1)
quad.update_probe_xe(ncoords_flatten)
quad.update_KC0(KC0r, KC0c, KC0v, prop)
factor = 1.
quad.update_KC0(KC0r, KC0c, KC0v, prop, hgfactor_u=factor,
hgfactor_v=factor, hgfactor_w=factor,
hgfactor_rx=factor, hgfactor_ry=factor)
quads.append(quad)
init_k_KC0 += data.KC0_SPARSE_SIZE
init_k_KG += data.KG_SPARSE_SIZE
Expand Down
2 changes: 1 addition & 1 deletion tests/test_quad4r_linear_buckling_plate_given_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_linear_buckling(mode=0, refinement=1):
# constraining u at x = a/2, y = 0,b
check = isclose(x, a/2.) & (isclose(y, 0.) | isclose(y, b))
bk[0::DOF] = check
# constraining v at x = 0,a y = b/2
# constraining v at x = 0, y = b/2
check = isclose(y, b/2.) & (isclose(x, 0.) | isclose(x, a))
bk[1::DOF] = check
# removing drilling
Expand Down
2 changes: 1 addition & 1 deletion tests/test_quad4r_linear_buckling_plate_mat_coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_linear_buckling_plate(plot=False, mode=0):
# constraining u at x = a/2, y = 0,b
check = isclose(x, a/2.) & (isclose(y, 0.) | isclose(y, b))
bk[0::DOF] = check
# constraining v at x = 0,a y = b/2
# constraining v at x = 0, y = b/2
check = isclose(y, b/2.) & (isclose(x, 0.) | isclose(x, a))
bk[1::DOF] = check
# removing drilling
Expand Down
5 changes: 4 additions & 1 deletion tests/test_quad4r_natural_freq_pre_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def test_nat_freq_pre_stress(plot=False, mode=0, mtypes=range(3), refinement=1):
quad.init_k_M = init_k_M
quad.update_rotation_matrix(ncoords_flatten)
quad.update_probe_xe(ncoords_flatten)
quad.update_KC0(KC0r, KC0c, KC0v, prop)
factor = 1.
quad.update_KC0(KC0r, KC0c, KC0v, prop, hgfactor_u=factor,
hgfactor_v=factor, hgfactor_w=factor,
hgfactor_rx=factor, hgfactor_ry=factor)
quad.update_M(Mr, Mc, Mv, prop, mtype=mtype)
quads.append(quad)
init_k_KC0 += data.KC0_SPARSE_SIZE
Expand Down
7 changes: 5 additions & 2 deletions tests/test_quad4r_static_point_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def test_static_plate_quad_point_load(plot=False):
quad.init_k_KC0 = init_k_KC0
quad.update_rotation_matrix(ncoords_flatten)
quad.update_probe_xe(ncoords_flatten)
quad.update_KC0(KC0r, KC0c, KC0v, prop)
factor = 0.1
quad.update_KC0(KC0r, KC0c, KC0v, prop, hgfactor_u=factor,
hgfactor_v=factor, hgfactor_w=factor,
hgfactor_rx=factor, hgfactor_ry=factor)
quads.append(quad)
init_k_KC0 += data.KC0_SPARSE_SIZE

Expand Down Expand Up @@ -110,7 +113,7 @@ def test_static_plate_quad_point_load(plot=False):
# obtained with bfsplate2d element, nx=ny=29
wmax_ref = 6.594931610258557e-05
# obtained with Quad4R nx=7, ny=11
wmax_ref = 5.8143934276185586e-05
wmax_ref = 6.531745527797951e-05
print('w.max()', w.max())
assert np.isclose(wmax_ref, w.max(), rtol=0.02)
if plot:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_quad4r_static_point_load_mat_coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def test_static_plate_quad_point_load(plot=False):
quad.init_k_KC0 = init_k_KC0
quad.update_rotation_matrix(ncoords_flatten, matx[0], matx[1], matx[2])
quad.update_probe_xe(ncoords_flatten)
quad.update_KC0(KC0r, KC0c, KC0v, prop)
factor = 0.1
quad.update_KC0(KC0r, KC0c, KC0v, prop, hgfactor_u=factor,
hgfactor_v=factor, hgfactor_w=factor,
hgfactor_rx=factor, hgfactor_ry=factor)
quads.append(quad)
init_k_KC0 += data.KC0_SPARSE_SIZE

Expand Down
7 changes: 5 additions & 2 deletions tests/test_quad4r_static_point_load_mat_coord_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def test_static_plate_quad_point_load(plot=False):
quad.init_k_KC0 = init_k_KC0
quad.update_rotation_matrix(ncoords_flatten, 0, 0, 1) # NOTE to create error messages
quad.update_probe_xe(ncoords_flatten)
quad.update_KC0(KC0r, KC0c, KC0v, prop)
factor = 0.1
quad.update_KC0(KC0r, KC0c, KC0v, prop, hgfactor_u=factor,
hgfactor_v=factor, hgfactor_w=factor,
hgfactor_rx=factor, hgfactor_ry=factor)
quads.append(quad)
init_k_KC0 += data.KC0_SPARSE_SIZE

Expand Down Expand Up @@ -110,7 +113,7 @@ def test_static_plate_quad_point_load(plot=False):
# obtained with bfsplate2d element, nx=ny=29
wmax_ref = 6.594931610258557e-05
# obtained with Quad4R nx=7, ny=11
wmax_ref = 5.8143934272350526e-05
wmax_ref = 6.531745527797951e-05
print('w.max()', w.max())
assert np.isclose(wmax_ref, w.max(), rtol=0.02)
if plot:
Expand Down

0 comments on commit 6bf0eb0

Please sign in to comment.