Swarm-NG
1.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
tutorial_integrator_plugin.cu
1
// That was the definition of the plugin. Now we need to intantiate it as a
2
// plugin so it is compiled and can be referenced in Swarm.
3
//
4
// For that we create a file with "cu" extension (for a GPU integrator). and
5
// include the definition of our integrator as well as plugin creating
6
// API.
7
//
8
// Here are the includes.
9
#include "
tutorial_integrator.hpp
"
10
#include "
monitors/stop_on_ejection.hpp
"
11
#include "
swarm/gpu/gravitation_accjerk.hpp
"
12
13
// Some aliasing and opening namespace can make our code more readable
14
typedef
gpulog::device_log
L
;
15
using namespace
swarm::monitors;
16
using
swarm::integrator_plugin_initializer
;
17
18
// First we have to define implementation for Monitor and Gravitational
19
// force calculation to our integrator to compile.
20
typedef
TutorialIntegrator< stop_on_ejection<L>
,
GravitationAccJerk
>
TutorialIntegrator_Instantiated
;
21
22
// Now that we have our integrator class, we use the Plug-in API to
23
// register our class with the name "tutorial_integrator" in the Swarm
24
// plugin system. You can use the name "tutorial_integrator" in the
25
// config files to use the class e.g. integrator=tutorial_integrator
26
//
27
integrator_plugin_initializer< TutorialIntegrator_Instantiated >
28
tutorial_integ_plugin(
"tutorial_integrator"
29
,
"This is the integrator based on tutorial integrator"
);
30
31
//
32
//
33
// For complete listing of these two files look at \ref src/tutorials/tutorial_integrator.hpp and \ref src/tutorials/tutorial_integrator_plugin.cu
34
swarm
src
tutorials
tutorial_integrator_plugin.cu
Generated on Sun Jul 21 2013 11:11:54 for Swarm-NG by
1.8.4