mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Adding checks for data size based on interpolation type
This commit is contained in:
parent
ac043cb67a
commit
3b00ed3864
1 changed files with 7 additions and 0 deletions
|
|
@ -2058,6 +2058,13 @@ class EnergyFunctionFilter(Filter):
|
|||
def interpolation(self, val):
|
||||
cv.check_type('interpolation', val, str)
|
||||
cv.check_value('interpolation', val, self.INTERPOLATION_SCHEMES.values())
|
||||
|
||||
if val == 'quadratic' and len(self.energy) < 3:
|
||||
raise ValueError('Quadratic interpolation requires 3 or more values.')
|
||||
|
||||
if val == 'cubic' and len(self.energy) < 4:
|
||||
raise ValueError('Cubic interpolation requires 3 or more values.')
|
||||
|
||||
self._interpolation = val
|
||||
|
||||
def to_xml_element(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue