Surfaces
- class mcnpy.Surface(*args, **kwargs)[source]
Bases:
SurfaceA representation of the model object Surface.
- Parameters
name (int) – Numeric ID for Surface.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Surface.
- next_id = 1
- used_ids = {}
- class mcnpy.Halfspace(*args, **kwargs)[source]
Bases:
HalfspaceA representation of the model object Halfspace.
- Parameters
side (mcnpy.PositiveNegative) – Side for Halfspace.
pseudo_cell (int) – PseudoCell for Halfspace.
surface (mcnpy.Surface) – Surface for Halfspace.
facets (str) – Facets for Halfspace.
- get_surfaces(surfaces=None)[source]
Returns the surface that this is a halfspace of.
- Parameters
surfaces (collections.OrderedDict, optional) – Dictionary mapping surface IDs to
mcnpy.Surfaceinstances- Returns
surfaces – Dictionary mapping surface IDs to
mcnpy.Surfaceinstances- Return type
collections.OrderedDict
- remove_redundant_surfaces(redundant_surfaces)[source]
Recursively remove all redundant surfaces referenced by this region
- Parameters
redundant_surfaces (dict) – Dictionary mapping redundant surface IDs to surface IDs for the
mcnpy.Surfaceinstances that should replace them.
Operation |
Symbol (Python) |
Symbol (MCNP) |
|---|---|---|
Positive |
|
|
Negative |
|
|
- class mcnpy.Macrobody[source]
Bases:
ABCAll macrobodies with facets. Excludes Sphere and Ellipsoid.
Note
Facets can be specified using [] on an applicable surface.
# A macrobody with facets.
rpp = mcnpy.RectangularPrism(name=10, ...)
# Define halfspace using facet 6.
hs = +rpp[6]
Sphere
- class mcnpy.Sphere(*args, **kwargs)[source]
Bases:
IDManagerMixin,Sphere,SurfaceSphere defined by
.
- Parameters
name (int) – Numeric ID for Sphere.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Sphere.
x0 (float) – X0 for Sphere.
y0 (float) – Y0 for Sphere.
z0 (float) – Z0 for Sphere.
r (float) – R for Sphere.
comment (str) – Comment for Sphere.
Plane
- class mcnpy.XPlane(*args, **kwargs)[source]
Bases:
IDManagerMixin,XPlane,SurfaceA plane defined by
.
- Parameters
name (int) – Numeric ID for XPlane.
boundary_type (mcnpy.BoundaryType) – Boundary condition for XPlane.
x0 (float) – X0 for XPlane.
- class mcnpy.YPlane(*args, **kwargs)[source]
Bases:
IDManagerMixin,YPlane,SurfaceA plane defined by
.
- Parameters
name (int) – Numeric ID for YPlane.
boundary_type (mcnpy.BoundaryType) – Boundary condition for YPlane.
y0 (float) – Y0 for YPlane.
- class mcnpy.ZPlane(*args, **kwargs)[source]
Bases:
IDManagerMixin,ZPlane,SurfaceA plane defined by
.
- Parameters
name (int) – Numeric ID for ZPlane.
boundary_type (mcnpy.BoundaryType) – Boundary condition for ZPlane.
z0 (float) – Z0 for ZPlane.
- class mcnpy.Plane(*args, **kwargs)[source]
Bases:
IDManagerMixin,Plane,SurfaceA plane defined by
.
- Parameters
name (int) – Numeric ID for Plane.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Plane.
a (float) – A for Plane.
b (float) – B for Plane.
c (float) – C for Plane.
d (float) – D for Plane.
comment (str) – Comment for Plane.
Cylinder
- class mcnpy.XCylinder(*args, **kwargs)[source]
Bases:
IDManagerMixin,XCylinder,SurfaceA cylinder parallel to the x-axis defined by
.
- Parameters
name (int) – Numeric ID for XCylinder.
boundary_type (mcnpy.BoundaryType) – Boundary condition for XCylinder.
y0 (float) – Y0 for XCylinder.
z0 (float) – Z0 for XCylinder.
r (float) – R for XCylinder.
comment (str) – Comment for XCylinder.
- class mcnpy.YCylinder(*args, **kwargs)[source]
Bases:
IDManagerMixin,YCylinder,SurfaceA cylinder parallel to the y-axis defined by
.
- Parameters
name (int) – Numeric ID for YCylinder.
boundary_type (mcnpy.BoundaryType) – Boundary condition for YCylinder.
x0 (float) – X0 for YCylinder.
z0 (float) – Z0 for YCylinder.
r (float) – R for YCylinder.
comment (str) – Comment for YCylinder.
- class mcnpy.ZCylinder(*args, **kwargs)[source]
Bases:
IDManagerMixin,ZCylinder,SurfaceA cylinder parallel to the z-axis defined by
.
- Parameters
name (int) – Numeric ID for ZCylinder.
boundary_type (mcnpy.BoundaryType) – Boundary condition for ZCylinder.
x0 (float) – X0 for ZCylinder.
y0 (float) – Y0 for ZCylinder.
r (float) – R for ZCylinder.
comment (str) – Comment for ZCylinder.
Cone
- class mcnpy.XCone(*args, **kwargs)[source]
Bases:
IDManagerMixin,XCone,SurfaceA cone parallel to the x-axis defined by
. sheet can be +/-1.
- Parameters
name (int) – Numeric ID for XCone.
boundary_type (mcnpy.BoundaryType) – Boundary condition for XCone.
x0 (float) – X0 for XCone.
y0 (float) – Y0 for XCone.
z0 (float) – Z0 for XCone.
r2 (float) – R2 for XCone.
sheet (mcnpy.Sheet) – Sheet for XCone.
comment (str) – Comment for XCone.
- class mcnpy.YCone(*args, **kwargs)[source]
Bases:
IDManagerMixin,YCone,SurfaceA cone parallel to the y-axis defined by
. sheet can be +/-1.
- Parameters
name (int) – Numeric ID for YCone.
boundary_type (mcnpy.BoundaryType) – Boundary condition for YCone.
x0 (float) – X0 for YCone.
y0 (float) – Y0 for YCone.
z0 (float) – Z0 for YCone.
r2 (float) – R2 for YCone.
sheet (mcnpy.Sheet) – Sheet for YCone.
comment (str) – Comment for YCone.
- class mcnpy.ZCone(*args, **kwargs)[source]
Bases:
IDManagerMixin,ZCone,SurfaceA cone parallel to the z-axis defined by
. sheet can be +/-1.
- Parameters
name (int) – Numeric ID for ZCone.
boundary_type (mcnpy.BoundaryType) – Boundary condition for ZCone.
x0 (float) – X0 for ZCone.
y0 (float) – Y0 for ZCone.
z0 (float) – Z0 for ZCone.
r2 (float) – R2 for ZCone.
sheet (mcnpy.Sheet) – Sheet for ZCone.
comment (str) – Comment for ZCone.
- class mcnpy.Sheet(*args, **kwargs)[source]
Bases:
SheetA representation of the model object Sheet.
- Parameters
side (mcnpy.PositiveNegative) – Side for Sheet.
value (int) – Value for Sheet.
Quadric
- class mcnpy.Quadric(*args, **kwargs)[source]
Bases:
IDManagerMixin,Quadric,SurfaceQuadric (GQ) with axes not parallel to x-, y-, or z-axis. Defined by
.
- Parameters
name (int) – Numeric ID for Quadric.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Quadric.
a (float) – A for Quadric.
b (float) – B for Quadric.
c (float) – C for Quadric.
d (float) – D for Quadric.
e (float) – E for Quadric.
f (float) – F for Quadric.
g (float) – G for Quadric.
h (float) – H for Quadric.
j (float) – J for Quadric.
k (float) – K for Quadric.
comment (str) – Comment for Quadric.
- class mcnpy.XYZQuadric(*args, **kwargs)[source]
Bases:
IDManagerMixin,XYZQuadric,SurfaceQuadric (SQ) with axes parallel to x-, y-, or z-axis. Defined by
.
- Parameters
name (int) – Numeric ID for XYZQuadric.
boundary_type (mcnpy.BoundaryType) – Boundary condition for XYZQuadric.
a (float) – A for XYZQuadric.
b (float) – B for XYZQuadric.
c (float) – C for XYZQuadric.
d (float) – D for XYZQuadric.
e (float) – E for XYZQuadric.
f (float) – F for XYZQuadric.
g (float) – G for XYZQuadric.
x (float) – X for XYZQuadric.
y (float) – Y for XYZQuadric.
z (float) – Z for XYZQuadric.
Torus
- class mcnpy.XTorus(*args, **kwargs)[source]
Bases:
IDManagerMixin,XTorus,SurfaceTorus parallel to x-axis defined by
.
- Parameters
name (int) – Numeric ID for XTorus.
boundary_type (mcnpy.BoundaryType) – Boundary condition for XTorus.
x0 (float) – X0 for XTorus.
y0 (float) – Y0 for XTorus.
z0 (float) – Z0 for XTorus.
a (float) – A for XTorus.
b (float) – B for XTorus.
c (float) – C for XTorus.
comment (str) – Comment for XTorus.
- class mcnpy.YTorus(*args, **kwargs)[source]
Bases:
IDManagerMixin,YTorus,SurfaceTorus parallel to y-axis defined by
.
- Parameters
name (int) – Numeric ID for YTorus.
boundary_type (mcnpy.BoundaryType) – Boundary condition for YTorus.
x0 (float) – X0 for YTorus.
y0 (float) – Y0 for YTorus.
z0 (float) – Z0 for YTorus.
a (float) – A for YTorus.
b (float) – B for YTorus.
c (float) – C for YTorus.
comment (str) – Comment for YTorus.
- class mcnpy.ZTorus(*args, **kwargs)[source]
Bases:
IDManagerMixin,ZTorus,SurfaceTorus parallel to z-axis defined by
.
- Parameters
name (int) – Numeric ID for ZTorus.
boundary_type (mcnpy.BoundaryType) – Boundary condition for ZTorus.
x0 (float) – X0 for ZTorus.
y0 (float) – Y0 for ZTorus.
z0 (float) – Z0 for ZTorus.
a (float) – A for ZTorus.
b (float) – B for ZTorus.
c (float) – C for ZTorus.
comment (str) – Comment for ZTorus.
Points
- class mcnpy.XPoints(*args, **kwargs)[source]
Bases:
IDManagerMixin,XPoints,SurfaceX symmetric surface defined by points A representation of the model object XPoints.
- Parameters
name (int) – Numeric ID for XPoints.
boundary_type (mcnpy.BoundaryType) – Boundary condition for XPoints.
points (iterable of mcnpy.PPoint) – Points for XPoints.
- property points
- class mcnpy.YPoints(*args, **kwargs)[source]
Bases:
IDManagerMixin,YPoints,SurfaceY symmetric surface defined by points A representation of the model object YPoints.
- Parameters
name (int) – Numeric ID for YPoints.
boundary_type (mcnpy.BoundaryType) – Boundary condition for YPoints.
points (iterable of mcnpy.PPoint) – Points for YPoints.
comment (str) – Comment for YPoints.
- property points
- class mcnpy.ZPoints(*args, **kwargs)[source]
Bases:
IDManagerMixin,ZPoints,SurfaceZ symmetric surface defined by points A representation of the model object ZPoints.
- Parameters
name (int) – Numeric ID for ZPoints.
boundary_type (mcnpy.BoundaryType) – Boundary condition for ZPoints.
points (iterable of mcnpy.PPoint) – Points for ZPoints.
comment (str) – Comment for ZPoints.
- property points
- class mcnpy.PPoints(*args, **kwargs)[source]
Bases:
IDManagerMixin,PPoints,SurfacePlane defined by 3 points A representation of the model object PPoints.
- Parameters
name (int) – Numeric ID for PPoints.
boundary_type (mcnpy.BoundaryType) – Boundary condition for PPoints.
points (iterable of mcnpy.Point) – Points for PPoints.
comment (str) – Comment for PPoints.
Macrobodies
- class mcnpy.Box(*args, **kwargs)[source]
Bases:
IDManagerMixin,Box,Surface,MacrobodyA Box defined by a corner and 2 or 3 vectors. A representation of the model object Box.
- Parameters
name (int) – Numeric ID for Box.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Box.
corner (mcnpy.Point) – Corner for Box.
vectors (iterable of mcnpy.Point) – Vectors for Box.
comment (str) – Comment for Box.
- class mcnpy.CircularCylinder(*args, **kwargs)[source]
Bases:
IDManagerMixin,CircularCylinder,Surface,MacrobodyA right circular cylinder defined by the center of its base, an axis vector, and radius r. A representation of the model object CircularCylinder.
- Parameters
name (int) – Numeric ID for CircularCylinder.
boundary_type (mcnpy.BoundaryType) – Boundary condition for CircularCylinder.
base (mcnpy.Point) – Base for CircularCylinder.
axis (mcnpy.Point) – Axis for CircularCylinder.
r (float) – R for CircularCylinder.
comment (str) – Comment for CircularCylinder.
- class mcnpy.Ellipsoid(*args, **kwargs)[source]
Bases:
IDManagerMixin,Ellipsoid,Surface,MacrobodyAn Ellipsoid defined by a 2 points/vectors and a radius. By default, rm is the major radius and v1 and v2 are the coordinates of the first and second focii. If rm < 0 (meaning rm is now the minor radius), then v1 is the coordinates of the ellipsoid’s center and v2 is its major axis vector. A representation of the model object Ellipsoid.
- Parameters
name (int) – Numeric ID for Ellipsoid.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Ellipsoid.
v1 (mcnpy.Point) – V1 for Ellipsoid.
v2 (mcnpy.Point) – V2 for Ellipsoid.
rm (float) – Rm for Ellipsoid.
comment (str) – Comment for Ellipsoid.
- class mcnpy.EllipticalCylinder(*args, **kwargs)[source]
Bases:
IDManagerMixin,EllipticalCylinder,Surface,MacrobodyRight Elliptical Cylinder defined by a base point, axis height vector, ellipse major axis vector v1, and ellipse minor axis vector v1 or radius r. A representation of the model object EllipticalCylinder.
- Parameters
name (int) – Numeric ID for EllipticalCylinder.
boundary_type (mcnpy.BoundaryType) – Boundary condition for EllipticalCylinder.
base (mcnpy.Point) – Base for EllipticalCylinder.
axis (mcnpy.Point) – Axis for EllipticalCylinder.
v1 (mcnpy.Point) – V1 for EllipticalCylinder.
v2 (mcnpy.Point) – V2 for EllipticalCylinder.
rm (float) – Rm for EllipticalCylinder.
comment (str) – Comment for EllipticalCylinder.
- class mcnpy.HexagonalPrism(*args, **kwargs)[source]
Bases:
IDManagerMixin,HexagonalPrism,Surface,MacrobodyRight Hexagonal Prism defined by a base point, height vector, and facet vectors facet1, facet2, and facet3. The second and third facet vectors are optional. A representation of the model object HexagonalPrism.
- Parameters
name (int) – Numeric ID for HexagonalPrism.
boundary_type (mcnpy.BoundaryType) – Boundary condition for HexagonalPrism.
base (mcnpy.Point) – Base for HexagonalPrism.
height (mcnpy.Point) – Height for HexagonalPrism.
facet1 (mcnpy.Point) – Facet1 for HexagonalPrism.
facet2 (mcnpy.Point) – Facet2 for HexagonalPrism.
facet3 (mcnpy.Point) – Facet3 for HexagonalPrism.
comment (str) – Comment for HexagonalPrism.
- class mcnpy.Polyhedron(*args, **kwargs)[source]
Bases:
IDManagerMixin,Polyhedron,Surface,MacrobodyAn Arbitrary Polyhedron (the ARB marcrobody). The shape of an ARB is specified by defining a list of the shape’s corners, corners, and a list of connectivity, sides, between those corners. corners are defined using mcnpy.Point objects while sides requires a list of integers. Each entry in sides is a 4 digit integer specifying the indicies defining a side. For instance, 1247 would indicate that a side is defined by the first, second, fourth, and seventh corner points. Note, these values are indexed from 1. For sides requiring only 3 corners, the three values are acceptable or a zero may be used instead. Valid ARBs may have 4, 5, or 6 sides using up to 8 corners. For example, a rectangular prism can be constructed with 8 corners and 6 sides. A tetrahedron would insted have 4 corners and 4 sides. For a more detailed description of ARB, users are advised to refer to the MCNP6.2 manual. A representation of the model object Polyhedron.
- Parameters
name (int) – Numeric ID for Polyhedron.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Polyhedron.
corners (iterable of mcnpy.Point) – Corners for Polyhedron.
sides (iterable of int) – Sides for Polyhedron.
comment (str) – Comment for Polyhedron.
- class mcnpy.RectangularPrism(*args, **kwargs)[source]
Bases:
IDManagerMixin,RectangularPrism,Surface,MacrobodyA rectangular parallelpiped defined by X, Y, and Z limits. Can be infinite in 1 dimension if upper and lower bounds are equal. A representation of the model object RectangularPrism.
- Parameters
name (int) – Numeric ID for RectangularPrism.
boundary_type (mcnpy.BoundaryType) – Boundary condition for RectangularPrism.
x0 (float) – X0 for RectangularPrism.
x1 (float) – X1 for RectangularPrism.
y0 (float) – Y0 for RectangularPrism.
y1 (float) – Y1 for RectangularPrism.
z0 (float) – Z0 for RectangularPrism.
z1 (float) – Z1 for RectangularPrism.
comment (str) – Comment for RectangularPrism.
- class mcnpy.Wedge(*args, **kwargs)[source]
Bases:
IDManagerMixin,Wedge,Surface,MacrobodyA Wedge defined by a vertex, 2 vectors for sides of the triangular base, and an axis height vector. A representation of the model object Wedge.
- Parameters
name (int) – Numeric ID for Wedge.
boundary_type (mcnpy.BoundaryType) – Boundary condition for Wedge.
vertex (mcnpy.Point) – Vertex for Wedge.
vectors (iterable of mcnpy.Point) – Vectors for Wedge.
axis (mcnpy.Point) – Axis for Wedge.
comment (str) – Comment for Wedge.
- class mcnpy.TruncatedCone(*args, **kwargs)[source]
Bases:
IDManagerMixin,TruncatedCone,Surface,MacrobodyTruncated Right Angle Cone defined by a base point, axis height vector, radius of the lower cone r0, and radius of the upper cone r1. A representation of the model object TruncatedCone.
- Parameters
name (int) – Numeric ID for TruncatedCone.
boundary_type (mcnpy.BoundaryType) – Boundary condition for TruncatedCone.
base (mcnpy.Point) – Base for TruncatedCone.
axis (mcnpy.Point) – Axis for TruncatedCone.
r0 (float) – R0 for TruncatedCone.
r1 (float) – R1 for TruncatedCone.
comment (str) – Comment for TruncatedCone.