Skip to content

Commit

Permalink
added mcnp cone surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
TWPHyatt committed Aug 27, 2024
1 parent f733444 commit 306a388
Showing 1 changed file with 132 additions and 1 deletion.
133 changes: 132 additions & 1 deletion src/pyg4ometry/mcnp/Surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def __init__(self, A, B, C, D):
def __repr__(self):
return f"P: {self.A} {self.B} {self.C} {self.D}"


class PX:
"""
Plane (normal to x-axis)
Expand All @@ -23,6 +24,7 @@ def __init__(self, D):
def __repr__(self):
return f"PX: {self.D}"


class PY:
"""
Plane (normal to y-axis)
Expand All @@ -34,6 +36,7 @@ def __init__(self, D):
def __repr__(self):
return f"PY: {self.D}"


class PZ:
"""
Plane (normal to z-axis)
Expand Down Expand Up @@ -111,6 +114,7 @@ def __init__(self, z, R):
def __repr__(self):
return f"SZ: {self.z} {self.R}"


class C_X:
"""
Cylinder (parallel to x-axis)
Expand All @@ -124,6 +128,7 @@ def __init__(self, y, z, R):
def __repr__(self):
return f"C_X: {self.y} {self.z} {self.R}"


class C_Y:
"""
Cylinder (parallel to y-axis)
Expand All @@ -137,6 +142,7 @@ def __init__(self, x, z, R):
def __repr__(self):
return f"C_Y: {self.x} {self.z} {self.R}"


class C_Z:
"""
Cylinder (parallel to z-axis)
Expand All @@ -150,6 +156,7 @@ def __init__(self, x, y, R):
def __repr__(self):
return f"C_Z: {self.x} {self.y} {self.R}"


class CX:
"""
Cylinder (on x-axis)
Expand All @@ -161,6 +168,7 @@ def __init__(self, R):
def __repr__(self):
return f"CX: {self.R}"


class CY:
"""
Cylinder (on y-axis)
Expand All @@ -172,6 +180,7 @@ def __init__(self, R):
def __repr__(self):
return f"CY: {self.R}"


class CZ:
"""
Cylinder (on z-axis)
Expand All @@ -181,4 +190,126 @@ def __init__(self, R):
self.R = R

def __repr__(self):
return f"CZ: {self.R}"
return f"CZ: {self.R}"


""" surface: Cone
:param sign: choice positive slope or negative slope.
The quadratic equation for a cone describes a cone of two sheets. One sheet is a
cone of positive slope, and the other has a negative slope. The parameter sign
provides the option to select either of the two sheets. The +1 or the -1 entry on
the cone surface card causes the one sheet cone treatment to be used. If the sign
of the entry is positive, the specified sheet is the one that extends to infinity
in the positive direction of the coordinate axis to which the cone axis is parallel.
The converse is true for a negative entry.
"""

class K_X:
"""
Cone (parallel to x-axis)
:param t_sqr: t squared
:param sign: choice positive slope or negative slope.
"""

def __init__(self, x, y, z, t_sqr, sign):
self.x = x
self.y = y
self.z = z
self.t_sqr = t_sqr
self.sign = sign

def __repr__(self):
return f"K_X: {self.x} {self.y} {self.z} {self.t_sqr} {self.sign}"


class K_Y:
"""
Cone (parallel to y-axis)
:param t_sqr: t squared
:param sign: choice positive slope or negative slope.
"""

def __init__(self, x, y, z, t_sqr, sign):
self.x = x
self.y = y
self.z = z
self.t_sqr = t_sqr
self.sign = sign

def __repr__(self):
return f"K_Y: {self.x} {self.y} {self.z} {self.t_sqr} {self.sign}"


class K_Z:
"""
Cone (parallel to z-axis)
:param t_sqr: t squared
:param sign: choice positive slope or negative slope.
"""

def __init__(self, x, y, z, t_sqr, sign):
self.x = x
self.y = y
self.z = z
self.t_sqr = t_sqr
self.sign = sign

def __repr__(self):
return f"K_Z: {self.x} {self.y} {self.z} {self.t_sqr} {self.sign}"


class KX:
"""
Cone (on x-axis)
:param t_sqr: t squared
:param sign: choice positive slope or negative slope.
"""

def __init__(self, x, t_sqr, sign):
self.x = x
self.t_sqr = t_sqr
self.sign = sign

def __repr__(self):
return f"KX: {self.x} {self.t_sqr} {self.sign}"


class KY:
"""
Cone (on y-axis)
:param t_sqr: t squared
:param sign: choice positive slope or negative slope.
"""

def __init__(self, y, t_sqr, sign):
self.y = y
self.t_sqr = t_sqr
self.sign = sign

def __repr__(self):
return f"KY: {self.y} {self.t_sqr} {self.sign}"


class KZ:
"""
Cone (on z-axis)
:param t_sqr: t squared
:param sign: choice positive slope or negative slope.
"""

def __init__(self, z, t_sqr, sign):
self.z = z
self.t_sqr = t_sqr
self.sign = sign

def __repr__(self):
return f"KZ: {self.z} {self.t_sqr} {self.sign}"

0 comments on commit 306a388

Please sign in to comment.