Automated repetition of Elmer Solver

Numerical methods and mathematical models of Elmer
Post Reply
Organ_Mark
Posts: 11
Joined: 26 Oct 2017, 22:59
Antispam: Yes

Automated repetition of Elmer Solver

Post by Organ_Mark »

I would like to repeatedly run ElmerSolver to solve the problem many times with different values of frequency. I have looked very hard to find an example of someone doing this type of automation but I have not seen it. I have looked at the Elmer MATC manual and see the makings of what I need, but I cannot put it together. There is a section in the ElmerSolver manual that describes Basic programming, but I can't get off the ground.

At the bottom of the posting is the SIF file I am working with. Here is a snippet of that file that has the relevant details.

Code: Select all

Equation 1
  Name = "Equation 1"
 Angular Frequency = 2155
   Active Solvers(1) = 1
End

I would like the angular frequency to change every time I re-execute the SIF file. As an example, I would like to execute the SIF file 5 times with the frequency changing to

Angular Frequency = 2155.1
Angular Frequency = 2165.1
Angular Frequency = 2175.1
Angular Frequency = 2185.1
Angular Frequency = 2195.1

Could someone please give me an example of how to do it? Or if this is a bad way to do it, please show me another way to do it.

Thank you,
Mark

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = comsol_validity_test_1.sif
  Post File = comsol_validity_test_1.vtu
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "Body 1"
  Equation = 1
  Material = 1
End

Solver 1
  Equation = Helmholtz Equation
  Procedure = "HelmholtzSolve" "HelmholtzSolver"
  Variable = -dofs 2 Pressure Wave
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "Equation 1"
 Angular Frequency = 2155
   Active Solvers(1) = 1
End

Material 1
  Name = "Air (room temperature)"
  Heat Conductivity = 0.0257
  Heat Capacity = 1005.0
  Density = 1.205
  Relative Permittivity = 1.00059
  Viscosity = 1.983e-5
  Sound speed = 343.0
  Heat expansion Coefficient = 3.43e-3
End

Boundary Condition 1
  Target Boundaries(1) = 1 
  Name = "In"
  Pressure Wave 2 = 0
  Pressure Wave 1 = 70.71
End

Boundary Condition 2
  Target Boundaries(1) = 6 
  Name = "Out"
  Wave impedance 1 = 343
  Wave impedance 2 = 0
End

Boundary Condition 3
  Target Boundaries(4) = 2 3 4 5 
  Name = "walls"
  Wave Flux 1 = 0
  Wave Flux 2 = 0
End
cmosbeux
Posts: 2
Joined: 31 Oct 2017, 00:36
Antispam: Yes

Re: Automated repetition of Elmer Solver

Post by cmosbeux »

Hi Mark,

The easiest way to do it automatically is to write a bash script running several time the ElmerSolver command with a slightly modified .sif file (just changing the parameter values you want to change). To my knowledge it is not possible to do it directly in a .sif file.

Cyrille
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Automated repetition of Elmer Solver

Post by kataja »

Hi,

the keyword you are perhaps looking for is "simulation type = scanning" in the "simulation" block. That way you can solve multiple steady state simulations and use the time variable as a pseudo-time. Then you can state something like

Code: Select all

angular frequency = variable time
  real matc "tx*a+b"
Hope this works.

Cheers,
Juhani
Organ_Mark
Posts: 11
Joined: 26 Oct 2017, 22:59
Antispam: Yes

Re: Automated repetition of Elmer Solver

Post by Organ_Mark »

Thank you to Juhani and Cyrille for your kind answers.

I studied the situation once more and could not understand how to make MATC work. So I took the other suggestion seriously about scripting the sif file. Rather than using BASH, I decided to do it with python. I wanted to repeatedly run a sif file that had 2 lines that were modified for each file. So I by hand edited the sif file into 3 parts. I called the 3 parts "a", "b", and "c". I read all 3 parts then write a new sif file by writing the "a" part followed by a custom line followed by the "b" part followed by a custom line followed by a "c" part. Then I execute ElmerSolver using the new sif file. Then I change the sif file again and run it again. After all of the runs are done I have a bunch of .vtu files I open with Paraview for analysis.

