Page 1 of 1

max number of variables in scalar solver section

Posted: 04 Aug 2023, 17:48
by ea_Marc
Hi All,

I try to calculate the flux linkage in an electrical machine in every stator slot. That means, I need to integrate the magnetic vector potential in every slot.

My idea was, to use the scalar solver, which already writes out the torque etc. However, I realized, that in the moment, I have more than 20 variables in the scalar solver, I get an error, complaining about the 21th variable.

Here is an example of the scalar solver:

Code: Select all

! scalar_solver
Solver 6
  Equation = SaveScalars
  Procedure = "SaveData" "SaveScalars"
  Filename = scalars.dat
  Exec Solver = After Timestep
  Variable 1 = Time
  Variable 2 = Position
  Operator 3 = cpu time
  Variable 4 = Magnetic Vector Potential 3
  Mask Name 4 = phase_A+_14.0
  Operator 4 = Body Int
  Variable 5 = Magnetic Vector Potential 3
  Mask Name 5 = phase_B-_14.0
  Operator 5 = Body Int
  Variable 6 = Magnetic Vector Potential 3
  Mask Name 6 = phase_C-_14.0
  Operator 6 = Body Int
  Variable 7 = Magnetic Vector Potential 3
  Mask Name 7 = phase_B+_14.0
  Operator 7 = Body Int
  Variable 8 = Magnetic Vector Potential 3
  Mask Name 8 = phase_A-_14.0
  Operator 8 = Body Int
  Variable 9 = Magnetic Vector Potential 3
  Mask Name 9 = phase_C+_14.0
  Operator 9 = Body Int
End
This example works, because I have "only" 9 variables defined. But in the moment, I have a bigger machine with a lot of stator slots and over 20 variables, I get an error:

Code: Select all

ERROR:: LoadInputFile: 
ERROR:: LoadInputFile:  Unknown specifier: [magnetic vector potential 3]
ERROR:: LoadInputFile:  In section: [solver 6]
ERROR:: LoadInputFile:  For property name:[variable 21]
STOP 1
It complains about the 21st variable, but it does no matter, which variable is the 21st.

So, now I think about creating multiple scalar solver sections to not exceed 20 variables per section. However, perhaps I am just totally wrong on how I try to get my integration results. Does anyone have a better idea?
Thx!

Re: max number of variables in scalar solver section

Posted: 07 Aug 2023, 11:25
by raback
Hi

This seems to be a problem when reading in the keyword. Probably it helps if you say

Code: Select all

Variable 21 = String "..."
Now this also suggest that your code is old since currently the keyword checker has no upper bound.

-Peter

Re: max number of variables in scalar solver section

Posted: 07 Aug 2023, 16:10
by ea_Marc
Thx yor your answer.
Changing the code like this:

Code: Select all

Variable 18 = String "Magnetic Vector Potential 3"
  Mask Name 18 = s_slot_27_B+
  Operator 18 = Body Int
  Variable 19 = String "Magnetic Vector Potential 3"
  Mask Name 19 = s_slot_28_C-
  Operator 19 = Body Int
  Variable 20 = String "Magnetic Vector Potential 3"
  Mask Name 20 = s_slot_29_B+
  Operator 20 = Body Int
  Variable 21 = String "Magnetic Vector Potential 3"
  Mask Name 21 = s_slot_30_B+
  Operator 21 = Body Int
  Variable 22 = String "Magnetic Vector Potential 3"
  Mask Name 22 = s_slot_31_A-
  Operator 22 = Body Int
It starts complaining

Code: Select all

ERROR:: LoadInputFile: 
ERROR:: LoadInputFile:  Unknown specifier: [s_slot_30_b+]
ERROR:: LoadInputFile:  In section: [solver 6]
ERROR:: LoadInputFile:  For property name:[mask name 21]
If you say, that my code is old, that is probably correct, I am learning from "old" examples, what is the modern way to write out the results?

Re: max number of variables in scalar solver section

Posted: 07 Aug 2023, 17:37
by Rich_B
Hello,

