406 ASSERT(upper_bounds != 0);
412 if (dCsi < upper_bounds[0]) {
413 silent_cerr(
"cannot find C81 data lower bound for point xi=" << dCsi << std::endl);
418 for (
unsigned i = 1; i < ndata; i++) {
419 if (upper_bounds[i] > dCsi) {
425 silent_cerr(
"cannot find C81 data upper bound for point xi=" << dCsi << std::endl);
430 if (
unsigned(from) == ndata) {
431 silent_cerr(
"cannot find C81 data upper bound for point xi=" << dCsi << std::endl);
440 if (data[from]->NML != data[to]->NML) {
441 silent_cerr(
"number of Mach points for Cl between airfoils "
442 << from <<
" (" << data[from]->NML <<
") and "
443 << to <<
" (" << data[to]->NML <<
") do not match"
448 if (data[from]->NAL != data[to]->NAL) {
449 silent_cerr(
"number of AoA points for Cl between airfoils "
450 << from <<
" (" << data[from]->NAL <<
") and "
451 << to <<
" (" << data[to]->NAL <<
") do not match"
456 if (data[from]->NMD != data[to]->NMD) {
457 silent_cerr(
"number of Mach points for Cd between airfoils "
458 << from <<
" (" << data[from]->NMD <<
") and "
459 << to <<
" (" << data[to]->NMD <<
") do not match"
464 if (data[from]->NAD != data[to]->NAD) {
465 silent_cerr(
"number of AoA points for Cd between airfoils "
466 << from <<
" (" << data[from]->NAD <<
") and "
467 << to <<
" (" << data[to]->NAD <<
") do not match"
472 if (data[from]->NMM != data[to]->NMM) {
473 silent_cerr(
"number of Mach points for Cm between airfoils "
474 << from <<
" (" << data[from]->NMM <<
") and "
475 << to <<
" (" << data[to]->NMM <<
") do not match"
480 if (data[from]->NAM != data[to]->NAM) {
481 silent_cerr(
"number of AoA points for Cm between airfoils "
482 << from <<
" (" << data[from]->NAM <<
") and "
483 << to <<
" (" << data[to]->NAM <<
") do not match"
488 for (
int i = 0; i < data[from]->
NML; i++) {
489 if (data[from]->ml[i] != data[to]->ml[i]) {
490 silent_cerr(
"Mach point " << i <<
"for Cl of airfoils "
491 << from <<
" (" << data[from]->ml[i] <<
") and "
492 << to <<
" (" << data[to]->ml[i] <<
") differs"
498 for (
int i = 0; i < data[from]->
NAL; i++) {
499 if (data[from]->al[i] != data[to]->al[i]) {
500 silent_cerr(
"AoA point " << i <<
"for Cl of airfoils "
501 << from <<
" (" << data[from]->al[i] <<
") and "
502 << to <<
" (" << data[to]->al[i] <<
") differs"
508 for (
int i = 0; i < data[from]->
NMD; i++) {
509 if (data[from]->md[i] != data[to]->md[i]) {
510 silent_cerr(
"Mach point " << i <<
"for Cd of airfoils "
511 << from <<
" (" << data[from]->md[i] <<
") and "
512 << to <<
" (" << data[to]->md[i] <<
") differs"
518 for (
int i = 0; i < data[from]->
NAD; i++) {
519 if (data[from]->ad[i] != data[to]->ad[i]) {
520 silent_cerr(
"AoA point " << i <<
"for Cd of airfoils "
521 << from <<
" (" << data[from]->ad[i] <<
") and "
522 << to <<
" (" << data[to]->ad[i] <<
") differs"
528 for (
int i = 0; i < data[from]->
NMM; i++) {
529 if (data[from]->mm[i] != data[to]->mm[i]) {
530 silent_cerr(
"Mach point " << i <<
"for Cm of airfoils "
531 << from <<
" (" << data[from]->mm[i] <<
") and "
532 << to <<
" (" << data[to]->mm[i] <<
") differs"
538 for (
int i = 0; i < data[from]->
NAM; i++) {
539 if (data[from]->am[i] != data[to]->am[i]) {
540 silent_cerr(
"AoA point " << i <<
"for Cm of airfoils "
541 << from <<
" (" << data[from]->am[i] <<
") and "
542 << to <<
" (" << data[to]->am[i] <<
") differs"
549 "interpolated (\"%s\"[%e]->\"%s\"[%e]: [%e])",
550 data[from]->
header, upper_bounds[from],
551 data[to]->
header, upper_bounds[to], dCsi);
553 i_data->
NML = data[from]->
NML;
554 i_data->
NAL = data[from]->
NAL;
555 i_data->
NMD = data[from]->
NMD;
556 i_data->
NAD = data[from]->
NAD;
557 i_data->
NMM = data[from]->
NMM;
558 i_data->
NAM = data[from]->
NAM;
560 doublereal dw = upper_bounds[to] - upper_bounds[from];
561 doublereal dw_from = (upper_bounds[to] - dCsi)/dw;
562 doublereal dw_to = (dCsi - upper_bounds[from])/dw;
566 for (
int i = 0; i < i_data->
NML; i++) {
567 i_data->
ml[i] = data[from]->
ml[i];
570 for (
int i = 0; i < i_data->
NAL; i++) {
571 i_data->
al[i] = data[from]->
al[i];
573 for (
int i = i_data->
NAL; i < (i_data->
NML + 1)*i_data->
NAL; i++) {
574 i_data->
al[i] = dw_from*data[from]->
al[i] + dw_to*data[to]->
al[i];
579 for (
int i = 0; i < i_data->
NMD; i++) {
580 i_data->
md[i] = data[from]->
md[i];
583 for (
int i = 0; i < i_data->
NAD; i++) {
584 i_data->
ad[i] = data[from]->
ad[i];
586 for (
int i = i_data->
NAD; i < (i_data->
NMD + 1)*i_data->
NAD; i++) {
587 i_data->
ad[i] = dw_from*data[from]->
ad[i] + dw_to*data[to]->
ad[i];
592 for (
int i = 0; i < i_data->
NMM; i++) {
593 i_data->
mm[i] = data[from]->
mm[i];
596 for (
int i = 0; i < i_data->
NAM; i++) {
597 i_data->
am[i] = data[from]->
am[i];
599 for (
int i = i_data->
NAM; i < (i_data->
NMM + 1)*i_data->
NAM; i++) {
600 i_data->
am[i] = dw_from*data[from]->
am[i] + dw_to*data[to]->
am[i];
int c81_data_do_stall(c81_data *data, const doublereal dcltol)
#define ASSERT(expression)
for(int i=0;i< 3;++i) for(int j=0