Naming of variables in vtu

Numerical methods and mathematical models of Elmer
Post Reply
m42kus
Posts: 5
Joined: 21 May 2017, 20:17
Antispam: Yes

Naming of variables in vtu

Post by m42kus »

Hi everyone,

Is it possible to make ElmerSolver honor capitalization when it saves variables to a vtu file? E.g. I would need to export the displacement as "Displacement" and temperature as "Temperature". The reason for that is that I'm currently implementing ElmerSolver support for the FreeCAD CAD workbench as part of my gsoc project. FreeCAD atm only searches for variable names with the first character in upper case. See https://forum.freecadweb.org/viewtopic. ... 20#p179666 for a video reporting my progress so far.

Regards,
Markus
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Naming of variables in vtu

Post by mzenker »

Hi,

AFAIK Elmer systematically converts everything to lowercase.
One could make a small change in the code of ResultOutputSolver to capitalize the first letter of certain keywords, maybe using an extra flag
FreeCAD Format = Logical True
or the like.
Have a look at ResultOutputSolve.src. It's a little bit of FORTRAN, should not be hard to do.
When done, you can ask the Elmer team to include it into the official distribution, so that the patch doesn't need to be applied at every new Elmer version.

HTH,

Matthias
m42kus
Posts: 5
Joined: 21 May 2017, 20:17
Antispam: Yes

Re: Naming of variables in vtu

Post by m42kus »

Hi,
Thanks for the fast answer and your suggestion. But I think that this would be too much of a hack to be included upstream (at least I wouldn't include it if it were my project xD). I'm going to extend the FreeCAD code to be a little bit more flexible when parsing the vtu file. That's probably much easier (for me) and should be done anyway.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Naming of variables in vtu

Post by mzenker »

There are quite some of such"hacks" in Elmer - as long as there is a keyword controlling the corresponding behaviour in a backward compatible way, that is usually no problem. But if it's easier for you to do it in FreeCAD, it's just as fine.

Matthias
raback
Site Admin
Posts: 4825
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Naming of variables in vtu

Post by raback »

Hi

The variables are always lower case simply because they are all transformed to lower case internally. This makes string comparisons easier etc.

Now one could indeed transfer names to start with a capital letter just for the VTU output. But if you already have a fix maybe that's the path to take. We try to be open to contributions but still it takes an effort to include them.

-Peter
Post Reply