OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
OscillatingField< Field > Class Template Reference

An oscillating electromagnetic field. More...

#include <OscillatingField.h>

Inheritance diagram for OscillatingField< Field >:
Inheritance graph
Collaboration diagram for OscillatingField< Field >:
Collaboration graph

Public Types

using Mesh_t = Mesh_t< Dim >
 
using Centering_t = Cell
 
using Layout_t = FieldLayout< Dim >
 
using BareField_t = BareField< T, Dim, ViewArgs... >
 
using view_type = typename BareField_t::view_type
 
using BConds_t = BConds< Field< T, Dim, Mesh_t< Dim >, Centering_t< Dim >, ViewArgs... >, Dim >
 
using uniform_type = typename detail::CreateUniformType< base_type, typename view_type::uniform_type >::type
 
using Domain_t = NDIndex< Dim >
 Domain type specifying the index region. More...
 
typedef view_type::memory_space memory_space
 
typedef view_type::execution_space execution_space
 
using HostMirror = typename view_type::host_mirror_type
 
using policy_type = typename RangePolicy< Dim, PolicyArgs... >::policy_type
 
using halo_type = detail::HaloCells< T, Dim, ViewArgs... >
 
using value_type = T
 

Public Member Functions

 OscillatingField ()
 Default constructor. More...
 
virtual ~OscillatingField ()
 
virtual double getFrequency () const
 Return the RF frequency in Hz. More...
 
virtual double getPhase () const
 Return the RF phase in rad. More...
 
virtual void setFrequency (double f)
 Assign the RF frequency in Hz. More...
 
virtual void setPhase (double phi)
 Assign the RF phase in rad. More...
 
virtual EVector Efield (const Point3D &point) const
 Get field. More...
 
virtual EVector Efield (const Point3D &point, double time) const
 Get field. More...
 
virtual BVector Bfield (const Point3D &point) const
 Get field. More...
 
virtual BVector Bfield (const Point3D &point, double time) const
 Get field. More...
 
Field deepCopy () const
 
void initialize (Mesh_t &, Layout_t &, int nghost=1)
 
void initialize (Layout_t &l, int nghost=1)
 
void updateLayout (Layout_t &, int nghost=1)
 
void setFieldBC (BConds_t &bc)
 
KOKKOS_INLINE_FUNCTION Mesh_tget_mesh () const
 
T getVolumeIntegral () const
 
T getVolumeAverage () const
 
BConds_tgetFieldBC ()
 
void resize (Args... args)
 
detail::size_type size (unsigned d) const
 
const Domain_tgetOwned () const
 
const Domain_t getAllocated () const
 
int getNghost () const
 
void fillHalo ()
 
void accumulateHalo ()
 
void accumulateHalo_noghost (int nghost=1)
 
auto & getCommunicator () const
 
Layout_tgetLayout () const
 
const Index & getIndex (unsigned d) const
 
const NDIndex< Dim > & getDomain () const
 
halo_typegetHalo ()
 
KOKKOS_INLINE_FUNCTION T operator() (Args... args) const
 
view_typegetView ()
 
const view_typegetView () const
 
HostMirror getHostMirror () const
 
policy_type< execution_space, PolicyArgs... > getFieldRangePolicy (const int nghost=0) const
 
void write (std::ostream &out=std::cout) const
 
void write (Inform &inf) const
 
T sum (int nghost=0) const
 
T max (int nghost=0) const
 
T min (int nghost=0) const
 
T prod (int nghost=0) const
 
KOKKOS_INLINE_FUNCTION auto operator[] (size_t i) const
 

Static Public Attributes

static constexpr unsigned dim
 

Private Types

using base_type = Field< T, Dim, Mesh_t< Dim >, Centering_t< Dim >, Props... >
 

Private Member Functions

void setup ()
 

Private Attributes

double frequency
 
double phase
 
Mesh_tmesh_m
 
BConds_t bc_m
 
int nghost_m
 Number of ghost layers on each field boundary. More...
 
view_type dview_m
 Actual field data. More...
 
Domain_t owned_m
 Domain of the data. More...
 
halo_type halo_m
 
Layout_tlayout_m
 How the arrays are laid out. More...
 

Detailed Description

template<class Field>
class OscillatingField< Field >

An oscillating electromagnetic field.

Definition at line 37 of file OscillatingField.h.

Member Typedef Documentation

◆ BareField_t

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::BareField_t = BareField<T, Dim, ViewArgs...>
inherited

Definition at line 26 of file Field.h.