It is not elegant but it does work without a huge amount of effort.

Code: Select all

import subprocess


for i in range(1,10):
    aa = open("sf.aa", "r") 
    bb = open("sf.bb", "r")
    cc = open("sf.cc", "r")
    target = open("target.sif","w") 
 
    target.write(aa.read())
    target.write("  Post File = SFoutput" + str(i) + ".vtu\r")
    target.write(bb.read()) 
    target.write("  angular frequency =" + str(2301+230*i) + "\r")
    target.write(cc.read())  
 
    target.close() 

    subprocess.call(['ElmerSolver'])
    print(i)
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Automated repetition of Elmer Solver

Post by mzenker »

Hi,

you can also do some scripting directly in the sif file (see solver manual, section "Running several sequences").
You might add something like

Code: Select all

RUN
Simulation::Post File = comsol_validity_test_2.vtu
Equation 1::Angular Frequency = 2165
RUN
Simulation::Post File = comsol_validity_test_3.vtu
Equation 1::Angular Frequency = 2175
RUN
at the end of your sif file and look if it does what you need (I didn't test it).

HTH,
Matthias
Organ_Mark
Posts: 11
Joined: 26 Oct 2017, 22:59
Antispam: Yes

Re: Automated repetition of Elmer Solver

Post by Organ_Mark »

Thank you very much Matthias. You said the magic words "put this at the end of your sif file". That was the clue that I was missing.

I did try your suggestion. It did not work but now I know how MATC should work. I think I will concentrate on the python solution I mentioned simply because I have it working and I want to keep up my Python skills.

But I sincerely appreciate you post. That was the missing link.

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

Re: Automated repetition of Elmer Solver

Post by mzenker »

Hi,

just curious: what did not work with the RUN commands in the sif?

Matthias
Organ_Mark
Posts: 11
Joined: 26 Oct 2017, 22:59
Antispam: Yes

Re: Automated repetition of Elmer Solver

Post by Organ_Mark »

MATCexampleforForum.tar.gz
Complete file
(641.8 KiB) Downloaded 330 times
I recreated the Crime and have the results here. Apparently it performed the first analysis correctly and then attempted the next one and gave a segmentation fault.

Here is the sif file I used.

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = target.sif
  Post File = SF.vtu
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "Body 1"
  Equation = 1
  Material = 1
End

Solver 1
  Equation = Helmholtz Equation
  Procedure = "HelmholtzSolve" "HelmholtzSolver"
  Variable = -dofs 2 Pressure Wave
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "Equation 1"
  angular frequency =4371
  Active Solvers(1) = 1
End

Material 1
  Name = "Air (room temperature)"
  Viscosity = 1.983e-5
  Heat expansion Coefficient = 3.43e-3
  Heat Conductivity = 0.0257
  Relative Permittivity = 1.00059
  Sound speed = 343.0
  Heat Capacity = 1005.0
  Density = 1.205
End

Boundary Condition 1
  Target Boundaries(1) = 1 
  Name = "In"
  Pressure Wave 2 = 0
  Pressure Wave 1 = 70.71
End

Boundary Condition 2
  Target Boundaries(1) = 6 
  Name = "Out"
  Wave impedance 1 = 343
  Wave impedance 2 = 0
End

Boundary Condition 3
  Target Boundaries(4) = 2 3 4 5 
  Name = "walls"
  Wave Flux 1 = 0
  Wave Flux 2 = 0
End

RUN
Simulation::Post File = SF2.vtu
Equation 1::Angular Frequency = 2165
RUN
Simulation::Post File = SF3.vtu
Equation 1::Angular Frequency = 2175
RUN
and here is the result of the run.

Code: Select all

elmeruser@cscuser-VirtualBox /media/sf_sharedFolder/SimplePipefromforum/MATCexampleforForum $ ElmerSolver
ELMER SOLVER (v 8.3) STARTED AT: 2017/11/06 12:24:09
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: 8.3 (Rev: d56e3b3, Compiled: 2017-09-21)
MAIN:  HYPRE library linked in.
MAIN:  MUMPS library linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: target.sif
LoadInputFile: Scanning input file: target.sif
LoadInputFile: Loading input file: target.sif
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_Init0]
LoadMesh: Base mesh name: ./.
LoadMesh: Elapsed REAL time:     0.1009 (s)
MAIN: -------------------------------------
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_Init]
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_bulk]
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver]
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: helmholtz equation...done.
OptimizeBandwidth: Half bandwidth without optimization: 6298
OptimizeBandwidth: 
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 247
OptimizeBandwidth: ---------------------------------------------------------
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: helmholtz equation
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           1
HelmholtzSolve:  Frequency (Hz):    695.66625625467452
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
HelmholtzSolve: Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.2788E-01
       2 0.1700E-01
       3 0.1324E-01
       4 0.1195E-01
       5 0.1215E-01
       6 0.1373E-01
       7 0.1762E-01
       8 0.2815E-01
       9 0.9407E-01
      10 0.6229E-01
      11 0.2421E-01
      12 0.1587E-01
      13 0.1265E-01
      14 0.1137E-01
      15 0.1121E-01
      16 0.1253E-01
      17 0.1142E-01
      18 0.1363E-01
      19 0.1443E-01
      20 0.1862E-01
      21 0.2121E-01
      22 0.2804E-01
      23 0.9545E-01
      24 0.6246E-01
      25 0.9352E-01
      26 0.1653E-01
      27 0.3340E-01
      28 0.3167E-01
      29 0.1204E-01
      30 0.1630E-01
      31 0.1384E-01
      32 0.1570E-01
      33 0.1516E-01
      34 0.1224E-01
      35 0.1049E-01
      36 0.1075E-01
      37 0.1035E-01
      38 0.1120E-01
      39 0.1119E-01
      40 0.1118E-01
      41 0.1119E-01
      42 0.1291E-01
      43 0.1286E-01
      44 0.1331E-01
      45 0.1745E-01
      46 0.1220E+00
      47 0.9200E-02
      48 0.1773E-01
      49 0.1774E-01
      50 0.1016E-01
      51 0.7591E-01
      52 0.3764E-01
      53 0.1810E-01
      54 0.1280E-01
      55 0.2004E-01
      56 0.1046E-01
      57 0.2185E-01
      58 0.1189E-01
      59 0.9999E-01
      60 0.1748E-01
      61 0.1828E-01
      62 0.2105E-01
      63 0.1631E-01
      64 0.1489E-01
      65 0.1658E-01
      66 0.1910E-01
      67 0.2432E-01
      68 0.2003E-01
      69 0.2390E-01
      70 0.3286E-01
      71 0.7093E-01
      72 0.1065E+00
      73 0.1260E-01
      74 0.1761E+00
      75 0.8421E-01
      76 0.8220E-01
      77 0.1473E-01
      78 0.1650E-01
      79 0.3168E-02
      80 0.1616E-01
      81 0.8606E-02
      82 0.6740E-02
      83 0.5317E-02
      84 0.2094E-02
      85 0.1469E-02
      86 0.4997E-03
      87 0.1228E-03
      88 0.5052E-04
      89 0.1843E-04
      90 0.6873E-05
      91 0.4810E-05
      92 0.2189E-05
      93 0.1646E-05
      94 0.8559E-06
      95 0.9275E-06
      96 0.7506E-06
      97 0.1665E-06
      98 0.1124E-06
      99 0.9424E-07
     100 0.5725E-08
     101 0.4871E-08
     102 0.1719E-08
     103 0.1109E-08
     104 0.1047E-08
     105 0.1580E-08
     106 0.5411E-09
     107 0.3458E-09
     108 0.9765E-10
     108 0.9765E-10
