Skip to content

Commit

Permalink
change Lx and Ly to 1d array or float
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Jul 25, 2024
1 parent bb91e21 commit 43db316
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions pyro/mesh/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,20 @@ def __init__(self, nx, ny, ng=1,

# Length of the side in x- and y-direction

self.Lx = ArrayIndexer(np.full((self.qx, self.qy), self.dx),
grid=self)
self.Ly = ArrayIndexer(np.full((self.qx, self.qy), self.dy),
grid=self)
self.Lx = self.dx
self.Ly = self.dy

# This is area of the side that is perpendicular to x.

self.Ax_l = self.Ly.copy()
self.Ax_r = self.Ly.copy()
self.Ax_l = ArrayIndexer(np.full((self.qx, self.qy), self.dy),
grid=self)
self.Ax_r = self.Ax_l.copy()

# This is area of the side that is perpendicular to y.

self.Ay_l = self.Lx.copy()
self.Ay_r = self.Lx.copy()
self.Ay_l = ArrayIndexer(np.full((self.qx, self.qy), self.dx),
grid=self)
self.Ay_r = self.Ay_l.copy()

# Volume of the cell.

Expand Down Expand Up @@ -254,15 +254,10 @@ def __init__(self, nx, ny, ng=1,

super().__init__(nx, ny, ng, xmin, xmax, ymin, ymax)

# Length of the side along r-direction, dr

self.Lx = ArrayIndexer(np.full((self.qx, self.qy), self.dx),
grid=self)

# Length of the side along theta-direction, r*dtheta
# Length of the side along r-direction, dr and θ-direction, r*dθ

self.Ly = ArrayIndexer(np.full((self.qx, self.qy), self.x2d*self.dy),
grid=self)
self.Lx = self.dx
self.Ly = self.x * self.dy

# Returns an array of the face area that points in the r(x) direction.
# dL_theta x dL_phi = r^2 * sin(theta) * dtheta * dphi
Expand Down

0 comments on commit 43db316

Please sign in to comment.