-
Notifications
You must be signed in to change notification settings - Fork 1
/
grid.py
41 lines (27 loc) · 958 Bytes
/
grid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# -*- coding: utf-8 -*-
""" grid.py
Authors:
Kyle Schau
This module holds the peregrinepy.multiBlock object class that inherits from
python lists to create a list of peregrine.block object with added functionality and attributes
"""
from .topology import topology
from .gridBlock import gridBlock
class grid(topology):
"""A list of peregrinepy.multiBlock.gridBlock objects. Inherits from peregrinepy.multiBlock.topology"""
mbType = "grid"
def __init__(self, nblks, ls=[]):
if ls == []:
temp = [gridBlock(i) for i in range(nblks)]
super().__init__(nblks, temp)
else:
super().__init__(nblks, ls)
def initGridArrays(self):
for blk in self:
blk.initGridArrays()
def computeMetrics(self, fdOrder=2):
for blk in self:
blk.computeMetrics(fdOrder=fdOrder)
def generateHalo(self):
for blk in self:
blk.generateHalo()