ElmerGrid -autoclean replaces boundary names

General discussion about Elmer
Post Reply
giesbrecht
Posts: 5
Joined: 24 Apr 2023, 19:53
Antispam: Yes

ElmerGrid -autoclean replaces boundary names

Post by giesbrecht »

Hello! I'm relatively new to using Gmsh and Elmer, and I'm trying to assign volume and surface names in Gmsh that will persist in ElmerSolver as body and boundary names, respectively.

When I convert mesh-pcb.msh with ElmerGrid -autoclean, the custom body names ("Board" and "Copper") persist in mesh.names and entities.sif, but my two custom surface names ("voltage" and "load") are removed from both mesh.names and entities.sif.

When I don't use -autoclean, the surface names from Gmsh appear correctly as boundaries in mesh.names and entities.sif, but I get the following warnings in ElmerSolver, and my simulation results aren't correct (expect a potential gradient across the copper).

Code: Select all

ELMER SOLVER (v 9.0) STARTED AT: 2023/04/24 10:59:39
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: Release, Compiled: 2023-03-05)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN:  Lua interpreter linked in.
MAIN:  External optimization routines linked in.
MAIN: =============================================================
MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: .\elmer-sim.sif
 Caught LUA error:...0-Release/share/elmersolver/lua-scripts/defaults.lua:58: r
LoadInputFile: Scanning input file: .\elmer-sim.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: .\elmer-sim.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 2
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: ./mesh-pcb
ReadTargetNames: Reading names info from file: ./mesh-pcb/mesh.names
WARNING:: ReadTargetNames: Could not map name to Body nor BC: board
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc7
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc8
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc9
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc10
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc11
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc12
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc13
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc14
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc15
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc16
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc17
WARNING:: ReadTargetNames: Could not map name to Body nor BC: surf_bc18
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc19
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc20
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc21
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc22
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc23
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc24
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc25
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc26
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc27
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc28
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc29
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc30
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc31
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc32
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc33
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc34
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc35
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc36
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc39
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc40
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc41
WARNING:: ReadTargetNames: Could not map name to Body nor BC: line_bc42
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc43
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc44
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc45
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc46
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc47
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc48
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc49
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc50
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc51
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc52
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc53
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc54
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc55
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc56
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc57
WARNING:: ReadTargetNames: Could not map name to Body nor BC: node_bc58
LoadMesh: Elapsed REAL time:     0.0710 (s)
MAIN: -------------------------------------
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: case
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: electrostatics...done.
OptimizeBandwidth: Half bandwidth without optimization: 411
OptimizeBandwidth:
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 43
OptimizeBandwidth: ---------------------------------------------------------
MAIN: Number of timesteps to be saved: 1
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN:
StatCurrentSolve: -------------------------------------
StatCurrentSolve: STAT CURRENT SOLVER:
StatCurrentSolve: -------------------------------------
StatCurrentSolve:  Assembly (s)          :   7.0000000000000062E-003
SolveLinearSystem: Solution trivially zero!
StatCurrentSolve:  Solve (s)             :   0.0000000000000000
StatCurrentSolve:  Total Heating Power   :   0.0000000000000000
ComputeChange: SS (ITER=1) (NRM,RELC): (  0.0000000      0.0000000     ) :: electrostatics
ResultOutputSolver: -------------------------------------
ResultOutputSolver: Saving with prefix: case
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: case
VtuOutputSolver: Saving number of partitions: 1
ResultOutputSolver: -------------------------------------
MAIN: *** Elmer Solver: ALL DONE ***
MAIN: The end
SOLVER TOTAL TIME(CPU,REAL):         0.18        0.18
ELMER SOLVER FINISHED AT: 2023/04/24 10:59:39
Any help to get the surface names in Gmsh to persist as boundary names and simulate correctly would be greatly appreciated!

Cheers,
Daniel
Attachments
run_without_autoclean.zip
Mesh was generated with ElmerGrid
(874.72 KiB) Downloaded 25 times
autoclean.zip
Mesh was generated with ElmerGrid -autoclean
(868.89 KiB) Downloaded 25 times
giesbrecht
Posts: 5
Joined: 24 Apr 2023, 19:53
Antispam: Yes

Re: ElmerGrid -autoclean replaces boundary names

Post by giesbrecht »

I seem to have answered my own question: when exporting from Gmsh, I was selecting Export>Gmsh format>Version 2 ASCII, ticking "save all elements". When I unticked "save all elements" this worked: running ElmerGrid -autoclean preserved my custom body names AND my surface names.

I was confused because when previewing the mesh in ElmerGUI, only the boundary surfaces were showing up. This lead me to think that I needed to use "save all elements" in Gmsh. It turns out, the sim works fine with only the boundary conditions needed set as physical surfaces in Gmsh.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: ElmerGrid -autoclean replaces boundary names

Post by kevinarden »

1. This is a gmsh feature, it will only save named bodies, surface, and edges, unless you tick save all elements on. Best practice is to name all elements that you want to avoid the down stream confusion. If you tick save all then Elmer will put all of the unamed elements into a body, surface, or edge depending on your -autoclean option. In 3D, named volume elements become bodies, and named surface elements become boundaries. In 2D named surface elements become bodies, and named edges become boundaries. In gmsh if you name all bodies and boundaries, then in ElmerGRid use -autoclean every thing comes out nice. Note, that you can open the msh file directly into ElmerGUI and it runs ElmerGrid with autoclean.

2. In 3D, ElmerGUI uses the boundary(surface) elements to display the bodies. If you want to see the volume elements there is an option to turn them on. Depending on how you created your mesh and boundaries, you could have a correct functional mesh that doesn't display well in ElmerGUI because GUI uses the boundary surfaces to display the bodies, doesn't happen a lot but it can happen. When it happens it sometimes confuses users.
Post Reply