PML default parameters and removed excess funcs

这个提交包含在:
Craig Warren
2022-11-15 16:12:23 +00:00
父节点 0094e8e2ff
当前提交 a96fe33e70

查看文件

@@ -50,16 +50,16 @@ class FDTDGrid:
self.iterations = 0 self.iterations = 0
self.timewindow = 0 self.timewindow = 0
# PML parameters - set some defaults to use if not user provided
self.pmls = {} self.pmls = {}
self.pmls['formulation'] = None self.pmls['formulation'] = 'HORIPML'
self.pmls['cfs'] = [] self.pmls['cfs'] = []
self.pmls['slabs'] = [] self.pmls['slabs'] = []
# Ordered dictionary required so that PMLs are always updated in the # Ordered dictionary required so that PMLs are always updated in the
# same order. The order itself does not matter, however, if must be the # same order. The order itself does not matter, however, if must be the
# same from model to model otherwise the numerical precision from adding # same from model to model otherwise the numerical precision from adding
# the PML corrections will be different. # the PML corrections will be different.
self.pmls['thickness'] = OrderedDict((key, None) for key in PML.boundaryIDs) self.pmls['thickness'] = OrderedDict((key, 10) for key in PML.boundaryIDs)
self.materials = [] self.materials = []
self.mixingmodels = [] self.mixingmodels = []
@@ -78,19 +78,6 @@ class FDTDGrid:
self.snapshots = [] self.snapshots = []
self.subgrids = [] self.subgrids = []
def n_edges(self):
i = self.nx
j = self.ny
k = self.nz
e = (i * j * (k - 1)) + (j * k * (i - 1)) + (i * k * (j - 1))
return e
def n_nodes(self):
return self.nx * self.ny * self.nz
def n_cells(self):
return (self.nx - 1) * (self.ny - 1) * (self.nz - 1)
def within_bounds(self, p): def within_bounds(self, p):
if p[0] < 0 or p[0] > self.nx: if p[0] < 0 or p[0] > self.nx:
raise ValueError('x') raise ValueError('x')