OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Functions | Variables
PyBindField.cpp File Reference
#include <Python.h>
#include <structmember.h>
#include <exception>
#include <iostream>
#include <pybind11/pybind11.h>
#include "AbstractObjects/OpalData.h"
#include "AbstractObjects/Object.h"
#include "AbsBeamline/Ring.h"
#include "Elements/OpalRingDefinition.h"
Include dependency graph for PyBindField.cpp:

Go to the source code of this file.

Functions

std::tuple< int, double, double, double, double, double, double > get_field_value (double x, double y, double z, double t)
 
 PYBIND11_MODULE (bind_field, module)
 

Variables

std::string get_field_value_docstring
 
const char * module_docstring = "field module returns the field"
 

Function Documentation

◆ get_field_value()

std::tuple< int, double, double, double, double, double, double > get_field_value ( double  x,
double  y,
double  z,
double  t 
)

Definition at line 32 of file PyBindField.cpp.

References Ring::apply(), and Attrib::Distribution::R.

Referenced by PYBIND11_MODULE().

Here is the call graph for this function:

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( bind_field  ,
module   
)

Definition at line 53 of file PyBindField.cpp.

References arg(), get_field_value(), get_field_value_docstring, and module_docstring.

Here is the call graph for this function:

Variable Documentation

◆ get_field_value_docstring

std::string get_field_value_docstring
Initial value:
=
std::string("Get the field value at a point in the field map.\n\n")+
std::string(" x: x position [m]\n")+
std::string(" y: y position [m]\n")+
std::string(" z: z position [m]\n")+
std::string(" t: time [ns]\n")+
std::string("Returns a tuple containing 6 values:\n")+
std::string(" out of bounds: 1 if the event was out of the field map\n")+
std::string(" boundary, else 0.\n")+
std::string(" Bx: x magnetic field [T]\n")+
std::string(" By: y magnetic field [T]\n")+
std::string(" Bz: z magnetic field [T]\n")+
std::string(" Ex: x electric field\n")+
std::string(" Ey: y electric field\n")+
std::string(" Ez: z electric field\n")

Definition at line 15 of file PyBindField.cpp.

Referenced by PYBIND11_MODULE().

◆ module_docstring

const char* module_docstring = "field module returns the field"

Definition at line 51 of file PyBindField.cpp.

Referenced by PYBIND11_MODULE().