savescalars format

Numerical methods and mathematical models of Elmer
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

savescalars format

Post by mark smith »

Hi Elmer team,
On a parallel run with a partitioned mesh, if the data does not exist in that partition nothing is written out, now this makes things less straight forward when say trying to add up all the values in a given column as given in file.dat.names, is there a way to force each of the .dat.N (N=0...number of partitions-1) files to have the same number of columns and a value of zero written for those that don't exist in the partition?
With single runs this isn't a big deal but in a DOE with variable geometry & BC's it make automation a problem.

I don't seem to get Parallel reduce to work when outputting the capacitance in a StatElecSolve

Thanks in advance
Mark
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: savescalars format

Post by raback »

Hi Mark,

Ok, that's a problem. I checked that in principle the capacitance computation is already parallel. The thing is that it is only parallel among the partitions including at least part of the problem. So if partition zero that writes the .dat file does not have a part of the problem then the capacitance is not included it writing. However, in any partition that it is active the capacitance should be correct as is. This may require some coding so that the parallel reduction for capacitance would be done also among the passive participants.

-Peter
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: savescalars format

Post by raback »

Now looking at the code for me it seems that the reduction is already done correctly. A minimal example of the problem would be nice. -Peter
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: savescalars format

Post by mark smith »

Hi Peter,
Thanks for looking.
I tried a minimal example and discovered that I couldn't reproduce the effect but discovered that my actual problem was cured if I put the following line in the solver section

Potential Difference = 1.0 ! Absolutely needed if capacitance calc is required, has to be consistent with potentials in BC's

which I had omitted in my original sif, Strangely though omitting this in my minimal example didn't produce the same effect, with it omitted the .dat.names file reports:
Variables in columns of matrix: ./Scalars.dat
1: res: electric energy

with it included gives:
Variables in columns of matrix: ./Scalars.dat
1: res: electric energy
2: res: potential difference
3: res: capacitance

but in my actual problem .dat.names reports
Variables in columns of matrix: ./Scalars.dat
1: res: electric energy
2: res: potential difference
3: res: capacitance
no matter if I have the "Potential Difference = 1.0" line or not, but without it the .dat.N files are incorrect, some have only 1 entry the electric energy while others have all 3 entries?

Maybe this might be of help? not so much a bug as operator error ;-(

I've attached my minimal test case anyway, geometry file is for GMSH.
Best Regards
Mark
Attachments
minimal_example.zip
capacitance minimal example
(133.76 KiB) Downloaded 334 times
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: savescalars format

Post by raback »

Hi Mark

There was a bug! I was looking accidentally at StatCurrentSolver but the StatElecSolver was buggy in that it was missing parallel reduction. It is now fixed in "devel" branch. Didn't test it though, but the reduction should be a no-brainer...

-Peter
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: savescalars format

Post by mark smith »

Hi Peter,
Just an obersrvation, (windows versions) Elmerfem_mpi 8.0-1e67e25 only exports zero values of electric energy, potential difference & capacitance where as elmerfem_mpi-7.0-8fe936f produces the correct output, so I have reverted to the old Elmer7.
I notice that the windows nightly builds at http://www.nic.funet.fi/pub/sci/physics ... n/windows/ are at least 6 months old, is there a repository with more up to date windows binaries?

Regards
Mark
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: savescalars format

Post by raback »

Hi Mark

Our virtual machine that should compile the nightly builds and copy them forward had run out of disk space. You can find new nightly build which I just compiled (ok, it's not night...)

http://www.nic.funet.fi/pub/sci/physics ... n/windows/

-Peter
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: savescalars format

Post by mark smith »

Hi Peter,
Unfortunately as far as the electrostatics solver and savescalars is concerned your new build "elmerfem-mpi-nightly_Windows-AMD64.exe 28-Oct-2016 11:48"
does not work insofar as it doesn't write out any values other than zero for the electric energy density, electric field or electric flux ;-(
So reverting back to elmerfem_mpi-7.0-8fe936f-20141104_Windows-AMD64.exe windows build for the moment until it is fixed.
Sorry for the bad news.

I must admit I'm always pleasantly surprised how responsive the Elmer team is in getting back to the user community, long may it continue; it is so different to the support I get from commercial venders especially Comsol.
Best Regards
Mark
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: savescalars format

Post by raback »

Hi Mark

Somehow a tiny but nasty bug had flipped into the code:

Code: Select all

elmer@Elmer-VirtualBox ~/Source/elmerfem/fem/src/modules $ git diff StatElecSolve.F90
-         s = s * SqrtMetric * SqrtElementMetric * S_Integ(tg)
+         s = SqrtMetric * SqrtElementMetric * S_Integ(tg)

After removing this one extra "s" everything seems to work ok.

Thanx for reporting!

-Peter
mark smith
Posts: 215
Joined: 26 Aug 2009, 18:20
Location: Peterborough, England

Re: savescalars format

Post by mark smith »

Hi Elmer team,
When using save scalars with mpiexec & elmersolver_mpi and Parallel Reduce to get 1 output file then the following gives incorrect results in a thermal problem.

Variable 1 = Temperature
Operator 1 = "boundary min"

UNLESS the boundary exists in all the partitions, if it doesn't then you will get the value 0.000 as this is what it will report the value as for a boundary which isn't in the partition, thus when mpi_min is performed it picks up 0.000. Maybe it should ignore any entries where the boundary is not in the partition?
Regards
Mark
Post Reply