ASCOT5
Loading...
Searching...
No Matches
libascot_mem.c
Go to the documentation of this file.
1
5
#include <stdlib.h>
6
#include "
libascot_mem.h
"
7
#include "
particle.h
"
8
16
input_particle
*
libascot_allocate_input_particles
(
int
nmrk) {
17
return
(
input_particle
*) malloc(nmrk *
sizeof
(
input_particle
) );
18
}
19
27
particle_state
*
libascot_allocate_particle_states
(
int
nmrk) {
28
return
(
particle_state
*) malloc(nmrk *
sizeof
(
particle_state
) );
29
}
30
38
real
*
libascot_allocate_reals
(
size_t
size) {
39
return
(
real
* ) malloc( size *
sizeof
(
real
) );
40
}
41
42
48
void
libascot_deallocate
(
void
*arr) {
49
free(arr);
50
}
real
double real
Definition
ascot5.h:85
libascot_allocate_particle_states
particle_state * libascot_allocate_particle_states(int nmrk)
A routine to allocate an array of particle states.
Definition
libascot_mem.c:27
libascot_allocate_input_particles
input_particle * libascot_allocate_input_particles(int nmrk)
A routine to allocate an array of input particles.
Definition
libascot_mem.c:16
libascot_allocate_reals
real * libascot_allocate_reals(size_t size)
A routine to allocate an array of reals.
Definition
libascot_mem.c:38
libascot_deallocate
void libascot_deallocate(void *arr)
A wrapper to C stdlib free()
Definition
libascot_mem.c:48
libascot_mem.h
Header file for libascot_mem.c.
particle.h
Header file for particle.c.
input_particle
Wrapper for marker structs.
Definition
particle.h:186
particle_state
General representation of a marker.
Definition
particle.h:40
Generated on Wed Oct 9 2024 17:13:57 for ASCOT5 by
1.10.0