mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-09 11:34:26 +08:00
updated where cell centers are and how I count the first h in 2D case
This commit is contained in:
@@ -116,7 +116,7 @@ class CylMesh(BaseTensorMesh):
|
||||
def vectorCCx(self):
|
||||
"""Cell-centered grid vector (1D) in the x direction."""
|
||||
if self.nCy == 1:
|
||||
return np.r_[0, self.hx[:-1].cumsum()] + self.hx*0.5 - self.hx[0]/2
|
||||
return np.r_[-self.hx[0]*0.5, self.hx[:-1].cumsum()] + self.hx*0.5 # - self.hx[0]/2
|
||||
return np.r_[0, self.hx[:-1].cumsum()] + self.hx*0.5
|
||||
|
||||
@property
|
||||
@@ -128,12 +128,14 @@ class CylMesh(BaseTensorMesh):
|
||||
def vectorNx(self):
|
||||
"""Nodal grid vector (1D) in the x direction."""
|
||||
if self.nCy == 1:
|
||||
return self.hx.cumsum() - self.hx[0]/2
|
||||
return self.hx.cumsum()# - self.hx[0]/2
|
||||
return np.r_[0, self.hx].cumsum()
|
||||
|
||||
@property
|
||||
def vectorNy(self):
|
||||
"""Nodal grid vector (1D) in the y direction."""
|
||||
if self.nCy == 1:
|
||||
return np.r_[0]
|
||||
return np.r_[0, self.hy[:-1].cumsum()] + self.hy[0]*0.5
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user