Nek5000
SEM for Incompressible NS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Classes | Macros | Functions
findpts_imp.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hash_data
 
struct  findpts_data
 
struct  src_pt
 
struct  out_pt
 
struct  eval_src_pt
 
struct  eval_out_pt
 

Macros

#define obbox   TOKEN_PASTE(obbox_,D)
 
#define local_hash_data   TOKEN_PASTE(findpts_local_hash_data_,D)
 
#define hash_data   TOKEN_PASTE(findpts_hash_data_,D)
 
#define hash_index   TOKEN_PASTE(hash_index_ ,D)
 
#define hash_setfac   TOKEN_PASTE(hash_setfac_ ,D)
 
#define hash_range   TOKEN_PASTE(hash_range_ ,D)
 
#define hash_bb   TOKEN_PASTE(hash_bb_ ,D)
 
#define set_local_mask   TOKEN_PASTE(set_local_mask_ ,D)
 
#define fill_hash   TOKEN_PASTE(fill_hash_ ,D)
 
#define table_from_hash   TOKEN_PASTE(table_from_hash_ ,D)
 
#define hash_build   TOKEN_PASTE(hash_build_ ,D)
 
#define hash_free   TOKEN_PASTE(hash_free_ ,D)
 
#define findpts_local_data   TOKEN_PASTE(findpts_local_data_,D)
 
#define findpts_local_setup   TOKEN_PASTE(PREFIXED_NAME(findpts_local_setup_),D)
 
#define findpts_local_free   TOKEN_PASTE(PREFIXED_NAME(findpts_local_free_ ),D)
 
#define findpts_local   TOKEN_PASTE(PREFIXED_NAME(findpts_local_ ),D)
 
#define findpts_local_eval   TOKEN_PASTE(PREFIXED_NAME(findpts_local_eval_ ),D)
 
#define findpts_data   TOKEN_PASTE(findpts_data_,D)
 
#define src_pt   TOKEN_PASTE(src_pt_ ,D)
 
#define out_pt   TOKEN_PASTE(out_pt_ ,D)
 
#define eval_src_pt   TOKEN_PASTE(eval_src_pt_ ,D)
 
#define eval_out_pt   TOKEN_PASTE(eval_out_pt_ ,D)
 
#define setup_aux   TOKEN_PASTE(setup_aux_,D)
 
#define findpts_setup   TOKEN_PASTE(PREFIXED_NAME(findpts_setup_),D)
 
#define findpts_free   TOKEN_PASTE(PREFIXED_NAME(findpts_free_ ),D)
 
#define findpts   TOKEN_PASTE(PREFIXED_NAME(findpts_ ),D)
 
#define findpts_eval   TOKEN_PASTE(PREFIXED_NAME(findpts_eval_ ),D)
 
#define FOR_LOOP()
 
#define FOR_LOOP()
 
#define AT(T, var, i)   (T*)((char*)var##_base+(i)*var##_stride)
 
#define AT(T, var, i)   (T*)((char*)var##_base+(i)*var##_stride)
 

Functions

static ulong hash_index (const struct hash_data *p, const double x[D])
 
static void hash_setfac (struct hash_data *p, const ulong n)
 
static struct ulong_range hash_range (const struct hash_data *p, unsigned d, const struct dbl_range r)
 
static void hash_bb (struct hash_data *p, const struct local_hash_data *lp, const struct comm *comm, uint hash_size)
 
static void set_local_mask (unsigned char *const local_mask, const ulong local_base[D], const uint local_n[D], const struct hash_data *const p, const struct obbox *const obb, const uint nel)
 
static void fill_hash (struct array *const hash, const unsigned char *const local_mask, const ulong local_base[D], const uint local_n[D], const ulong hn, const uint np)
 
static void table_from_hash (struct hash_data *const p, struct array *const hash, const uint np, buffer *buf)
 
static void hash_build (struct hash_data *const p, const struct local_hash_data *const lp, const struct obbox *const obb, const uint nel, const uint hash_size, struct crystal *cr)
 
