Error "DefaultInitialize: No matrix exists, cannot initialize!" in Helmholtz Equation

General discussion about Elmer
Post Reply
eramirezwmtech
Posts: 2
Joined: 02 Jul 2023, 07:20
Antispam: Yes

Error "DefaultInitialize: No matrix exists, cannot initialize!" in Helmholtz Equation

Post by eramirezwmtech »

I am trying to perform a simulation using the Helmholtz Equation in Elmer, but I keep encountering an error that I haven't been able to resolve on my own.

The error message is "DefaultInitialize: No matrix exists, cannot initialize!" This appears when I try to run my simulation. The error message points to a problem during the assembly stage of the HelmholtzSolver.

My sif file is:

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "domain"
  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 = simlate1.sif
  Post File = simlate1.ep
End

Constants
  Gravity(3) = 0 -1 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
  Equation = 1
  Material = 1
  Target Bodies(1) = 1
End

Solver 1
  Equation = Helmholtz Equation
  Variable = "Pressure Wave"
  Procedure = "HelmholtzSolve" "HelmholtzSolver"
  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 = 10
  Linear System Precondition Recompute = 1
  Angular Frequency = Real MATC "2*pi*6000"
End

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

Boundary Condition 1
  Target Boundaries(1) = 1 
  Pressure Wave 1 = 0
End

Equation 1
  Name = "Equation 1"
  Active Solvers(1) = 1
End
Code file gmsh for model 2d:

Code: Select all

SetFactory("OpenCASCADE");

Point(1) = {0, -0.1, 0, 1.0};
Point(2) = {0, 0.4, 0, 1.0};
Point(3) = {0.3, 0.4, 0, 1.0};
Point(4) = {0.3, 0.2, 0, 1.0};
Point(5) = {0.4, 0.2, 0, 1.0};
Point(6) = {0.4, 0.1, 0, 1.0};
Point(7) = {0.3, 0.1, 0, 1.0};
Point(8) = {0.3, -0.1, 0, 1.0};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 6};
Line(6) = {6, 7};
Line(7) = {7, 8};
Line(8) = {8, 1};

Line Loop(1) = {1, 2, 3, 4, 5, 6, 7, 8};
Attachments
sim1.msh
Model 2d generate with gmsh
(2.46 KiB) Downloaded 19 times
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Error "DefaultInitialize: No matrix exists, cannot initialize!" in Helmholtz Equation

Post by Rich_B »

Hello,

Running 'elmergrid 14 2 sim1' and running your sif file, gives the same error.

Running 'elmergrid 14 2 sim1 -autoclean' with your sif file, the error is gone, and it runs to completion. When converting from gmsh, one almost always needs to add '-autoclean'.

You may want to change 'Post File = simlate1.ep', which is obsolete, to 'Post File = simlate1.vtu', which gives an output file in vtu format. The results are all zero, probably due to boundary conditions. Looks like you are trying to duplicate the ElmerGUI tutorial 'Helmholtz – 2D – Acoustic Waves – Air in a Cavity', so look there for boundary condition examples.

Rich.
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Error "DefaultInitialize: No matrix exists, cannot initialize!" in Helmholtz Equation

Post by Rich_B »

A little more detail, opening the mesh files created with 'elmergrid 14 2 sim1' in ElmerGUI shows the boundaries without a body defined. That would explain the message 'No matrix exists'.

Note that if the file had been converted using ElmerGUI, then '-autocleaan' would be applied by default. ElmerGUI is valuable for checking geometry, bodies, and boundary conditions, as well as a file converter.

Rich.
eramirezwmtech
Posts: 2
Joined: 02 Jul 2023, 07:20
Antispam: Yes

Re: Error "DefaultInitialize: No matrix exists, cannot initialize!" in Helmholtz Equation

Post by eramirezwmtech »

Thank you all for the help, indeed that was the problem, now the simulation ran without problem and it was able to continue working.
Post Reply