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)

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
  • dicLin – dictionary with all the lines linked to the grid. Each key is the name of a line, the value associated is the line itself.
  • dicQuadSurf – dictionary with all the surfaces linked to the grid. Each key is the name of a surface, the value associated is the surface itself.
appendLinRange(ijkRange, nameSet)

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 ‘nameSet’. Add those lines to the dictionary dicLin.

appendSurfRange(ijkRange, nameSet)

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 ‘nameSet’. Add those surfaces to the dictionary dicQuadSurf.

genLinMultiRegion(lstIJKRange, nameSet)

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.

genLinOneRegion(ijkRange, nameSet)

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.

genSurfMultiRegion(lstIJKRange, nameSet)

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.

genSurfOneRegion(ijkRange, nameSet)

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.

generatePoints()

Point generation.

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).

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
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

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)

return the quadrangle surface

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)

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).

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
getSetLinMultiRegion(lstIJKRange, nameSet)

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).

getSetLinOneRegion(ijkRange, nameSet)

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).

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
getSetSurfMultiRegion(lstIJKRange, nameSet)

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).

getSetSurfOneRegion(ijkRange, nameSet)

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).

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
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()
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
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

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

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
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
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
slopePointsRange(ijkRange, slopeX=0, xZeroSlope=0, slopeY=0, yZeroSlope=0)

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.

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”.
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