ComputeChange: NS (ITER=1) (NRM,RELC): (  50.062719      2.0000000     ) :: helmholtz equation
HelmholtzSolve: iter:    1 Assembly: (s)    0.81    0.81
HelmholtzSolve: iter:    1 Solve:    (s)    0.76    0.76
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           2
HelmholtzSolve:  Frequency (Hz):    695.66625625467452
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
HelmholtzSolve: Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.4776E-10
       1 0.4776E-10
ComputeChange: NS (ITER=2) (NRM,RELC): (  50.062719     0.16477991E-10 ) :: helmholtz equation
HelmholtzSolve: iter:    2 Assembly: (s)    0.79    1.60
HelmholtzSolve: iter:    2 Solve:    (s)    0.02    0.78
ComputeChange: SS (ITER=1) (NRM,RELC): (  50.062719      2.0000000     ) :: helmholtz equation
WritePostFile: Saving results in ElmerPost format to file ./sfvtu
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: comsol_validity_test_2
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_bulk]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver]
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: helmholtz equation
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           1
HelmholtzSolve:  Frequency (Hz):    344.57045179395340
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
: .Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.3402E-01
       2 0.2725E-01
       3 0.1912E-01
       4 0.1783E-01
       5 0.1811E-01
       6 0.1751E-01
       7 0.1735E-01
       8 0.1869E-01
       9 0.1620E-01
      10 0.1275E-01
      11 0.1321E-01
      12 0.8551E-02
      13 0.5657E-02
      14 0.5649E-02
      15 0.6341E-02
      16 0.9238E-02
      17 0.1171E-01
      18 0.2333E-01
      19 0.1933E-01
      20 0.1770E-01
      21 0.1833E-01
      22 0.1838E-01
      23 0.1446E-01
      24 0.9679E-02
      25 0.7796E-02
      26 0.7407E-02
      27 0.7335E-02
      28 0.7116E-02
      29 0.7702E-02
      30 0.6836E-02
      31 0.1047E-01
      32 0.1159E-01
      33 0.1224E-01
      34 0.1517E-01
      35 0.1392E-01
      36 0.8580E-02
      37 0.5585E-02
      38 0.5148E-02
      39 0.5428E-02
      40 0.4680E-02
      41 0.4729E-02
      42 0.5028E-02
      43 0.4112E-02
      44 0.3592E-02
      45 0.3427E-02
      46 0.3437E-02
      47 0.3487E-02
      48 0.3547E-02
      49 0.3680E-02
      50 0.2735E-02
      51 0.1117E-01
      52 0.9568E-02
      53 0.4605E-01
      54 0.4152E-02
      55 0.3718E-02
      56 0.1116E-01
      57 0.1253E-02
      58 0.1911E-02
      59 0.8681E-03
      60 0.1009E-02
      61 0.7287E-03
      62 0.1260E-03
      63 0.9976E-04
      64 0.1264E-04
      65 0.1332E-05
      66 0.5856E-06
      67 0.4271E-06
      68 0.3740E-06
      69 0.6339E-06
      70 0.7906E-07
      71 0.1594E-07
      72 0.1330E-08
      73 0.1314E-08
      74 0.1008E-08
      75 0.1769E-08
      76 0.1434E-08
      77 0.1645E-08
      78 0.8508E-09
      79 0.2771E-10
      79 0.2771E-10
