[Gmsh] PostView format and background mesh

Geordie McBain gdmcbain at freeshell.org
Tue Jul 30 02:17:55 CEST 2013


2013/7/30 j s <j.s4403 at gmail.com>:
> Hello,
>
> I would like to create a background mesh using the postview format.
> Is there documentation for this format online?
>
> I found bgmesh.pos here:
> http://fossies.org/linux/privat/gmsh-2.8.2-source.tgz:a/gmsh-2.8.2-source/tutorial/bgmesh.pos
>
> For 2D, and 3D, can I just use Node Values (1 coordinate per
> characteristic length)?
>
> Are the 3 values for each coordinate "node" characteristic lengths or
> "direction" coordinate lengths?
>
> It took me a while to discover from the online manual that the "pos"
> extension has nothing to do with the legacy format?

Rather that try and understand another format, when I wanted to do the
same thing (create a background mesh), I saved my data in the .msh
format (which I already understood, following its description in the
manual) and then used Gmsh to convert it from .msh to .pos.

Specifically, I use a couple of Make-rules:

#%<--
%.geo: %.msh
	@echo "Merge '$<';\nSave View[0] '$(subst msh,pos,$<)';" > $@
%.pos: %.geo %.msh
	gmsh -0 $<
	@rm -f $(subst geo,geo_unrolled,$<)
#--->%

But you don't need Make; basically, given data in data.msh, write
data.geo which contains

#%<---
Merge 'data.msh';
Save View[0] 'data.pos';
#--->%

and call it with "gmsh -0 data.1.geo" from the command line. This
produces data.pos, which is what is sought, and data.geo_unrolled,
which can be ignored and discarded.