◆ base_type

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::base_type = Field<T, Dim, Mesh_t< Dim > , Centering_t< Dim > , Props...>
privateinherited

Definition at line 20 of file Field.h.

◆ BConds_t

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::BConds_t = BConds<Field<T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs...>, Dim>
inherited

Definition at line 28 of file Field.h.

◆ Centering_t

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::Centering_t = Cell
inherited

Definition at line 24 of file Field.h.

◆ Domain_t

using ippl::BareField< T, Dim, ViewArgs >::Domain_t = NDIndex<Dim>
inherited

Domain type specifying the index region.

Definition at line 47 of file BareField.h.

◆ execution_space

typedef view_type::execution_space ippl::BareField< T, Dim, ViewArgs >::execution_space
inherited

Definition at line 52 of file BareField.h.

◆ halo_type

using ippl::BareField< T, Dim, ViewArgs >::halo_type = detail::HaloCells<T, Dim, ViewArgs...>
inherited

Definition at line 57 of file BareField.h.

◆ HostMirror

using ippl::BareField< T, Dim, ViewArgs >::HostMirror = typename view_type::host_mirror_type
inherited

Definition at line 53 of file BareField.h.

◆ Layout_t

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::Layout_t = FieldLayout<Dim>
inherited

Definition at line 25 of file Field.h.

◆ memory_space

typedef view_type::memory_space ippl::BareField< T, Dim, ViewArgs >::memory_space
inherited

Definition at line 51 of file BareField.h.

◆ Mesh_t

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::Mesh_t = Mesh_t< Dim >
inherited

Definition at line 23 of file Field.h.

◆ policy_type

using ippl::BareField< T, Dim, ViewArgs >::policy_type = typename RangePolicy<Dim, PolicyArgs...>::policy_type
inherited

Definition at line 55 of file BareField.h.

◆ uniform_type

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::uniform_type = typename detail::CreateUniformType<base_type, typename view_type::uniform_type>::type
inherited

Definition at line 30 of file Field.h.

◆ value_type

using ippl::BareField< T, Dim, ViewArgs >::value_type = T
inherited

Definition at line 59 of file BareField.h.

◆ view_type

using ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::view_type = typename BareField_t::view_type
inherited

Definition at line 27 of file Field.h.

Constructor & Destructor Documentation

◆ OscillatingField()

Default constructor.

Definition at line 87 of file OscillatingField.h.

◆ ~OscillatingField()

template<class Field >
OscillatingField< Field >::~OscillatingField
virtual

Definition at line 92 of file OscillatingField.h.

Member Function Documentation

◆ accumulateHalo()

void ippl::BareField< T, Dim, ViewArgs >::accumulateHalo
inherited

Definition at line 128 of file BareField.hpp.

◆ accumulateHalo_noghost()

void ippl::BareField< T, Dim, ViewArgs >::accumulateHalo_noghost ( int  nghost = 1)
inherited

Definition at line 129 of file BareField.hpp.

◆ Bfield() [1/2]

template<class Field >
BVector OscillatingField< Field >::Bfield ( const Point3D point) const
virtual

Get field.

Definition at line 127 of file OscillatingField.h.

◆ Bfield() [2/2]

template<class Field >
BVector OscillatingField< Field >::Bfield ( const Point3D point,
double  time 
) const
virtual

Get field.

Definition at line 132 of file OscillatingField.h.

◆ deepCopy()

Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs... > ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::deepCopy
inherited

Creates a new Field with the same properties and contents

Returns
A deep copy of the field

Definition at line 45 of file Field.hpp.

◆ Efield() [1/2]

template<class Field >
EVector OscillatingField< Field >::Efield ( const Point3D point) const
virtual

Get field.

Definition at line 117 of file OscillatingField.h.

◆ Efield() [2/2]

template<class Field >
EVector OscillatingField< Field >::Efield ( const Point3D point,
double  time 
) const
virtual

Get field.

Definition at line 122 of file OscillatingField.h.

◆ fillHalo()

void ippl::BareField< T, Dim, ViewArgs >::fillHalo
inherited

Definition at line 127 of file BareField.hpp.

◆ get_mesh()

KOKKOS_INLINE_FUNCTION Mesh_t & ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::get_mesh ( ) const
inlineinherited

Definition at line 64 of file Field.h.

◆ getAllocated()

const Domain_t ippl::BareField< T, Dim, ViewArgs >::getAllocated ( ) const
inlineinherited

Index domain of the allocated field.

Returns
the allocated index domain (including ghost cells)

Definition at line 123 of file BareField.h.

◆ getCommunicator()

