pyg4ometry.fluka¶
Subpackages¶
Submodules¶
- pyg4ometry.fluka.Writer
- pyg4ometry.fluka.body
- pyg4ometry.fluka.boolean_algebra
- pyg4ometry.fluka.card
- pyg4ometry.fluka.directive
- pyg4ometry.fluka.elcfield
- pyg4ometry.fluka.extruder
- pyg4ometry.fluka.flair
- pyg4ometry.fluka.fluka_registry
- pyg4ometry.fluka.lattice
- pyg4ometry.fluka.material
- pyg4ometry.fluka.mgnfield
- pyg4ometry.fluka.preprocessor
- pyg4ometry.fluka.reader
- pyg4ometry.fluka.region
- pyg4ometry.fluka.vector
- pyg4ometry.fluka.vis
Classes¶
Rectangular Parallelepiped |
|
General Rectangular Parallelepiped |
|
Sphere |
|
Right Circular Cylinder |
|
Right Elliptical Cylinder |
|
Truncated Right-angled Cone |
|
Ellipsoid of Revolution |
|
Right Angle Wedge |
|
Base class representing a body as defined in FLUKA |
|
Arbitrary Convex Polyhedron |
|
Infinite half-space delimited by the x-y plane (perpendicular to the z-axis) |
|
Infinite half-space delimited by the x-y plane (perpendicular to the y-axis) |
|
Infinite half-space delimited by the x-y plane (perpendicular to the x-axis) |
|
Infinite half-space delimited by the x-y plane (perpendicular to the z-axis) Generic infinite half-space. |
|
Infinite Circular Cylinder parallel to the x-axis |
|
Infinite Circular Cylinder parallel to the y-axis |
|
Infinite Circular Cylinder parallel to the z-axis |
|
Infinite Elliptical Cylinder parallel to the x-axis |
|
Infinite Elliptical Cylinder parallel to the y-axis |
|
Infinite Elliptical Cylinder parallel to the z-axis |
|
Generic quadric |
|
Class to read a FLUKA file. |
|
Class to write FLUKA input files from a fluka registry object. |
|
Object to store geometry for FLUKA input and output. All of the FLUKA classes can be used without storing them in the Registry. The registry is used to write the FLUKA output file. |
|
Represents a zone which consists of one or more body intersections |
|
Represents a region which consists of a region name, one or more |
|
expansion, translation, rotoTranslation can be either a single |
|
translation in mm, angles in degrees |
|
container for dealing with a recursively defined |
|
A FLUKA material consisting of a single element. This corresponds |
|
A FLUKA compound material. This corresponds to the case in |
|
Card class for representing a FLUKA input card. To construct |
|
Base class for all solids |
Functions¶
|
Use this to temporarily modify INFINITY, with it resetting back |
|
|
|
|
|
|
|
|
|
Convert sympy boolean to fluka region |
Package Contents¶
- class pyg4ometry.fluka.RPP(name, xmin, xmax, ymin, ymax, zmin, zmax, transform=None, flukaregistry=None, addRegistry=True, comment='')¶
Bases:
BodyMixinRectangular Parallelepiped
- Parameters:
- name¶
- lower¶
- upper¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- lengths()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.BOX(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, addRegistry=True, comment='')¶
Bases:
BodyMixinGeneral Rectangular Parallelepiped
- Parameters:
- name¶
- vertex¶
- edge1¶
- edge2¶
- edge3¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- lengths()¶
- geant4Solid(greg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.SPH(name, point, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinSphere
- Parameters:
- name¶
- point¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.RCC(name, face, direction, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinRight Circular Cylinder
- Parameters:
- name¶
- face¶
- direction¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.REC(name, face, direction, semiminor, semimajor, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinRight Elliptical Cylinder
- Parameters:
- name¶
- face¶
- direction¶
- semiminor¶
- semimajor¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.TRC(name, major_centre, direction, major_radius, minor_radius, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinTruncated Right-angled Cone
- Parameters:
- name¶
- major_centre¶
- direction¶
- major_radius¶
- minor_radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(registry, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.ELL(name, focus1, focus2, length, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinEllipsoid of Revolution
- Parameters:
- name¶
- focus1¶
- focus2¶
- length¶
- transform¶
- comment¶
- semimajor¶
- centre(aabb=None)¶
- rotation()¶
- _linearEccentricity()¶
- _semiminor()¶
- geant4Solid(greg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.WED(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, comment='')¶
Bases:
_WED_RAWRight Angle Wedge
- class pyg4ometry.fluka.RAW(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, comment='')¶
Bases:
_WED_RAWBase class representing a body as defined in FLUKA
- __doc__¶
- class pyg4ometry.fluka.ARB(name, vertices, facenumbers, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixinArbitrary Convex Polyhedron
- Parameters:
name (str) – of body
vertices (list) – Eight vertices which make up the polyhedron as [[x1, y1, z1], [x2, y2, z2], …]. There must be eight even if only six or seven vertices are needed to make up the polydedron.
facenumbers (float) – The faces of the polyhedron expressed as floats where each digit of the float refers to one of the vertices which makes up that face. Six must always be provided as [1234,8765, …], even if only four or five faces are needed. Any unneeded faces must be set to 0 (no less than 4 sides). Note that the references to the vertices are not zero-counting. The order of the vertices denoted in the facenumbers must be either all clockwise or all anticlockwise, which if not obeyed will result in erroneous output without warning.
- name¶
- vertices¶
- facenumbers¶
- transform¶
- comment¶
- _nfaces = 6¶
- zeros = []¶
- centre(aabb=None)¶
- rotation()¶
- _faceNumbersToZeroCountingIndices()¶
- _extent()¶
- geant4Solid(greg, aabb=None)¶
- _toTesselatedSolid(verticesAndPolygons, greg, addRegistry)¶
- _getVerticesAndPolygons()¶
- _toVerticesAndPolygons(reverse)¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.XYP(name, z, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the z-axis)
- Parameters:
- name¶
- z¶
- transform¶
- comment¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.fluka.XZP(name, y, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the y-axis)
- Parameters:
- name¶
- y¶
- transform¶
- comment¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.fluka.YZP(name, x, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the x-axis)
- Parameters:
- name¶
- x¶
- transform¶
- comment¶
- __repr__()¶
- _withLengthSafety(safety, reg)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.fluka.PLA(name, normal, point, transform=None, flukaregistry=None, comment='')¶
Bases:
_HalfSpaceMixinInfinite half-space delimited by the x-y plane (perpendicular to the z-axis) Generic infinite half-space.
- Parameters:
- name¶
- normal¶
- point¶
- transform¶
- comment¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- toPlane()¶
- class pyg4ometry.fluka.XCC(name, y, z, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
_InfiniteCylinderMixin,_ShiftableCylinderMixinInfinite Circular Cylinder parallel to the x-axis
- Parameters:
- name¶
- y¶
- z¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- point()¶
- direction()¶
- class pyg4ometry.fluka.YCC(name, z, x, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
_InfiniteCylinderMixin,_ShiftableCylinderMixinInfinite Circular Cylinder parallel to the y-axis
- Parameters:
- name¶
- z¶
- x¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- point()¶
- direction()¶
- class pyg4ometry.fluka.ZCC(name, x, y, radius, transform=None, flukaregistry=None, comment='')¶
Bases:
_InfiniteCylinderMixin,_ShiftableCylinderMixinInfinite Circular Cylinder parallel to the z-axis
- Parameters:
- name¶
- x¶
- y¶
- radius¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- point()¶
- direction()¶
- class pyg4ometry.fluka.XEC(name, y, z, ysemi, zsemi, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixin,_ShiftableCylinderMixinInfinite Elliptical Cylinder parallel to the x-axis
- Parameters:
- name¶
- y¶
- z¶
- ysemi¶
- zsemi¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.YEC(name, z, x, zsemi, xsemi, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixin,_ShiftableCylinderMixinInfinite Elliptical Cylinder parallel to the y-axis
- Parameters:
- name¶
- z¶
- x¶
- zsemi¶
- xsemi¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.ZEC(name, x, y, xsemi, ysemi, transform=None, flukaregistry=None, comment='')¶
Bases:
BodyMixin,_ShiftableCylinderMixinInfinite Elliptical Cylinder parallel to the z-axis
- Parameters:
- name¶
- x¶
- y¶
- xsemi¶
- ysemi¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- geant4Solid(reg, aabb=None)¶
- __repr__()¶
- _withLengthSafety(safety, reg=None)¶
- flukaFreeString()¶
- hash()¶
- class pyg4ometry.fluka.QUA(name, cxx, cyy, czz, cxy, cxz, cyz, cx, cy, cz, c, transform=None, flukaregistry=None, comment='', **kwargs)¶
Bases:
BodyMixinGeneric quadric
- Parameters:
name (str) – of body
cxx (float) – x^2 coefficient
cyy (float) – y^2 coefficient
czz (float) – z^2 coefficient
cxy (float) – xy coefficient
cxz (float) – xz coefficient
cyz (float) – yz coefficient
cx (float) – x coefficient
cy (float) – y coefficient
cz (float) – z coefficient
c (constant) – constant
- name¶
- cxx¶
- cyy¶
- czz¶
- cxy¶
- cxz¶
- cyz¶
- cx¶
- cy¶
- cz¶
- c¶
- transform¶
- comment¶
- centre(aabb=None)¶
- rotation()¶
- coefficientsMatrix()¶
- static _quadricMatrixToCoefficients(matrix)¶
- mesh(lower, upper, capping=True)¶
- geant4Solid(reg, aabb=None)¶
- _withLengthSafety(safety, reg=None)¶
- __repr__()¶
- flukaFreeString()¶
- hash()¶
- pyg4ometry.fluka.infinity(inf)¶
Use this to temporarily modify INFINITY, with it resetting back to the default once the block has exited. INFINITY is used throughout the bodies to approximate the infinite size of infinity (elliptical) cylinders, half spaces, and quadrics.
- Parameters:
inf – the value to temporarily set INFINITY to.
- class pyg4ometry.fluka.Reader(filename)¶
Class to read a FLUKA file.
- filename¶
- flukaregistry¶
- cards = []¶
- getRegistry()¶
Get the fluka registry
- _load()¶
Load the FLUKA input file
- _findLines()¶
- _parseBodies()¶
- _parseRegions()¶
- _parseCards()¶
- _parseRotDefinis()¶
- _parseGeometryDirective(line_parts, expansion_stack, translation_stack, transform_stack)¶
- _parseMaterialAssignments()¶
- _parseLattice()¶
- _parseMaterials()¶
- _splitMaterialCards()¶
Return a tuple as (Elements, Compounds, Matprop (not yet implemented)). Each is keyed with the name of the material, and the value corresponds to the card (Element) or cards (Compounds) that define the material.
- class pyg4ometry.fluka.Writer¶
Class to write FLUKA input files from a fluka registry object.
>>> f = Writer() >>> f.addDetectro(flukaRegObject) >>> f.write("model.inp")
- _flukaFFString = '*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+...'¶
- addDetector(flukaRegistry)¶
Set the fluka registry and therefore the model for this writer instance.
- write(fileName)¶
Write the output to a given filename. e.g. “model.inp”.
- class pyg4ometry.fluka.FlukaRegistry¶
Object to store geometry for FLUKA input and output. All of the FLUKA classes can be used without storing them in the Registry. The registry is used to write the FLUKA output file.
- bodyDict¶
- rotoTranslations¶
- regionDict¶
- materials¶
- iMaterials = 0¶
- materialShortName¶
- latticeDict¶
- mgnFieldDict¶
- cardDict¶
- assignmas¶
- _predefinedMaterialNames¶
- iMerge = 0¶
- iMergeBodies = 0¶
- iMergeRegions = 0¶
- iMergeMaterials = 0¶
- _bodiesAndRegions¶
- PhysVolToRegionMap¶
- addBody(body)¶
- makeBody(clas, *args, **kwargs)¶
- getDegenerateBody(body)¶
- addRotoTranslation(rototrans)¶
- addRegion(region, addBodies=False)¶
- makeRegionsDNF()¶
- addLattice(lattice)¶
- getBody(name)¶
- getBodyToRegionsMap()¶
- printDefinitions()¶
- regionAABBs(write=None)¶
- latticeAABBs()¶
- addMaterial(material, recursive=False)¶
- getMaterial(name)¶
- addMaterialAssignments(mat, *regions, elc=None, mgn=None)¶
- assignma(material, *regions)¶
- addCard(card)¶
- addTitle(title='FLUKA simulation')¶
- addDefaults(default='EM-CASCA')¶
- addGlobal()¶
- addBeam(energy, energySpread=0.1, beamDivergence=0, beamWidthX=0.1, beamWidthY=0.0, annular=-1, particleType='ELECTRON')¶
- addBeamPos(xpos=0, ypos=0, zpos=0, xdc=0, ydc=0)¶
- addLowMat(flukaMat, lowENeutron1, lowENeutron2, lowENeutron3)¶
- addLowMatAllMaterials()¶
Add LOWMAT card to all materials
- addLowPwxs(what1=None, lowerMaterial=None, upperMaterial=None)¶
- addMgnCreat()¶
- addMgnField()¶
- addElcField()¶
- addUsrBin(mesh=0, particle='ENERGY', lunOutput=-21, e1max=1, e2max=1, e3max=1, name='name', e1min=-1, e2min=-1, e3min=-1, e1nbin=10, e2nbin=10, e3nbin=10)¶
- addRotprBin(precision=0, rotDefi=0, printEventBin=0, lowerBin=None, upperBin=None)¶
- addUsrBdx(binning, scoringDir, scoringType, type, reg1, reg2, name, area=1.0, lunOutput=-22, maxKE=None, minKE=None, nKEbin=None, maxSA=None, minSA=None, nSAbin=None)¶
- addUsricall()¶
- addUsrocall()¶
- addUsrDump(mgdraw=100, lun=70, mgdrawOpt=-1, what4=0, sdum=None)¶
- addRandomiz(seedLun=1, seed=54217137)¶
- addStart(maxPrimHistories=1, timeTermSec=None, coreDump=None, eachHistoryOutput=None)¶
- addPhotonuc(what1, mat_low, mat_high, mat_step, sdum='')¶
- addMuphoton(what1, mat_low, mat_high, mat_step)¶
- addPairbrem(what1, what2, what3, mat_low, mat_high, mat_step)¶
- addDeltaRay(what1, what2, what3, mat_low, mat_high, mat_step, dsum='NOPRINT')¶
- addIonFluct(what1, what2, what3, mat_low, mat_high, mat_step, dsum='PRIM-ION')¶
- printDumps(detail=1)¶
- findLastBodyIndex()¶
Find last body index (if the numbering was performed by a geant4 -> fluka conversion
- findLastRegionIndex()¶
Find last region index (if the numbering was performed by a geant4 -> fluka conversion
- findLastMaterialIndex()¶
Find last material index (if the numbering was performed by a geant4 -> fluka conversion
- findLastTransformationIndex()¶
- checkBodyName(bodyName)¶
- checkRegionName(regionName)¶
- checkMaterialName(materialName)¶
- addRegistry(flukaRegistry, outerRegion=None, rotation=[0, 0, 0], translation=[0, 0, 0], removeRegions=[], removeRegionDependents=False)¶
- class pyg4ometry.fluka.FlukaBodyStoreExact¶
- nameBody¶
- hashBody¶
- hashName¶
- _bodyNames()¶
- _bodies()¶
- make(cls, *args, **kwargs)¶
- getDegenerateBody(body)¶
- addBody(body)¶
- keys()¶
- values()¶
- __setitem__(key, value)¶
- __getitem__(key)¶
- __delitem__(key)¶
- __len__()¶
- __contains__(key)¶
- __iter__()¶
- __repr__()¶
- class pyg4ometry.fluka.Three(shape, dtype=float, buffer=None, offset=0, strides=None, order=None)¶
Bases:
numpy.ndarray- property x¶
- property y¶
- property z¶
- parallel_to(other, tolerance=1e-10)¶
Check if instance is parallel to some other vector, v
- unit()¶
Get this as a unit vector.
- length()¶
vector length (l2 norm)
- dot(other)¶
- cross(other)¶
- __eq__(other)¶
- __ne__(other)¶
- __add__(other)¶
- __radd__(other)¶
- __sub__(other)¶
- __rsub__(other)¶
- __iadd__(other)¶
- __isub__(other)¶
- class pyg4ometry.fluka.AABB(lower, upper)¶
- lower¶
- upper¶
- size¶
- centre¶
- __repr__()¶
- __eq__(other)¶
- cornerDistance()¶
- classmethod fromMesh(csgmesh)¶
- intersects(other)¶
- coplanarIntersects(other)¶
- envelops(other)¶
- intersect(other)¶
- union(other)¶
- isNull()¶
- class pyg4ometry.fluka.Zone(name=None)¶
Bases:
pyg4ometry.fluka.vis.ViewableMixinRepresents a zone which consists of one or more body intersections and zero or more body subtractions. May also be used to represent subzones, which are zones nested within zones, for example the form +A -B -(+C -D). Once instantiated, intersections and subtractions can be added to this instance with the addIntersection and addSubtraction method.
- Parameters:
name (string) – Optional name for the zone.
- intersections = []¶
- subtractions = []¶
- name¶
- addSubtraction(body)¶
Add a body or subzone as a subtraction to this Zone instance.
- Parameters:
body (Body or Zone) – Body or Zone instance.
- addIntersection(body)¶
Add a body or subzone as an intersection to this Zone instance.
- Parameters:
body – Body or Zone instance.
- Type:
body: Body or Zone
- convertToDNF(fluka_registry)¶
- centre(aabb=None)¶
- rotation()¶
- tbxyz()¶
- static _getSolidFromBoolean(boolean, g4reg, aabb)¶
- mesh(aabb=None)¶
- geant4Solid(reg, aabb=None)¶
Translate this zone to a geant4solid, adding the constituent primitive solids and any Booleans to the Geant4 registry. Returns the geant4 solid equivalent in geometry to this Zone.
- Parameters:
reg (AABB or dict) – The Registry (geant4) instance to which the resulting Geant4 definitions should be added.
aabb – Optional reference AABB or dictionary of body name to AABB instances with which the geant4 solid should be evaluated with respect to. This is the entry point to which solid minimisation can be performed.
- _combine_booleans(body0, start, collection, operation, reg, aabb)¶
- _geant4MultiUnionSubtraction(body0, start, reg, aabb)¶
- dumps()¶
Returns a string of this Zone instance in the equivalent FLUKA syntax.
- dumpsDebug()¶
Returns a string of this Zone instance in the equivalent FLUKA syntax with extra debug information
- withLengthSafety(bigger_flukareg, smaller_flukareg, shrink_intersections)¶
- allBodiesToRegistry(flukaregistry)¶
Add all the bodies that contitute this Zone to the provided FlukaRegistry instance.
- Parameters:
flukaregistry (FlukaRegistry) – FlukaRegistry instance to which constituent bodies will be added.
- bodies()¶
Return the set of unique bodies that constitute this Zone.
- removeBody(name)¶
Remove a body from this zone by name.
- Parameters:
name (string) – The name of the body to be removed.
- makeUnique(nameSuffix, flukaregistry)¶
Get this zone with every constituent body recreated with a unique name by appending nameSuffix.
- Parameters:
nameSuffix – The string to append to the names of the bodies.
flukaregistry – the FlukaRegisytr instance to add the uniquely defined bodies to.
- isNull(aabb=None)¶
- toDNF(name)¶
- isDNF()¶
- leafCount()¶
- class pyg4ometry.fluka.Region(name, comment='')¶
Bases:
pyg4ometry.fluka.vis.ViewableMixinRepresents a region which consists of a region name, one or more zones, and a single material. Metadata may be provided with the comment kwarg, which is used when writing to FLUKA to provide contextual information to the physicist.
- Parameters:
- name¶
- zones = []¶
- comment¶
- addZone(zone)¶
Add a Zone instance to this region.
- Parameters:
zone (Zone) – The Zone instance to be added.
- addIntersection(zone)¶
- addSubtraction(zone)¶
- extend(region)¶
- removeNullZones()¶
- convertToDNF(fluka_registry)¶
- centre(aabb=None)¶
- tbxyz()¶
- rotation()¶
- bodies()¶
Return the set of unique bodies that constitute this Zone.
- mesh(aabb=None)¶
- geant4Solid(reg, aabb=None)¶
Get the geant4Solid instance corresponding to this Region.
- dumps()¶
- flukaFreeString()¶
- withLengthSafety(bigger_flukareg, smaller_flukareg)¶
- allBodiesToRegistry(registry)¶
Add all the bodies that constitute this Region to the provided FlukaRegistry instance.
- Parameters:
flukaregistry (FlukaRegistry) – FlukaRegistry instance to which constituent bodies will be added.
- zoneGraph(zoneAABBs=None, aabb=None)¶
- _zoneGraphPycgal()¶
- connectedZones(zoneAABBs=None, aabb=None)¶
- zoneAABBs(aabb=None)¶
- aabb(aabb=None)¶
- removeBody(name)¶
Remove a body from this region by name.
- Parameters:
name (string) – The name of the body to be removed.
- makeUnique(nameSuffix, flukaregistry)¶
Get this Region instance with every constituent body with a unique name by appending nameSuffix to each Body instance.
- Parameters:
nameSuffix – string to append to each Body instance.
flukaregistry – FlukaRegisty instance to add each newly-defined body to.
- isNull(aabb=None)¶
- toDNF(name)¶
- isDNF()¶
- filterNullZones(aabb=None)¶
- leafCount()¶
- simplify()¶
- __repr__()¶
- removeZones(indices)¶
Remove zones by index
- pyg4ometry.fluka.bracket_depth(zone)¶
- pyg4ometry.fluka.bracket_number(zone)¶
- pyg4ometry.fluka.zone_to_sympy(zone)¶
- pyg4ometry.fluka.region_to_sympy(region)¶
- pyg4ometry.fluka.sympy_to_region(sympy_expr, freg, regionName='name')¶
Convert sympy boolean to fluka region Must be the OR of multiple convex zones
- class pyg4ometry.fluka.Transform(*, expansion=None, translation=None, rotoTranslation=None, invertRotoTranslation=None)¶
Bases:
MatrixConvertibleMixinexpansion, translation, rotoTranslation can be either a single instance of RotoTranslation or a multiple instances of RotoTranslation and RecursiveRotoTranslation
- expansion¶
- translation¶
- rotoTranslation¶
- invertRotoTranslation¶
- _expansionsTo4DMatrices()¶
- _translationsTo4DMatrices()¶
- _rotoTranslationsTo4DMatrices()¶
- to4DMatrix()¶
- class pyg4ometry.fluka.RotoTranslation(name, axis=None, polar=0.0, azimuth=0.0, translation=None, transformationIndex=None, flukaregistry=None)¶
Bases:
MatrixConvertibleMixintranslation in mm, angles in degrees
- name¶
- axis¶
- polar¶
- azimuth¶
- translation¶
- transformationIndex¶
- __repr__()¶
- to4DMatrix()¶
- toCard()¶
- flukaFreeString()¶
- classmethod fromCard(card)¶
- hasTranslation()¶
- hasRotation()¶
- isPureTranslation()¶
- class pyg4ometry.fluka.RecursiveRotoTranslation(name, rotoTranslations)¶
Bases:
collections.abc.MutableSequence,MatrixConvertibleMixincontainer for dealing with a recursively defined rototranslation. they must also refer to the same rototrans, i.e., have the same name. for a list of rototranslations supplied:
[a, b, c], the order of evaluation acting on a vector v is c*b*a*v. so teh first rototrans is applied first.. and so on.
- name¶
- _rtransList¶
- names¶
- __repr__()¶
- __getitem__(i)¶
- _raiseIfDifferentName(name)¶
- __setitem__(i, obj)¶
- __delitem__(i)¶
- __len__()¶
- insert(i, obj)¶
S.insert(index, value) – insert value before index
- to4DMatrix()¶
- flukaFreeString()¶
- _transformationIndices()¶
- areAllTheSameTransformationIndices()¶
- property transformationIndex¶
- class pyg4ometry.fluka.Lattice(cellRegion, rotoTranslation, invertRotoTranslation=False, flukaregistry=None)¶
- cellRegion¶
- rotoTranslation¶
- invertRotoTranslation¶
- flukaFreeString(delim=', ')¶
- getTransform()¶
- class pyg4ometry.fluka.Flair(flukaInputFileName='fluka.inp', extent=None)¶
- flukaInputFileName¶
- flukaTemplateFileName¶
- extent¶
- matrialColours¶
- write(fileName)¶
- addMaterialColour(materialName, color=(0, 0, 0, 0))¶
- class pyg4ometry.fluka.BuiltIn(name, *, atomicNumber=None, atomicMass=None, density=None, flukaregistry=None)¶
- name¶
- atomicNumber¶
- atomicMass¶
- density¶
- __repr__()¶
- flukaFreeString(delim='')¶
- class pyg4ometry.fluka.Material(name, atomicNumber, density, massNumber=None, atomicMass=None, pressure=None, flukaregistry=None, comment='')¶
Bases:
_MatPropA FLUKA material consisting of a single element. This corresponds to the case in FLUKA of a single MATERIAL card with no associated COMPOUND cards, as well as a possible MAT-PROP card (only if a pressure is provided, other options of MAT-PROP are unsupported).
- Parameters:
name (str) – The name of the material
atomicNumber (int) – the atomic number, Z, of the element.
density (float) – the density in g/cm3 of the material.
massNumber (int, None) – Optional mass number, will be inferred in FLUKA based on atomicNumber. Allows one to specify a specific isotope.
atomicMass (float) – The mass of the atom in g/mole. Will be inferred in FLUKA based on atomicNumber.
pressure (float) – Optional pressure if the material is a gas.
flukaregistry (FlukaRegistry) – Optional FlukaRegistry instance the material is to be added to.
- name¶
- atomicNumber¶
- density¶
- atomicMass¶
- massNumber¶
- pressure¶
- comment¶
- toCards()¶
- flukaFreeString(delim=', ')¶
- __repr__()¶
- classmethod fromCard(card, flukaregistry)¶
- rename(newName, recursive=False, iIndex=0)¶
- class pyg4ometry.fluka.Compound(name, density, fractions, fractionType, pressure=None, flukaregistry=None, comment='')¶
Bases:
_MatPropA FLUKA compound material. This corresponds to the case in FLUKA of a single MATERIAL card with one or more associated COMPOUND cards.
- Parameters:
name (str) – The name of the compound.
density (float) – The density of the compound in g/cm3
fractions (list) – List of (Element, fraction) and (Compound, fraction) tuples corresponding to the fractional proportion of that material.
fractionType (str) – The type of the fractions listed in the fractions parameter, either atomic, mass, or volume.
flukaregistry (FlukaRegistry) – Optional FlukaRegistry instance the Compound is to be added to.
- name¶
- density¶
- fractions¶
- fractionType¶
- pressure¶
- comment¶
- toCards()¶
- flukaFreeString(delim=', ')¶
- classmethod fromCards(cards, flukareg)¶
- __repr__()¶
- totalWeighting(densityWeighted=False)¶
- rename(newName, recursive=True, iIndex=0)¶
- class pyg4ometry.fluka.Card(keyword, what1=None, what2=None, what3=None, what4=None, what5=None, what6=None, sdum=None)¶
Card class for representing a FLUKA input card. To construct instances from a of FLUKA input, use the fromFree or fromFixed class method for FREE and FIXED format, respectively.
- keyword¶
- what1¶
- what2¶
- what3¶
- what4¶
- what5¶
- what6¶
- sdum¶
- __repr__()¶
- toList()¶
- toFreeString(delim=', ')¶
- toFixedString()¶
- nonesToZero()¶
Return a class instance with same contents as this instance, but with all entries of None set to 0.0 instead.
- classmethod fromFree(line)¶
- classmethod fromFixed(line)¶
- class pyg4ometry.fluka.Extruder(name='', length=1000, angle=0.0, regions=None, materials=None, registry=None)¶
Bases:
pyg4ometry.geant4.solid.SolidBaseBase class for all solids
- length¶
- angle¶
- regions¶
- materials¶
- cgalpolys¶
- extrusions¶
- decomposed¶
- g4_extrusions¶
- g4_decomposed_extrusions¶
- extruders¶
- addRegion(name, material=None)¶
- addRegionComplete(name, pointList, material=None, scale=None, dxdy=None)¶
- addExtruder(extruder)¶
- addPointToRegion(name, pntIndx)¶
- setRegionToOuterBoundary(name)¶
- setRegionMaterial(name, material)¶
- getRegionMaterial(name)¶
- buildCgalPolygons()¶
- buildGeant4Extrusions()¶
- _buildStraightExtrustions()¶
- _buildCurvedExtrusions()¶
- plot(decompositions=False)¶
- polygon_area(vertices)¶
- mesh()¶