static void hash_free (struct hash_data *p)
 
static void setup_aux (struct findpts_data *const fd, const double *const elx[D], const unsigned n[D], const uint nel, const unsigned m[D], const double bbox_tol, const uint local_hash_size, const uint global_hash_size, const unsigned npt_max, const double newt_tol)
 
struct findpts_datafindpts_setup (const struct comm *const comm, const double *const elx[D], const unsigned n[D], const uint nel, const unsigned m[D], const double bbox_tol, const uint local_hash_size, const uint global_hash_size, const unsigned npt_max, const double newt_tol)
 
void findpts_free (struct findpts_data *fd)
 
void findpts (uint *const code_base, const unsigned code_stride, uint *const proc_base, const unsigned proc_stride, uint *const el_base, const unsigned el_stride, double *const r_base, const unsigned r_stride, double *const dist2_base, const unsigned dist2_stride, const double *const x_base[D], const unsigned x_stride[D], const uint npt, struct findpts_data *const fd)
 
void findpts_eval (double *const out_base, const unsigned out_stride, const uint *const code_base, const unsigned code_stride, const uint *const proc_base, const unsigned proc_stride, const uint *const el_base, const unsigned el_stride, const double *const r_base, const unsigned r_stride, const uint npt, const double *const in, struct findpts_data *const fd)
 

Macro Definition Documentation

