diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fe4cc06..36ef451f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Project Changelog ================= +Release 1.6.0 (TBD) +------------------- + +New: +* Add e_field attribute to Plasma object for electric field vector. (#465) + + Release 1.5.0 (27 Aug 2024) ------------------- diff --git a/cherab/core/VERSION b/cherab/core/VERSION index bc80560f..4c39f7c4 100644 --- a/cherab/core/VERSION +++ b/cherab/core/VERSION @@ -1 +1 @@ -1.5.0 +1.6.0.dev1 diff --git a/cherab/core/plasma/node.pxd b/cherab/core/plasma/node.pxd index f7a9bb89..9d268070 100644 --- a/cherab/core/plasma/node.pxd +++ b/cherab/core/plasma/node.pxd @@ -60,6 +60,7 @@ cdef class Plasma(Node): readonly object notifier VectorFunction3D _b_field + VectorFunction3D _e_field DistributionFunction _electron_distribution Composition _composition AtomicData _atomic_data @@ -72,6 +73,8 @@ cdef class Plasma(Node): cdef VectorFunction3D get_b_field(self) + cdef VectorFunction3D get_e_field(self) + cdef DistributionFunction get_electron_distribution(self) cdef Composition get_composition(self) diff --git a/cherab/core/plasma/node.pyx b/cherab/core/plasma/node.pyx index 08d31069..96f687ca 100644 --- a/cherab/core/plasma/node.pyx +++ b/cherab/core/plasma/node.pyx @@ -258,6 +258,8 @@ cdef class Plasma(Node): All plasma emission from this plasma will be calculated with the same provider. :ivar VectorFunction3D b_field: A vector function in 3D space that returns the magnetic field vector at any requested point. + :ivar VectorFunction3D e_field: A vector function in 3D space that returns the + electric field vector at any requested point. :ivar Composition composition: The composition object manages all the atomic plasma species and provides access to their distribution functions. :ivar DistributionFunction electron_distribution: A distribution function object @@ -324,6 +326,7 @@ cdef class Plasma(Node): # plasma properties self.b_field = None + self.e_field = None self.electron_distribution = None # setup plasma composition handler and pass through notifications @@ -362,6 +365,24 @@ cdef class Plasma(Node): cdef VectorFunction3D get_b_field(self): return self._b_field + @property + def e_field(self): + return self._e_field + + @e_field.setter + def e_field(self, object value): + # assign Vector3D(0, 0, 0) if None is passed + if value is None: + self._e_field = autowrap_vectorfunction3d(Vector3D(0, 0, 0)) + else: + self._e_field = autowrap_vectorfunction3d(value) + + self._modified() + + # cython fast access + cdef VectorFunction3D get_e_field(self): + return self._e_field + @property def electron_distribution(self): return self._electron_distribution