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

Go to the source code of this file.

Classes

struct  pt_data
 

Macros

#define D   3
 
#define INITD(a, b, c)   {a,b,c}
 
#define MULD(a, b, c)   ((a)*(b)*(c))
 
#define INDEXD(a, na, b, nb, c)   (((c)*(nb)+(b))*(na)+(a))
 
#define findpts_local_data   findpts_local_data_3
 
#define findpts_local_setup   findpts_local_setup_3
 
#define findpts_local_free   findpts_local_free_3
 
#define findpts_local   findpts_local_3
 
#define NR   5
 
#define NS   8
 
#define NT   6
 
#define K   4
 
#define NEL   MULD(K,K,K)
 
#define TN   4
 
#define NPT_MAX   256
 
#define BBOX_TOL   0.01
 
#define NEWT_TOL   1024*DBL_EPSILON
 
#define MAX_HASH_SIZE   NEL*MULD(NR,NS,NT)
 
#define EVALR(base)
 
#define EVALS(base)
 
#define EVALT(base)
 
#define EVAL()   EVALT(0)
 

Functions

static double quad_eval (const double coef[MULD(3, 3, 3)], const double r[D])
 
static void rand_mesh (void)
 
static void test_mesh (void)
 
static void print_ptdata (void)
 
static void test (buffer *buf)
 
int main ()
 

Variables

static const unsigned nr [D] = INITD(NR,NS,NT)
 
static const unsigned mr [D] = INITD(4*NR,4*NS,4*NT)
 
static double zr [NR]
 
static double zs [NS]
 
static double zt [NT]
 
static double x3 [D][MULD(3, 3, 3)]
 
static double mesh [D][NEL *MULD(NR, NS, NT)]
 
static const double *const elx [D] = INITD(mesh[0],mesh[1],mesh[2])
 
static double testx [NEL *MULD(TN, TN, TN)*D]
 
static struct pt_data testp [NEL *MULD(TN, TN, TN)]
 

Macro Definition Documentation

#define BBOX_TOL   0.01

Definition at line 46 of file findpts_local_test.c.

Referenced by test().

#define D   3

Definition at line 18 of file findpts_local_test.c.

Referenced by print_ptdata(), quad_eval(), rand_mesh(), test(), and test_mesh().

#define EVAL ( )    EVALT(0)

Referenced by quad_eval().

#define EVALR (   base)
Value:
( coef [base ]*lr0[0] \
+coef [base+ 1]*lr1[0] \
+coef [base+ 2]*lr2[0] )
#define EVALS (   base)
Value:
( EVALR(base )*lr0[1] \
+EVALR(base+ 3)*lr1[1] \
+EVALR(base+ 6)*lr2[1] )
#define EVALR(base)
#define EVALT (   base)
Value:
( EVALS(base )*lr0[2] \
+EVALS(base+ 9)*lr1[2] \
+EVALS(base+18)*lr2[2] )
#define EVALS(base)
#define findpts_local   findpts_local_3

Definition at line 27 of file findpts_local_test.c.

Referenced by test().

Definition at line 24 of file findpts_local_test.c.

#define findpts_local_free   findpts_local_free_3

Definition at line 26 of file findpts_local_test.c.

Referenced by test().

#define findpts_local_setup   findpts_local_setup_3

Definition at line 25 of file findpts_local_test.c.

Referenced by test().

#define INDEXD (   a,
  na,
  b,
  nb,
 
)    (((c)*(nb)+(b))*(na)+(a))

Definition at line 23 of file findpts_local_test.c.

Referenced by rand_mesh(), and test_mesh().

#define INITD (   a,
  b,
 
)    {a,b,c}

Definition at line 21 of file findpts_local_test.c.

Referenced by rand_mesh(), test(), and test_mesh().

#define K   4

Definition at line 41 of file findpts_local_test.c.

Referenced by rand_mesh(), and test_mesh().

#define MAX_HASH_SIZE   NEL*MULD(NR,NS,NT)

Definition at line 48 of file findpts_local_test.c.

Referenced by test().

#define MULD (   a,
  b,
 
)    ((a)*(b)*(c))

