List numpy arrays in FDTDGrid constructor

More clearly lists the properties of an FDTDGrid without having to read
every method.
这个提交包含在:
nmannall
2024-05-17 17:20:35 +01:00
父节点 1b24a72ca4
当前提交 c323cea83c

查看文件

@@ -51,6 +51,8 @@ class FDTDGrid:
accessing regularly used parameters.
"""
IDlookup = {"Ex": 0, "Ey": 1, "Ez": 2, "Hx": 3, "Hy": 4, "Hz": 5}
def __init__(self):
self.name = "main_grid"
self.mem_use = 0
@@ -61,6 +63,25 @@ class FDTDGrid:
self.dl: np.ndarray[Any, np.dtype[np.single]]
self.dt = 0.0
# Field Arrays
self.Ex: np.ndarray[Any, np.dtype[np.single]]
self.Ey: np.ndarray[Any, np.dtype[np.single]]
self.Ez: np.ndarray[Any, np.dtype[np.single]]
self.Hx: np.ndarray[Any, np.dtype[np.single]]
self.Hy: np.ndarray[Any, np.dtype[np.single]]
self.Hz: np.ndarray[Any, np.dtype[np.single]]
# Dispersive Arrays
self.Tx: np.ndarray[Any, np.dtype[np.single]]
self.Ty: np.ndarray[Any, np.dtype[np.single]]
self.Tz: np.ndarray[Any, np.dtype[np.single]]
# Geometry Arrays
self.solid: np.ndarray[Any, np.dtype[np.uint32]]
self.rigidE: np.ndarray[Any, np.dtype[np.int8]]
self.rigidH: np.ndarray[Any, np.dtype[np.int8]]
self.ID: np.ndarray[Any, np.dtype[np.uint32]]
# PML parameters - set some defaults to use if not user provided
self.pmls = {}
self.pmls["formulation"] = "HORIPML"
@@ -345,7 +366,6 @@ class FDTDGrid:
self.rigidE = np.zeros((12, self.nx, self.ny, self.nz), dtype=np.int8)
self.rigidH = np.zeros((6, self.nx, self.ny, self.nz), dtype=np.int8)
self.ID = np.ones((6, self.nx + 1, self.ny + 1, self.nz + 1), dtype=np.uint32)
self.IDlookup = {"Ex": 0, "Ey": 1, "Ez": 2, "Hx": 3, "Hy": 4, "Hz": 5}
def initialise_field_arrays(self):
"""Initialise arrays for the electric and magnetic field components."""