/usr/bin/msh2geo is in rheolef 6.6-1build2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | #!/bin/sh
#
# This file is part of Rheolef.
#
# Copyright (C) 2000-2009 Pierre Saramito
#
# Rheolef is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Rheolef is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rheolef; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -------------------------------------------------------------------------
#Prog:msh2geo
#NAME: @code{msh2geo} - convert gmsh mesh in geo format
#@cindex mesh
#@toindex msh2geo
#@pindex geo
#@fiindex @file{.msh} gmsh mesh
#@fiindex @file{.geo} mesh
#@toindex @code{gmsh}
#SYNOPSIS:
#@example
# msh2geo [-zr|-rz] @var{input}[.msh] > @var{output}.geo
#@end example
#
#DESCRIPTION:
#Convert a gmsh @file{.msh} into @file{.geo} one.
#The output goes to standart output.
#See the @code{gmsh} documentation for a detailed description
#of the @file{.mshcad} input file for @code{gmsh}.
#EXAMPLES:
#@example
# gmsh -2 toto.mshcad -o toto.msh
# msh2geo toto.msh > toto.geo
#
# gmsh -2 -order 2 toto.mshcad -o toto2.msh
# msh2geo toto2.msh > toto2.geo
#@end example
#COORDINATE SYSTEM OPTION:
#Most of rheolef codes are coordinate-system independant.
#The coordinate system is specified in the geometry file @file{.geo}.
#@table @code
#@cindex axisymmetric coordinate system
#@item -zr
#@itemx -rz
# the 2d mesh is axisymmetric: @code{zr} (resp. @code{rz}) stands when the symmetry is related
# to the first (resp. second) coordinate.
#@end table
#NOTES:
#Pk triangle, when k>=5, may have internal nodes renumbered: from the
#gmsh documentation:
# @example
# The nodes of a curved element are numbered in the following order:
#
# the element principal vertices;
# the internal nodes for each edge;
# the internal nodes for each face;
# the volume internal nodes.
#
# The numbering for face and volume internal nodes is recursive,
# i.e., the numbering follows that of the nodes of an embedded face/volume.
# The higher order nodes are assumed to be equispaced on the element.
# @end example
#
#In rheolef, internal triangle nodes are numbered from left to right and then
#from bottom to top. The numbering differ for triangle when k >= 5.
#Thus, @code{msh2geo} fix the corresponding internal nodes numbering during the
#conversion.
#
#Pk tetrahedrons and hexaedrons in gmsh and rheolef has not the same edge-node order
#nd orientation.
#E.g. for tetrahedrons, edges 13 and 23 should be swaped
#and reoriented as 32 and 31.
#Thus, @code{msh2geo} fix the corresponding internal nodes numbering.
#
#TODO:
#Fix for P3-tetra: swap edges orientations for 3,4,5
#and swap faces 1 and 2. Check P4(T) for face orientation.
#Perform face visualisation with gnuplot face fill.
#
#See also hexa edges orient and faces numbers and orient.
#
#Check that node are numbered by vertex-node, then edge-node, then face(tri,qua)-node and then volume(T,P,H)-node.
#Otherwise, renumber all nodes.
#
#Support for high order >= 6 element ? not documented in gmsh, but gmsh supports it at run
#End:
opts=""
if test $# -eq 0; then
echo "msh2geo: usage: msh2geo [-rz|-zr] file.msgh > file.geo" 1>&2
exit 1
fi
if test x"$1" = x"-rz" -o x"$1" = x"-zr"; then
opts=$1
shift
fi
msh_file=$1
basename=`basename ${msh_file}`
basename=`expr ${msh_file} : '\(.*\).msh' \| ${msh_file}`
if test ! -f ${msh_file}; then
echo "msh2geo: \"${msh_file}\" file not found" 1>&2
exit 1
fi
pkglibdir=`rheolef-config --pkglibdir 2>/dev/null`
$pkglibdir/msh2geo_int $opts < ${msh_file} | geo -geo -check -upgrade -
status=$?
if test $status -ne 0; then
echo "msh2geo: failed." >&2
exit 1
fi
|