Nek5000
SEM for Incompressible NS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Classes | Macros | Functions
obbox.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "c99.h"
#include "name.h"
#include "fail.h"
#include "types.h"
#include "mem.h"
#include "tensor.h"
#include "poly.h"
#include "lob_bnd.h"
+ Include dependency graph for obbox.c:

Go to the source code of this file.

Classes

struct  obbox_2
 
struct  obbox_3
 

Macros

#define obbox_calc_2   PREFIXED_NAME(obbox_calc_2)
 
#define obbox_calc_3   PREFIXED_NAME(obbox_calc_3)
 
#define DO_MAX(a, b)   do { unsigned temp = b; if(temp>a) a=temp; } while(0)
 
#define SETUP_DIR(r)
 
#define DO_BOUND(bnd, merge, r, x, work)
 
#define DO_EDGE(merge, r, x, y, work)
 
#define GET_EDGE(off)
 
#define SETUP_DIR(r)
 
#define EVAL_AT_0(d, x)   x0[d] = tensor_ig3(J+3*d, I0r,nr, I0s,ns, I0t,nt, x, work)
 
#define DO_BOUND(bnd, merge, r, s, x, work)
 
#define DO_FACE(merge, r, s, x, y, z, work)
 
#define GET_FACE(r, s, off, n1, n2, n3)
 

Functions

static void copy_strided (double *out, const double *in, unsigned g, unsigned s, unsigned n)
 
static void mat_inv_2 (double inv[4], const double A[4])
 
static void mat_inv_3 (double inv[9], const double A[9])
 
static struct dbl_range dbl_range_merge (struct dbl_range a, struct dbl_range b)
 
static struct dbl_range dbl_range_expand (struct dbl_range b, double tol)
 
static void bbox_2_tfm (double *out, const double x0[2], const double Ji[4], const double *x, const double *y, unsigned n)
 
static void bbox_3_tfm (double *out, const double x0[3], const double Ji[9], const double *x, const double *y, const double *z, unsigned n)
 
void obbox_calc_2 (struct obbox_2 *out, const double *const elx[2], const unsigned n[2], uint nel, const unsigned m[2], const double tol)
 
void obbox_calc_3 (struct obbox_3 *out, const double *const elx[3], const unsigned n[3], uint nel, const unsigned m[3], const double tol)
 

Macro Definition Documentation

