Added C interface
This commit is contained in:
parent
b59b6716a6
commit
69e1a7ad9d
3 changed files with 63 additions and 1 deletions
26
example.c
Normal file
26
example.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
void etics_external_init(const int n_total);
|
||||
void etics_external_grav(const double* const A, const int n_act, double x_act[][3], double pot_act[], double a_act[][3]);
|
||||
|
||||
int main()
|
||||
{
|
||||
const int n_total = 1024;
|
||||
etics_external_init(n_total);
|
||||
|
||||
srand(19640916);
|
||||
|
||||
double x_act[n_total][3], pot_act[n_total], a_act[n_total][3];
|
||||
for (int i = 0; i < n_total; i++) {
|
||||
x_act[i][0] = rand();
|
||||
x_act[i][1] = rand();
|
||||
x_act[i][2] = rand();
|
||||
}
|
||||
|
||||
double A[2048];
|
||||
for (int i = 0; i < 2048; i++) {
|
||||
A[i] = rand();
|
||||
}
|
||||
|
||||
etics_external_grav(A, n_total, x_act, pot_act, a_act);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue