Skip to content

Commit

Permalink
Add support for gradients in LEOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Brill authored and flow-phys committed Jul 14, 2023
1 parent adea44b commit 527090e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyranda/pyrandaLEOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ def temperature(self,matID,rho,ie):



def addMaterial(self,EOS_number,function_names=['Pt','Et','Cs'],matID=None):
def addMaterial(self,EOS_number,function_names=['Pt','Et','Cs'],matID=None,dxdy=False):

# Assign a name/ID for this material
if not matID:
matID = EOS_number

self.materials[matID] = self.__setupLEOS__(EOS_number,function_names)
self.materials[matID] = self.__setupLEOS__(EOS_number,function_names,dxdy=dxdy)



Expand All @@ -129,7 +129,10 @@ def __setupLEOS__(self,EOS_File,fnames,dxdy=False):

# Set options
lopts = leospy.LEOS_LookupOptions()
lopts.calculateFunction(True).calculateDFDX(False).calculateDFDY(False)
if not dxdy:
lopts.calculateFunction(True).calculateDFDX(False).calculateDFDY(False)
else :
lopts.calculateFunction(True).calculateDFDX(True).calculateDFDY(True)

fopts = leospy.LEOS_FunctionOptions()
fopts.interpolation(leospy.BICUBIC) # Bi-cubic
Expand Down

0 comments on commit 527090e

Please sign in to comment.