Advertisement
Guest User

Untitled

a guest
Jun 29th, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.50 KB | None | 0 0
  1. /** @file */
  2. #ifndef INDICES_H
  3. #define INDICES_H
  4.  
  5. /* This file contains all functions relevant for indices calculations */
  6.  
  7. #define N_POINTS_COARSE 3;
  8. #define N_POINTS_FINE 6;
  9.  
  10. /**
  11.  * Enumerator specifying valid grid types.
  12.  */
  13. typedef enum {GRID_TYPE_COARSE, /*!< The coarse grid used for linear ansatz functions */
  14.               GRID_TYPE_FINE  /*!< The coarse grid used for quadratic ansatz functions */
  15.              } grid_type;
  16.  
  17. typedef enum {W,N,NE,E,S,SW} neighbour_type;
  18.  
  19. /**
  20. * Enumerator specifying types of rectangles
  21. */
  22. typedef enum {RECT_TYPE_TOP, /*!< The rectangle with a tip pointing downwards */
  23.               RECT_TYPE_BOTTOM /*!< The rectangle with a tip pointing upwards */
  24. } elem_type;
  25.  
  26.  
  27. int get_local_index(int glob_index,
  28.             int elem_index,
  29.             int elems_x,
  30.             grid_type grid);
  31.  
  32. void get_node_indices(int elem_index,
  33.                       int elems_x,
  34.                       int *indices,
  35.                       grid_type grid);
  36.  
  37.  
  38.  
  39. void get_ele_indices(int node_index, int elems_x, int elems_y, int *elems, grid_type grid);
  40.  
  41. void abs_2_coord(int glob_index, int elems_x, int *coord, grid_type grid);
  42.  
  43. int coord_2_abs(int coord_x, int coord_y, int elems_x, grid_type grid);
  44.  
  45. void elem_abs_2_coord(int elem_index, int elems_x, int *coord);
  46.  
  47. int elem_coord_2_abs(int coord_x, int coord_y, int elems_x);
  48.  
  49. void get_affected_elems_coarse(int coord_x, int coord_y, int elems_x, int elems_y, int *elems, grid_type grid);
  50.  
  51. int validated_elem_coord_2_abs(int coord_x, int coord_y, int elems_x, int elems_y, grid_type grid);
  52.  
  53. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement