23 #if defined(CHECK_COUNT)
24 if (
ncount >= ncount_check)
31 +2*(nvar+1)*
sizeof(
double);
52 memcpy(
list,px->get_u_dot(),nvar*
sizeof(double));
53 memcpy(
list,py->get_u_dot(),nvar*
sizeof(double));
84 cerr <<
"illegal value for df1b2variable::pass = "
115 #if defined(SAFE_ARRAYS)
127 memcpy(&xu,bptr,
sizeof(
double));
128 bptr+=
sizeof(double);
129 memcpy(&yu,bptr,
sizeof(
double));
130 bptr+=
sizeof(double);
131 double * xdot=(
double*)bptr;
132 bptr+=nvar*
sizeof(double);
133 double * ydot=(
double*)bptr;
146 size_t total_bytes=2*nvar*
sizeof(double);
148 #if defined(SAFE_ALL)
150 int slen=strlen(ids);
154 void * tmpptr=list2.
bptr;
155 #if defined(SAFE_ALL)
167 #if defined(PRINT_DERS)
176 #if defined(__DERCHECK__)
178 if (derchecker->node_number)
180 if (derchecker->counter == derchecker->node_number)
182 switch (derchecker->pass_number)
185 switch(derchecker->vartype)
188 if (!derchecker->dotflag)
189 px->
u_bar[derchecker->index-1]+=derchecker->delta;
191 px->
u_dot_bar[derchecker->index-1]+=derchecker->delta;
194 if (!derchecker->dotflag)
195 py->
u_bar[derchecker->index-1]+=derchecker->delta;
197 py->
u_dot_bar[derchecker->index-1]+=derchecker->delta;
200 if (!derchecker->dotflag)
201 pz->
u_bar[derchecker->index-1]+=derchecker->delta;
203 pz->
u_dot_bar[derchecker->index-1]+=derchecker->delta;
206 cerr <<
"Invalid index value for dercheck_index was "
207 << derchecker->index <<
endl;
212 switch(derchecker->vartype)
215 if (!derchecker->dotflag)
216 px->
u_bar[derchecker->index-1]-=derchecker->delta;
218 px->
u_dot_bar[derchecker->index-1]-=derchecker->delta;
221 if (!derchecker->dotflag)
222 py->
u_bar[derchecker->index-1]-=derchecker->delta;
224 py->
u_dot_bar[derchecker->index-1]-=derchecker->delta;
227 if (!derchecker->dotflag)
228 pz->
u_bar[derchecker->index-1]-=derchecker->delta;
230 pz->
u_dot_bar[derchecker->index-1]-=derchecker->delta;
233 cerr <<
"Invalid index value for dercheck_index was "
234 << derchecker->index <<
endl;
244 for (
size_t i=0;i<nvar;i++)
249 for (
size_t i=0;i<nvar;i++)
253 for (
size_t i=0;i<nvar;i++)
257 #if defined(ADDEBUG_PRINT)
258 cout << px->
u_bar[i] <<
" " << pz->
u_dot_bar[i] <<
" " << addebug_count
262 for (
size_t i=0;i<nvar;i++)
268 #if defined(ADDEBUG_PRINT)
269 cout << py->
u_bar[i] <<
" " << pz->
u_dot_bar[i] <<
" " << addebug_count
273 for (
size_t i=0;i<nvar;i++)
277 #if defined(ADDEBUG_PRINT)
282 for (
size_t i=0;i<nvar;i++)
285 #if defined(ADDEBUG_PRINT)
292 for (
size_t i=0;i<nvar;i++)
296 for (
size_t i=0;i<nvar;i++)
301 #if defined(PRINT_DERS)
325 +2*(nvar+1)*
sizeof(
double);
327 #if defined(SAFE_ALL)
329 int slen=strlen(ids);
347 int num_bytes2=*nlist2.
bptr;
363 #if defined(SAFE_ARRAYS)
374 list.
bptr+=
sizeof(
char*);
376 list.
bptr+=
sizeof(double);
378 list.
bptr+=
sizeof(double);
379 xdot=(
double*)list.
bptr;
380 list.
bptr+=nvar*
sizeof(
double);
381 ydot=(
double*)list.
bptr;
387 zbar=(
double*)list2.
bptr;
388 zdotbar=(
double*)(list2.
bptr+nvar*
sizeof(double));
402 #if defined(PRINT_DERS)
412 for (
size_t i=0;i<nvar;i++)
415 z_dot_bar_tilde[i]=0;
419 for (
size_t i=0;i<nvar;i++)
421 *x_tilde+=(pf->
d2f11)(xu,yu)*zbar[i]*x_bar_tilde[i];
422 z_bar_tilde[i]+=(pf->
df1)(xu,yu)*x_bar_tilde[i];
423 *y_tilde+=(pf->
d2f12)(xu,yu)*zbar[i]*x_bar_tilde[i];
426 for (
size_t i=0;i<nvar;i++)
428 *x_tilde+=(pf->
d2f11)(xu,yu)*zdotbar[i]*x_dot_bar_tilde[i];
429 *y_tilde+=(pf->
d2f12)(xu,yu)*zdotbar[i]*x_dot_bar_tilde[i];
430 z_dot_bar_tilde[i]+=(pf->
df1)(xu,yu)*x_dot_bar_tilde[i];
433 for (
size_t i=0;i<nvar;i++)
435 x_dot_tilde[i]+=(pf->
d2f11)(xu,yu)*zdotbar[i]*x_bar_tilde[i];
436 z_dot_bar_tilde[i]+=(pf->
d2f11)(xu,yu)*xdot[i]*x_bar_tilde[i];
437 *x_tilde+=(pf->
d3f111)(xu,yu)*xdot[i]*zdotbar[i]*x_bar_tilde[i];
438 *y_tilde+=(pf->
d3f112)(xu,yu)*xdot[i]*zdotbar[i]*x_bar_tilde[i];
441 for (
size_t i=0;i<nvar;i++)
443 *y_tilde+=(pf->
d2f22)(xu,yu)*zbar[i]*y_bar_tilde[i];
444 *x_tilde+=(pf->
d2f12)(xu,yu)*zbar[i]*y_bar_tilde[i];
445 z_bar_tilde[i]+=(pf->
df2)(xu,yu)*y_bar_tilde[i];
448 for (
size_t i=0;i<nvar;i++)
450 *y_tilde+=(pf->
d2f22)(xu,yu)*zdotbar[i]*y_dot_bar_tilde[i];
451 *x_tilde+=(pf->
d2f12)(xu,yu)*zdotbar[i]*y_dot_bar_tilde[i];
452 z_dot_bar_tilde[i]+=(pf->
df2)(xu,yu)*y_dot_bar_tilde[i];
455 for (
size_t i=0;i<nvar;i++)
457 y_dot_tilde[i]+=(pf->
d2f22)(xu,yu)*zdotbar[i]*y_bar_tilde[i];
458 z_dot_bar_tilde[i]+=(pf->
d2f22)(xu,yu)*ydot[i]*y_bar_tilde[i];
459 *y_tilde+=(pf->
d3f222)(xu,yu)*ydot[i]*zdotbar[i]*y_bar_tilde[i];
460 *x_tilde+=(pf->
d3f122)(xu,yu)*ydot[i]*zdotbar[i]*y_bar_tilde[i];
462 for (
size_t i=0;i<nvar;i++)
464 *x_tilde+=(pf->
d3f112)(xu,yu)*ydot[i]*zdotbar[i]*x_bar_tilde[i];
465 *y_tilde+=(pf->
d3f122)(xu,yu)*ydot[i]*zdotbar[i]*x_bar_tilde[i];
466 y_dot_tilde[i]+=(pf->
d2f12)(xu,yu)*zdotbar[i]*x_bar_tilde[i];
467 z_dot_bar_tilde[i]+=(pf->
d2f12)(xu,yu)*ydot[i]*x_bar_tilde[i];
469 for (
size_t i=0;i<nvar;i++)
471 *x_tilde+=(pf->
d3f112)(xu,yu)*xdot[i]*zdotbar[i]*y_bar_tilde[i];
472 *y_tilde+=(pf->
d3f122)(xu,yu)*xdot[i]*zdotbar[i]*y_bar_tilde[i];
473 x_dot_tilde[i]+=(pf->
d2f12)(xu,yu)*zdotbar[i]*y_bar_tilde[i];
474 z_dot_bar_tilde[i]+=(pf->
d2f12)(xu,yu)*xdot[i]*y_bar_tilde[i];
476 #if defined(__DERCHECK__)
477 if (derchecker->node_number)
479 if (derchecker->counter == derchecker->node_number)
481 if (derchecker->pass_number==1)
483 switch(derchecker->vartype)
486 if (!derchecker->dotflag)
487 derchecker->der_value=
490 derchecker->der_value=
494 if (!derchecker->dotflag)
495 derchecker->der_value=
498 derchecker->der_value=
502 if (!derchecker->dotflag)
503 derchecker->der_value=
506 derchecker->der_value=
510 cerr <<
"Invalid index value for dercheck_index was "
511 << derchecker->index <<
endl;
517 #if defined(PRINT_DERS)
554 #if defined(SAFE_ARRAYS)
564 list.
bptr+=
sizeof(
char*);
566 list.
bptr+=
sizeof(double);
568 list.
bptr+=
sizeof(double);
569 xdot=(
double*)list.
bptr;
570 list.
bptr+=nvar*
sizeof(
double);
571 ydot=(
double*)list.
bptr;
573 #if defined(PRINT_DERS)
585 for (
size_t i=0;i<nvar;i++)
592 for (
size_t i=0;i<nvar;i++)
598 for (
size_t i=0;i<nvar;i++)
602 #if defined(PRINT_DERS)
void ad_read_pass2(void)
Description not yet available.
double(* d3f222)(double, double)
void check_buffer_size(const size_t)
Description not yet available.
df1b2_gradlist * f1b2gradlist
double(* d3f122)(double, double)
void memcpy(test_smartlist &dest, void *source, const size_t nsize)
memcpy for test_smartlist
void read_pass2_3(void)
Description not yet available.
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
double(* d3f111)(double, double)
double(* d3f112)(double, double)
double(* f)(double, double)
double(* d2f22)(double, double)
int adptr_diff(void *x, void *y)
void ncount_checker(int ncount, int ncount_check)
void restoreposition(void)
Description not yet available.
Description not yet available.
void read_pass2_2(void)
Description not yet available.
Description not yet available.
prnstream & endl(prnstream &)
void print_derivatives(const adstring &s, double f, double df, double d2f, double d3f, int bflag)
Description not yet available.
double(* d2f11)(double, double)
double(* df2)(double, double)
Description not yet available.
Description not yet available.
double(* d2f12)(double, double)
int write_pass1(const df1b2variable *px, const df1b2variable *py, df1b2variable *pz, df1b2function2 *pf)
Description not yet available.
Description not yet available.
void checkidentiferstring(const char *ids, test_smartlist &list)
Description not yet available.
double(* df1)(double, double)
void read_pass2_1(void)
Description not yet available.