diff --git a/src/openmc_cad_adapter/gqs.py b/src/openmc_cad_adapter/gqs.py index a764bc2..7b0a510 100644 --- a/src/openmc_cad_adapter/gqs.py +++ b/src/openmc_cad_adapter/gqs.py @@ -117,20 +117,32 @@ def find_type( rAa, rAc, delta, S, D ): if gq_type == ONE_SHEET_HYPERBOLOID: if abs( K_) < equivalence_tol: K_ = 0 - return ELLIPTIC_CONE + gq_type = ELLIPTIC_CONE if gq_type == TWO_SHEET_HYPERBOLOID: if abs( K_) < equivalence_tol: K_ = 0 - return ELLIPTIC_CONE + gq_type = ELLIPTIC_CONE if gq_type == ELLIPSOID: if abs( A_) < equivalence_tol: A_ = 0 - return ELLIPTIC_CYLINDER + gq_type = ELLIPTIC_CYLINDER elif abs( B_) < equivalence_tol: B_ = 0 - return ELLIPTIC_CYLINDER + gq_type = ELLIPTIC_CYLINDER elif abs( C_) < equivalence_tol: C_ = 0 - return ELLIPTIC_CYLINDER - else: - return (gq_type, A_, B_, C_, K_, translation, rotation_matrix) \ No newline at end of file + gq_type = ELLIPTIC_CYLINDER + + return (gq_type, A_, B_, C_, K_, translation, rotation_matrix) + + +__all__ = ["characterize_general_quadratic", + "ELLIPSOID", + "ONE_SHEET_HYPERBOLOID", + "TWO_SHEET_HYPERBOLOID", + "ELLIPTIC_CONE", + "ELLIPTIC_PARABOLOID", + "HYPERBOLIC_PARABOLOID", + "ELLIPTIC_CYLINDER", + "HYPERBOLIC_CYLINDER", + "PARABOLIC_CYLINDER"] \ No newline at end of file diff --git a/src/openmc_cad_adapter/to_cubit_journal.py b/src/openmc_cad_adapter/to_cubit_journal.py index f8e93ec..eff69ad 100644 --- a/src/openmc_cad_adapter/to_cubit_journal.py +++ b/src/openmc_cad_adapter/to_cubit_journal.py @@ -6,7 +6,6 @@ import sys import warnings -from numpy.linalg import matrix_rank import numpy as np try: @@ -18,18 +17,7 @@ from openmc.surface import Halfspace, Quadric from openmc.lattice import Lattice, HexLattice -from .gqs import ( - characterize_general_quadratic, - ELLIPSOID, - ONE_SHEET_HYPERBOLOID, - TWO_SHEET_HYPERBOLOID, - ELLIPTIC_CONE, - ELLIPTIC_PARABOLOID, - HYPERBOLIC_PARABOLOID, - ELLIPTIC_CYLINDER, - HYPERBOLIC_CYLINDER, - PARABOLIC_CYLINDER -) +from .gqs import * from .cubit_util import emit_get_last_id, reset_cubit_ids, new_variable from .geom_util import rotate, move from .cubit_util import emit_get_last_id, reset_cubit_ids, new_variable diff --git a/test/test_local.py b/test/test_local.py index 3600e75..2d87c64 100644 --- a/test/test_local.py +++ b/test/test_local.py @@ -122,3 +122,9 @@ def test_general_cone(request, run_in_tmpdir): cone = openmc.Cone(x0=0.0, y0=0.0, z0=0.0, r2=6.0, dx=1, dy=1, dz=1) g = openmc.Geometry([openmc.Cell(region=-cone)]) to_cubit_journal(g, world=(500, 500, 500), filename='cone.jou') + +@reset_openmc_ids +def test_gq_ellipsoid(request): + ellipsoid = openmc.Quadric(1, 2, 3, k=1) + g = openmc.Geometry([openmc.Cell(region=-ellipsoid)]) + to_cubit_journal(g, world=(500, 500, 500), filename='ellipsoid.jou')