ComputeChange: NS (ITER=1) (NRM,RELC): (  50.015731     0.93901557E-03 ) :: helmholtz equation
HelmholtzSolve: iter:    1 Assembly: (s)    0.74    0.74
HelmholtzSolve: iter:    1 Solve:    (s)    0.56    0.56
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           2
HelmholtzSolve:  Frequency (Hz):    344.57045179395340
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
HelmholtzSolve: Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.8800E-10
       1 0.8800E-10
ComputeChange: NS (ITER=2) (NRM,RELC): (  50.015731     0.33493840E-09 ) :: helmholtz equation
HelmholtzSolve: iter:    2 Assembly: (s)    0.80    1.54
HelmholtzSolve: iter:    2 Solve:    (s)    0.02    0.59
ComputeChange: SS (ITER=1) (NRM,RELC): (  50.015731     0.93901591E-03 ) :: helmholtz equation
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: internalvtuoutputsolver
ResultOutputSolver: -------------------------------------
ResultOutputSolve: Saving with prefix: comsol_validity_test_2
ResultOutputSolver: Creating list for saving - if not present
CreateListForSaving: Field Variables for Saving
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format
VtuOutputSolver: Saving results in VTK XML format with prefix: comsol_validity_test_2
VtuOutputSolver: Saving number of partitions: 1

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F419FB0AE08
#1  0x7F419FB09F90
#2  0x7F419F75A4AF
#3  0x7F419FE66AC1
#4  0x7F419FE6AF22
#5  0x7F418F194AA2
#6  0x7F418F19C67C
#7  0x7F418F1A77B3
#8  0x7F41A0007E1B
#9  0x7F41A001A6A4
#10  0x7F41A01DE33F
#11  0x4010B5 in MAIN__ at Solver.F90:69
elmeruser@cscuser-VirtualBox /media/sf_sharedFolder/SimplePipefromforum/MATCexampleforForum $ 
elmeruser@cscuser-VirtualBox /media/sf_sharedFolder/SimplePipefromforum/MATCexampleforForum $ ElmerSolver
ELMER SOLVER (v 8.3) STARTED AT: 2017/11/06 12:27:24
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: 8.3 (Rev: d56e3b3, Compiled: 2017-09-21)
MAIN:  HYPRE library linked in.
MAIN:  MUMPS library linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: target.sif
LoadInputFile: Scanning input file: target.sif
LoadInputFile: Loading input file: target.sif
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_Init0]
LoadMesh: Base mesh name: ./.
LoadMesh: Elapsed REAL time:     0.1906 (s)
MAIN: -------------------------------------
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: sf
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_Init]
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver_bulk]
Loading user function library: [HelmholtzSolve]...[HelmholtzSolver]
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: helmholtz equation...done.
OptimizeBandwidth: Half bandwidth without optimization: 6298
OptimizeBandwidth: 
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 247
OptimizeBandwidth: ---------------------------------------------------------
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_bulk]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver]
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: helmholtz equation
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           1
HelmholtzSolve:  Frequency (Hz):    695.66625625467452
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
: .Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.2788E-01
       2 0.1700E-01
       3 0.1324E-01
       4 0.1195E-01
       5 0.1215E-01
       6 0.1373E-01
       7 0.1762E-01
       8 0.2815E-01
       9 0.9407E-01
      10 0.6229E-01
      11 0.2421E-01
      12 0.1587E-01
      13 0.1265E-01
      14 0.1137E-01
      15 0.1121E-01
      16 0.1253E-01
      17 0.1142E-01
      18 0.1363E-01
      19 0.1443E-01
      20 0.1862E-01
      21 0.2121E-01
      22 0.2804E-01
      23 0.9545E-01
      24 0.6246E-01
      25 0.9352E-01
      26 0.1653E-01
      27 0.3340E-01
      28 0.3167E-01
      29 0.1204E-01
      30 0.1630E-01
      31 0.1384E-01
      32 0.1570E-01
      33 0.1516E-01
      34 0.1224E-01
      35 0.1049E-01
      36 0.1075E-01
      37 0.1035E-01
      38 0.1120E-01
      39 0.1119E-01
      40 0.1118E-01
      41 0.1119E-01
      42 0.1291E-01
      43 0.1286E-01
      44 0.1331E-01
      45 0.1745E-01
      46 0.1220E+00
      47 0.9200E-02
      48 0.1773E-01
      49 0.1774E-01
      50 0.1016E-01
      51 0.7591E-01
      52 0.3764E-01
      53 0.1810E-01
      54 0.1280E-01
      55 0.2004E-01
      56 0.1046E-01
      57 0.2185E-01
      58 0.1189E-01
      59 0.9999E-01
      60 0.1748E-01
      61 0.1828E-01
      62 0.2105E-01
      63 0.1631E-01
      64 0.1489E-01
      65 0.1658E-01
      66 0.1910E-01
      67 0.2432E-01
      68 0.2003E-01
      69 0.2390E-01
      70 0.3286E-01
      71 0.7093E-01
      72 0.1065E+00
      73 0.1260E-01
      74 0.1761E+00
      75 0.8421E-01
      76 0.8220E-01
      77 0.1473E-01
      78 0.1650E-01
      79 0.3168E-02
      80 0.1616E-01
      81 0.8606E-02
      82 0.6740E-02
      83 0.5317E-02
      84 0.2094E-02
      85 0.1469E-02
      86 0.4997E-03
      87 0.1228E-03
      88 0.5052E-04
      89 0.1843E-04
      90 0.6873E-05
      91 0.4810E-05
      92 0.2189E-05
      93 0.1646E-05
      94 0.8559E-06
      95 0.9275E-06
      96 0.7506E-06
      97 0.1665E-06
      98 0.1124E-06
      99 0.9424E-07
     100 0.5725E-08
     101 0.4871E-08
     102 0.1719E-08
     103 0.1109E-08
     104 0.1047E-08
     105 0.1580E-08
     106 0.5411E-09
     107 0.3458E-09
     108 0.9765E-10
     108 0.9765E-10
