Gid calculation error in Linux
Moderator: GiD Team
Gid calculation error in Linux
I am using GiD in linux. I have used it in windows and there was no problem, but, right now, I am getting an error (please loot at the attached file).
Do you have any idea what might cause the error?
Thanks
Do you have any idea what might cause the error?
Thanks
- Attachments
-
- GiD error.png (39.22 KiB) Viewed 26779 times
Re: Gid calculation error in Linux
The error is self-explained: your file UWquad2D.bat file is wrong for Linux,
and by its end-lines (\r\n) seems that has been created in a Windows OS (on Linux ASCII files the lines ends with \n)
Are you the UWquad2D problemtype developer?
Have you compiled the calculation .exe that probably is started from the .bat for this Linux platform?
If the solver is not compiled for Linux it won't be possible to calculate in this platform!!
and in Linux/Mac Os X (FreeBSD based) the .bat and the exe file must have set true the 'execution' flag, else won't be executed
Usually instead of .bat file there are provided a file .win.bat (for Windows) and a file .unix.bat (for Linux, MacOSX or Unix platforms)
GiD start the .win.bat or the .unix.bat depending on the current platform.
The contents of the .win.bat and .unix.bat must be different.
.win.bat is like a classical MSDOS/Windows bat file (script with Windows DOS console commands, but a little restricted, only the command explained in the GiD documentation are valid, because is interpreted by GiD, not by cmd.exe of the operating system)
.unix.bat is a classical Unix/Linux console file, and its syntax depend on the shell declared on the first line
available shells depends on the OS. 'sh' is recommended because is available by default in most current Linux distributions
other possible shells are 'bash', 'csh', etc.
Note: have a look to our example: <GiD>\problemtypes\Examples\cmas2d.gid
and by its end-lines (\r\n) seems that has been created in a Windows OS (on Linux ASCII files the lines ends with \n)
Are you the UWquad2D problemtype developer?
Have you compiled the calculation .exe that probably is started from the .bat for this Linux platform?
If the solver is not compiled for Linux it won't be possible to calculate in this platform!!
and in Linux/Mac Os X (FreeBSD based) the .bat and the exe file must have set true the 'execution' flag, else won't be executed
Usually instead of .bat file there are provided a file .win.bat (for Windows) and a file .unix.bat (for Linux, MacOSX or Unix platforms)
GiD start the .win.bat or the .unix.bat depending on the current platform.
The contents of the .win.bat and .unix.bat must be different.
.win.bat is like a classical MSDOS/Windows bat file (script with Windows DOS console commands, but a little restricted, only the command explained in the GiD documentation are valid, because is interpreted by GiD, not by cmd.exe of the operating system)
.unix.bat is a classical Unix/Linux console file, and its syntax depend on the shell declared on the first line
available shells depends on the OS. 'sh' is recommended because is available by default in most current Linux distributions
other possible shells are 'bash', 'csh', etc.
Note: have a look to our example: <GiD>\problemtypes\Examples\cmas2d.gid
Re: Gid calculation error in Linux
I am not one of the developers and I am just using the problemtype. I believe they have not released any Unix version of the problem type.
To be honest, I am not sure if I understand your point correctly. I have compiled and run gid on Linux platform but I am not sure what the *.bat file does here because what it shows in Windows version seems not to do a significant job! Here is the windows *.bat script:
@ECHO OFF
rem set basename = %1
rem set directory = %2
rem set ProblemDirectory = %3
del %1.flavia.res
rem OutputFile: %2\%1.tcl
rem ErrorFile: %2\%1.err
copy %1.dat %1.tcl
del %1.dat
Do I need to translate it to Linux bash script? Or I need to rewrite another *.bat file based on the unix example you mentioned?
Bests
To be honest, I am not sure if I understand your point correctly. I have compiled and run gid on Linux platform but I am not sure what the *.bat file does here because what it shows in Windows version seems not to do a significant job! Here is the windows *.bat script:
@ECHO OFF
rem set basename = %1
rem set directory = %2
rem set ProblemDirectory = %3
del %1.flavia.res
rem OutputFile: %2\%1.tcl
rem ErrorFile: %2\%1.err
copy %1.dat %1.tcl
del %1.dat
Do I need to translate it to Linux bash script? Or I need to rewrite another *.bat file based on the unix example you mentioned?
Bests
Re: Gid calculation error in Linux
This bat file is not starting any other program, is only writing its input calculation file
In fact, finding in Internet seems that UWQuad2D is a old problemtype related to OpenSees.
http://opensees.berkeley.edu/wiki/index.php/Examples
In order to calculate you will need an appropriated version of OpenSees compiled for your Linux (and compatible with the version format of the input file)
The bat file is basically only renaming from .dat to .tcl the calculation file written by GiD (according to the .bas template of the problemtype)
You can to write a similar .unix.bat file, but I think that is not interesting.
You can simply manually rename the .dat to .tcl outside GiD. Probably you won't be able to calculate it with OpenSees
(must do it in a console outside GiD, the current problemtype is not trying to run it directly from GiD)
In fact, finding in Internet seems that UWQuad2D is a old problemtype related to OpenSees.
http://opensees.berkeley.edu/wiki/index.php/Examples
In order to calculate you will need an appropriated version of OpenSees compiled for your Linux (and compatible with the version format of the input file)
The bat file is basically only renaming from .dat to .tcl the calculation file written by GiD (according to the .bas template of the problemtype)
You can to write a similar .unix.bat file, but I think that is not interesting.
You can simply manually rename the .dat to .tcl outside GiD. Probably you won't be able to calculate it with OpenSees
(must do it in a console outside GiD, the current problemtype is not trying to run it directly from GiD)
Re: Gid calculation error in Linux
Thank you.
I managed to solve the problem by changing .bat file content to something simple. As you said it does not run any other program and it does not need to contain important stuff.
Bests
I managed to solve the problem by changing .bat file content to something simple. As you said it does not run any other program and it does not need to contain important stuff.
Bests
Re: Gid calculation error in Linux
And that didn't cause any other errors, Payoubi? That's a pretty clever solution if it indeed works without issues.
People are protecting wifi with ExpressVPN all the time.
Re: Gid calculation error in Linux
Yeah, I was surprised to see it working but it's working fine right now.
Re: Gid calculation error in Linux
It it not surprising. As I have explained the .bat is an additional file to automatically start the calculation program with appropriated input.
If you simply delete the file it will also work. GiD will write the .dat input file (based on the .bas template) and won't do nothing more.
If you simply delete the file it will also work. GiD will write the .dat input file (based on the .bas template) and won't do nothing more.