diff --git a/src/geouned/GEOReverse/Modules/MCNPinput.py b/src/geouned/GEOReverse/Modules/MCNPinput.py index e9d9f490..ac06e20d 100644 --- a/src/geouned/GEOReverse/Modules/MCNPinput.py +++ b/src/geouned/GEOReverse/Modules/MCNPinput.py @@ -1074,7 +1074,7 @@ def get_hyperboloid_parameters(eVal, eVect, T, k, iaxis): cylTan = 1e3 coneRad = 0.1 - elliposoid = False + ellipsoid = False if iaxis is None: iaxis = np.argmin(np.abs(eVal)) ellipsoid = True @@ -1101,7 +1101,7 @@ def get_hyperboloid_parameters(eVal, eVect, T, k, iaxis): elif minorRad < coneRad: return get_cone_parameters(eVal, eVect, T, iaxis) else: - if elliposoid: + if ellipsoid: print("ellipical hyperboloid not implemented") print("single radius from {} eigen Value will be used".format(minorRad)) return "hyperboloid", ( @@ -1199,7 +1199,7 @@ def getGQAxis(eVal, k): ek = (0, -1) elif np.sign(e0) == np.sign(e1) and np.sign(e1) == np.sign( e2 - ): # e1*X^2 + e2*Y^2 + e0*Z^2 - |k| = 0 Elliposoid + ): # e1*X^2 + e2*Y^2 + e0*Z^2 - |k| = 0 Ellipsoid ek = (1, -1) else: # e1*X^2 + e2*Y^2 - e0*Z^2 - |k| = 0 Hyperbpoloid ek = (-1, 1) @@ -1247,7 +1247,6 @@ def gq2params(x): # f b g * beta = -v # h g c gamma -w - zeroLim = 1e-12 mat3 = np.array( [ [x[0], x[3] / 2, x[5] / 2], diff --git a/src/geouned/GEOReverse/Modules/Parser/parser.py b/src/geouned/GEOReverse/Modules/Parser/parser.py index 5431690a..927c98b0 100644 --- a/src/geouned/GEOReverse/Modules/Parser/parser.py +++ b/src/geouned/GEOReverse/Modules/Parser/parser.py @@ -1264,7 +1264,6 @@ def get_cards(inp, debug=None, preservetabs=False): If dump exists and it is newwer than the input file, read the dump file """ - iname = inp for c in get_cards_from_input(inp, debug=debug, preservetabs=preservetabs): yield c diff --git a/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py b/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py index 49c0761a..24ce1bed 100644 --- a/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py +++ b/src/geouned/GEOReverse/Modules/Utils/BooleanSolids.py @@ -244,7 +244,6 @@ def buildCTableFromSolids(Box, SurfInfo, option="diag"): surfaces = SurfInfo.surfaces surfaceList = SurfInfo.surfaceList - outSurfaces = [] for s in surfaceList: surfaces[s].buildShape(Box.BoundBox) @@ -306,7 +305,6 @@ def buildCTableFromSolids(Box, SurfInfo, option="diag"): def removeExtraSurfaces(CellSeq, CTable): # checking is make on solid cell definition to be removed from void cell outSurfaces = set(CTable.getOutSurfaces()) - changed = False newDef = BoolSequence(operator="OR") # Loop over all compound solids of the metaSolid diff --git a/src/geouned/GEOReverse/Modules/XMLinput.py b/src/geouned/GEOReverse/Modules/XMLinput.py index 9b22ee67..8b22a5fb 100644 --- a/src/geouned/GEOReverse/Modules/XMLinput.py +++ b/src/geouned/GEOReverse/Modules/XMLinput.py @@ -68,7 +68,6 @@ def GetFilteredCells(self, Surfaces, config): def GetLevelStructure(self): containers = [] Universe_dict = {} - cellCards = {} for c in self.__inputcards__: if c.type != "cell": @@ -291,10 +290,6 @@ def Get_primitive_surfaces(mcnp_surfaces, scale=10.0): X_vec = FreeCAD.Vector(1.0, 0.0, 0.0) Y_vec = FreeCAD.Vector(0.0, 1.0, 0.0) Z_vec = FreeCAD.Vector(0.0, 0.0, 1.0) - negX_vec = -X_vec - negY_vec = -Y_vec - negZ_vec = -Z_vec - origin = FreeCAD.Vector(0.0, 0.0, 0.0) surfaces = {} for Sid in mcnp_surfaces.keys(): diff --git a/src/geouned/GEOReverse/Modules/splitFunction.py b/src/geouned/GEOReverse/Modules/splitFunction.py index 643ce3ba..2a688d42 100644 --- a/src/geouned/GEOReverse/Modules/splitFunction.py +++ b/src/geouned/GEOReverse/Modules/splitFunction.py @@ -70,7 +70,6 @@ def SplitSolid(base, surfacesCut, cellObj, solidTool=False, tolerance=0.01): # Solids = [base.base] partPositions, partSolids = space_decomposition(Solids, surfacesCut) - ii = 0 for pos, sol in zip(partPositions, partSolids): # fullPos = updateSurfacesValues(pos,cellObj.surfaces,base.knownSurf) # inSolid = cellObj.definition.evaluate(fullPos) @@ -139,7 +138,6 @@ def point_inside(solid): # no poner boundbox, el punto puente caer en una superficie para geometria triangular point = solid.CenterOfMass - points = point if solid.isInside(point, 0.0, False): return point diff --git a/src/geouned/GEOUNED/Conversion/CellDefinition.py b/src/geouned/GEOUNED/Conversion/CellDefinition.py index 8c8fd8d2..50ded8d5 100644 --- a/src/geouned/GEOUNED/Conversion/CellDefinition.py +++ b/src/geouned/GEOUNED/Conversion/CellDefinition.py @@ -382,7 +382,6 @@ def GenPlaneCylinder_old(face, solid): try: UVNodes.append(face2.getUVNodes()) except RuntimeError: - tess = face.tessellate(1.0, True) UVNodes.append(face2.getUVNodes()) Uval_str_cl = [] @@ -404,12 +403,9 @@ def GenPlaneCylinder_old(face, solid): # searching for minimum and maximum angle points for j, Nodes in enumerate(UVNodes): for elem in Nodes: - val = "%11.4E" % elem[0] dif1 = abs(float(Uval_str_cl[0]) - elem[0]) dif2 = abs(float(Uval_str_cl[1]) - elem[0]) - if abs(elem[0]) < 1.0e-5: - val = "%11.4E" % 0.0 if dif1 < dif1_0: Node_min = elem face_index_2[0] = face_index[j] @@ -483,8 +479,6 @@ def GenPlaneCone(face, solid): def GenPlaneCone_old(face, solid): Surf = face.Surface - rad = Surf.Radius - Axis = face.Surface.Axis if str(Surf) != "": return None @@ -544,11 +538,8 @@ def GenPlaneCone_old(face, solid): # searching for minimum and maximum angle points for j, Nodes in enumerate(UVNodes): for elem in Nodes: - val = "%11.4E" % elem[0] dif1 = abs(float(Uval_str_cl[0]) - elem[0]) dif2 = abs(float(Uval_str_cl[1]) - elem[0]) - if abs(elem[0]) < 1.0e-5: - val = "%11.4E" % 0.0 if dif1 < dif1_0: Node_min = elem face_index_2[0] = face_index[j] @@ -1165,7 +1156,6 @@ def ExtraPlaneCylFace(face, Box, Surfaces): plane = GEOUNED_Surface( ("Plane", (center, dir, dim1, dim2)), Box, Face="Build" ) - sign = signPlane(face.CenterOfMass, plane) id, exist = Surfaces.addPlane(plane) if exist: pp = Surfaces.getSurface(id) diff --git a/src/geouned/GEOUNED/Decompose/Decom_one.py b/src/geouned/GEOUNED/Decompose/Decom_one.py index bc3167e3..3246e4db 100644 --- a/src/geouned/GEOUNED/Decompose/Decom_one.py +++ b/src/geouned/GEOUNED/Decompose/Decom_one.py @@ -229,13 +229,9 @@ def ExtractSurfaces(solid, kind, UniverseBox, MakeObj=False): P3P = False solidParts = [GU.solid_GU(solid, P3P)] - ex = FreeCAD.Vector(1, 0, 0) - ey = FreeCAD.Vector(0, 1, 0) - ez = FreeCAD.Vector(0, 0, 1) Surfaces = UF.Surfaces_dict() for solid_GU in solidParts: - flag_inv = CD.isInverted(solid_GU.solid) # Get the parameter of all faces of the solid # Add auxillary planes for Cylinders and Cones @@ -501,12 +497,9 @@ def GenPlaneCylinder(face, solid): for j, Nodes in enumerate(UVNodes): for elem in Nodes: - val = "%11.4E" % elem[0] dif1 = abs(float(Uval_str_cl[0]) - elem[0]) dif2 = abs(float(Uval_str_cl[1]) - elem[0]) - if abs(elem[0]) < 1.0e-5: - val = "%11.4E" % 0.0 if dif1 < dif1_0: Node_min = elem face_index_2[0] = face_index[j] @@ -535,9 +528,6 @@ def GenPlaneCylinder(face, solid): # function should be reviewed def GenPlaneCone(face, solid): - Surf = face.Surface - rad = Surf.Radius - if face.Area < 1e-2: return None @@ -628,12 +618,9 @@ def GenPlaneCone(face, solid): # searching for minimum and maximum angle points for j, Nodes in enumerate(UVNodes): for elem in Nodes: - val = "%11.4E" % elem[0] dif1 = abs(float(Uval_str_cl[0]) - elem[0]) dif2 = abs(float(Uval_str_cl[1]) - elem[0]) - if abs(elem[0]) < 1.0e-5: - val = "%11.4E" % 0.0 if dif1 < dif1_0: Node_min = elem face_index_2[0] = face_index[j] @@ -735,7 +722,6 @@ def SplitPlanes_new(Solids, UniverseBox): def SplitPlanes_org(Solids, UniverseBox): Bases = [] - icount = 0 err = 0 for sol in Solids: Bases.append((sol, [])) @@ -988,7 +974,6 @@ def Split2ndOrderPlanes(Solids): def split2ndOPlane(solid): - Planes = [] err = 0 flag_inv = CD.isInverted(solid) solid_GU = GU.solid_GU(solid) diff --git a/src/geouned/GEOUNED/LoadFile/LoadFunctions.py b/src/geouned/GEOUNED/LoadFile/LoadFunctions.py index 3aac03ac..cb56527d 100644 --- a/src/geouned/GEOUNED/LoadFile/LoadFunctions.py +++ b/src/geouned/GEOUNED/LoadFile/LoadFunctions.py @@ -13,7 +13,6 @@ def GetLabel(label): return label wrd = label.split() try: - val = float(wrd[-1]) new_label = " ".join(wrd[:-1]) return new_label except: diff --git a/src/geouned/GEOUNED/LoadFile/LoadSTEP.py b/src/geouned/GEOUNED/LoadFile/LoadSTEP.py index a1098d73..b54057b9 100644 --- a/src/geouned/GEOUNED/LoadFile/LoadSTEP.py +++ b/src/geouned/GEOUNED/LoadFile/LoadSTEP.py @@ -15,7 +15,6 @@ # Paco mod def extractMaterials(filename): rhoreal = [] - namestr = [] mdict = {} # _ Material dictionary with open(filename, "rt") as file: for line in file: diff --git a/src/geouned/GEOUNED/Utils/BasicFunctions_part2.py b/src/geouned/GEOUNED/Utils/BasicFunctions_part2.py index 5fbb84d3..430e1303 100644 --- a/src/geouned/GEOUNED/Utils/BasicFunctions_part2.py +++ b/src/geouned/GEOUNED/Utils/BasicFunctions_part2.py @@ -41,7 +41,6 @@ def Fuzzy(index, dtype, surf1, surf2, val, tol): elif dtype == "cylAxs": cyl1str = MCNPSurface(index, "Cylinder", surf1) cyl2str = MCNPSurface(0, "Cylinder", surf2) - c12 = surf1.Center - surf2.Center line = "Same surface : {}\nDist Axis / Tolerance: {} {}\n {}\n {}\n\n".format( same, val, tol, cyl1str, cyl2str ) diff --git a/src/geouned/GEOUNED/Utils/BooleanSolids.py b/src/geouned/GEOUNED/Utils/BooleanSolids.py index 3fb4735e..e1d9cf5c 100644 --- a/src/geouned/GEOUNED/Utils/BooleanSolids.py +++ b/src/geouned/GEOUNED/Utils/BooleanSolids.py @@ -250,7 +250,6 @@ def buildCTableFromSolids(Box, SurfInfo, option="diag"): surfaces = SurfInfo.Surfaces surfaceList = SurfInfo.surfaceList - outSurfaces = [] if type(surfaces[surfaceList[0]]) is GEOUNED_Surface: for s in surfaceList: ss = surfaces[s] @@ -318,7 +317,6 @@ def buildCTableFromSolids(Box, SurfInfo, option="diag"): def removeExtraSurfaces(CellSeq, CTable): # checking is make on solid cell definition to be removed from void cell outSurfaces = set(CTable.getOutSurfaces()) - changed = False newDef = BoolSequence(operator="OR") # Loop over all compound solids of the metaSolid diff --git a/src/geouned/GEOUNED/Void/VoidBoxClass.py b/src/geouned/GEOUNED/Void/VoidBoxClass.py index 309770c7..f4640ea2 100644 --- a/src/geouned/GEOUNED/Void/VoidBoxClass.py +++ b/src/geouned/GEOUNED/Void/VoidBoxClass.py @@ -156,8 +156,6 @@ def refine(self): FreeCAD.Vector(self.BoundBox.XMin, self.BoundBox.YMin, self.BoundBox.ZMin), FreeCAD.Vector(0, 0, 1), ) - refinedList = [] - newcom = [] for m in self.Objects: self.__removeExtraComp__(m, Cube, mode="dist") @@ -290,8 +288,6 @@ def getVoidComplementary(self, Surfaces, simplify="no"): compSeq = voidSolidDef.getComplementary() else: - newCell = [] - if voidSolidDef.level == 1 and voidSolidDef.operator == "AND": compSeq = BoolSequence(operator="OR") else: diff --git a/src/geouned/GEOUNED/Write/Functions.py b/src/geouned/GEOUNED/Write/Functions.py index 975d37b1..4095eb6d 100644 --- a/src/geouned/GEOUNED/Write/Functions.py +++ b/src/geouned/GEOUNED/Write/Functions.py @@ -733,13 +733,6 @@ def SerpentSurface(id, Type, surf): ) else: Q = Qform.QFormCone(Dir, Apex, tan) - MCNP_def = """\ -surf quadratic {v[0]:{aTof}} {v[1]:{aTof}} {v[2]:{aTof}} - {v[3]:{aTof}} {v[4]:{aTof}} {v[5]:{aTof}} - {v[6]:{gToi}} {v[7]:{gToi}} {v[8]:{gToi}} - {v[9]:{j}} """.format( - id, v=Q, aTof=nf.GQ_1to6, gToi=nf.GQ_7to9, j=nf.GQ_10 - ) elif Type == "Sphere": rad = surf.Radius * 0.1 diff --git a/src/geouned/GEOUNED/Write/MCNPFormat.py b/src/geouned/GEOUNED/Write/MCNPFormat.py index 7e76fb44..a157b16b 100644 --- a/src/geouned/GEOUNED/Write/MCNPFormat.py +++ b/src/geouned/GEOUNED/Write/MCNPFormat.py @@ -300,8 +300,6 @@ def __getSurfaceTable__(self): return def __simplifyPlanes__(self, Surfaces): - offset = len(self.Cells) - keys = self.surfaceTable.keys() for p in Surfaces["PX"]: if p.Surf.Axis[0] < 0: diff --git a/src/geouned/GEOUNED/Write/OpenMCFormat.py b/src/geouned/GEOUNED/Write/OpenMCFormat.py index 48ebfd68..a425665a 100644 --- a/src/geouned/GEOUNED/Write/OpenMCFormat.py +++ b/src/geouned/GEOUNED/Write/OpenMCFormat.py @@ -225,8 +225,6 @@ def __getSurfaceTable__(self): return def __simplifyPlanes__(self, Surfaces): - offset = len(self.Cells) - keys = self.surfaceTable.keys() for p in Surfaces["PX"]: if p.Surf.Axis[0] < 0: diff --git a/src/geouned/GEOUNED/Write/PHITSFormat.py b/src/geouned/GEOUNED/Write/PHITSFormat.py index 8163a138..62c60511 100644 --- a/src/geouned/GEOUNED/Write/PHITSFormat.py +++ b/src/geouned/GEOUNED/Write/PHITSFormat.py @@ -551,8 +551,6 @@ def __getSurfaceTable__(self): return def __simplifyPlanes__(self, Surfaces): - offset = len(self.Cells) - keys = self.surfaceTable.keys() for p in Surfaces["PX"]: if p.Surf.Axis[0] < 0: diff --git a/src/geouned/GEOUNED/Write/SerpentFormat.py b/src/geouned/GEOUNED/Write/SerpentFormat.py index 5af58fc4..82f87132 100644 --- a/src/geouned/GEOUNED/Write/SerpentFormat.py +++ b/src/geouned/GEOUNED/Write/SerpentFormat.py @@ -309,8 +309,6 @@ def __getSurfaceTable__(self): return def __simplifyPlanes__(self, Surfaces): - offset = len(self.Cells) - keys = self.surfaceTable.keys() for p in Surfaces["PX"]: if p.Surf.Axis[0] < 0: diff --git a/src/geouned/GEOUNED/Write/StringFunctions.py b/src/geouned/GEOUNED/Write/StringFunctions.py index f8cf2970..24c7287d 100644 --- a/src/geouned/GEOUNED/Write/StringFunctions.py +++ b/src/geouned/GEOUNED/Write/StringFunctions.py @@ -137,7 +137,6 @@ def redundant(m, geom): def remove_redundant(geom): """return cell without redundant parenthesis""" - porg = countP(geom) # Loop until no redundant parentheses are found cont = True while cont: diff --git a/src/geouned/GEOUNED/__init__.py b/src/geouned/GEOUNED/__init__.py index 3cd34449..e6da2c6c 100644 --- a/src/geouned/GEOUNED/__init__.py +++ b/src/geouned/GEOUNED/__init__.py @@ -374,7 +374,6 @@ def Start(self): UniverseBox = getUniverse(MetaList + EnclosureList) else: UniverseBox = getUniverse(MetaList) - Comsolids = [] surfOffset = code_setting["startSurf"] - 1 Surfaces = UF.Surfaces_dict(offset=surfOffset)