auto & ippl::BareField< T, Dim, ViewArgs >::getCommunicator ( ) const
inlineinherited

Definition at line 131 of file BareField.h.

◆ getDomain()

const NDIndex< Dim > & ippl::BareField< T, Dim, ViewArgs >::getDomain ( ) const
inlineinherited

Definition at line 140 of file BareField.h.

◆ getFieldBC()

BConds_t & ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::getFieldBC ( )
inlineinherited

Definition at line 78 of file Field.h.

◆ getFieldRangePolicy()

policy_type< execution_space, PolicyArgs... > ippl::BareField< T, Dim, ViewArgs >::getFieldRangePolicy ( const int  nghost = 0) const
inlineinherited

Generate the range policy for iterating over the field, excluding ghost layers

Template Parameters
PolicyArgs...additional template parameters for the range policy
Parameters
nghostNumber of ghost layers to include in the range policy (default 0)
Returns
Range policy for iterating over the field and nghost of the ghost layers

Definition at line 183 of file BareField.h.

◆ getFrequency()

template<class Field >
double OscillatingField< Field >::getFrequency
inlinevirtual

Return the RF frequency in Hz.

Definition at line 97 of file OscillatingField.h.

Referenced by RFCavityRep::getFrequency(), and TravelingWaveRep::getFrequency().

◆ getHalo()

halo_type & ippl::BareField< T, Dim, ViewArgs >::getHalo ( )
inlineinherited

Definition at line 142 of file BareField.h.

◆ getHostMirror()

HostMirror ippl::BareField< T, Dim, ViewArgs >::getHostMirror ( ) const
inlineinherited

Definition at line 173 of file BareField.h.

◆ getIndex()

const Index & ippl::BareField< T, Dim, ViewArgs >::getIndex ( unsigned  d) const
inlineinherited

Definition at line 139 of file BareField.h.

◆ getLayout()

Layout_t & ippl::BareField< T, Dim, ViewArgs >::getLayout ( ) const
inlineinherited

Definition at line 134 of file BareField.h.

◆ getNghost()

int ippl::BareField< T, Dim, ViewArgs >::getNghost ( ) const
inlineinherited

Definition at line 125 of file BareField.h.

◆ getOwned()

const Domain_t & ippl::BareField< T, Dim, ViewArgs >::getOwned ( ) const
inlineinherited

Index domain of the local field.

Returns
the index domain.

Definition at line 117 of file BareField.h.

◆ getPhase()

template<class Field >
double OscillatingField< Field >::getPhase
inlinevirtual

Return the RF phase in rad.

Definition at line 102 of file OscillatingField.h.

Referenced by RFCavityRep::getPhase(), and TravelingWaveRep::getPhase().

◆ getView() [1/2]

view_type & ippl::BareField< T, Dim, ViewArgs >::getView ( )
inlineinherited

Definition at line 169 of file BareField.h.

◆ getView() [2/2]

const view_type & ippl::BareField< T, Dim, ViewArgs >::getView ( ) const
inlineinherited

Definition at line 171 of file BareField.h.

◆ getVolumeAverage()

T ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::getVolumeAverage
inherited

Use the midpoint rule to calculate the field's volume average

Returns
Integral of the field divided by the mesh volume

Definition at line 76 of file Field.hpp.

◆ getVolumeIntegral()

T ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::getVolumeIntegral
inherited

Use the midpoint rule to calculate the field's volume integral

Returns
Integral of the field over its domain

Definition at line 70 of file Field.hpp.

◆ initialize() [1/2]

void ippl::BareField< T, Dim, ViewArgs >::initialize ( Layout_t l,
int  nghost = 1 
)
inherited

Initialize the field, if it was constructed from the default constructor. This should NOT be called if the field was constructed by providing a FieldLayout.

Parameters
lof field
nghostnumber of ghost layers

Definition at line 101 of file BareField.hpp.

◆ initialize() [2/2]

void ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::initialize ( Mesh_t m,
Layout_t l,
int  nghost = 1 
)
inherited

Definition at line 53 of file Field.hpp.

◆ max()

T ippl::BareField< T, Dim, ViewArgs >::max ( int  nghost = 0) const
inherited

Definition at line 203 of file BareField.hpp.

◆ min()

T ippl::BareField< T, Dim, ViewArgs >::min ( int  nghost = 0) const
inherited

Definition at line 204 of file BareField.hpp.

◆ operator()()

KOKKOS_INLINE_FUNCTION T ippl::BareField< T, Dim, ViewArgs >::operator() ( Args...  args) const
inlineinherited

Assign another field.

