|
13 | 13 | #include "dagmcmetadata.hpp" |
14 | 14 | #include "moab/ProgOptions.hpp" |
15 | 15 |
|
| 16 | +#include <cstdlib> |
16 | 17 | #include <cstring> |
17 | 18 | #include <fstream> |
18 | 19 | #include <time.h> // for timing the routine |
@@ -116,8 +117,30 @@ int main(int argc, char* argv[]) { |
116 | 117 | fludag_write_ididx(vol_id); |
117 | 118 | } else { |
118 | 119 | // call fluka run |
119 | | - // flugg mode is flag = 1 |
120 | | - const int flag = 1; |
| 120 | + |
| 121 | + // check for the input file argument |
| 122 | + // get it from the command line |
| 123 | + if(argc >= 1) { |
| 124 | + // convert to std::string |
| 125 | + std::string chinpf_s(argv[1]); |
| 126 | + char chinpf[256] = ""; |
| 127 | + memset(chinpf,' ',256); |
| 128 | + std::copy(chinpf_s.begin(),chinpf_s.end(),chinpf); |
| 129 | + strcpy(chcmpt_.chinpf,chinpf); |
| 130 | + } else { |
| 131 | + // get it from the environment |
| 132 | + std::cout << "from env" << std::endl; |
| 133 | + char* env = std::getenv("INPF"); |
| 134 | + std::cout << env << std::endl; |
| 135 | + strncpy(env,chcmpt_.chinpf,sizeof(env)); |
| 136 | + if (chcmpt_.chinpf[0] == 0) { |
| 137 | + // flabrt("FLUKAM","FLUDAG NO INPUT SPECIFIED"); |
| 138 | + return 1; |
| 139 | + } |
| 140 | + std::cout << chcmpt_.chinpf << std::endl; |
| 141 | + } |
| 142 | + const int flag = 2; |
| 143 | + std::cout << "running fluka" << std::endl; |
121 | 144 | flukam(flag); |
122 | 145 | } |
123 | 146 |
|
|
0 commit comments