Commit f1fe4b72 authored by Sean Leavey's avatar Sean Leavey
Browse files

Added check to make sure R, T and L add up to 1 for mirrors and beam splitters

parent b5e1105d
Pipeline #1649 failed with stage
in 0 seconds
......@@ -339,6 +339,10 @@ class AbstractMirrorComponent(Component):
if R is not None: self.R.value = R
if T is not None: self.T.value = T
if L is not None: self.L.value = L
# check energy conservation
if self.R.value + self.T.value + self.L.value != 1:
raise pkex.BasePyKatException("The specified R, T and L values (%f, %f and %f) violate energy conservation" % (self.R.value, self.T.value, self.L.value))
def z(self): return self.__z
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment