Cleaned up some code formatting.

这个提交包含在:
Craig Warren
2015-12-14 10:17:58 +00:00
父节点 9259b587d4
当前提交 84b0c714c3
共有 5 个文件被更改,包括 12 次插入1 次删除

查看文件

@@ -39,6 +39,7 @@ class GeometryView:
filename (str): Filename to save to. filename (str): Filename to save to.
type (str): Either 'n' for a per cell geometry view, or 'f' for a per cell edge geometry view. type (str): Either 'n' for a per cell geometry view, or 'f' for a per cell edge geometry view.
""" """
self.xs = xs self.xs = xs
self.ys = ys self.ys = ys
self.zs = zs self.zs = zs

查看文件

@@ -49,6 +49,7 @@ class Material():
ID (str): Name of the material. ID (str): Name of the material.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
self.numID = numID self.numID = numID
self.ID = ID self.ID = ID
self.type = 'standard' self.type = 'standard'
@@ -73,6 +74,7 @@ class Material():
Args: Args:
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
HA = (m0*self.mr / G.dt) + 0.5*self.sm HA = (m0*self.mr / G.dt) + 0.5*self.sm
HB = (m0*self.mr / G.dt) - 0.5*self.sm HB = (m0*self.mr / G.dt) - 0.5*self.sm
self.DA = HB / HA self.DA = HB / HA
@@ -155,6 +157,7 @@ class PeplinskiSoil():
sandpartdensity (float): Density of the sand particles in the soil (g/cm3). sandpartdensity (float): Density of the sand particles in the soil (g/cm3).
watervolfraction (float): Two numbers that specify a range for the volumetric water fraction of the soil. watervolfraction (float): Two numbers that specify a range for the volumetric water fraction of the soil.
""" """
self.ID = ID self.ID = ID
self.S = sandfraction self.S = sandfraction
self.C = clayfraction self.C = clayfraction

查看文件

@@ -40,6 +40,7 @@ class CFS():
sigmamin (float): Minimum value for sigma parameter. sigmamin (float): Minimum value for sigma parameter.
sigmamax (float): Maximum value for sigma parameter. sigmamax (float): Maximum value for sigma parameter.
""" """
self.alphascaling = alphascaling self.alphascaling = alphascaling
self.alphamin = alphamin self.alphamin = alphamin
self.alphamax = alphamax self.alphamax = alphamax
@@ -59,6 +60,7 @@ class CFS():
mr (float): Average permeability of underlying material. mr (float): Average permeability of underlying material.
G (class): Grid class instance - holds essential parameters describing the model. G (class): Grid class instance - holds essential parameters describing the model.
""" """
# Get general direction from first letter of PML direction # Get general direction from first letter of PML direction
if direction[0] == 'x': if direction[0] == 'x':
d = G.dx d = G.dx
@@ -84,6 +86,7 @@ class CFS():
Evalues (float): numpy array holding scaling value for electric PML update. Evalues (float): numpy array holding scaling value for electric PML update.
Hvalues (float): numpy array holding scaling value for magnetic PML update. Hvalues (float): numpy array holding scaling value for magnetic PML update.
""" """
tmp = max * ((np.linspace(0, (len(Evalues) - 1) + 0.5, num=2*len(Evalues))) / (len(Evalues) - 1)) ** order tmp = max * ((np.linspace(0, (len(Evalues) - 1) + 0.5, num=2*len(Evalues))) / (len(Evalues) - 1)) ** order
Evalues = tmp[0:-1:2] Evalues = tmp[0:-1:2]
Hvalues = tmp[1::2] Hvalues = tmp[1::2]
@@ -103,6 +106,7 @@ class CFS():
Evalues (float): numpy array holding scaling value for electric PML update. Evalues (float): numpy array holding scaling value for electric PML update.
Hvalues (float): numpy array holding scaling value for magnetic PML update. Hvalues (float): numpy array holding scaling value for magnetic PML update.
""" """
if scaling == 'constant': if scaling == 'constant':
Evalues += max Evalues += max
Hvalues += max Hvalues += max
@@ -126,6 +130,7 @@ class PML():
xs, xf, ys, yf, zs, zf (float): Extent of the PML volume. xs, xf, ys, yf, zs, zf (float): Extent of the PML volume.
cfs (list): CFS class instances associated with the PML. cfs (list): CFS class instances associated with the PML.
""" """
self.direction = direction self.direction = direction
self.xs = xs self.xs = xs
self.xf = xf self.xf = xf

查看文件

@@ -28,6 +28,7 @@ class Rx:
positiony (float): y-coordinate of location in model. positiony (float): y-coordinate of location in model.
positionz (float): z-coordinate of location in model. positionz (float): z-coordinate of location in model.
""" """
self.ID = None self.ID = None
self.outputs = [] self.outputs = []
self.positionx = positionx self.positionx = positionx

查看文件

@@ -49,6 +49,7 @@ class Snapshot:
time (int): Iteration number to take the snapshot on. time (int): Iteration number to take the snapshot on.
filename (str): Filename to save to. filename (str): Filename to save to.
""" """
self.xs = xs self.xs = xs
self.ys = ys self.ys = ys
self.zs = zs self.zs = zs