#define AT (   T,
  var,
  i 
)    (T*)((char*)var##_base+(i)*var##_stride)

Referenced by findpts(), and findpts_eval().

#define AT (   T,
  var,
  i 
)    (T*)((char*)var##_base+(i)*var##_stride)
#define eval_out_pt   TOKEN_PASTE(eval_out_pt_ ,D)

Definition at line 24 of file findpts_imp.h.

#define eval_src_pt   TOKEN_PASTE(eval_src_pt_ ,D)

Definition at line 23 of file findpts_imp.h.

#define fill_hash   TOKEN_PASTE(fill_hash_ ,D)

Definition at line 10 of file findpts_imp.h.

Referenced by hash_build().

#define findpts   TOKEN_PASTE(PREFIXED_NAME(findpts_ ),D)

Definition at line 28 of file findpts_imp.h.

#define findpts_data   TOKEN_PASTE(findpts_data_,D)

Definition at line 20 of file findpts_imp.h.

#define findpts_eval   TOKEN_PASTE(PREFIXED_NAME(findpts_eval_ ),D)

Definition at line 29 of file findpts_imp.h.

#define findpts_free   TOKEN_PASTE(PREFIXED_NAME(findpts_free_ ),D)

Definition at line 27 of file findpts_imp.h.

#define findpts_local   TOKEN_PASTE(PREFIXED_NAME(findpts_local_ ),D)

Definition at line 18 of file findpts_imp.h.

Referenced by findpts().

#define findpts_local_data   TOKEN_PASTE(findpts_local_data_,D)

Definition at line 15 of file findpts_imp.h.

#define findpts_local_eval   TOKEN_PASTE(PREFIXED_NAME(findpts_local_eval_ ),D)

Definition at line 19 of file findpts_imp.h.

Referenced by findpts_eval().

#define findpts_local_free   TOKEN_PASTE(PREFIXED_NAME(findpts_local_free_ ),D)

Definition at line 17 of file findpts_imp.h.

Referenced by findpts_free().

#define findpts_local_setup   TOKEN_PASTE(PREFIXED_NAME(findpts_local_setup_),D)

Definition at line 16 of file findpts_imp.h.

Referenced by setup_aux().

#define findpts_setup   TOKEN_PASTE(PREFIXED_NAME(findpts_setup_),D)

Definition at line 26 of file findpts_imp.h.

#define FOR_LOOP ( )
Value:
do { ulong i,j; WHEN_3D(ulong k;) \
WHEN_3D(for(k=ir[2].min;k<ir[2].max;++k)) \
for(j=ir[1].min;j<ir[1].max;++j) \
for(i=ir[0].min;i<ir[0].max;++i) \
set_bit(local_mask, (WHEN_3D((k-local_base[2]) *local_n[1]) \
+(j-local_base[1]))*local_n[0] \
+(i-local_base[0]) \
); \
} while(0)
static void set_bit(unsigned char *const p, const uint i)
Definition: findpts.c:44
#define WHEN_3D(a)
Definition: findpts.c:79
#define ulong
Definition: types.h:75
for i
Definition: xxt_test.m:74

Referenced by fill_hash(), and set_local_mask().

#define FOR_LOOP ( )
Value:
do { uint bit=0,i,j; WHEN_3D(uint k;) \
WHEN_3D(for(k=0;k<local_n[2];++k)) \
for(j=0;j<local_n[1];++j) \
for(i=0;i<local_n[0];++i) { ulong hi; \
if(get_bit(local_mask,bit++)==0) continue; \
hi = (WHEN_3D( (local_base[2]+k) *hn ) \
+(local_base[1]+j))*hn \
+(local_base[0]+i); \
hp->proc = hi%np, hp->index = hi/np; \
++hp; \
} \
} while(0)
#define uint
Definition: types.h:70
#define WHEN_3D(a)
Definition: findpts.c:79
static unsigned get_bit(const unsigned char *const p, const uint i)
Definition: findpts.c:51
#define ulong
Definition: types.h:75
for i
Definition: xxt_test.m:74
static uint np
Definition: findpts_test.c:63
#define hash_bb   TOKEN_PASTE(hash_bb_ ,D)

Definition at line 8 of file findpts_imp.h.

Referenced by hash_build().

#define hash_build   TOKEN_PASTE(hash_build_ ,D)

Definition at line 12 of file findpts_imp.h.

Referenced by setup_aux().

#define hash_data   TOKEN_PASTE(findpts_hash_data_,D)

Definition at line 4 of file findpts_imp.h.

#define hash_free   TOKEN_PASTE(hash_free_ ,D)

Definition at line 13 of file findpts_imp.h.

Referenced by findpts_free().

#define hash_index   TOKEN_PASTE(hash_index_ ,D)

Definition at line 5 of file findpts_imp.h.

Referenced by findpts().

#define hash_range   TOKEN_PASTE(hash_range_ ,D)

Definition at line 7 of file findpts_imp.h.

Referenced by hash_build(), and set_local_mask().

#define hash_setfac   TOKEN_PASTE(hash_setfac_ ,D)

Definition at line 6 of file findpts_imp.h.

Referenced by hash_bb().

#define local_hash_data   TOKEN_PASTE(findpts_local_hash_data_,D)

Definition at line 3 of file findpts_imp.h.

#define obbox   TOKEN_PASTE(obbox_,D)

Definition at line 2 of file findpts_imp.h.

#define out_pt   TOKEN_PASTE(out_pt_ ,D)

Definition at line 22 of file findpts_imp.h.

#define set_local_mask   TOKEN_PASTE(set_local_mask_ ,D)

Definition at line 9 of file findpts_imp.h.

Referenced by hash_build().

#define setup_aux   TOKEN_PASTE(setup_aux_,D)

Definition at line 25 of file findpts_imp.h.

Referenced by findpts_setup().

#define src_pt   TOKEN_PASTE(src_pt_ ,D)

Definition at line 21 of file findpts_imp.h.

#define table_from_hash   TOKEN_PASTE(table_from_hash_ ,D)

Definition at line 11 of file findpts_imp.h.

Referenced by hash_build().

Function Documentation

static void fill_hash ( struct array *const  hash,
const unsigned char *const  local_mask,
const ulong  local_base[D],
const uint  local_n[D],
const ulong  hn,
const uint  np 
)
static

Definition at line 113 of file findpts_imp.h.

References FOR_LOOP, and array::ptr.

void findpts ( uint *const  code_base,
const unsigned  code_stride,
uint *const  proc_base,
const unsigned  proc_stride,
uint *const  el_base,
const unsigned  el_stride,
double *const  r_base,
const unsigned  r_stride,
double *const  dist2_base,
const unsigned  dist2_stride,
const double *const  x_base[D],
const unsigned  x_stride[D],
const uint  npt,
struct findpts_data *const  fd 
)
void findpts_eval ( double *const  out_base,
const unsigned  out_stride,
const uint *const  code_base,
const unsigned  code_stride,
const uint *const  proc_base,
const unsigned  proc_stride,
const uint *const  el_base,
const unsigned  el_stride,
const double *const  r_base,
const unsigned  r_stride,
const uint  npt,
const double *const  in,
struct findpts_data *const  fd 
)
void findpts_free ( struct findpts_data fd)
struct findpts_data* findpts_setup ( const struct comm *const  comm,
const double *const  elx[D],
const unsigned  n[D],
const uint  nel,
const unsigned  m[D],
const double  bbox_tol,
const uint  local_hash_size,
const uint  global_hash_size,
const unsigned  npt_max,
const double  newt_tol 
)

Definition at line 219 of file findpts_imp.h.

References findpts_data::cr, crystal_init, elx, n, setup_aux, and tmalloc.

static void hash_bb ( struct hash_data p,
const struct local_hash_data lp,
const struct comm comm,
uint  hash_size 
)
static

Definition at line 65 of file findpts_imp.h.

References hash_data::bnd, comm_allreduce(), D, hash_data::hash_n, hash_setfac, comm::id, lceil(), dbl_range::max, dbl_range::min, and x.

+ Here is the call graph for this function:

static void hash_build ( struct hash_data *const  p,
const struct local_hash_data *const  lp,
const struct obbox *const  obb,
const uint  nel,
const uint  hash_size,
struct crystal cr 
)
static

Definition at line 160 of file findpts_imp.h.

References array_free, array_init, hash_data::bnd, crystal::comm, count_bits(), D, crystal::data, fill_hash, hash_bb, hash_data::hash_n, hash_range, comm::id, ulong_range::max, ulong_range::min, array::n, comm::np, sarray_transfer, set_local_mask, table_from_hash, tcalloc, uint, and ulong.

+ Here is the call graph for this function:

static void hash_free ( struct hash_data p)
static

Definition at line 197 of file findpts_imp.h.

References hash_data::offset.

static ulong hash_index ( const struct hash_data p,
const double  x[D] 
)
static

Definition at line 38 of file findpts_imp.h.

References hash_data::bnd, hash_data::fac, hash_index_aux(), hash_data::hash_n, dbl_range::min, n, ulong, WHEN_3D, and x.

+ Here is the call graph for this function:

static struct ulong_range hash_range ( const struct hash_data p,
unsigned  d,
const struct dbl_range  r 
)
static

Definition at line 53 of file findpts_imp.h.

References lceil(), lfloor(), ulong_range::max, ulong_range::min, slong, and ulong.

+ Here is the call graph for this function:

static void hash_setfac ( struct hash_data p,
const ulong  n 
)
static

Definition at line 46 of file findpts_imp.h.

References hash_data::bnd, D, hash_data::fac, hash_data::hash_n, dbl_range::max, dbl_range::min, and n.

static void set_local_mask ( unsigned char *const  local_mask,
const ulong  local_base[D],
const uint  local_n[D],
const struct hash_data *const  p,
const struct obbox *const  obb,
const uint  nel 
)
static

Definition at line 89 of file findpts_imp.h.

References D, FOR_LOOP, hash_range, uint, and x.

static void setup_aux ( struct findpts_data *const  fd,
const double *const  elx[D],
const unsigned  n[D],
const uint  nel,
const unsigned  m[D],
const double  bbox_tol,
const uint  local_hash_size,
const uint  global_hash_size,
const unsigned  npt_max,
const double  newt_tol 
)
static
static void table_from_hash ( struct hash_data *const  p,
struct array *const  hash,
const uint  np,
buffer buf 
)
static