Topic: can't get unv2oofem to work

Hey there,

I want to try out the unv2oofem tool. I created an .unv-file with Salome and now want to run it. However, I noticed that all your Python codes are written in Python 2 and I have Python3 installed, so I changed all print commands which have changed from 2 to 3 but still I get an invalid syntax error. He's complaining already about the line 51 "t1=time.time()". I tried to comment it out with # because this line is not absolutely neccesary, I think. However, then I get an invalid syntax error on the next line. I must be doing something wrong.

Has anyone already tried running unv2oofem with Pyhton3 and maybe knows the solution of how to do it?

Cheers,
Marit

Re: can't get unv2oofem to work

Hello!
I also had problems with unv2oofem. I have a python2 and when I loading the exam from  http://www.oofem.org/wiki/doku.php?id=u … :unv2oofem getting an error
Traceback (most recent call last):
  File "D:\OOFEM_primer\exam\unv2oofem.py", line 68, in <module>
    FEM=UNV.parse()
  File "D:\OOFEM_primer\exam\unv2x.py", line 204, in parse
    self.FEM=func(self.file,self.FEM)
  File "D:\OOFEM_primer\exam\unv2x.py", line 107, in UNV2412Reader
    FEM.elems.append(Element(dataline[0],dataline[1],0,0,dataline[5],cntvt))
IndexError: list index out of range
what am I doing wrong?

Olga

3

Re: can't get unv2oofem to work

HI,
I have just committed fix to the git repository. The unv2oofem should now work correctly with python2 and python3 versions.
Note: I have tested it only on Unix system, there may be issues on Win platform. Let me know, if you experience any problems.
Borek

Re: can't get unv2oofem to work

Thank you.
but still I can not find my mistake. I have a file UNV from SALOME_MECA . in it there is a data set 2467. if I convert with it, then the conversion does not work, if I replace it with 2477. then only the nodes are converted. Elements are not converted and loads to nodes are not applied. Help me please!!
Olga

5

Re: can't get unv2oofem to work

Hi Olga, could you attach your unv and cntr files?

6 (edited by kuzovleva 02-10-2017 06:35:28)

Re: can't get unv2oofem to work

I attached my files or by reference https://drive.google.com/open?id=0B0h7L … WVRVDhYUW8

7

Re: can't get unv2oofem to work

Hi Olga,
two things, that need to be corrected:
1) in ctrl file use "TrPlaneStress2D" for element type 41 (triangular element)
2) It seems that you are using some new salome version, which is using dataset 2477 instead of old 2467. You should replace dataset with 2477 id by 2467 and it should work

I have no access to documentation of unv, so its hard to say what is difference between dataset 2467 and 2477, but seems to work. We need to test it on several examples.

EDIT: I have added support for dataset 2477, so the second point is no longer necessary. Updated in git repository.

Re: can't get unv2oofem to work

Thanks a lot, I did it !! Now I have the problem with the load: the vertical load on the node(NodalLoad 2 loadTimeFunction 1 Components 2 0.0 1.0 ) . in the .in file should look like :
node 53    coords 3 -3        0        0  load 1 2.
What should be written in groups in ctrl file?

9

Re: can't get unv2oofem to work

Hi Olga,
try this:

group LC1
nodeprop load 1 2

unv2oofem uses old way to add load to the node (it is specified on individual nodes, not using set syntax) but this also works.

Borek

Re: can't get unv2oofem to work

Thank you Borek!