20 #define USE_HW_COUNTER 1
34 #define TNTOT (TNR*TNS*TNT)
45 #define TOL 1024*DBL_EPSILON
61 unsigned long long tic,toc, tot=0;
79 bubble_elt(elx,ely,elz, zr,NR, zs,NS, zt,NT, n);
82 tensor_3t(telx[0], Jr,TNR,NR, Js,TNS,NS, Jt,TNT,NT, elx,
work);
83 tensor_3t(telx[1], Jr,TNR,NR, Js,TNS,NS, Jt,TNT,NT, ely,
work);
84 tensor_3t(telx[2], Jr,TNR,NR, Js,TNS,NS, Jt,TNT,NT, elz,
work);
91 ie = i+
NPT, ie = ie>TNTOT ? TNTOT : ie;
94 const double x=telx[0][
i],
y=telx[1][
i],
z=telx[2][
i];
95 p->
x[0]=
x,p->
x[1]=
y,p->
x[2]=
z;
100 for(i=i0;i!=ie;++
i) {
102 const double r=tzr[i%
TNR], s=tzs[(i/
TNR)%TNS], t=tzt[i/(TNR*TNS)];
103 if((p->
flags&(1u<<6))==0) ++unconv;
104 if(fabs(p->
r[0]-r)+fabs(p->
r[1]-s)+fabs(p->
r[2]-t)>1024*DBL_EPSILON) {
105 printf(
"found (%g,%g,%g) for (%g,%g,%g) ; error (%g,%g,%g)\n",
106 p->
r[0],p->
r[1],p->
r[2], r,s,t, p->
r[0]-r,p->
r[1]-s,p->
r[2]-t);
107 printf(
"(%g,%g,%g) for (%.15g,%.15g,%.15g) ; dist2 = %g\n",
108 p->
x[0],p->
x[1],p->
x[2],
109 telx[0][i],telx[1][i],telx[2][i],p->
dist2);
117 printf(
"element took %llu cycles\n",toc-tic);
124 #if !(USE_HW_COUNTER)
125 printf(
"%u failed points (out of %u)\n", failure, (6+REPEAT)*
TNTOT);
126 printf(
"%u unconverged points\n", unconv);
128 printf(
"average cycles = %g\n", tot/(
double)(6+REPEAT));
static double Jr[NR *TNR]
static double ely[NR *NS *NT]
void bubble_elt(double *x, double *y, double *z, const double *zr, unsigned nr, const double *zs, unsigned ns, const double *zt, unsigned nt, int type)
static struct findpts_el_pt_3 * findpts_el_points_3(struct findpts_el_data_3 *const fd)
static const double *const elxyz[3]
static const unsigned nr[3]
void rand_elt_3(double *x, double *y, double *z, const double *zr, unsigned nr, const double *zs, unsigned ns, const double *zt, unsigned nt)
#define findpts_el_free_3
#define DEFINE_HW_COUNTER()
static double work[TNR *(NS+TNS)*NT]
#define findpts_el_setup_3
static void findpts_el_start_3(struct findpts_el_data_3 *const fd, const double *const x[3])
static double Js[NS *TNS]
static double elx[NR *NS *NT]
static double elz[NR *NS *NT]
static void tensor_3t(double *out, const double *Jrt, uint nr, uint mr, const double *Jst, uint ns, uint ms, const double *Jtt, uint nt, uint mt, const double *u, double *work)
establishes some macros to establish naming conventions
static double y[NR *NS *NT *N]
static double Jt[NT *TNT]
static double telx[3][TNR *TNS *TNT]
static double z[NR *NS *NT *N]