I think the reference to 'old code', means that you might be running an older version of Elmer. What is the Compile date listed in the ElmerSolver output to console?

Posting a minimal working example may be the fastest way for you to get an answer.

Rich.

Re: max number of variables in scalar solver section

Posted: 08 Aug 2023, 09:28
by ea_Marc
It's version 9:

Code: Select all

ELMER SOLVER (v 9.0) STARTED AT: 2023/08/08 08:23:03
ParCommInit:  Initialize #PEs:            1
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: b0f5c763e, Compiled: 2023-02-09)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: mSpW10.6_10-4_FU1.sif
LoadInputFile: Scanning input file: mSpW10.6_10-4_FU1.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
ERROR:: LoadInputFile: 
ERROR:: LoadInputFile:  Unknown specifier: [s_slot_30_b+]
ERROR:: LoadInputFile:  In section: [solver 6]
ERROR:: LoadInputFile:  For property name:[mask name 21]
I attached the example. The file ending is bz2, but it is an xz, which I was not allowed to upload. xz was necessary due to file size restriction. Thx for your support!

Re: max number of variables in scalar solver section

Posted: 08 Aug 2023, 10:34
by raback
Hi

As said, the keyword checker has been enhanced. If you have an old version you can manipulate the SOLVER.KEYWORDS file or just add types for all keywords with index >20.

Code: Select all

  Variable 21 = String "Magnetic Vector Potential 3"
  Mask Name 21 = String "s_slot_30_B+"
  Operator 21 = String "body int"
Generally it is not very fruitful to chase problems in old code that may have been addressed in the current version.

-Peter

Re: max number of variables in scalar solver section

Posted: 08 Aug 2023, 15:53
by Rich_B
Hello,

From your post, the Elmer Compiled date is 2023-02-09, so the version is about 6 months old.

Running your example using Elmer with Compiled date of 2023-08-03 ran to completion with the attached solver log.

Rich.

Re: max number of variables in scalar solver section

Posted: 09 Aug 2023, 15:52
by ea_Marc
Thanky you very much Rich. I compiled ELMER in release branch and ELMER release-9.0 tag. Version from release branch throw the same error than before, version from release-9 tag throws: "elements.def not found".

I can not compile the actual develop branch, due to:

Code: Select all

/home/scma/devel/elmer/elmerfem/fem/src/SParIterComm.F90:5019:51:

      CALL MPI_ALLREDUCE( ssum, tsum, 1, MPI_COMPLEX, &
                                                   1
Error: Symbol ‘mpi_complex’ at (1) has no IMPLICIT type
even with WITH_MPI=OFF

But I understand, that the error has something to do with the compiled version, because it runs for you. Let's see, what the future brings.

@Peter: Well I was really not aware, that a 6 month old version with the same version number is "old code".

Re: max number of variables in scalar solver section

Posted: 09 Aug 2023, 16:44
by Rich_B
Hello,

I ran the Windows installer, which is based on the latest devel branch. Elmer has been on Version 9 for several years. That is why looking at the Compiled Date is of interest.

Which OS are you running?

Rich.

Re: max number of variables in scalar solver section

Posted: 10 Aug 2023, 11:59
by ea_Marc
Ah ok, I was not aware that version 9 is a LTS version :-)

I use Rocky Linux 8.

Today I tried to compile the devel branch with ubuntu 20.04, but this does not work as well ... There he complains about not finding the mpif.h.

Code: Select all

[ 52%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/GeneralUtils.F90.o
/home/scma/devel/elmer/elmerfem/fem/src/GeneralUtils.F90:1994: Error: Can't open included file 'mpif.h'
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/build.make:245: fem/src/CMakeFiles/elmersolver.dir/GeneralUtils.F90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:15397: fem/src/CMakeFiles/elmersolver.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
This applies for devel and release branch. It's curious, because the file is available and cmake set the MPI_Fortran_INCLUDE_PATH correctly.
However, I do not want to bother you with compilation issues.

I tested the windows version as well, there it works :-).

I installed the ppa Version on ubuntu 20.04, there it works as well, thx!