Grid model¶
Particular geometry organization, linked to a framework of spaced points, usually referenced by their indices (i,j,k) that point to the global coordinates (x,y,z).
Generally, an ijkGrid contains the grid of points itself and all the geometric entities (lines, surfaces, …) attached to it. Dictionaries with those entities, identified by specific names, are created, in order to facilitate and accelerate their creation, search, grouping in sets, …
Several grids can coexist in a FE problem.
- class model.geometry.grid_model.GridModel(prep, xList, yList, zList, xCentCoo=0, yCentCoo=0, semiYellipList=None)¶
Bases:
object
Particular geometry organization, linked to a framework of spaced points, usually referenced by their indices (i,j,k) that point to the global coordinates (x,y,z).
Generally, an ijkGrid contains the grid of points itself and all the geometric entities (lines, surfaces, …) attached to it. Dictionaries with those entities, identified by specific names, are created, in order to facilitate and accelerate their creation, search, grouping in sets, …
Several grids can coexist in a FE problem.
- Variables
prep – preprocessor
xList –
cartesian coord: ordered list of x-coordinates for the grid
cylindrical coord: ordered list of radius
elliptical coord: ordered list of semi-axes X
yList –
cartesian coord: ordered list of y-coordinates for the grid
cylindrical and elliptical coord: ordered list of angles expressed in degrees counterclockwise from the X-axis direction
elliptical coord: ordered list of semi-axes Y
zList – ordered list of z-coordinates for the grid.
yCentCoo (xCentCoo,) – x and y coordinates of the center point in cylindrical or elliptical coordinates (both coordinates default to 0)
semiYellipList – (only used for elliptical coordinates) ordered list of semi-axes Y that correspond with each semi-axis X in xList
dicLin – generated dictionary with all the lines linked to the grid. Each key is the name of a line, the value associated is the line itself.
dicHexaedr – generated dictionary with all the hexaedral volumes linked to the grid. Each key is the name of a volume, the value associated is the volume itself.
dicQuadSurf – generated dictionary with all the surfaces linked to the grid. Each key is the name of a surface, the value associated is the surface itself.
- appendHexaedrRange(ijkRange, setVol, closeCyl='N')¶
generate the hexaedral volumes limited by a region defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax) and append them to the set named ‘setName’. Add those volumes to the dictionary dicHexaedr.
- Parameters
ijkRange – instance of IJKRange class
setVol – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- appendLinRange(ijkRange, setName)¶
generate the lines limited by a region defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax) and append them to the set named ‘setName’. Add those lines to the dictionary dicLin.
- appendSurfRange(ijkRange, setSurf, closeCyl='N')¶
generate the surfaces limited by a region defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax) and append them to the set named ‘setName’. Add those surfaces to the dictionary dicQuadSurf.
- Parameters
ijkRange – instance of IJKRange class
setSurf – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genHexaedrMultiRegion(lstIJKRange, setName, closeCyl='N')¶
generate the hexaedral volums limited by all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Return a set with the volumes generated. Add those volumes to the dictionary dicHexaedr
- Parameters
lstIJKRange – list of instances of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genHexaedrMultiXYZRegion(lstXYZRange, setName, closeCyl='N')¶
generate the hexaedral volumes limited by all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the coordinates in ranges xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Return a set with the volumes generated. Add those volumes to the dictionary dicHexaedr
- Parameters
lstXYZRange – list of ranges xyz
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genHexaedrOneRegion(ijkRange, setName, closeCyl='N')¶
generate the hexaedral volumes limited by a region defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Return a set with the volumes generated. Add those volumes to the dictionary dicHexaedr.
- Parameters
ijkRange – instance of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genHexaedrOneXYZRegion(xyzRange, setName, closeCyl='N')¶
generate the hexaedral volumes limited by a region defined by the coordinates defined in the range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Return a set with the volumes generated. Add those volumes to the dictionary dicHexaedr
- Parameters
xyzRange – range xyz
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genLinMultiRegion(lstIJKRange, setName)¶
generate the lines limited by all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Return a set with the lines generated. Add those lines to the dictionary dicLin.
- genLinMultiXYZRegion(lstXYZRange, setName)¶
generate the lines limited by all the regions included in the list of coordinate passed as parameter. Each region defines a volume limited by the coordinates that correspond to the ranges xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Return a set with the lines generated. Add those lines to the dictionary dicLin.
- genLinOneRegion(ijkRange, setName)¶
generate the lines limited by a region defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Return a set with the lines generated. Add those lines to the dictionary dicLin.
- genLinOneXYZRegion(xyzRange, setName)¶
generate the lines limited by a region defined by the coordinates defined in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Return a set with the lines generated. Add those lines to the dictionary dicLin.
- genSetLinFromLstGridPnt(lstGridPnt, setName)¶
generate the set of lines that joint the successive points defined in ‘lstGridPnt’ by their indexes in the grid.
- Parameters
lstGridPnt – list of successive points [(i1,j1,k1),(i2,j2,k2), …]
setName – name of the set.
- genSetLinFromLstXYZPnt(lstXYZPnt, setName)¶
generate the set of lines that joint the successive points defined in ‘lstXYZPnt’ by their coordinates (x,y,z).
- Parameters
lstXYZPnt – list of successive points [(x1,y1,z1),(x2,y2,z2), …]
setName – name of the set.
- genSetLinFromMultiLstGridPnt(multiLstGridPnt, setName)¶
generate the set of lines that joint the successive points defined in ‘multiLstGridPnt’ by their indexes in the grid.
- Parameters
multiLstGridPnt – list of lists of successive points
[[(i1,j1,k1),(i2,j2,k2), …],[],…] :param setName: name of the set.
- genSetLinFromMultiLstXYZPnt(multiLstXYZPnt, setName)¶
generate the set of lines that joint the successive points defined in ‘multiLstXYZPnt’ by their coordinates (x,y,z)
- Parameters
multiLstXYZPnt – list of lists of successive points
[[(x1,y1,z1),(x2,y2,z2), …],[],…] :param setName: name of the set.
- genSurfMultiRegion(lstIJKRange, setName, closeCyl='N')¶
generate the surfaces limited by all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Return a set with the surfaces generated. Add those surfaces to the dictionary dicQuadSurf.
- Parameters
lstIJKRange – list of instances of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genSurfMultiXYZRegion(lstXYZRange, setName, closeCyl='N')¶
generate the surfaces limited by all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the coordinates in ranges xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Return a set with the surfaces generated. Add those surfaces to the dictionary dicQuadSurf.
- Parameters
lstXYZRange – list of ranges xyz
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genSurfOneRegion(ijkRange, setName, closeCyl='N')¶
generate the surfaces limited by a region defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Return a set with the surfaces generated. Add those surfaces to the dictionary dicQuadSurf.
- Parameters
ijkRange – instance of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- genSurfOneXYZRegion(xyzRange, setName, closeCyl='N')¶
generate the surfaces limited by a region defined by the coordinates defined in the range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Return a set with the surfaces generated. Add those surfaces to the dictionary dicQuadSurf.
- Parameters
xyzRange – range xyz
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- generateCylZPoints()¶
Point generation in the following cylindrical coordinate system:
Origin: point of coordinates (xCentCoo,yCentCoo,0)
Longitudinal axis: Z
Azimuth expressed in degrees counterclockwise from the X-axis direction (Z+)
Coordinates are defined:
x: radial coordinate (radius)
y: angular coordinate (degrees counterclockwise from X-axis)
z: height coordinate (Z axis)
- generateEllipZPoints()¶
Point generation in the following elliptical coordinate system:
Origin: point of coordinates (xCentCoo,yCentCoo,0)
Longitudinal axis: Z
Azimuth expressed in degrees counterclockwise from the X-axis direction
Coordinates are defined:
x: semi-axis X of the ellipse
y: angular coordinate (degrees counterclockwise from X-axis)
z: height coordinate (Z axis)
semiYellipList contains a list of semi-axis Y of the ellipse that correspond element to element with the semi-axis X in xList
- generatePoints()¶
Point generation in a cartesian coordinate system.
- getCylCooPnt(pnt)¶
Return the cylindrical coorfinates of the point pnt (radius,angle in degrees from X axis counterclockwise, Z)
- getIJKfromXYZ(xyz)¶
Return (i,j,k) indexes that match the closest with (x,y,z) coordinates
- getIJKrangeFromXYZrange(xyzRange)¶
Return an ijkRange that matches with closest coordinates in xyzRange defined as: xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getLstLinRange(ijkRange)¶
return a list of lines in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getLstLinXYZRange(xyzRange)¶
return a list of lines in a region limited by the coordinates defined in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getLstPntRange(ijkRange)¶
return the ordered list points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax)
- Parameters
ijkRange – range for the search
- getLstPntXYZRange(xyzRange)¶
return the ordered list points in a 3D grid-region limited by coordinates defined in xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getNameGridLine(ind2Pnt)¶
Return the name of the line defined by the 2 vertices whose indices in the grid are passed as parameters.
- Parameters
ind2Pnt – tuple of ordered points defined by their grid indices (i,j,k)
return the line
- getNameHexaedr(ind8Pnt)¶
Return the name of the hexaedral volume defined by the 8 vertices whose indices in the grid are passed as parameters.
- Parameters
ind8Pnt – tuple of ordered points defined by their grid indices (i,j,k)
- Returns
the hexaedral volume
- getNameQuadGridSurface(ind4Pnt)¶
Return the name of the quadrangle surface defined by the 4 vertices whose indices in the grid are passed as parameters.
- Parameters
ind4Pnt – tuple of ordered points defined by their grid indices (i,j,k)
- Returns
the quadrangle surface nane
- getNmHexaedrInRange(ijkRange, closeCyl='N')¶
Return a list with the names of the hexedral volumes limited by a volume defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- Parameters
ijkRange – instance of IJKRange class
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’) (not yet implemented)
- getNmLinInRange(ijkRange)¶
Return a list with the names of the surfaces limited by a volume defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getNmSurfInRange(ijkRange, closeCyl='N')¶
Return a list with the names of the surfaces limited by a volume defined by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- Parameters
ijkRange – instance of IJKRange class
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- getPntGrid(indPnt)¶
Return the point at indPnt=(i,j,k) index of the grid.
- Parameters
indPnt – grid indices that point to the global (X, Y, Z) coordinates
- getPntXYZ(xyz)¶
Return the point of the grid closest to coordinates (x,y,z)
- getSetHexaedrMultiRegion(lstIJKRange, setName, closeCyl='N')¶
return the set of hexaedral volumes and all the entities (surfaces, lines, points, elements, nodes, …) associated with them in a all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- Parameters
lstIJKRange – list of instances of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- getSetHexaedrMultiXYZRegion(lstXYZRange, setName, closeCyl='N')¶
return the set of volumes and all the entities(surfaces, lines, points, elements, nodes, …) associated with them in a all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetHexaedrOneRegion(ijkRange, setName, closeCyl='N')¶
return the set of hexaedral volumes and all the entities(surfaces,lines, points, elements, nodes, …) associated with them in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- Parameters
ijkRange – instance of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- getSetHexaedrOneXYZRegion(xyzRange, setName, closeCyl='N')¶
return the set of volumes and all the entities(lines, points, elements, nodes, …) associated with them in a region limited by the coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetLinFromLstGridPnt(lstGridPnt, setName)¶
return the set of lines that joint the successive points defined in ‘lstGridPnt’ by their indexes in the grid.
- Parameters
lstGridPnt – list of successive points [(i1,j1,k1),(i2,j2,k2), …]
setName – name of the set.
- getSetLinFromLstXYZPnt(lstXYZPnt, setName)¶
return the set of lines that joint the successive points defined in ‘lstXYZPnt’ by their coordinates (x,y,z).
- Parameters
lstXYZPnt – list of successive points [(x1,y1,z1),(x2,y2,z2), …]
setName – name of the set.
- getSetLinFromMultiLstGridPnt(multiLstGridPnt, setName)¶
return the set of lines that joint the successive points defined in ‘multiLstGridPnt’ by their indexes in the grid.
- Parameters
multiLstGridPnt – list of lists of successive points
[[(i1,j1,k1),(i2,j2,k2), …],[],…] :param setName: name of the set.
- getSetLinFromMultiLstXYZPnt(multiLstXYZPnt, setName)¶
generate the set of lines that joint the successive points defined in ‘multiLstXYZPnt’ by their coordinates (x,y,z)
- Parameters
multiLstXYZPnt – list of lists of successive points
[[(x1,y1,z1),(x2,y2,z2), …],[],…] :param setName: name of the set.
- getSetLinMultiRegion(lstIJKRange, setName)¶
return the set of lines and all the entities(points, elements, nodes, …) associated with them in a all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSetLinMultiXYZRegion(lstXYZRange, setName)¶
return the set of lines and all the entities(points, elements, nodes, …) associated with them in a all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates defined in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetLinOneRegion(ijkRange, setName)¶
return the set of lines and all the entities(points, elements, nodes, …) associated with them in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSetLinOneXYZRegion(xyzRange, setName)¶
return the set of lines and all the entities(points, elements, nodes, …) associated with them in a region limited by the coordinates defined in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetPntMultiRegion(lstIJKRange, setName)¶
return the set of points in a all the 3D grid-regions included in the list of ijkRanges passed as parameter Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSetPntMultiXYZRegion(lstXYZRange, setName)¶
return the set of points in a all the 3D grid-regions included in the list of xyzRanges passed as parameter Each region defines a volume limited by the coordinates defined in xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetPntRange(ijkRange, setName)¶
return the set of points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax)
- Parameters
ijkRange – range for the search
setName – name of the new set of points
- getSetPntXYZRange(xyzRange, setName)¶
return the set of points in a 3D grid-region limited by coordinates in xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetSurfMultiRegion(lstIJKRange, setName, closeCyl='N')¶
return the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- Parameters
lstIJKRange – list of instances of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- getSetSurfMultiXYZRegion(lstXYZRange, setName, closeCyl='N')¶
return the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSetSurfOneRegion(ijkRange, setName, closeCyl='N')¶
return the set of surfaces and all the entities (lines, points, elements, nodes, …) associated with them in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- Parameters
ijkRange – instance of IJKRange class
setName – name of the set
closeCyl – ‘Y’ to close cylinder when using cylindrical coordinate system (defaults to ‘N’)
- getSetSurfOneXYZRegion(xyzRange, setName, closeCyl='N')¶
return the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a region limited by the coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSubsetHexaedrMultiRegion(superset, lstIJKRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of hexaedral volumes and all the entities (lines, points, elements, nodes, …) associated with them in a all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSubsetHexaedrMultiXYZRegion(superset, lstXYZRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of volumes and all the entities (surfaces, lines, points, elements, nodes, …) associated with them in a all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSubsetHexaedrOneRegion(superset, ijkRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of surfaces and all the entities (surfaces,lines, points, elements, nodes, …) associated with them in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSubsetHexaedrOneXYZRegion(superset, xyzRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of volumes and all the entities (surfaces,lines, points, elements, nodes, …) associated with them in a region limited by the coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSubsetLinMultiRegion(superset, lstIJKRange, nameSubset)¶
return from the set ‘superset’ the set of lines and all the entities(points, elements, nodes, …) associated with them in a all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSubsetLinMultiXYZRegion(superset, lstXYZRange, nameSubset)¶
return from the set ‘superset’ the set of lines and all the entities(points, elements, nodes, …) associated with them in a all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates defined in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSubsetLinOneRegion(superset, ijkRange, nameSubset)¶
return from the set ‘superset’ the set of lines and all the entities(points, elements, nodes, …) associated with them in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSubsetLinOneXYZRegion(superset, xyzRange, nameSubset)¶
return from the set ‘superset’ the set of lines and all the entities(points, elements, nodes, …) associated with them in a region limited by the coordinates defined in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSubsetSurfMultiRegion(superset, lstIJKRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a all the regions included in the list of ijkRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSubsetSurfMultiXYZRegion(superset, lstXYZRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a all the regions included in the list of xyzRanges passed as parameter. Each region defines a volume limited by the coordinates that correspond to coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getSubsetSurfOneRegion(superset, ijkRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a region limited by the coordinates that correspond to the indices in the grid ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax).
- getSubsetSurfOneXYZRegion(superset, xyzRange, nameSubset, closeCyl='N')¶
return from the set ‘superset’ the set of surfaces and all the entities(lines, points, elements, nodes, …) associated with them in a region limited by the coordinates in range xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax))
- getTagPntGrid(indPnt)¶
Return the tag of the point at indPnt=(i,j,k) index of the grid.
- Parameters
indPnt – grid indices that point to the global (X, Y, Z) coordinates
- getXYZcooPnt(pnt)¶
Return the (x,y,z) coordinates of point pnt
- gridHexaedrName(pt1, pt2, pt3, pt4, pt5, pt6, pt7, pt8)¶
Return the name of the hexaedral volume defined by 8 points.
- Parameters
pt1,pt2,pt3,pt4,pt5,pt6,pt7,pt8 – tags of the points (in right order) that define the hexaedral volume
- gridLinName(pt1, pt2)¶
Return the name of the line defined by 2 points
- Parameters
pt1,pt2 – tags of the points (in right order) that define the line
- gridSurfName(pt1, pt2, pt3, pt4)¶
Return the name of the quadrangle surface defined by 4 points.
- Parameters
pt1,pt2,pt3,pt4 – tags of the points (in right order) that define the surface
- lastXIndex()¶
- lastYIndex()¶
- lastZIndex()¶
- moveAllPoints(vDisp)¶
Move all points in the grid to a new position by pplying a 3D displacement.
- Parameters
vDisp – xc vector displacement
- moveCylPointToRadius(pnt, radius, xCent=None, yCent=None)¶
Move point in the cylindrical coordinate system to radius coordinate given as parameter. By default, it will take the center at the center of the self cylindrical coordinate-system, although other X and/or Y coordinates can be given for the new circumference arc.
- Parameters
pnt – point to move
radius – radius
- moveCylPointsIJKRangeToVarRadius(ijkRange, RangMin, RangMax, xCent=None, yCent=None)¶
Move points in a 3D grid-region limited by the ijkRange ((imin,jmin,kmin),(imax,jmax,kmax)) in the cylindrical coordinate system to a varibale radius coordinate given as parameter
- Parameters
ijkRange – range of index
RangMin – radius to which move point of minimum angle in each of the ijRanges included in ijkRange
RangMax – radius to which move point of maximum angle in each of the ijRanges included in ijkRange
- moveCylPointsIJKrangeToRadius(ijkRange, radius, xCent=None, yCent=None)¶
Move points in a 3D grid-region limited by the ijkRange ((imin,jmin,kmin),(imax,jmax,kmax)) in the cylindrical coordinate system to radius coordinate given as parameter
- moveCylPointsXYXRangeToVarRadius(xyzRange, RangMin, RangMax, xCent=None, yCent=None)¶
Move points in a 3D grid-region limited by the xyzRange ((xmin,ymin,zmin),(xmax,ymax,zmax)) in the cylindrical coordinate system to a varibale radius coordinate given as parameter
- Parameters
ijkRange – range of index
RangMin – radius to which move point of minimum angle in each of the ijRanges included in ijkRange
RangMax – radius to which move point of maximum angle in each of the ijRanges included in ijkRange
- moveCylPointsXYZrangeToRadius(xyzRange, radius, xCent=None, yCent=None)¶
Move points in a 3D grid-region limited by the xyzRange ((xmin,ymin,zmin),(xmax,ymax,zmax)) in the cylindrical coordinate system to radius coordinate given as parameter
- movePointXYZ(xyz, vDisp)¶
Move the nearest point in grid xyz=(x,y,z) coordinates to a new position by applying a 3D displacement.
- Parameters
xyz – grid (x,y,z) coordinates of the point
vDisp – xc vector displacement xc.Vector([vx,vy,vz])
- movePointsEllipse(ijkRange, semiAxX, semiAXY)¶
‘Move points in a 3D grid-region limited by the ijkRange in the elliptical coordinate system to an ellipse of semi-axes semiAxX and semiAXY given as parameters
- movePointsRange(ijkRange, vDisp)¶
Move points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax), to a new position by applying a 3D displacement.
- Parameters
ijkRange – range for the search
vDisp – xc vector displacement
- movePointsRangeToXcylinder(ijkRange, yCent, zCent, R)¶
Moves the points in the range to make them belong to a cylinder with radius R and axis parallel to global X passing through the point (0,yCent,zCent)
- movePointsRangeToYcylinder(ijkRange, xCent, zCent, R)¶
Moves the points in the range to make them belong to a cylinder with radius R and axis parallel to global Y passing through the point (xCent,0,zCent)
- movePointsRangeToZcylinder(ijkRange, xCent, yCent, R)¶
Moves the points in the range to make them belong to a cylinder with radius R and axis parallel to global Z passing through the point (xCent,yCent,0).
- movePointsXYZRange(XYZrange, vDisp)¶
Move points in a 3D grid-region limited by an xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) to a new position by applying a 3D displacement.
- Parameters
XYZRange – range for the search
vDisp – xc vector displacement
- newGridLine(linName)¶
Generate the line defined by the 2 end-points whose tags are implicit in the name of the line.
- Parameters
linName – name given to the grid line
return the line
- newHexaedrGridVol(volName)¶
Generate the hexaedral volume defined by the 8 vertex whose tags are implicit in the name of the volume.
- Parameters
volName – name given to the grid volume
return the hexaedral volumen
- newQuadGridSurface(surfName)¶
Generate the quadrangle surface defined by the 4 vertex whose tags are implicit in the name of the surface.
- Parameters
surfName – name given to the grid surface
return the quadrangle surface
- rotAllPntsXAxis(angle, yzRotCent)¶
Rotates all points in the grid around a X axis passing by yzRotCent.
- Parameters
angle – rotation angle (degrees)
yzRotCent – coordinates [y,z] of the axis X of rotation
- rotAllPntsYAxis(angle, xzRotCent)¶
Rotates all points in the grid around a X axis passing by yzRotCent.
- Parameters
angle – rotation angle (degrees)
xzRotCent – coordinates [z,z] of the axis Y of rotation
- rotAllPntsZAxis(angle, xyRotCent)¶
Rotates all points in the grid around a Z axis passing by xyRotCent.
- Parameters
angle – rotation angle (degrees)
xyRotCent – coordinates [x,y] of the axis Z of rotation
- rotPntsXAxis(ijkRange, angle, yzRotCent)¶
Rotates points in ijkRange around a X axis passing by yzRotCent.
- Parameters
ijkRange – range for the search.
angle – rotation angle (degrees)
yzRotCent – coordinates [y,z] of the axis X of rotation
- rotPntsXYZrangeXAxis(XYZrange, angle, yzRotCent)¶
Rotates points in XYZrange around a X axis passing by yzRotCent.
- Parameters
XYZrange – range for the search.
angle – rotation angle (degrees)
yzRotCent – coordinates [y,z] of the axis X of rotation
- rotPntsXYZrangeYAxis(XYZrange, angle, xzRotCent)¶
Rotates points in ijkRange around a Y axis passing by xzRotCent.
- Parameters
XYZrange – range for the search.
angle – rotation angle (degrees)
xzRotCent – coordinates [x,z] of the axis Y of rotation
- rotPntsXYZrangeZAxis(XYZrange, angle, xyRotCent)¶
Rotates points in XYZrange around a Z axis passing by xyRotCent.
- Parameters
XYZrange – range for the search.
angle – rotation angle (degrees)
xyRotCent – coordinates [x,y] of the axis Z of rotation
- rotPntsYAxis(ijkRange, angle, xzRotCent)¶
Rotates points in ijkRange around a Y axis passing by xzRotCent.
- Parameters
ijkRange – range for the search.
angle – rotation angle (degrees)
xzRotCent – coordinates [x,z] of the axis Y of rotation
- rotPntsZAxis(ijkRange, angle, xyRotCent)¶
Rotates points in ijkRange around a Z axis passing by xyRotCent.
- Parameters
ijkRange – range for the search.
angle – rotation angle (degrees)
xyRotCent – coordinates [x,y] of the axis Z of rotation
- scaleCoorXPointsRange(ijkRange, xOrig, scale)¶
Applies a scale in X with origin xOrig (fixed axis: X=xOrig) to the points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Only X coordinate of points is modified in the following way: x_scaled=xOrig+scale*(x_inic-xOrig)
- Parameters
ijkRange – range for the search.
xOrig – origin X to apply scale (point in axis X=xOrig) are not affected by the transformation
scale – scale to apply to X coordinate
- scaleCoorXPointsXYZRange(XYZrange, xOrig, scale)¶
Applies a scale in X with origin xOrig (fixed axis: X=xOrig) to the points in a 3D grid-region limited by one XYZrange defined as ((xmin,ymin,zmin),(xmax,ymax,zmax)) Only X coordinate of points is modified in the following way: x_scaled=xOrig+scale*(x_inic-xOrig)
:param XYZrange:((xmin,ymin,zmin),(xmax,ymax,zmax)) range for the search. :param xOrig: origin X to apply scale (point in axis X=xOrig)
are not affected by the transformation
- Parameters
scale – scale to apply to X coordinate
- scaleCoorYPointsRange(ijkRange, yOrig, scale)¶
Applies a scale in Y with origin yOrig (fixed axis: y=yOrig) to the points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Only Y coordinate of points is modified in the following way: y_scaled=yOrig+scale*(y_inic-yOrig)
- Parameters
ijkRange – range for the search.
yOrig – origin Y to apply scale (point in axis Y=yOrig) are not affected by the transformation
scale – scale to apply to Y coordinate
- scaleCoorYPointsXYZrange(XYZrange, yOrig, scale)¶
Applies a scale in Y with origin yOrig (fixed axis: y=yOrig) to the points in a 3D grid-region limited by an XYZrange defined as ((xmin,ymin,zmin),(xmax,ymax,zmax)) Only Y coordinate of points is modified in the following way: y_scaled=yOrig+scale*(y_inic-yOrig)
:param XYZrange:((xmin,ymin,zmin),(xmax,ymax,zmax)) range for the search. :param yOrig: origin Y to apply scale (point in axis Y=yOrig)
are not affected by the transformation
- Parameters
scale – scale to apply to Y coordinate
- scaleCoorZPointsRange(ijkRange, zOrig, scale)¶
Applies a scale in Z with origin zOrig (fixed axis: z=zOrig) to the points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Only Z coordinate of points is modified in the following way: z_scaled=zOrig+scale*(z_inic-zOrig)
- Parameters
ijkRange – range for the search.
zOrig – origin Z to apply scale (point in axis Z=zOrig) are not affected by the transformation
scale – scale to apply to Z coordinate
- scaleCoorZPointsXYZrange(XYZrange, zOrig, scale)¶
Applies a scale in Z with origin zOrig (fixed axis: z=zOrig) to the points in a 3D grid-region limited by one XYZrange defined as ((xmin,ymin,zmin),(xmax,ymax,zmax)) Only Z coordinate of points is modified in the following way: z_scaled=zOrig+scale*(z_inic-zOrig)
:param XYZrange:((xmin,ymin,zmin),(xmax,ymax,zmax)) range for the search. :param zOrig: origin Z to apply scale (point in axis Z=zOrig)
are not affected by the transformation
- Parameters
scale – scale to apply to Z coordinate
- slopePointsRange(ijkRange, slopeX=0, xZeroSlope=0, slopeY=0, yZeroSlope=0, cylCoo=False)¶
Applies one or two slopes (in X and Y directions) to points in a 3D grid-region limited by ijkRange.ijkMin=(indXmin,indYmin,indZmin) and ijkRange.ijkMax=(indXmax,indYmax,indZmax). Only Z coordinate of points is modified. If cylindrical coordinates (cylCoo=True), x is taken as the radius and y is taken as the angle
- Parameters
ijkRange – range for the search.
slopeX – slope in X direction, expressed as deltaZ/deltaX (defaults to 0 = no slope applied)
xZeroSlope – coordinate X of the “rotation axis”.
slopeY – slope in Y direction, expressed as deltaZ/deltaY) (defaults to 0 = no slope applied)
yZeroSlope – coordinate Y of the “rotation axis”.
cylCoo – True if cylindric coordinates (defaults to False)
- slopePointsXYZrange(XYZrange, slopeX=0, xZeroSlope=0, slopeY=0, yZeroSlope=0, cylCoo=False)¶
Applies one or two slopes (in X and Y directions) to points in a 3D grid-region limited by an xyzRange=((xmin,ymin,zmin),(xmax,ymax,zmax)) Only Z coordinate of points is modified. If cylindrical coordinates (cylCoo=True), x is taken as the radius and y is taken as the angle
- Parameters
XYZrange – range for the search.
slopeX – slope in X direction, expressed as deltaZ/deltaX (defaults to 0 = no slope applied)
xZeroSlope – coordinate X of the “rotation axis”.
slopeY – slope in Y direction, expressed as deltaZ/deltaY) (defaults to 0 = no slope applied)
yZeroSlope – coordinate Y of the “rotation axis”.
cylCoo – True if cylindric coordinates (defaults to False)
- class model.geometry.grid_model.IJKRange(ijkMin, ijkMax)¶
Bases:
object
Range of indexes (i,j,k) in the 3D-grid that defines a region bounded by the coordinates associated with those indexes.
- Variables
ijkMin – tuple (or list) with minimum value of indexes (minIindex,minJindex,minKindex) that point to (xmin,ymin,zmin)
ijkMax – tuple (or list) with maximum value of indexes (maxIindex,maxJindex,maxKindex) that point to (xmax,ymax,zmax)
- extractIncludedIJranges(step=1)¶
return a list with all the sub-ranges included in the IJKRange for which the index K is a constant. Graphically it can be seen as the set of planes ‘parallel’ to global XY included in the region defined by the IJKRange
- Variables
step – K step to select the XY planes (defaults to 1)
- extractIncludedIKranges(step=1)¶
return a list with all the sub-ranges included in the IJKRange for which the index J is a constant. Graphically it can be seen as the set of planes ‘parallel’ to global XZ included in the region defined by the IJKRange
- Parameters
step – J step to select the XZ planes (defaults to 1)
- extractIncludedIranges(stepJ=1, stepK=1)¶
return a list with all the sub-ranges included in the IJKRange for which the indices J and K are a constant. Graphically it can be seen as the set of lines ‘parallel’ to global X axis included in the region defined by the IJKRange
- Parameters
stepJ – step to select the lines in Y direction (defaults to 1)
:param stepK step to select the lines in Z direction (defaults to 1)
- extractIncludedJKranges(step=1)¶
return a list with all the sub-ranges included in the IJKRange for which the index I is a constant. Graphically it can be seen as the set of planes ‘parallel’ to global YZ included in the region defined by the IJKRange
- Parameters
step – I step to select the XZ planes (defaults to 1)
- extractIncludedJranges(stepI=1, stepK=1)¶
return a list with all the sub-ranges included in the IJKRange for which the indices I and K are a constant. Graphically it can be seen as the set of lines ‘parallel’ to global Y axis included in the region defined by the IJKRange
- Parameters
stepI – step to select the lines in X direction (defaults to 1)
:param stepK step to select the lines in Z direction (defaults to 1)
- extractIncludedKranges(stepI=1, stepJ=1)¶
return a list with all the sub-ranges included in the IJKRange for which the indices I and J are a constant. Graphically it can be seen as the set of lines ‘parallel’ to global Z axis included in the region defined by the IJKRange
- Parameters
stepI – step to select the lines in X direction (defaults to 1)
:param stepJ step to select the lines in Y direction (defaults to 1)
- getIMax()¶
return the value of the index I maximum in the range
- getIMin()¶
return the value of the index I minimum in the range
- getIRange()¶
return a list with the range of indexes between minIindex and maxIindex
- getJMax()¶
return the value of the index J maximum in the range
- getJMin()¶
return the value of the index J minimum in the range
- getJRange()¶
return a list with the range of index between minJindex and maxJindex
- getKMax()¶
return the value of the index K maximum in the range
- getKMin()¶
return the value of the index K minimum in the range
- getKRange()¶
return a list with the range of indexes between minKindex and maxKindex
- getRange(index)¶
return a list with the range of indexes between minIindex and maxIindex
- model.geometry.grid_model.getSetIntersLin(set1, set2, setNameInter)¶
Return a set of lines intersection of those in ‘set1’ and ‘set2’
- Parameters
set2 (set1,) – sets containing lines to search intersection
setNameInter – name of the set of lines to return
- model.geometry.grid_model.getSetIntersSurf(set1, set2, setNameInter)¶
Return a set of surfaces intersection of those in ‘set1’ and ‘set2’
- Parameters
set2 (set1,) – sets containing surfaces to search intersection
setNameInter – name of the set of surfaces to return
- model.geometry.grid_model.getSetIntersVol(set1, set2, setNameInter)¶
Return a set of volumes, intersection of those in ‘set1’ and ‘set2’
- Parameters
set2 (set1,) – sets containing volumes to search intersection
setNameInter – name of the set of surfaces to return