Page 1 of 1

Error using classic problemtype in GiD14

Posted: Sun May 12, 2019 3:08 am
by parduino
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

Re: Error using classic problemtype in GiD14

Posted: Tue May 14, 2019 2:03 pm
by escolano
Attach a zip with the problemtype and the model

Re: Error using classic problemtype in GiD14

Posted: Tue May 14, 2019 5:33 pm
by parduino
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

Re: Error using classic problemtype in GiD14

Posted: Thu May 23, 2019 7:11 pm
by escolano
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 297 times

Re: Error using classic problemtype in GiD14

Posted: Thu May 23, 2019 9:58 pm
by parduino
Hi!
Thanks a ton! Much appreciated. I checked the problemtype in GiD14 and it worked well.
Thanks again
Pedro