Page 1 of 1

Gmsh format reader for restart etc.

Posted: 17 Aug 2020, 14:22
by raback
Hi All,

We faced a need to couple several geometrically ordered parts hierarchically. In order to not be limited to conforming meshes in the interpolation among the different parts we must use some format that comes with the FE mesh as well.

Instead of using some existing Elmer format we opted this time for Gmsh format (current only version 2.0) for which we already had a simple output writer. The good thing in using Gmsh format is that it is widely used and there is a visualisation tool that can deal with it. VTU could also be considered but it would be much harder to read in natively.

So now there is also a very simple tentative Gmsh reader. As for now, it was only meant for this simple case but I could imagine there being further development avenues.

The only test case so far is "Outlet2InletBC". From there one can see how to write Gmsh results

Code: Select all

 Solver 2
  Exec Solver = after all  
  Equation = "GmshOutput"
  Procedure = "ResultOutputSolve" "ResultOutputSolver"
  Output Directory = "."
  Output File Name = case_a.msh
  Gmsh Format = Logical True
  Scalar Field 1 = temperature
End
and then read them in the next simulation the provide BCs

Code: Select all

Solver 2
  Exec Solver = before simulation
  Equation = "GmshReader"
  Procedure = "GmshOutputReader" "GmshOutputReader"
  Output Directory = "."
  Filename = File "case_a.msh"
! This makes the interpolation only to dofs where "Inlet" is set True.
  Mask Name = "Inlet BC"
End

Boundary Condition 4
  ...
  Inlet BC = Logical True
  ...

We are open for comments and ideas.

-Peter

Re: Gmsh format reader for restart etc.

Posted: 25 May 2022, 22:13
by bxyzhu
Hi Peter,

Is it possible to use this reader as an input to a body force?

Thanks,
Brian

Re: Gmsh format reader for restart etc.

Posted: 21 Jun 2022, 14:54
by raback
Hi Brian,

Sorry for the late answer. I think it is coded such that the mask may be in either boundary condition or body force section. So yes.

-Peter

Re: Gmsh format reader for restart etc.

Posted: 09 Aug 2023, 19:22
by Yongmei
Hi Peter,
Apologise if my question has already been answered elsewhere. I have found this entry is the most relevant.
It seems that GmshOutputReader cannot handle results saved from parallel simulations. And there is no way like ´Reduce Parallel = Logical True´ in ResultOutputSolver when saving .msh format.
Is there a work-around to this issue?
Thanks!
Yongmei

Re: Gmsh format reader for restart etc.

Posted: 22 Oct 2023, 00:22
by raback
Hi Youngmei,

I seem to have missed this question. Probably it comes late, sorry for that. Since March this has worked in parallel trivially. Every partition reads all .msh files. Good enough for moderately parallel cases.

See test case: ParallelBoundaryMapGmsh

-Peter