ComputeChange: NS (ITER=1) (NRM,RELC): (  50.062719      2.0000000     ) :: helmholtz equation
HelmholtzSolve: iter:    1 Assembly: (s)    0.78    0.78
HelmholtzSolve: iter:    1 Solve:    (s)    0.76    0.76
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           2
HelmholtzSolve:  Frequency (Hz):    695.66625625467452
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
: .Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.4776E-10
       1 0.4776E-10
ComputeChange: NS (ITER=2) (NRM,RELC): (  50.062719     0.16477991E-10 ) :: helmholtz equation
HelmholtzSolve: iter:    2 Assembly: (s)    0.82    1.61
HelmholtzSolve: iter:    2 Solve:    (s)    0.03    0.79
ComputeChange: SS (ITER=1) (NRM,RELC): (  50.062719      2.0000000     ) :: helmholtz equation
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: internalvtuoutputsolver
ResultOutputSolver: -------------------------------------
ResultOutputSolve: Saving with prefix: sf
ResultOutputSolver: Creating list for saving - if not present
CreateListForSaving: Field Variables for Saving
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format
VtuOutputSolver: Saving results in VTK XML format with prefix: sf
VtuOutputSolver: Saving number of partitions: 1
ResultOutputSolver: -------------------------------------
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: sf2
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_bulk]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver]
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: helmholtz equation
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           1
HelmholtzSolve:  Frequency (Hz):    344.57045179395340
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
: .Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.3402E-01
       2 0.2725E-01
       3 0.1912E-01
       4 0.1783E-01
       5 0.1811E-01
       6 0.1751E-01
       7 0.1735E-01
       8 0.1869E-01
       9 0.1620E-01
      10 0.1275E-01
      11 0.1321E-01
      12 0.8551E-02
      13 0.5657E-02
      14 0.5649E-02
      15 0.6341E-02
      16 0.9238E-02
      17 0.1171E-01
      18 0.2333E-01
      19 0.1933E-01
      20 0.1770E-01
      21 0.1833E-01
      22 0.1838E-01
      23 0.1446E-01
      24 0.9679E-02
      25 0.7796E-02
      26 0.7407E-02
      27 0.7335E-02
      28 0.7116E-02
      29 0.7702E-02
      30 0.6836E-02
      31 0.1047E-01
      32 0.1159E-01
      33 0.1224E-01
      34 0.1517E-01
      35 0.1392E-01
      36 0.8580E-02
      37 0.5585E-02
      38 0.5148E-02
      39 0.5428E-02
      40 0.4680E-02
      41 0.4729E-02
      42 0.5028E-02
      43 0.4112E-02
      44 0.3592E-02
      45 0.3427E-02
      46 0.3437E-02
      47 0.3487E-02
      48 0.3547E-02
      49 0.3680E-02
      50 0.2735E-02
      51 0.1117E-01
      52 0.9568E-02
      53 0.4605E-01
      54 0.4152E-02
      55 0.3718E-02
      56 0.1116E-01
      57 0.1253E-02
      58 0.1911E-02
      59 0.8681E-03
      60 0.1009E-02
      61 0.7287E-03
      62 0.1260E-03
      63 0.9976E-04
      64 0.1264E-04
      65 0.1332E-05
      66 0.5856E-06
      67 0.4271E-06
      68 0.3740E-06
      69 0.6339E-06
      70 0.7906E-07
      71 0.1594E-07
      72 0.1330E-08
      73 0.1314E-08
      74 0.1008E-08
      75 0.1769E-08
      76 0.1434E-08
      77 0.1645E-08
      78 0.8508E-09
      79 0.2771E-10
      79 0.2771E-10
