Please login with a confirmed email address before reporting spam
     
    
 
                                                Posted:
                            
                                1 year ago                            
                            
                                2024/06/19 19:10 GMT-4                            
                        
                        
                                                    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:
                            
                                1 year ago                            
                            
                                2024/06/24 2:40 GMT-4                            
                        
                        
                                                    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:
                            
                                1 year ago                            
                            
                                2024/06/25 13:01 GMT-4                            
                        
                        Updated:
                            
                                1 year ago                            
                            
                                2024/06/25 13:43 GMT-4                            
                        
                        
                                                    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.