How hard would it be to have units indicated in Elmer GUI?

The graphical user interface of Elmer
Post Reply
Elanid
Posts: 10
Joined: 13 Apr 2015, 04:40
Antispam: Yes

How hard would it be to have units indicated in Elmer GUI?

Post by Elanid »

Hello Colleagues,

I'm curious about making the units displayable in Elmer. I find it bothersome checking what units I have to use by going back and forth between forums, manuals, and other literature. I understand that Elmer uses SI, and if you know your field enough it shouldn't be a problem to know what units are needed. Nonetheless, I think it would be very convenient if in the GUI the units would displayed beside the input line (it would be great to know that the conductivity, for instance, is in Siemens per meter [S/m] for sure). Also, I find that if I'd like to know whether the magnetic field strength is actually Tesla or Gauss in Elmer it would be convenient if the unit was displayed in the VTK output as well. So, I'm wondering about possibility of implementing this feature, but I'm not sure where to start, and if someone could point to a possible direction I would appreciate it. I understand that my first step would probably be to get into the source code and I might have to polish my Fortran and C, I'm still curious if anyone had ever intended to do something like this, simply because it would be a neat little detail. Please let me know if you could give directions or details on this matter.

Best regards, Elanid.
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: How hard would it be to have units indicated in Elmer GUI?

Post by mark smith »

Hi Elanid,
As far as I'm aware Elmer can use any units as long as they are consistent i.e. you can choose your mass,length,time etc units to be what you want but all derived properties (density, viscosity, force etc) need to be in the same M,L,T units (including the constants) which is why most users would stick to SI I guess.
Regards
Mark
KaiMartin
Posts: 42
Joined: 02 Jun 2013, 00:07
Antispam: Yes
Location: Hannover, Germany
Contact:

Re: How hard would it be to have units indicated in Elmer GUI?

Post by KaiMartin »

Elanid wrote:I find it bothersome checking what units I have to use by going back and forth between forums, manuals, and other literature.
+1 from me.
The GUI should explicitly give units. While it may be theoretically possible to switch to some alternative units, the application is married to the SI via the numerical values of fundamental constants. If you really want to give lengths in imperial units you'd have to adapt the constants. And then there is the inherent ambiguity whether lengths are given in feet, yards, miles or inches.
On a more serious note, I'd be happy to have the application tell me what units to use for electromagnetic problems.

I am just a user. So I can't judge on how hard the patches would be. But I imagine it to me not difficult, but a little tedious, because quite a number of dialogs are affected.
---<)kaimartin(>---
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How hard would it be to have units indicated in Elmer GUI?

Post by mzenker »

Hi,

there is a way to do that, and the good thing is: It is not hard to do, and it can be done by everybody.

The units can be indicated in the xml files describing the fields for each solver. I see two ways to do it:

1. In the help tooltips (Label <Whatis>) which appear by pressing Shift-F1 after having clicked into the field. Remark: There is also another help text labelled <StatusTip>, but I don't know how to make appear that one.

2. In the name of the variable (label <Name>). In that case, one has to use the <Sifname> for the name of the parameter to be written into the the sif file. Example:

Code: Select all

<Name>Density /kg m-1</Name>
<SifName>Density</SifName>
It might be necessary to decide somehow which way to adopt - I would opt for the second possibility.
Then everyone is free to modify the xml file for his/her favourite solver and submit it to the Elmer team for inclusion into the next release.

HTH,

Matthias
KaiMartin
Posts: 42
Joined: 02 Jun 2013, 00:07
Antispam: Yes
Location: Hannover, Germany
Contact:

Re: How hard would it be to have units indicated in Elmer GUI?

Post by KaiMartin »

mzenker wrote:It might be necessary to decide somehow which way to adopt - I would opt for the second possibility.
I'd say, the name label would be appropriate. The tool tips are well hidden. I for one didn't know about [shift F1] in the first place. SI units tend to be quite dense. So the dialogs don't get overly cluttered.
Then everyone is free to modify the xml file for his/her favourite solver and submit it to the Elmer team for inclusion into the next release.
Low level hacking for everyone! :-)
---<)kaimartin(>---
KaiMartin
Posts: 42
Joined: 02 Jun 2013, 00:07
Antispam: Yes
Location: Hannover, Germany
Contact:

Re: How hard would it be to have units indicated in Elmer GUI?

Post by KaiMartin »

mzenker wrote:

Code: Select all

<Name>Density /kg m-1</Name>
I'd suggest a slightly more verbose format:

Code: Select all

<Name>Density [kg·m−1]</Name>
Square brackets are quite widespread to indicate units of measurement. Hopefully, qt can render the centered dot.

Any thoughts?
---<)kaimartin(>---
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How hard would it be to have units indicated in Elmer GUI?

Post by mzenker »

KaiMartin wrote:
mzenker wrote:

Code: Select all

<Name>Density /kg m-1</Name>
I'd suggest a slightly more verbose format:

Code: Select all

<Name>Density [kg·m−1]</Name>
Square brackets are quite widespread to indicate units of measurement. Hopefully, qt can render the centered dot.

Any thoughts?
I object! This (mis)use of square brackets may be widespread, but it is nevertheless not correct.
The square brackets mean "the unit of", e.g. [m]=kg.
See, for example, http://www.bipm.org/en/publications/si- ... on5-3.html, http://physics.nist.gov/cuu/pdf/sp811.pdf (section 7.1, page 15) and https://de.wikipedia.org/wiki/Einheitenzeichen (in german).

So IMO the use of square brackets is not an option. We can write "Density / kg·m-1" or alternatively "Density in kg·m-1" or "Density in kg/m".

Matthias
Elanid
Posts: 10
Joined: 13 Apr 2015, 04:40
Antispam: Yes

Re: How hard would it be to have units indicated in Elmer GUI?

Post by Elanid »

Hello Everyone!

Thank you for all the replies and amazing feedback. My bad on the absence, it was a busy semester. I'm going to follow up with Matthias' advice and see what can be done. Personally I'm not a a fan of British measurement system and I'm a lot more used to SI. In Canada we have to use both, partly because of our neighbors, but I'm not going to translate the same mentality to Elmer. As soon as I get some nice outputs in the GUI displays I'll make sure to post my progress, I'll see if I can start with the magneto-dynamics, although I plan to cover as many options that require units as possible.

Best regards, Elanid.
Post Reply