Skip to content

Commit

Permalink
Changes to make it work, its working! Huzzah!
Browse files Browse the repository at this point in the history
  • Loading branch information
makeclean committed Nov 12, 2020
1 parent ffb0c63 commit 6f0a7ef
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/fluka/app/mainFluDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "dagmcmetadata.hpp"
#include "moab/ProgOptions.hpp"

#include <cstdlib>
#include <cstring>
#include <fstream>
#include <time.h> // for timing the routine
Expand Down Expand Up @@ -116,8 +117,30 @@ int main(int argc, char* argv[]) {
fludag_write_ididx(vol_id);
} else {
// call fluka run
// flugg mode is flag = 1
const int flag = 1;

// check for the input file argument
// get it from the command line
if(argc >= 1) {
// convert to std::string
std::string chinpf_s(argv[1]);
char chinpf[256] = "";
memset(chinpf,' ',256);
std::copy(chinpf_s.begin(),chinpf_s.end(),chinpf);
strcpy(chcmpt_.chinpf,chinpf);
} else {
// get it from the environment
std::cout << "from env" << std::endl;
char* env = std::getenv("INPF");
std::cout << env << std::endl;
strncpy(env,chcmpt_.chinpf,sizeof(env));
if (chcmpt_.chinpf[0] == 0) {
// flabrt("FLUKAM","FLUDAG NO INPUT SPECIFIED");
return 1;
}
std::cout << chcmpt_.chinpf << std::endl;
}
const int flag = 2;
std::cout << "running fluka" << std::endl;
flukam(flag);
}

Expand Down
18 changes: 18 additions & 0 deletions src/fluka/fluka_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ extern "C" {
} mulbou_;
}

// the CHCMPT struct for
// setting the input name
extern "C" {
extern struct {
char comptr[50];
char inpfil[200];
char pwddir[200];
char hlfdir[200];
char homdir[200];
char hostnm[200];
char usrflk[200];
char grpflk[200];
char inpnam[200];
char chinpf[256];
char hfpath[200];
} chcmpt_;
}

// struct to hold particle state
struct particle_state {
moab::DagMC::RayHistory history;
Expand Down

0 comments on commit 6f0a7ef

Please sign in to comment.