| 2474 | int printIntegrator(OPS_Stream& output); |
| 2475 | |
| 2476 | int OPS_printModel() |
| 2477 | { |
| 2478 | int res = 0; |
| 2479 | |
| 2480 | int flag = OPS_PRINT_CURRENTSTATE; |
| 2481 | |
| 2482 | FileStream outputFile; |
| 2483 | OPS_Stream *output = &opserr; |
| 2484 | bool done = false; |
| 2485 | |
| 2486 | Domain* theDomain = OPS_GetDomain(); |
| 2487 | if (theDomain == 0) return -1; |
| 2488 | |
| 2489 | // if just 'print' then print out the entire domain |
| 2490 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 2491 | opserr << *theDomain; |
| 2492 | return 0; |
| 2493 | } |
| 2494 | |
| 2495 | while (done == false && OPS_GetNumRemainingInputArgs() > 0) { |
| 2496 | |
| 2497 | const char* arg = OPS_GetString(); |
| 2498 | |
| 2499 | // if 'print ele i j k..' print out some elements |
| 2500 | if ((strcmp(arg, "-ele") == 0) || (strcmp(arg, "ele") == 0)) { |
| 2501 | res = printElement(*output); |
| 2502 | done = true; |
| 2503 | } |
| 2504 | // if 'print node i j k ..' print out some nodes |
| 2505 | else if ((strcmp(arg, "-node") == 0) || (strcmp(arg, "node") == 0)) { |
| 2506 | res = printNode(*output); |
| 2507 | done = true; |
| 2508 | } |
| 2509 | |
| 2510 | // if 'print integrator flag' print out the integrator |
| 2511 | else if ((strcmp(arg, "integrator") == 0) || (strcmp(arg, "-integrator") == 0)) { |
| 2512 | res = printIntegrator(*output); |
| 2513 | done = true; |
| 2514 | } |
| 2515 | |
| 2516 | // if 'print algorithm flag' print out the algorithm |
| 2517 | else if ((strcmp(arg, "algorithm") == 0) || (strcmp(arg, "-algorithm") == 0)) { |
| 2518 | res = printAlgorithm(*output); |
| 2519 | done = true; |
| 2520 | } |
| 2521 | |
| 2522 | // if 'print -JSON' print using JSON format |
| 2523 | else if ((strcmp(arg, "JSON") == 0) || (strcmp(arg, "-JSON") == 0)) { |
| 2524 | flag = OPS_PRINT_PRINTMODEL_JSON; |
| 2525 | } |
| 2526 | |
| 2527 | else { |
| 2528 | |
| 2529 | if ((strcmp(arg, "file") == 0) || (strcmp(arg, "-file") == 0)) {} |
| 2530 | |
| 2531 | if (OPS_GetNumRemainingInputArgs() < 1) break; |
| 2532 | const char* filename = OPS_GetString(); |
| 2533 |
no test coverage detected