Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
project('PyORBIT', ['cpp'], version: run_command('python', '-m', 'setuptools_scm').stdout().strip())
project('PyORBIT',
['cpp'],
version: run_command('python', '-m', 'setuptools_scm').stdout().strip(),
default_options: [
'buildtype=release',
'b_lto=true',
'cpp_std=c++11',
'warning_level=3',
],
)

subdir('src')
subdir('py/orbit')
4 changes: 2 additions & 2 deletions src/core/mpi_init.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Python.h"
#include <Python.h>
#include "wrap_orbit_mpi.hh"

PyMODINIT_FUNC PyInit_orbit_mpi(void) {
return wrap_orbit_mpi::initorbit_mpi();
}
}
65 changes: 65 additions & 0 deletions src/core/type_accessors.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include <Python.h>

#include "wrap_bunch.hh"
#include "wrap_spacecharge.hh"
#include "wrap_mpi_comm.hh"
#include "wrap_utils.hh"
#include "wrap_trackerrk4.hh"

extern "C" {

namespace wrap_orbit_bunch {

PyObject* getBunchType(const char* name){
PyObject* mod = PyImport_ImportModule("orbit.core.bunch");
PyObject* pyType = PyObject_GetAttrString(mod,name);
Py_DECREF(mod);
Py_DECREF(pyType);
return pyType;
}

}

PyObject* getSpaceChargeType(const char* name){
PyObject* mod = PyImport_ImportModule("orbit.core.spacecharge");
PyObject* pyType = PyObject_GetAttrString(mod,name);
Py_DECREF(mod);
Py_DECREF(pyType);
return pyType;
}

namespace wrap_orbit_mpi_comm {

PyObject* getMPI_CommType(const char* name){
PyObject* mod = PyImport_ImportModule("orbit.core.orbit_mpi");
PyObject* mpi_comm_mod = PyObject_GetAttrString(mod,"mpi_comm");
PyObject* pyType = PyObject_GetAttrString(mpi_comm_mod,name);
Py_DECREF(mpi_comm_mod);
Py_DECREF(mod);
Py_DECREF(pyType);
return pyType;
}

}

namespace wrap_orbit_utils {

PyObject* getOrbitUtilsType(const char* name){
PyObject* mod = PyImport_ImportModule(const_cast<char*>("orbit.core.orbit_utils"));
PyObject* pyType = PyObject_GetAttrString(mod,name);
Py_DECREF(mod);
Py_DECREF(pyType);
return pyType;
}

}

PyObject* getTrackerRK4Type(const char* name){
PyObject* mod = PyImport_ImportModule("orbit.core.trackerrk4");
PyObject* pyType = PyObject_GetAttrString(mod,name);
Py_DECREF(mod);
Py_DECREF(pyType);
return pyType;
}

}
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_BaseRfGap.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_BASE_RF_GAP_H
#define WRAP_BASE_RF_GAP_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_BaseRfGap_slow.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_BASE_RF_GAP_SLOW_H
#define WRAP_BASE_RF_GAP_SLOW_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_MatrixRfGap.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_MATRIX_RF_GAP_H
#define WRAP_MATRIX_RF_GAP_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_RfGapTTF.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_RF_GAP_TTF_H
#define WRAP_RF_GAP_TTF_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_RfGapTTF_slow.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_RF_GAP_TTF_SLOW_H
#define WRAP_RF_GAP_TTF_SLOW_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_RfGapThreePointTTF.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_RF_GAP_THREE_POINT_TTF_H
#define WRAP_RF_GAP_THREE_POINT_TTF_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_RfGapThreePointTTF_slow.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_RF_GAP_THREE_POINT_TTF_SLOW_H
#define WRAP_RF_GAP_THREE_POINT_TTF_SLOW_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/rfgap/wrap_SuperFishFieldSource.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_SUPER_FISH_RF_FIELD_SOURCE_H
#define WRAP_SUPER_FISH_RF_FIELD_SOURCE_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/linac/tracking/wrap_linac_tracking.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Python.h"
#include <Python.h>
#include "orbit_mpi.hh"

#include "pyORBIT_Object.hh"
Expand Down
2 changes: 1 addition & 1 deletion src/linac/tracking/wrap_linac_tracking.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_LINAC_TRACKING_H
#define WRAP_LINAC_TRACKING_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C"
Expand Down
2 changes: 1 addition & 1 deletion src/linac/wrap_linacmodule.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef WRAP_LINAC_H
#define WRAP_LINAC_H

#include "Python.h"
#include <Python.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/main/pyORBIT_Object.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef PY_ORBIT_OBJECT_H
#define PY_ORBIT_OBJECT_H

#include "structmember.h"
#include <structmember.h>

#ifdef __cplusplus
extern "C" {
Expand Down
Loading
Loading