Struphy data structures#
Check out Tutorial 07 - Struphy data structures for a hands-on introduction.
FEEC variables#
Struphy uses the FEEC data structures provided by the open source package Psydac for its fluid/EM-fields variables. FE coefficients are stores as
a
StencilVectorfor scalar-valued variables (H1orL2)a
BlockVectorfor vector-valued variables (Hcurl,HdivorH1vec)
A BlockVector is just a 3-list of StencilVectors.
- class psydac.linalg.stencil.StencilVector(V)[source]#
Bases:
VectorVector in n-dimensional stencil format.
- Parameters:
V (psydac.linalg.stencil.StencilVectorSpace) – Space to which the new vector belongs.
- property space#
Vector space to which this vector belongs.
- toarray(*, order='C', with_pads=False)[source]#
Return a numpy 1D array corresponding to the given StencilVector, with or without pads.
- Parameters:
with_pads (bool) – If True, include pads in output array (ignored in serial case).
order ({'C','F'}) – Memory representation of the data ‘C’ for row-major ordering (C-style), ‘F’ column-major ordering (Fortran-style).
- Returns:
array – A copy of the data array collapsed into one dimension.
- Return type:
numpy.ndarray
- copy(out=None)[source]#
Return an identical copy of this vector.
Subclasses must ensure that x.copy(out=x) returns x and not a new object.
- conjugate(out=None)[source]#
Compute the complex conjugate vector.
Please note that x.conjugate(out=x) modifies x in place and returns x.
If the field is real (i.e. self.dtype in (np.float32, np.float64)) this method is equivalent to copy. If the field is complex (i.e. self.dtype in (np.complex64, np.complex128)) this method returns the complex conjugate of self, element-wise.
The behavior of this function is similar to numpy.conjugate(self, out=None).
- property starts#
- property ends#
- property pads#
- property ghost_regions_in_sync#
- class psydac.linalg.block.BlockVector(V, blocks=None)[source]#
Bases:
VectorBlock of Vectors, which is an element of a BlockVectorSpace.
- Parameters:
V (psydac.linalg.block.BlockVectorSpace) – Space to which the new vector belongs.
blocks (list or tuple (psydac.linalg.basic.Vector)) – List of Vector objects, belonging to the correct spaces (optional).
- property space#
Vector space to which this vector belongs.
- copy(out=None)[source]#
Return an identical copy of this vector.
Subclasses must ensure that x.copy(out=x) returns x and not a new object.
- conjugate(out=None)[source]#
Compute the complex conjugate vector.
Please note that x.conjugate(out=x) modifies x in place and returns x.
If the field is real (i.e. self.dtype in (np.float32, np.float64)) this method is equivalent to copy. If the field is complex (i.e. self.dtype in (np.complex64, np.complex128)) this method returns the complex conjugate of self, element-wise.
The behavior of this function is similar to numpy.conjugate(self, out=None).
- property blocks#
- property n_blocks#
- property ghost_regions_in_sync#
Kinetic variables#
All information pertaining to markers in Struphy is stored in the particle_base.
In particular, the data structure holding the values of each marker is under struphy.pic.base.Particles.markers().