Definition at line 72 of file c81test.cc.
References a, c81_data::ad, c81_data::al, c81_data::am, c81_data_destroy(), c81_data_fc511_read(), c81_data_flip(), c81_data_get_coef(), c81_data_nrel_read(), c81_data_read(), c81_data_read_free_format(), c81_data_write_free_format(), getopt(), c81_data::md, c81_data::ml, c81_data::mm, c81_data::NAD, c81_data::NAL, c81_data::NAM, c81_data::NMD, c81_data::NML, c81_data::NMM, optarg, optind, and usage().
75 char *dump_fname = NULL;
84 GOT_ALPHAMACH = (GOT_ALPHA|GOT_MACH)
86 unsigned got = GOT_NONE;
91 int opt =
getopt(argc, argv,
"a:cC:d:fFm:not:");
108 if (strcasecmp(
optarg,
"cl") == 0) {
111 }
else if (strcasecmp(
optarg,
"cd") == 0) {
114 }
else if (strcasecmp(
optarg,
"cm") == 0) {
118 std::cerr <<
"unknown coefficient "
119 "\"" <<
optarg <<
"\"" << std::endl;
167 if (dump_fname || dump) {
169 std::cerr <<
"\"dump\" incompatible "
170 "with alpha/mach selection"
182 std::cerr <<
"need to select a coefficient "
183 "when alpha and mach "
184 "are not selected altogether"
196 std::ifstream in(argv[0]);
198 std::cerr <<
"unable to open file '" << argv[0] <<
"'"
237 std::cerr <<
"unable to read c81 data from file "
238 "\"" << argv[0] <<
"\"" << std::endl;
247 std::ofstream out(dump_fname);
259 if ((got & GOT_ALPHAMACH) == GOT_ALPHAMACH) {
263 data->
NAL, data->
al, alpha, mach)
269 data->
NAD, data->
ad, alpha, mach)
275 data->
NAM, data->
am, alpha, mach)
281 <<
"alpha: " << alpha << std::endl
282 <<
"mach: " << mach << std::endl
284 data->
NAL, data->
al, alpha, mach)
287 data->
NAD, data->
ad, alpha, mach)
290 data->
NAM, data->
am, alpha, mach)
295 }
else if (got & GOT_ALPHAMACH) {
297 double *m = 0, *
a = 0;
327 switch (got & GOT_ALPHAMACH) {
329 for (
int i = 0; i < NM; i++) {
339 for (
int i = 0; i < NA; i++) {
351 std::cerr <<
"don't know what to do..." << std::endl;
void c81_data_destroy(c81_data *data)
int c81_data_write_free_format(std::ostream &out, c81_data *data)
int c81_data_flip(c81_data *data)
int c81_data_read_free_format(std::istream &in, c81_data *data, const doublereal dcltol)
int c81_data_read(std::istream &in, c81_data *data, const doublereal dcltol, int *ff)
static void usage(int rc)
doublereal c81_data_get_coef(int nm, doublereal *m, int na, doublereal *a, doublereal alpha, doublereal mach)
int c81_data_fc511_read(std::istream &in, c81_data *data, const doublereal dcltol)
int getopt(int argc, char *const argv[], const char *opts)
int c81_data_nrel_read(std::istream &in, c81_data *data, const doublereal dcltol)
static const doublereal a