Definition at line 22 of file findpts_local_test.c.

Referenced by print_ptdata(), rand_mesh(), test(), and test_mesh().

#define NEL   MULD(K,K,K)

Definition at line 42 of file findpts_local_test.c.

Referenced by print_ptdata(), and test().

#define NEWT_TOL   1024*DBL_EPSILON

Definition at line 47 of file findpts_local_test.c.

Referenced by test().

#define NPT_MAX   256

Definition at line 45 of file findpts_local_test.c.

Referenced by test().

#define NR   5

Definition at line 38 of file findpts_local_test.c.

Referenced by main(), and rand_mesh().

#define NS   8

Definition at line 39 of file findpts_local_test.c.

Referenced by main(), and rand_mesh().

#define NT   6

Definition at line 40 of file findpts_local_test.c.

Referenced by main(), and rand_mesh().

#define TN   4

Definition at line 43 of file findpts_local_test.c.

Referenced by print_ptdata(), test(), and test_mesh().

Function Documentation

int main ( )

Definition at line 203 of file findpts_local_test.c.

References findpts_local_data::buf, buffer_free, lobatto_nodes, NR, NS, NT, null_buffer, test(), zr, zs, and zt.

+ Here is the call graph for this function:

static void print_ptdata ( void  )
static

Definition at line 160 of file findpts_local_test.c.

References pt_data::code, D, pt_data::dist2, pt_data::el, i, MULD, NEL, pt_data::r, testp, TN, and uint.

Referenced by test().

+ Here is the caller graph for this function:

static double quad_eval ( const double  coef[MULD(3, 3, 3)],
const double  r[D] 
)
static

Definition at line 68 of file findpts_local_test.c.

References D, EVAL, and pt_data::r.

Referenced by rand_mesh(), and test_mesh().

+ Here is the caller graph for this function:

static void rand_mesh ( void  )
static

Definition at line 98 of file findpts_local_test.c.

References D, i, INDEXD, INITD, K, MULD, NR, NS, NT, quad_eval(), pt_data::r, rand_elt_2(), rand_elt_3(), x3, zr, zs, and zt.

Referenced by test().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void test ( buffer buf)
static

Definition at line 183 of file findpts_local_test.c.

References BBOX_TOL, D, elx, findpts_local, findpts_local_free, findpts_local_setup, INITD, MAX_HASH_SIZE, mr, MULD, NEL, NEWT_TOL, NPT_MAX, nr, print_ptdata(), rand_mesh(), test_mesh(), testp, testx, and TN.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void test_mesh ( void  )
static

Definition at line 132 of file findpts_local_test.c.

References D, i, INDEXD, INITD, K, MULD, quad_eval(), pt_data::r, testx, TN, and x3.

Referenced by test().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const double* const elx[D] = INITD(mesh[0],mesh[1],mesh[2])
static

Definition at line 62 of file findpts_local_test.c.

Referenced by test().

double mesh[D][NEL *MULD(NR, NS, NT)]
static

Definition at line 61 of file findpts_local_test.c.

const unsigned mr[D] = INITD(4*NR,4*NS,4*NT)
static
const unsigned nr[D] = INITD(NR,NS,NT)
static

Definition at line 57 of file findpts_local_test.c.

Referenced by test().

struct pt_data testp[NEL *MULD(TN, TN, TN)]
static

Definition at line 66 of file findpts_local_test.c.

Referenced by print_ptdata(), and test().

double testx[NEL *MULD(TN, TN, TN)*D]
static

Definition at line 64 of file findpts_local_test.c.

Referenced by test(), and test_mesh().

double x3[D][MULD(3, 3, 3)]
static

Definition at line 60 of file findpts_local_test.c.

Referenced by rand_mesh(), and test_mesh().

double zr[NR]
static

Definition at line 59 of file findpts_local_test.c.

Referenced by main(), and rand_mesh().

double zs[NS]
static

Definition at line 59 of file findpts_local_test.c.

Referenced by main(), and rand_mesh().

double zt[NT]
static

Definition at line 59 of file findpts_local_test.c.

Referenced by main(), and rand_mesh().