Jump to content
Guest Mr. Watle Andreas

Result file output running CAESES with shipflow in batch

Recommended Posts

Guest Mr. Watle Andreas

Hi.

 

I am running CAESES with shipflow in batch through matlab for an optimization purposes. The system is up and running, but I'm having trouble generating a text-file etc with some evaluations from shipflow. Now, the output folder only contains pictures of the pressure distribution, waveheights etc, but I want to generate a file containing Cw, Cwtwc Cf etc. Is this possible?

 

Regards

 

Andreas

Share this post


Link to post
Share on other sites

Hi Andreas,

 

Just to give you an idea: Maybe you could write a feature definition that creates an ASCII file in the design directory, and which contains the values that you need. The following is taken from the documentation of Feature Definitions:

// set up string for current design directory adding the name of the feature
string workingDir(getDesignDir() + "/" + this.getName() + "/")
// create a new path
mkpath(workingDir)
 
// open a file for writing
FFile out(workingDir + "value.dat")
out.openWrite()
// write out the parameter value of myParam
out.writeLine("value="+myParam.toString())
out.close()
 
// now the external tool
process myProcess("myTool.exe")
myProcess.setWorkingDir(workingDir)
myProcess.setArguments([workingDir+"value.dat"])
myProcess.run()
 
// read the result
FFile in(workingDir+"results.dat")
in.openRead()
// split the string by at least 1 whitespaces using regular expressions,
// put single values into a list
fobjectlist data(in.readLine().splitByRegExp("\s+"))
double resultvalue(data.at(0).castTo(FString).toDouble())
// close the file
in.close()

Hope this helps,

Joerg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...