Nek5000
SEM for Incompressible NS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Classes | Macros | Functions | Variables
findpts_test.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include "c99.h"
#include "name.h"
#include "fail.h"
#include "types.h"
#include "mem.h"
#include "poly.h"
#include "gs_defs.h"
#include "comm.h"
#include "rand_elt_test.h"
#include "findpts.h"
#include "crystal.h"
#include "sarray_transfer.h"
+ Include dependency graph for findpts_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_data   findpts_data_3
 
#define findpts_setup   findpts_setup_3
 
#define findpts_free   findpts_free_3
 
#define findpts   findpts_3
 
#define findpts_eval   findpts_eval_3
 
#define NR   5
 
#define NS   7
 
#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 LOC_HASH_SIZE   NEL*MULD(NR,NS,NT)
 
#define GBL_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 (const struct comm *const comm)
 
static void test (const struct comm *const comm)
 
int main (int narg, char *arg[])
 

Variables

static uint np
 
static uint id
 
static const unsigned nr [D] = INITD(NR,NS,NT)
 
static const unsigned mr [D] = INITD(2*NR,2*NS,2*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 struct array testp
 
static struct crystal cr
 

Macro Definition Documentation

#define BBOX_TOL   0.01

Definition at line 50 of file findpts_test.c.

Referenced by test().

#define D   3

Definition at line 20 of file findpts_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   findpts_3

Definition at line 29 of file findpts_test.c.

Referenced by test().

#define findpts_data   findpts_data_3

Definition at line 26 of file findpts_test.c.

#define findpts_eval   findpts_eval_3

Definition at line 30 of file findpts_test.c.

Referenced by test().

#define findpts_free   findpts_free_3

Definition at line 28 of file findpts_test.c.

Referenced by test().

#define findpts_setup   findpts_setup_3

Definition at line 27 of file findpts_test.c.

Referenced by test().

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

Definition at line 53 of file findpts_test.c.

Referenced by test().

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

Definition at line 25 of file findpts_test.c.

Referenced by rand_mesh().

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

Definition at line 23 of file findpts_test.c.

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

#define K   4

Definition at line 45 of file findpts_test.c.

Referenced by rand_mesh(), and test_mesh().

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

Definition at line 52 of file findpts_test.c.

Referenced by test().

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

Definition at line 24 of file findpts_test.c.

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

#define NEL   MULD(K,K,K)

Definition at line 46 of file findpts_test.c.

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

#define NEWT_TOL   1024*DBL_EPSILON

Definition at line 51 of file findpts_test.c.

Referenced by test().

#define NPT_MAX   256

Definition at line 49 of file findpts_test.c.

Referenced by test().

#define NR   5

Definition at line 42 of file findpts_test.c.

Referenced by main(), and rand_mesh().

#define NS   7

Definition at line 43 of file findpts_test.c.

Referenced by main(), and rand_mesh().

#define NT   6

Definition at line 44 of file findpts_test.c.

Referenced by main(), and rand_mesh().

#define TN   4

Definition at line 47 of file findpts_test.c.

Referenced by main(), and test_mesh().

Function Documentation

int main ( int  narg,
char *  arg[] 
)

Definition at line 299 of file findpts_test.c.

References array_free, array_init, comm_free(), comm_init(), cr, crystal_free, crystal_init, comm::id, lobatto_nodes, MULD, NEL, np, comm::np, NR, NS, NT, test(), testp, TN, zr, zs, and zt.

+ Here is the call graph for this function:

static void print_ptdata ( const struct comm *const  comm)
static

Definition at line 195 of file findpts_test.c.

References pt_data::code, D, pt_data::dist2, pt_data::el, pt_data::ex, array::n, pt_data::proc, array::ptr, pt_data::r, sint, slong, testp, uint, and pt_data::x.

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 77 of file findpts_test.c.

References D, and EVAL.

Referenced by rand_mesh(), and test_mesh().

+ Here is the caller graph for this function:

static void rand_mesh ( void  )
static

Definition at line 107 of file findpts_test.c.

References D, i, INDEXD, INITD, K, MULD, np, NR, NS, NT, quad_eval(), rand_elt_2(), rand_elt_3(), uint, 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 ( const struct comm *const  comm)
static

Definition at line 258 of file findpts_test.c.

References BBOX_TOL, pt_data::code, D, pt_data::dist2, pt_data::el, elx, pt_data::ex, findpts, findpts_eval, findpts_free, findpts_setup, GBL_HASH_SIZE, INITD, LOC_HASH_SIZE, mr, array::n, NEL, NEWT_TOL, NPT_MAX, nr, print_ptdata(), pt_data::proc, array::ptr, pt_data::r, rand_mesh(), test_mesh(), testp, and pt_data::x.

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 149 of file findpts_test.c.

References cr, D, i, INITD, K, MULD, array::n, NEL, np, out, pt_data::proc, array::ptr, quad_eval(), pt_data::r, sarray_transfer, testp, TN, uint, pt_data::x, and x3.

Referenced by test().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct crystal cr
static

Definition at line 75 of file findpts_test.c.

Referenced by lob_bnd_setup(), main(), and test_mesh().

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

Definition at line 70 of file findpts_test.c.

Referenced by test().

uint id
static

Definition at line 63 of file findpts_test.c.

Referenced by findpts(), main(), outfld(), and shared_ids().

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

Definition at line 69 of file findpts_test.c.

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

Definition at line 66 of file findpts_test.c.

Referenced by test().

uint np
static
const unsigned nr[D] = INITD(NR,NS,NT)
static

Definition at line 65 of file findpts_test.c.

Referenced by test().

struct array testp
static

Definition at line 73 of file findpts_test.c.

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

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

Definition at line 68 of file findpts_test.c.

Referenced by rand_mesh(), and test_mesh().

double zr[NR]
static

Definition at line 67 of file findpts_test.c.

Referenced by main(), and rand_mesh().

double zs[NS]
static

Definition at line 67 of file findpts_test.c.

Referenced by main(), and rand_mesh().

double zt[NT]
static

Definition at line 67 of file findpts_test.c.

Referenced by main(), and rand_mesh().