C-callable Interface to the Field object

The Field object stores scalar or vector data on either regular or irregular grids. Each element, in addition to a position vector (explicitly stored in the irregular grid case) may have a mask element (to denote whether a valid data element is held) and a vector of integer indices, to index the point on a mesh.

Function definitions


int FIELD_copy
int FIELD_copy_grid
int FIELD_allocate_irregular_memory
int FIELD_allocate_regular_memory
int FIELD_get_value
int FIELD_get_position_vector
int FIELD_get_grid_size
int FIELD_set_mask
int FIELD_get_mask
int FIELD_reset_mask
int FIELD_set_masked_value
int FIELD_set_value
int FIELD_increment_value
int FIELD_scale_regular
int FIELD_transform
int FIELD_define_unit
int FIELD_set_title

int FIELD_copy

Arguments:

 Field to                       Pointer to source Field object                    
 Field from                     Pointer to destination Field object               
Copy the field object, including allocation of data, title etc.

int FIELD_copy_grid

Arguments:

 Field to                       Pointer to source Field object                    
 Field from                     Pointer to destination Field object               
Copy the grid definition from one field object to another

int FIELD_allocate_irregular_memory

Arguments:

 Field d                        pointer to Field object to be manipulated         
 int no                         Number of components of each element vector       
 int ndd                        Number of components of element position vector   
 int ndi                        Number of components of element index vector      
Allocate memory for an irregular field object. This assumes that the number of grid elements (d->ng) has already been set.

int FIELD_allocate_regular_memory

Arguments:

 Field d                        pointer to Field object to be manipulated         
 int no                         Number of components of each element vector       
Allocate memory for a regular field object. This assumes that the number of grid elements (d->ng) has already been set.

int FIELD_get_value

Arguments:

 Field field                    Pointer to Field object to be interrogated        
 int index                      Sequence number of the required element           
 float *p                       Returned data value                               

int FIELD_get_position_vector

Arguments:

 Field field                    Pointer to Field object to be interrogated        
 int index                      Sequence number of the required element           
 float p[3]                     Returned position                                 
Obtain the position of a grid point.

int FIELD_get_grid_size

Arguments:

 Field field                    Pointer to Field object to be interrogated        
Return the number of grid points.

int FIELD_set_mask

Arguments:

 Field field                    Pointer to Field object to be manipulated         
 int point                      Sequence number of element                        
Set the mask element corresponding to a particular field element.

int FIELD_get_mask

Arguments:

 Field field                    Pointer to Field object to be interrogated        
 int point                      Sequence number of element                        
Return the mask value corresponding to a particular field element.

int FIELD_reset_mask

Arguments:

 Field field                    Pointer to Field object to be manipulated         
Set all mask elements to zero.

int FIELD_set_masked_value

Arguments:

 Field field                    pointer to Field object to be manipulated         
 float value                    New value                                         
Set all elements of a Field to a constant only of the corresponding element of the mask is set.

int FIELD_set_value

Arguments:

 Field field                    pointer to Field object to be manipulated         
 int index                      Sequence number of the element to change          
 float *value                   New value                                         
Set an element.

int FIELD_increment_value

Arguments:

 Field field                    Pointer to Field object to be manipulated         
 int index                      Sequence number of the required element           
 float *value                   Pointer to value to be added on                   
Increment an element by a constant.

int FIELD_scale_regular

Arguments:

 Field field                    Pointer to Field to be modified                   
 float scal0                    Scaling for first axis direction                  
 float scal1                    Scaling for second axis direction                 
 float scal2                    Scaling for third axis direction                  
Scaling a regular grid around its centre.

int FIELD_transform

Arguments:

 Field field                    Pointer to input Field object                     
 Field result                   Pointer to output Field object                    
 float *parms                   Transformation paramaters                         
Apply rotation translation and scale to the grid.

Translations are in the grid coordinate system, at timeof staring the edit rotations are about axes through the plot centre applied in order x, y, z. size alterations leave the centre position unchanged.

Order of parameters:
parms[0-2] Scale factors
parms[3-5] Rotations
parms[6-8] Translations


int FIELD_define_unit

Arguments:

 Field p                        Pointer to Field object                           
 char *unit                     String containing unit                            
Provide definition of the unit used. The input string is copied to local memory.

int FIELD_set_title

Arguments:

 Field p                        Pointer to Field object                           
 char *title                    String containg required title                    
Define title of the field structure. The input string is copied to local memory.