[SOLVED] ElmerGUI VS ElmerGrid: Different Results

The graphical user interface of Elmer
Post Reply
CrocoDuck
Posts: 81
Joined: 12 May 2016, 13:15
Antispam: Yes

[SOLVED] ElmerGUI VS ElmerGrid: Different Results

Post by CrocoDuck »

Hi guys!

I am working on an ear canal model. I can import the mesh file easily with ElmerGUI and setup my simulation normally. It all seems to work fine.

However, I am now trying to script it all with pyelmer. Since pyelmer doesn't seem to handle UNV format I have used:

Code: Select all

ElmerGrid 8 2 ear-canal-40-kHz.unv -autoclean
This works without error. However, if I try to run my simulation I get:

Code: Select all

ELMER SOLVER (v 9.0) STARTED AT: 2024/04/01 16:57:59
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: unknown, Compiled: 2024-03-28)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN:  HYPRE library linked in.
MAIN:  MUMPS library linked in.
MAIN:  Lua interpreter linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
LoadInputFile: Scanning input file: case.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: case.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 3
LoadInputFile: Number of Body Forces: 0
LoadInputFile: Number of Initial Conditions: 0
LoadInputFile: Number of Materials: 1
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 1
LoadInputFile: Number of Bodies: 1
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by area
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by volume
ElmerAsciiMesh: Base mesh name: ./.
MapCoordinates: Scaling coordinates: 1.000E-03 1.000E-03 1.000E-03
LoadMesh: Elapsed REAL time:     1.1891 (s)
MAIN: -------------------------------------
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: case
MAIN: Number of timesteps to be saved: 1
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
HelmholtzSolve: 
HelmholtzSolve: -------------------------------------
HelmholtzSolve:  Helmholtz iteration           1
HelmholtzSolve:  Frequency (Hz):    5000.0000000000000
HelmholtzSolve: -------------------------------------
HelmholtzSolve: 
HelmholtzSolve: Starting Assembly
ERROR:: DefaultInitialize: No matrix exists, cannot initialize!
STOP 1

Also, if I try to load the converted mesh in ElmerGUI it will crash:

Code: Select all

Loading from directory /home/administrator/CA/ear-canal-1/study/output/5000.0_Hz_(1+0j)_mps
Loading elmer mesh files
Summary:
Nodes: 13756
Point elements: 0
Edge elements: 3120
Surface elements: 7904
Volume elements: 68637
Found 11856 edges on boundary
Segmentation fault (core dumped)
Upon inspection, I found that:
  • ElmerGrid generates the additional files entities.sif and mesh.names
  • All the rest of the files are generated by both programs, and they are all identical except for mesh.header
From ElmerGrid:

Code: Select all

13756  68637  11024 
3     
202    3120  
303    7904  
504    68637 
From ElmerGUI:

Code: Select all

13756 68637 7904
2
303 7904
504 68637
The sif generated by my script will work fine with the mesh generated by ElmerGUI. Any idea? I feel like I should pass some additional magic parameters to ElmerGrid, but I haven't figured out what they are yet.
Last edited by CrocoDuck on 01 Apr 2024, 22:43, edited 1 time in total.
kevinarden
Posts: 2319
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: ElmerGUI VS ElmerGrid: Different Results

Post by kevinarden »

You did not use -autoclean you used -autocleam

assert subprocess.run(
['ElmerGrid', '8', '2', msh_path.absolute().as_posix(), '-autocleam'],
cwd=dst

Also note that ElmerGrid puts the mesh in a subfolder by default, so you have to tell elmer where he mesh is in the sif.
CrocoDuck
Posts: 81
Joined: 12 May 2016, 13:15
Antispam: Yes

Re: ElmerGUI VS ElmerGrid: Different Results

Post by CrocoDuck »

Oh... It is always the typos that get me... that was sneaky. Thanks @kevinarden!

My code works now :D .
Post Reply