Skip to content

Commit

Permalink
Merge pull request #14 from pshriwise/housekeeping
Browse files Browse the repository at this point in the history
Addressing some warnings coming from the test suite
  • Loading branch information
pshriwise authored Nov 7, 2024
2 parents c1a367e + 8b57d91 commit c312dbf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
18 changes: 8 additions & 10 deletions src/openmc_cad_adapter/gqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ def characterize_general_quadratic( surface ): #s surface
j = surface.coefficients['j']
k = surface.coefficients['k']
#coefficient matrix
Aa = np.matrix([
[a, d/2, f/2],
[d/2, b, e/2],
[f/2, e/2, c]])
Aa = np.asarray([[a, d/2, f/2],
[d/2, b, e/2],
[f/2, e/2, c]])
#hessian matrix
Ac = np.matrix([
[a, d/2, f/2, g/2],
[d/2, b, e/2, h/2],
[f/2, e/2, c, j/2],
[g/2, h/2, j/2, k]])
Ac = np.asarray([[a, d/2, f/2, g/2],
[d/2, b, e/2, h/2],
[f/2, e/2, c, j/2],
[g/2, h/2, j/2, k]])
rank_Aa = matrix_rank( Aa )
rank_Ac = matrix_rank( Ac )

Expand Down Expand Up @@ -68,7 +66,7 @@ def characterize_general_quadratic( surface ): #s surface

#Update the constant using the resulting translation
K_ = k + (g/2)*dx + (h/2)*dy + (j/2)*dz
K_ = K_[0,0]
K_ = K_[0]

if rank_Aa == 2 and rank_Ac == 3 and S == 1:
delta = -1 if K_ * signs[0] else 1
Expand Down
12 changes: 6 additions & 6 deletions test/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def wrapper(*args, **kwargs):

@reset_openmc_ids
def test_planes(request, run_in_tmpdir):
plane1 = openmc.Plane(A=1.0, B=1.0, C=0.0, D=-5.0)
plane2 = openmc.Plane(A=1.0, B=1.0, C=0.0, D=5.0)
plane3 = openmc.Plane(A=0.0, B=1.0, C=1.0, D=-5.0)
plane4 = openmc.Plane(A=0.0, B=1.0, C=1.0, D=5.0)
plane5 = openmc.Plane(A=1.0, B=0.0, C=1.0, D=-5.0)
plane6 = openmc.Plane(A=1.0, B=0.0, C=1.0, D=5.0)
plane1 = openmc.Plane(a=1.0, b=1.0, c=0.0, d=-5.0)
plane2 = openmc.Plane(a=1.0, b=1.0, c=0.0, d=5.0)
plane3 = openmc.Plane(a=0.0, b=1.0, c=1.0, d=-5.0)
plane4 = openmc.Plane(a=0.0, b=1.0, c=1.0, d=5.0)
plane5 = openmc.Plane(a=1.0, b=0.0, c=1.0, d=-5.0)
plane6 = openmc.Plane(a=1.0, b=0.0, c=1.0, d=5.0)
g = openmc.Geometry([openmc.Cell(region=+plane1 & -plane2 & +plane3 & -plane4 & +plane5 & -plane6)])
to_cubit_journal(g, world=(500, 500, 500), filename='plane.jou')
diff_gold_file('plane.jou')
Expand Down

0 comments on commit c312dbf

Please sign in to comment.