Please login with a confirmed email address before reporting spam
Posted:
10 months ago
Jun 19, 2024, 7:10 p.m. EDT
Clarification:
I realize that I can make a parameter "CalcNumber", and then have my input files be something like
InputFile = "StandardInputPrefix_"+toInteger(CalcNumber);
and output files be something like
OutputFile = "StandardOutputPrefix_"+toInteger(CalcNumber);
with obvious extensions for files that are saving specific results.
But that would make it difficult to keep track of various calculations, since all the filenames would differ only by that CalcNumber.
I really want my batch file that is calling my executable to specify a file with an arbitrary filename (complete with location) for the file that contains all the needed parameters. And I want that arbitrary filename to be the root for all the output files that get saved after the calculation.
One last thought: I suppose I could have the calling batch file keep renaming files as they are needed and generated. But really? There's not a better way? Please tell me there is a better way!
Clarification:
I realize that I can make a parameter "CalcNumber", and then have my input files be something like
InputFile = "StandardInputPrefix_"+toInteger(CalcNumber);
and output files be something like
OutputFile = "StandardOutputPrefix_"+toInteger(CalcNumber);
with obvious extensions for files that are saving specific results.
But that would make it difficult to keep track of various calculations, since all the filenames would differ only by that CalcNumber.
I really want my batch file that is calling my executable to specify a file with an arbitrary filename (complete with location) for the file that contains all the needed parameters. And I want that arbitrary filename to be the root for all the output files that get saved after the calculation.
One last thought: I suppose I could have the calling batch file keep renaming files as they are needed and generated. But really? There's not a better way? Please tell me there is a better way!
Magnus Ringh
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
10 months ago
Jun 24, 2024, 2:40 a.m. EDT
Hi David,
Perhaps an Application Argument node could be used here. It provides a poweful way of sending inputs to COMSOL apps (including compiled apps) from the command line. See the documentation for more information.
Best regards,
Magnus
Hi David,
Perhaps an Application Argument node could be used here. It provides a poweful way of sending inputs to COMSOL apps (including compiled apps) from the command line. See the documentation for more information.
Best regards,
Magnus
Please login with a confirmed email address before reporting spam
Posted:
10 months ago
Jun 25, 2024, 1:01 p.m. EDT
Updated:
10 months ago
Jun 25, 2024, 1:43 p.m. EDT
Magnus: App args was the way to go. I could not get it to work for days. In the end, it turned out that the particular version of Windows PowerShell that I have was preventing me from passing full filenames (with : and \ in them) into the app arg. Used just a plain command prompt, and it worked. Kudos to Akhilesh Sasankan for asking about PowerShell.
Magnus: App args was the way to go. I could not get it to work for days. In the end, it turned out that the particular version of Windows PowerShell that I have was preventing me from passing full filenames (with : and \ in them) into the app arg. Used just a plain command prompt, and it worked. Kudos to Akhilesh Sasankan for asking about PowerShell.