Error using classic problemtype in GiD14

Moderator: GiD Team

parduino
Posts: 8
Joined: Sat May 11, 2019 6:23 pm

Error using classic problemtype in GiD14

Postby parduino » Sun May 12, 2019 3:08 am

Hi,
Using GiD14 and a classic problemtype we have used for many years for opensees we are getting the following error in the .bas file:

ERROR MESSAGE
==============
Error in base file 'C:/Program Files/GiD/GiD 14.0.2/problemtypes/UWGiDproblemTypes/UWquad2D_TVA.gid/UWquad2D_TVA.bas' at line number 90: Error in Conditions data.

Command:cond must be a char
Error in 'strcmp' or 'strcasecmp'.
Error in base file 'C:/Program Files/GiD/GiD 14.0.2/problemtypes/UWGiDproblemTypes/UWquad2D_TVA.gid/UWquad2D_TVA.bas' at line number 90: Error into an *if expression

Relevant part of UWquad2D_TVA.bas file
===================================
...
*loop nodes
*set Cond EqualDOF_01_on_lines *nodes
*add Cond EqualDOF_01_on_nodes *nodes
*if(strcmp(cond(1),"master")==0)
*set var mstrY(real) = NodesCoord(2,real)
*set var mstrNode(int) = NodesNum(int)
...


Any comment that could guide us on what is the problem??
This works well in GiD13

Thanks

Pedro
User avatar
escolano
Posts: 1568
Joined: Thu Sep 18, 2014 3:31 pm

Re: Error using classic problemtype in GiD14

Postby escolano » Tue May 14, 2019 2:03 pm

Attach a zip with the problemtype and the model
parduino
Posts: 8
Joined: Sat May 11, 2019 6:23 pm

Re: Error using classic problemtype in GiD14

Postby parduino » Tue May 14, 2019 5:33 pm

Hi,

Thanks for your response. Below a link to a dropbox folder with the case under consideration and the problemtype used.
Let me know if you have any question.
Thanks

https://www.dropbox.com/sh/6bshyzmz4lmi ... 0--2a?dl=0

Pedro
User avatar
escolano
Posts: 1568
Joined: Thu Sep 18, 2014 3:31 pm

Re: Error using classic problemtype in GiD14

Postby escolano » Thu May 23, 2019 7:11 pm

GiD 14 has a bug fixed related to the .bas evaluation, and just this fix highlight an error of your old code.

The error of this code

*loop nodes
*set Cond EqualDOF_01_on_lines *nodes
*add Cond EqualDOF_01_on_nodes *nodes
*if(strcmp(cond(1),"master")==0)


Is that you are doing a loop over all nodes, not only over the nodes that have applied the condition EqualDOF_01_on_lines or EqualDOF_01_on_nodes
then you are asking in the line number 90 for the field
cond(1) that doesn't exists on most nodes !!

To fix it you must do this:

*set Cond EqualDOF_01_on_lines *nodes
*add Cond EqualDOF_01_on_nodes *nodes
*loop nodes *OnlyInCond
*if(strcmp(cond(1),"master")==0)


first set the condition (this internally create a table with the nodes with this condition
and then the loop *OnlyInCond is on the nodes of this table
then you can ask by 1-st field value to be compared with the string "master"

The same error appear three times in this file.

And there is also another error in the line 296
*set var matID = operation(matnum+matShift)

it seems that with the data of this example the variable named matShift is not set, then cannot be asked.
It can be fixed with something like this:
*set var matShift=0
*set var matID = operation(matnum+matShift)

but check that really in this case matShift must be zero!!

I attach a zip file with UWquad2D_TVA.bas with this changes.
UWquad2D_TVA.zip
(7.92 KiB) Downloaded 16 times
parduino
Posts: 8
Joined: Sat May 11, 2019 6:23 pm

Re: Error using classic problemtype in GiD14

Postby parduino » Thu May 23, 2019 9:58 pm

Hi!
Thanks a ton! Much appreciated. I checked the problemtype in GiD14 and it worked well.
Thanks again
Pedro

Return to “Customization”

Who is online

Users browsing this forum: No registered users and 1 guest