sphore 0.0.1
SPH openGL rendering engine

src/data.c File Reference

Code for managing SPH data. More...

#include <stdlib.h>
#include <stdio.h>
#include "data.h"

Data Structures

struct  _data
 The internal storage for SPH data. More...

Functions

data_tdata_create (unsigned int n, float *x, float *y, float *z, float *h, float *data)
 Creates a new data set object.
void data_destroy (data_t *ds)
 Frees the memory associated with the given dataset.
const float * data_get_verticies (data_t *ds)
 Returns the verticies of all the particles.
unsigned int data_get_number_of_particles (data_t *ds)
 Returns the number of particles in a given data set.

Detailed Description

Code for managing SPH data.


Function Documentation

data_t* data_create ( unsigned int  n,
float *  x,
float *  y,
float *  z,
float *  h,
float *  data 
)

Creates a new data set object.

Makes a copy of the data, so your original copy can be destroyed.

Parameters:
[in]nthe number of points.
[in]xthe x coordinantes of the points.
[in]ythe y coordinantes of the points.
[in]zthe z coordinantes of the points.
[in]hthe smoothing length of the particles.
[in]datathe value of the data at each point.
Returns:
A pointer to the new data object.
void data_destroy ( data_t ds)

Frees the memory associated with the given dataset.

Parameters:
[in]dsthe data to be destroyed.
unsigned int data_get_number_of_particles ( data_t ds)

Returns the number of particles in a given data set.

Parameters:
[in]dsThe data to query.
Returns:
The number of particles in ds.
const float* data_get_verticies ( data_t ds)

Returns the verticies of all the particles.

Parameters:
[in]dsThe data to get the verticies from.
Returns:
An array containing the verticies.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines