Skip to content

Commit

Permalink
WindowAround3DPoint convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
maximumsomething committed Feb 8, 2022
1 parent 086a8b9 commit 7ebab4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generate_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def save(self, ProjectName):
def load(ProjectName, NDIM):
return GridInfo.loadFromFile(GridInfo.getFilename(ProjectName, NDIM))

def WindowAround3DPoint(SIZE, X=0.0, Y=0.0, Z=0.0, DIV=25, Analytic=False, UserFunction="", Limited = True, PotentialLimit = 10000.0):
if type(SIZE) != float:
raise ValueError("SIZE must be floating-point.")

return GridInfo(3, X - SIZE/2.0, X + SIZE/2.0, DIV, 0.0, Y - SIZE/2.0, Y + SIZE/2.0, DIV, 0.0, Z - SIZE/2.0, Z + SIZE/2.0, DIV, 0.0, Analytic, UserFunction, Limited, PotentialLimit)

def hxyz(self):
if self.NDIM == 3 or self.NDIM == 2:
hx = (self.XMAX - self.XMIN) / (self.XDIV - 1)
Expand Down

0 comments on commit 7ebab4b

Please sign in to comment.