Template Parameters
Args...variadic template to specify an access index for a view element.
Parameters
argsview indices
Returns
a view element

Definition at line 165 of file BareField.h.

◆ operator[]()

KOKKOS_INLINE_FUNCTION auto ippl::detail::Expression< BareField< T, Dim, ViewArgs... > , N >::operator[] ( size_t  i) const
inlineinherited

Access single element of the expression

Definition at line 32 of file IpplExpressions.h.

◆ prod()

T ippl::BareField< T, Dim, ViewArgs >::prod ( int  nghost = 0) const
inherited

Definition at line 205 of file BareField.hpp.

◆ resize()

void ippl::BareField< T, Dim, ViewArgs >::resize ( Args...  args)
inherited

Dimension independent view resize function which calls Kokkos.

Template Parameters
Args...variadic template specifying the individiual dimension arguments

Definition at line 92 of file BareField.hpp.

◆ setFieldBC()

void ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::setFieldBC ( BConds_t bc)
inlineinherited

Definition at line 58 of file Field.h.

◆ setFrequency()

template<class Field >
void OscillatingField< Field >::setFrequency ( double  f)
inlinevirtual

Assign the RF frequency in Hz.

Definition at line 107 of file OscillatingField.h.

Referenced by RFCavityRep::setFrequency(), and TravelingWaveRep::setFrequency().

◆ setPhase()

template<class Field >
void OscillatingField< Field >::setPhase ( double  phi)
inlinevirtual

Assign the RF phase in rad.

Definition at line 112 of file OscillatingField.h.

Referenced by RFCavityRep::setPhase(), and TravelingWaveRep::setPhase().

◆ setup()

void ippl::BareField< T, Dim, ViewArgs >::setup
privateinherited

Allocate field.

Definition at line 222 of file BareField.hpp.

◆ size()

detail::size_type ippl::BareField< T, Dim, ViewArgs >::size ( unsigned  d) const
inlineinherited

Local field size.

Parameters
dthe dimension
Returns
the number of grid points in the given dimension.

Definition at line 111 of file BareField.h.

◆ sum()

T ippl::BareField< T, Dim, ViewArgs >::sum ( int  nghost = 0) const
inherited

Definition at line 202 of file BareField.hpp.

◆ updateLayout()

void ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::updateLayout ( Layout_t l,
int  nghost = 1 
)
inherited

Definition at line 56 of file Field.hpp.

◆ write() [1/2]

void ippl::BareField< T, Dim, ViewArgs >::write ( Inform inf) const
inherited

Print the BareField

Parameters
infInform object

Definition at line 200 of file BareField.hpp.

◆ write() [2/2]

void ippl::BareField< T, Dim, ViewArgs >::write ( std::ostream &  out = std::cout) const
inherited

Print the BareField.

Parameters
outstream

Definition at line 194 of file BareField.hpp.

Member Data Documentation

◆ bc_m

BConds_t ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::bc_m
privateinherited

Definition at line 87 of file Field.h.

◆ dim

constexpr unsigned ippl::BareField< T, Dim, ViewArgs >::dim
staticconstexprinherited

Definition at line 60 of file BareField.h.

◆ dview_m

view_type ippl::BareField< T, Dim, ViewArgs >::dview_m
privateinherited

Actual field data.

Definition at line 212 of file BareField.h.

◆ frequency

template<class Field >
double OscillatingField< Field >::frequency
private

Definition at line 78 of file OscillatingField.h.

◆ halo_m

halo_type ippl::BareField< T, Dim, ViewArgs >::halo_m
privateinherited

Definition at line 217 of file BareField.h.

◆ layout_m

Layout_t* ippl::BareField< T, Dim, ViewArgs >::layout_m
privateinherited

How the arrays are laid out.

Definition at line 225 of file BareField.h.

◆ mesh_m

Mesh_t* ippl::Field< T, Dim, Mesh_t< Dim > , Centering_t< Dim > , ViewArgs >::mesh_m
privateinherited

Definition at line 84 of file Field.h.

◆ nghost_m

int ippl::BareField< T, Dim, ViewArgs >::nghost_m
privateinherited

Number of ghost layers on each field boundary.

Definition at line 209 of file BareField.h.

◆ owned_m

Domain_t ippl::BareField< T, Dim, ViewArgs >::owned_m
privateinherited

Domain of the data.

Definition at line 215 of file BareField.h.

◆ phase

template<class Field >
double OscillatingField< Field >::phase
private

Definition at line 79 of file OscillatingField.h.


The documentation for this class was generated from the following file: