Skip to content

Commit

Permalink
Add comment to function
Browse files Browse the repository at this point in the history
  • Loading branch information
akleb committed Apr 14, 2021
1 parent 28a5493 commit ff2f84c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cgnsutilities/cgnsutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,22 @@ def __init__(self):
self.name = "domain"
self.cellDim = 3

def printInfo(self):
"""Print some information on the mesh to screen. Specifically
information needed by the drag prediction workshop"""
def getCellsNodes(self):
""" Returns the total number of Cells and Nodes in the grid. """
totalCells = 0
totalNodes = 0
for blk in self.blocks:
totalCells += (blk.dims[0] - 1) * (blk.dims[1] - 1) * (blk.dims[2] - 1)
totalNodes += blk.dims[0] * blk.dims[1] * blk.dims[2]

return totalCells, totalNodes


def printInfo(self):
"""Print some information on the mesh to screen. Specifically
information needed by the drag prediction workshop"""
totalCells, totalNodes = self.getCellsNodes()

print("Total Zones:", len(self.blocks))
print("Total Cells:", totalCells)
print("Total Nodes:", totalNodes)
Expand Down

0 comments on commit ff2f84c

Please sign in to comment.