#define DO_BOUND (   bnd,
  merge,
  r,
  x,
  work 
)
Value:
do { \
struct dbl_range b = \
lob_bnd_1(lob_bnd_data_##r,n##r,m##r, x, work); \
if(merge) bnd=dbl_range_merge(bnd,b); else bnd=b; \
} while(0)
n
Definition: xxt_test.m:73
#define lob_bnd_1
Definition: lob_bnd.c:17
static struct dbl_range dbl_range_merge(struct dbl_range a, struct dbl_range b)
Definition: obbox.c:59
#define x
static double work[TNR *NS]
#define DO_BOUND (   bnd,
  merge,
  r,
  s,
  x,
  work 
)
Value:
do { \
struct dbl_range b = \
lob_bnd_2(lob_bnd_data_##r,n##r,m##r, \
lob_bnd_data_##s,n##s,m##s, x, work); \
if(merge) bnd=dbl_range_merge(bnd,b); else bnd=b; \
} while(0)
n
Definition: xxt_test.m:73
static struct dbl_range dbl_range_merge(struct dbl_range a, struct dbl_range b)
Definition: obbox.c:59
#define x
#define lob_bnd_2
Definition: lob_bnd.c:18
static double work[TNR *NS]
#define DO_EDGE (   merge,
  r,
  x,
  y,
  work 
)
Value:
do { \
DO_BOUND(ab[0],merge,r,x,work); \
DO_BOUND(ab[1],merge,r,y,work); \
bbox_2_tfm(work, x0,Ji, x,y,n##r); \
DO_BOUND(tb[0],merge,r,(work) ,(work)+2*n##r); \
DO_BOUND(tb[1],merge,r,(work)+n##r,(work)+2*n##r); \
} while(0)
n
Definition: xxt_test.m:73
#define x
#define DO_BOUND(bnd, merge, r, x, work)
static void bbox_2_tfm(double *out, const double x0[2], const double Ji[4], const double *x, const double *y, unsigned n)
Definition: obbox.c:75
static double work[TNR *NS]
static double y[NR *NS *NT *N]
Definition: obbox_test.c:31

Referenced by obbox_calc_2().

#define DO_FACE (   merge,
  r,
  s,
  x,
  y,
  z,
  work 
)
Value:
do { \
DO_BOUND(ab[0],merge,r,s,x,work); \
DO_BOUND(ab[1],merge,r,s,y,work); \
DO_BOUND(ab[2],merge,r,s,z,work); \
bbox_3_tfm(work, x0,Ji, x,y,z,n##r*n##s); \
DO_BOUND(tb[0],merge,r,s,(work) ,(work)+3*n##r*n##s); \
DO_BOUND(tb[1],merge,r,s,(work)+ n##r*n##s,(work)+3*n##r*n##s); \
DO_BOUND(tb[2],merge,r,s,(work)+2*n##r*n##s,(work)+3*n##r*n##s); \
} while(0)
n
Definition: xxt_test.m:73
#define x
#define DO_BOUND(bnd, merge, r, x, work)
static void bbox_3_tfm(double *out, const double x0[3], const double Ji[9], const double *x, const double *y, const double *z, unsigned n)
Definition: obbox.c:86
static double work[TNR *NS]
static double y[NR *NS *NT *N]
Definition: obbox_test.c:31
static double z[NR *NS *NT *N]
Definition: obbox_test.c:31

Referenced by obbox_calc_3().

#define DO_MAX (   a,
 
)    do { unsigned temp = b; if(temp>a) a=temp; } while(0)

Definition at line 125 of file obbox.c.

Referenced by obbox_calc_2(), and obbox_calc_3().

#define EVAL_AT_0 (   d,
  x 
)    x0[d] = tensor_ig3(J+3*d, I0r,nr, I0s,ns, I0t,nt, x, work)

Referenced by obbox_calc_3().

#define GET_EDGE (   off)
Value:
do { \
} while(0)
#define DO_EDGE(merge, r, x, y, work)
#define x
ns
Definition: xxt_test.m:43
static void copy_strided(double *out, const double *in, unsigned g, unsigned s, unsigned n)
Definition: obbox.c:23
static const unsigned nr[3]
static double work[TNR *NS]
static double y[NR *NS *NT *N]
Definition: obbox_test.c:31

Referenced by obbox_calc_2().

#define GET_FACE (   r,
  s,
  off,
  n1,
  n2,
  n3 
)
Value:
do { \
copy_strided(work , x+off,n1,n2,n3); \
copy_strided(work+ n##r*n##s, y+off,n1,n2,n3); \
copy_strided(work+2*n##r*n##s, z+off,n1,n2,n3); \
DO_FACE(1,r,s,work,work+n##r*n##s,work+2*n##r*n##s,work+3*n##r*n##s); \
} while(0)
n
Definition: xxt_test.m:73
#define x
#define DO_FACE(merge, r, s, x, y, z, work)
static void copy_strided(double *out, const double *in, unsigned g, unsigned s, unsigned n)
Definition: obbox.c:23
static double work[TNR *NS]
static double y[NR *NS *NT *N]
Definition: obbox_test.c:31
static double z[NR *NS *NT *N]
Definition: obbox_test.c:31

Referenced by obbox_calc_3().

#define obbox_calc_2   PREFIXED_NAME(obbox_calc_2)

Definition at line 13 of file obbox.c.

Referenced by main().

#define obbox_calc_3   PREFIXED_NAME(obbox_calc_3)

Definition at line 14 of file obbox.c.

Referenced by main().

#define SETUP_DIR (   r)
Value:
do { \
lagrange_fun *const lag = gll_lag_setup(work, n##r); \
lag(I0##r, work,n##r,1, 0); \
lob_bnd_setup(lob_bnd_data_##r, n##r,m##r); \
} while(0)
void lagrange_fun(double *restrict p, double *restrict data, unsigned n, int d, double x)
Definition: poly.c:20
n
Definition: xxt_test.m:73
#define gll_lag_setup
Definition: poly.c:18
#define lob_bnd_setup
Definition: lob_bnd.c:13
static double work[TNR *NS]

Referenced by obbox_calc_2(), and obbox_calc_3().

#define SETUP_DIR (   r)
Value:
do { \
lagrange_fun *const lag = gll_lag_setup(work, n##r); \
lag(I0##r, work,n##r,1, 0); \
lob_bnd_setup(lob_bnd_data_##r, n##r,m##r); \
} while(0)
void lagrange_fun(double *restrict p, double *restrict data, unsigned n, int d, double x)
Definition: poly.c:20
n
Definition: xxt_test.m:73
#define gll_lag_setup
Definition: poly.c:18
#define lob_bnd_setup
Definition: lob_bnd.c:13
static double work[TNR *NS]

Function Documentation

static void bbox_2_tfm ( double *  out,
const double  x0[2],
const double  Ji[4],
const double *  x,
const double *  y,
unsigned  n 
)
static

Definition at line 75 of file obbox.c.

References i, and n.

static void bbox_3_tfm ( double *  out,
const double  x0[3],
const double  Ji[9],
const double *  x,
const double *  y,
const double *  z,
unsigned  n 
)
static

Definition at line 86 of file obbox.c.

References i, and n.

static void copy_strided ( double *  out,
const double *  in,
unsigned  g,
unsigned  s,
unsigned  n 
)
static

Definition at line 23 of file obbox.c.

References n.

static struct dbl_range dbl_range_expand ( struct dbl_range  b,
double  tol 
)
static

Definition at line 67 of file obbox.c.

References dbl_range::max, and dbl_range::min.

Referenced by obbox_calc_2(), and obbox_calc_3().

+ Here is the caller graph for this function:

static struct dbl_range dbl_range_merge ( struct dbl_range  a,
struct dbl_range  b 
)
static

Definition at line 59 of file obbox.c.

References dbl_range::max, and dbl_range::min.

static void mat_inv_2 ( double  inv[4],
const double  A[4] 
)
static

Definition at line 33 of file obbox.c.

Referenced by obbox_calc_2().

+ Here is the caller graph for this function:

static void mat_inv_3 ( double  inv[9],
const double  A[9] 
)
static

Definition at line 42 of file obbox.c.

Referenced by obbox_calc_3().

+ Here is the caller graph for this function:

void obbox_calc_2 ( struct obbox_2 out,
const double *const  elx[2],
const unsigned  n[2],
uint  nel,
const unsigned  m[2],
const double  tol 
)

Definition at line 127 of file obbox.c.

References obbox_2::A, obbox_2::c0, dbl_range_expand(), DO_EDGE, DO_MAX, GET_EDGE, gll_lag_size, lob_bnd_size(), mat_inv_2(), dbl_range::max, dbl_range::min, mr, nr, ns, out, SETUP_DIR, tensor_ig2(), tmalloc, work, and obbox_2::x.

+ Here is the call graph for this function:

void obbox_calc_3 ( struct obbox_3 out,
const double *const  elx[3],
const unsigned  n[3],
uint  nel,
const unsigned  m[3],
const double  tol 
)

Definition at line 225 of file obbox.c.

References obbox_3::A, obbox_3::c0, dbl_range_expand(), DO_FACE, DO_MAX, EVAL_AT_0, GET_FACE, gll_lag_size, lob_bnd_size(), mat_inv_3(), dbl_range::max, dbl_range::min, mr, nr, ns, out, SETUP_DIR, tmalloc, work, obbox_3::x, and z.

+ Here is the call graph for this function: