[Gmsh] Reduce number of digits in key-format file

Winfried Boxleitner winfried.boxleitner at ait.ac.at
Fri Mar 20 12:23:09 CET 2020


dear Christophe,
my awk-script is meant as an example only, howto modify the msh-file
after creation. for users not familiar to commandline tools however, this
is not useful. I personally have no problems with the current format.
remark: until now I only used msh version 2, because this can be used
together with FreeFem.


Winfried

On Fri, 20 Mar 2020, Christophe Geuzaine wrote:

>
>
>> On 20 Mar 2020, at 07:59, Winfried Boxleitner <winfried.boxleitner at ait.ac.at> wrote:
>>
>> dear Xingsheng,
>> if you are used to commandline you can modify my awk-script to fit your needs.
>>
>> to format the mesh file use the following command:
>> awk -f pretty_print_msh.awk input.msh > output.msh
>>
>
> Do you mean that we should use %12.6g in our KEY export?
>
> Christophe
>
>
>> the awk-script is attached
>>
>> best regards,
>> Winfried
>>
>>
>> On Thu, 19 Mar 2020, Xingsheng Sun wrote:
>>
>>> Hello All,
>>>
>>> I am using Gmsh to generate the mesh file for Ls-dyna. The problem is that
>>> in the key-format file generated by Gmsh, the coordinates of nodes have too
>>> many digits. For instance, in the node information:
>>>
>>> *NODE
>>> 22, 0, 0.012499999999976, -0.001
>>> 23, 0, 0.02499999999995, -0.001
>>> 24, 0, 0.037499999999926, -0.001
>>> 25, 0, 0.049999999999907, -0.001
>>>
>>> the y-coordinates of nodes 22-25 have 15 digits that cannot be read by
>>> Ls-dyna.
>>>
>>> So could any people shed light on how to reduce the number of digits in
>>> Gmsh? I am using command lines, not GUI. Thank you so much in advance.
>>>
>>> Best regards,
>>> Xingsheng
>>>
>>
>>
>>  ______________________________________________________________________
>> /
>> | Winfried Boxleitner
>> | Scientist
>> | AIT Austrian Institute of Technology GmbH
>> \______________________________________________________________________<pretty_print_msh.awk>_______________________________________________
>> gmsh mailing list
>> gmsh at onelab.info
>> http://onelab.info/mailman/listinfo/gmsh
>
>> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science
> http://www.montefiore.ulg.ac.be/~geuzaine
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Digital Signature
URL: <http://onelab.info/pipermail/gmsh/attachments/20200320/5b87c9b9/attachment.asc>


More information about the gmsh mailing list