Question on Dakota Postprocessing #19
Replies: 1 comment 4 replies
-
|
Emmanuel, There are a couple of things to note. First: If Dakota is creating the work directories (workdir.N) for you, then Dakota expects to find the results files in those work directories. They are being (correctly) written there by your workflow because, even though your driver script may be located one directory up, Dakota is executing it in each work directory. (If you echo out the 'pwd' command in the driver script, you can see this.) Second: The four commands where you use awk are suspicious to me. There may be a shell script where this will work, but it won't work in bash, for example. You might need something like this, instead: The $() tells Bash to collect the stdout from the enclosed command and turn it into a string. That string will be stored in the variable TIME. An alternative for some older shells is to enclose the command in backticks: This assumes that PLOTT.asc contains a single row of data. If there are multiple rows of data and you want to treat all of them like Dakota responses, you'll need to make bigger changes to your driver and study. A Dakota response is a scalar (single) value, not a vector. You'll need to define additional responses in your Dakota input (TIME1, TIME2, etc) and perhaps loop over the result of that awk command to write them into the results file. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Dakota Community,
I am coupling Dakota to another solver for UQ applications and I have an issue with passing output data back to Dakota.
Using a driver script, I successfully performed preprocessing as well as executing the solver. At the post-processing stage, I want to pass the responses back to the Dakota results.out file but without success so far.
For a sample size of 5 for instance, 'workdir.1-workdir.5' were created, containing the output files from the solver executable. Now I am trying to extract data from some of these output files (these data are in columns) so that the extracted data can be written to the results.out file in the main directory containing the script. Currently though, what I get with my script is that a results.out file is created in each 'workdir*' and instead of the column of data printed, I rather get the names of the responses printed to file. The actual values are rather displayed on the screen.
I am sure there is a way to go about this and I will appreciate suggestions. The post-processing part of my bash script is appended below:
TIME= awk '{print $1}' PLOTT.asc
TFUELT= awk '{print $2}' TFUELT.asc
TCOOLT= awk '{print $2}' TCOOLT.asc
REACTT= awk '{print $2}' REACTT.asc
echo "$TIME TIME" >>$results
echo "$TFUELT TFUELT" >>$results
echo "$TCOOLT TCOOLT" >>$results
echo "$REACTT REACTT" >>$results
Best regards,
/Emmanuel
Beta Was this translation helpful? Give feedback.
All reactions