ComputeChange: NS (ITER=1) (NRM,RELC): (  50.015731     0.93901557E-03 ) :: helmholtz equation
HelmholtzSolve: iter:    1 Assembly: (s)    0.81    0.81
HelmholtzSolve: iter:    1 Solve:    (s)    0.55    0.55
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           2
HelmholtzSolve:  Frequency (Hz):    344.57045179395340
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
HelmholtzSolve: Assembly:
: .Assembly done
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
CRS_ComplexIncompleteLU: ILU(0) (Complex), Starting Factorization:
CRS_ComplexIncompleteLU: ILU(0) (Complex), NOF nonzeros:    120499
CRS_ComplexIncompleteLU: ILU(0) (Complex), filling (%) :       100
CRS_ComplexIncompleteLU: ILU(0) (Complex), Factorization ready at (s):     0.01
       1 0.8800E-10
       1 0.8800E-10
ComputeChange: NS (ITER=2) (NRM,RELC): (  50.015731     0.33493840E-09 ) :: helmholtz equation
HelmholtzSolve: iter:    2 Assembly: (s)    0.80    1.61
HelmholtzSolve: iter:    2 Solve:    (s)    0.03    0.58
ComputeChange: SS (ITER=1) (NRM,RELC): (  50.015731     0.93901591E-03 ) :: helmholtz equation
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: internalvtuoutputsolver
ResultOutputSolver: -------------------------------------
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F90B49FCE08
#1  0x7F90B49FBF90
#2  0x7F90B464C4AF
#3  0x7F90B4D58A98
#4  0x7F90B4D5CF22
#5  0x7F90A81E0AA2
#6  0x7F90A81E867C
#7  0x7F90A81F37B3
#8  0x7F90B4EF9E1B
#9  0x7F90B4F0C6A4
#10  0x7F90B50D033F
#11  0x4010B5 in MAIN__ at Solver.F90:69
Segmentation fault
elmeruser@cscuser-VirtualBox /media/sf_sharedFolder/SimplePipefromforum/MATCexampleforForum $ 
I am also uploading the complete project. I think.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Automated repetition of Elmer Solver

Post by mzenker »

Hi,

thanks for the report - I think this would have to be analyzed by someone with deeper knowledge of Elmersolver internals. It may be related to the remark in the Solver Manual:
It should be noted that not quite all features support this procedure. For example, some preconditioners
create static structures that will not be recreated.
Matthias
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Automated repetition of Elmer Solver

Post by raback »

Hi

It seems that the vtu output is the culprint. This is rather rarely used feature (to use "RUN" to perform the state of sif file read in so far) that probably the vtu writer has some problems in allocations.

-Peter
Post Reply