Skip to content
Snippets Groups Projects
Commit 863b5d83 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Reorganized utils/ directory + added Maya converter from
<kenny@diku.dk>
parent 3949f660
Branches
Tags
No related merge requests found
Showing
with 342 additions and 60 deletions
# $Id: Makefile,v 1.45 2003-03-21 00:52:37 geuzaine Exp $
# $Id: Makefile,v 1.46 2003-05-09 16:29:57 geuzaine Exp $
#
# Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
#
......@@ -22,8 +22,8 @@
include ../variables
LIB = ../lib/libGmshFltk.a
INCLUDE = -I../Common -I../DataStr -I../Graphics -I../Geo\
-I../Mesh -I../Numeric -I../Parser -I../Fltk -I../Plugin -I../utils
INCLUDE = -I../Common -I../DataStr -I../Graphics -I../Geo -I../Mesh\
-I../Numeric -I../Parser -I../Fltk -I../Plugin -I../utils/solvers
CFLAGS = ${OPTIM} ${FLAGS} ${INCLUDE}
SRC = Main.cpp \
......@@ -123,7 +123,7 @@ Colorbar_Window.o: Colorbar_Window.cpp ../Common/Gmsh.h \
GmshServer.o: GmshServer.cpp
Solvers.o: Solvers.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../utils/GmshClient.h GmshServer.h \
../DataStr/avl.h ../DataStr/Tools.h ../utils/solvers/GmshClient.h GmshServer.h \
../Parser/OpenFile.h Solvers.h ../Common/GmshUI.h GUI.h Opengl_Window.h \
Colorbar_Window.h ../Common/ColorTable.h ../Mesh/Mesh.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
......
# $Id: Makefile,v 1.283 2003-04-21 01:38:40 geuzaine Exp $
# $Id: Makefile,v 1.284 2003-05-09 16:29:57 geuzaine Exp $
#
# Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
#
......@@ -59,10 +59,10 @@ variables: configure
source-common:
rm -rf gmsh-${GMSH_RELEASE}
tar zcvf gmsh.tgz `ls TODO README* */README* configure *.in Makefile */Makefile\
*/*.[chylr] */*.[ch]pp */*.rc */*.res */*.ico */*.icns\
*/*.p[lm] */*.sh */*.opt */*.spec`\
doc demos tutorial
tar zcvf gmsh.tgz `ls TODO README* */README* configure *.in *.spec Makefile\
*/Makefile */*.[chylr] */*.[ch]pp */*.rc */*.res */*.ico\
*/*.icns`\
doc demos tutorial utils
mkdir gmsh-${GMSH_RELEASE}
cd gmsh-${GMSH_RELEASE} && tar zxvf ../gmsh.tgz
rm -f gmsh.tgz
......@@ -79,8 +79,8 @@ source-nonfree: source-common
parser:
cd Parser && ${MAKE} parser
utilities:
cd utils && ${MAKE}
converters:
cd utils/converters && ${MAKE}
doc-info:
cd doc/texinfo && ${MAKE} info
......@@ -188,13 +188,14 @@ package-windows:
cp doc/FAQ gmsh-${GMSH_RELEASE}/FAQ.txt
cp doc/CONTRIBUTORS gmsh-${GMSH_RELEASE}/CONTRIBUTORS.txt
cp doc/COPYING gmsh-${GMSH_RELEASE}/COPYING.txt
cd utils && unix2dos ../gmsh-${GMSH_RELEASE}/*.txt
cd utils/misc && unix2dos.bash ../../gmsh-${GMSH_RELEASE}/*.txt
cp -R tutorial gmsh-${GMSH_RELEASE}
cp -R demos gmsh-${GMSH_RELEASE}
rm -rf gmsh-${GMSH_RELEASE}/*/CVS
rm -f gmsh-${GMSH_RELEASE}/*/*.msh
rm -f gmsh-${GMSH_RELEASE}/*/*~
cd utils && unix2dos ../gmsh-${GMSH_RELEASE}/tutorial/* ../gmsh-${GMSH_RELEASE}/demos/*
cd utils/misc && unix2dos.bash ../../gmsh-${GMSH_RELEASE}/tutorial/*\
../../gmsh-${GMSH_RELEASE}/demos/*
cd gmsh-${GMSH_RELEASE} && zip -r gmsh-${GMSH_RELEASE}-Windows.zip *
mv gmsh-${GMSH_RELEASE}/gmsh-${GMSH_RELEASE}-Windows.zip .
......@@ -239,13 +240,13 @@ package-mac:
rpmold:
tar zcvf gmsh-${GMSH_RELEASE}.tar.gz ${GMSH_SOURCES}
mv gmsh-${GMSH_RELEASE}.tar.gz /usr/src/redhat/SOURCES
rpm -bb --define 'gmshversion ${GMSH_RELEASE}' utils/gmsh.spec
rpm -bb --define 'gmshversion ${GMSH_RELEASE}' gmsh.spec
cp /usr/src/redhat/RPMS/i386/gmsh-${GMSH_RELEASE}-?.i386.rpm .
cp /usr/src/redhat/BUILD/gmsh-${GMSH_RELEASE}/gmsh-${GMSH_RELEASE}-${UNAME}.tgz .
rpm:
tar zcvf gmsh-${GMSH_RELEASE}.tar.gz ${GMSH_SOURCES}
mv gmsh-${GMSH_RELEASE}.tar.gz /usr/src/redhat/SOURCES
rpmbuild -bb --define 'gmshversion ${GMSH_RELEASE}' utils/gmsh.spec
rpmbuild -bb --define 'gmshversion ${GMSH_RELEASE}' gmsh.spec
cp /usr/src/redhat/RPMS/i386/gmsh-${GMSH_RELEASE}-?.i386.rpm .
cp /usr/src/redhat/BUILD/gmsh-${GMSH_RELEASE}/gmsh-${GMSH_RELEASE}-${UNAME}.tgz .
$Id: README.mac,v 1.4 2003-03-06 23:01:17 geuzaine Exp $
$Id: README.mac,v 1.5 2003-05-09 16:29:57 geuzaine Exp $
How to make a version recognized by the Mac Finder?
......@@ -17,7 +17,7 @@ The old way (using resource forks):
- a) use the DiskCopy utility to create a disk image (.dmg)
b) you can also create the disk image on the command line, using
utils/make-dmg.sh (WARNING: modify the script to suit your needs)
utils/misc/makedmg.sh (WARNING: modify the script to suit your needs)
The new way:
......
\input texinfo.tex @c -*-texinfo-*-
@c $Id: gmsh.texi,v 1.54 2003-05-06 00:21:23 geuzaine Exp $
@c $Id: gmsh.texi,v 1.55 2003-05-09 16:29:57 geuzaine Exp $
@c
@c Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
@c
......@@ -2055,12 +2055,12 @@ available on @value{GMSH-WEB}.
@cindex Example, solver
Here is a small example of how to interface a C solver with Gmsh. The
following listing reproduces the @file{utils/mysolver.c} file from the Gmsh
source distribution.
following listing reproduces the @file{utils/solvers/mysolver.c} file from
the Gmsh source distribution.
@sp 1
@verbatiminclude ../../utils/mysolver.c
@verbatiminclude ../../utils/solvers/mysolver.c
@sp 1
......@@ -2071,7 +2071,7 @@ options}):
@sp 1
@verbatiminclude ../../utils/mysolver.opt
@verbatiminclude ../../utils/solvers/mysolver.opt
@c =========================================================================
@c Post-processing module
......@@ -3106,10 +3106,10 @@ please enable full warnings for your compiler (e.g.@: add @code{-Wall} to
@item
always use the @code{Msg()} function to print information, errors, @dots{};
@item
indent your files using @file{utils/indent.sh};
indent your files using @file{utils/misc/indent.sh};
@item
if working on Windows, don't leave tabs in your files (e.g.@: untabify them
with @file{utils/untabify}).
with @file{utils/misc/untabify.sh}).
@end enumerate
@sp 2
......
......@@ -31,7 +31,7 @@ and/or post-processor.
%build
make distrib-unix
make utilities
make converters
make doc-pdf
make doc-info
rm -rf CVS */CVS */*/CVS
......
#!/bin/sh
if [ $# -lt 1 ] ; then
echo "Usage: addId files" 1>&2
exit 1
else
# echo "/* \$Id\$ */" > _tmp_string_
echo "# \$Id\$" > _tmp_string_
# echo "c \$Id\$" > _tmp_string_
for file in $@; do
echo Modifying $file
mv $file $file~
cat _tmp_string_ $file~ > $file
done
rm -f _tmp_string_
fi
Windows elap15.montefiore.ulg.ac.be
Linux elap21.montefiore.ulg.ac.be
TRU64 elap53.montefiore.ulg.ac.be
IRIX elap20.montefiore.ulg.ac.be
SunOS montef01.montefiore.ulg.ac.be
HP-UX stokes.ltas.ulg.ac.be
AIX sp2s.ulg.ac.be
Where to change the version number?
1) Makfile
2) doc/VERSIONS
3) doc/gmsh.html
# $Id: Makefile,v 1.1 2003-05-09 16:29:58 geuzaine Exp $
#
# Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
#
# This program 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.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "gmsh@geuz.org".
include ../../variables
dxf2geo: dxf2geo.c message.c
${CXX} ${OPTIM} -o ../../bin/dxf2geo -I../../DataStr\
dxf2geo.c message.c ../../lib/libGmshDataStr.a -lm
clean:
rm -f *.o
depend:
true
// $Id: dxf2geo.c,v 1.7 2003-03-21 00:52:49 geuzaine Exp $
// $Id: dxf2geo.c,v 1.1 2003-05-09 16:29:59 geuzaine Exp $
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
......
/***********************************************************
This mel script was written based on the
MEL How-to by Joey Ponthieux (Video
Applications Group, NASA Langley Research
Center).
@see
http://www.ewertb.com/maya/mel/mel_a55.html
***********************************************************/
global proc string[] edgeVertexOrder( string $inputEdge, string $inputFace )
{
string $edgeVertexOrder[];
string $vertexOrder[];
// Note: polyListComponentConversion will return the components relative
// to the TRANSFORM node. You may want to add an assertion/conversion
// for the input arguments so they are relative to a transform.
// If the input arguments are shape-relative then this procedure will FAIL.
// Get vertex order of face
string $vtxFace[] = `polyListComponentConversion -fromFace -toVertexFace $inputFace`;
// Use filterExpand to individualize each .vtxFace component in $vtxFace
$vtxFace = `filterExpand -sm 70 -expand true $vtxFace`;
for ( $vf in $vtxFace )
{
// Get vertex for this vtxFace
string $vertex[] = `polyListComponentConversion -fromVertexFace -toVertex $vf`;
// And append to our result
$vertexOrder[ size($vertexOrder) ] = $vertex[0];
}
// Now, check each vertex pair to see if it matches the specified edge
for ( $v = 0; $v < size($vertexOrder); $v++ )
{
int $nextVtx = ( $v < ( size($vertexOrder) - 1 ) ? $v + 1 : 0 );
// Use two successive vertices to derive internal edge
string $edge[] = `polyListComponentConversion -fromVertex -toEdge
-internal $vertexOrder[$v] $vertexOrder[$nextVtx]`;
// Does this match?
if ( $edge[0] == $inputEdge )
{
$edgeVertexOrder[0] = $vertexOrder[$v];
$edgeVertexOrder[1] = $vertexOrder[$nextVtx];
// As soon as a match is found we can stop looking.
break;
}
}
// Warn if $inputEdge not found in $inputFace
if ( size( $edgeVertexOrder ) == 0 )
warning ( $inputEdge + " is not part of " + $inputFace );
return $edgeVertexOrder;
}
//-----------------------------------------------------------------
//
// Copyright (c) 2003
//
// Department of Computer Science
// University of Copenhagen
// (DIKU)
//
// and
//
// School of Dentistry, Dept. of Pediatric Dentistry
// University of Copenhagen
// (3DLab)
//
// All Rights Reserved.
//
// This software is provided as is WITHOUT ANY WARRANTY; Use it on
// your own risk.
//
// Please send remarks, questions and bug reports to simulation@diku.dk
//
//-------------------------------------------------------------------
/**
* Maya to gmsh export MEL script.
* How to use:
*
* 1) Add mel-script to your script path
* 2) write for instance
*
* "gmsh pCube1 0.5 myfile.geo"
*
* on the command line (in Maya)
*
* This mel script uses the auxiliary script
* edgeVertexOrder.mel. Most of the mel code
* was written based on the MEL How-to by Joey
* Ponthieux (Video Applications Group, NASA
* Langley Research Center
*
* @see
*
* http://www.ewertb.com/maya/mel/mel_a55.html
*
* @param obj
* @param length
* @param fileName
*/
global proc gmsh(string $obj, float $length, string $fileName)
{
if ($length <= 0)
{
error "length must be positive!";
}
if( !`objExists $obj` )
{
error "No object of that name!";
}
string $notPoly = "Nothing counted : no polygonal object is selected.";
if(`polyEvaluate -fmt -v $obj` == $notPoly)
{
error "Only works on polygons!";
}
string $out = "";
int $fileID = `fopen $fileName "w"`;
$out = "\n//--- Characteristic Length ---------\n\n";
fprint $fileID $out;
$out = "\tlength =" + $length +";\n";
fprint $fileID $out;
int $region = 100;
$out = "\n//--- vertices of mesh " + $obj + "--------------\n\n";
fprint $fileID $out;
//--- Get number of vertices in mesh
int $vertexCount[] = `polyEvaluate -v $obj`;
for ($i=0; $i < $vertexCount[0]; ++$i)
{
//--- get coordinates of the i'th vertex
float $coords[] = eval("pointPosition " +$obj + ".vtx["+$i+"]");
$out = "\tPoint(" +($i+1)+ ") = {" +$coords[0]+ "," +$coords[1]+ "," +$coords[2]+ ",length} ;\n";
fprint $fileID $out;
}
$out = "\n//--- edges of mesh " + $obj + "--------------\n\n";
fprint $fileID $out;
//--- Get number of edges in mesh
int $edgeCount[] = `polyEvaluate -e $obj`;
for ($i=0; $i < $edgeCount[0]; ++$i)
{
//--- get indices of the end nodes
string $edge = $obj + ".e["+$i+"]";
string $attr[] = `listAttr $edge`;
int $idxA = match( "[0-9]+", $attr[0] );
int $idxB = match( "[0-9]+", $attr[4] );
$out = "\tLine(" +($i+1)+ ") = {" +($idxA+1)+ "," +($idxB+1)+ "} ;\n";
fprint $fileID $out;
}
$out = "\n\tn = " + $edgeCount[0] + " ; // Last edge index \n" ;
fprint $fileID $out;
$out = "\n//--- faces of mesh " + $obj + "--------------\n\n";
fprint $fileID $out;
int $faceCount[] = `polyEvaluate -f $obj`;
int $count = 0;
for ($i=0; $i < $faceCount[0]; ++$i)
{
string $facet = $obj + ".f["+$i+"]";
string $vtxFace[] = `polyListComponentConversion -fromFace -toVertexFace $facet`;
$vtxFace = `filterExpand -sm 70 -expand true $vtxFace`;
// Array's to store our result
string $edgeOrder[];
int $edges[];
int $numEdges = 0;
for ( $vf in $vtxFace )
{
// Get edge for this vtxFace
string $edge[] = `polyListComponentConversion -fromVertexFace -toEdge $vf`;
$edge = `filterExpand -sm 32 -expand true $edge`;
// And append to our result
string $tmpStr = $edge[0];
$edgeOrder[ $numEdges ] = $tmpStr;
// Hack to get rid of object name, which includes a number as well
$tmpStr = match( "\[[0-9]+\]", $tmpStr );
$edges[ $numEdges ] = match( "[0-9]+", $tmpStr );
$edges[ $numEdges ] = $edges[ $numEdges ] +1; // converting to gmsh idx
// Check order of vertices in edge for this face
string $attr[] = `listAttr $edge[0]`;
int $storedIdxA = match( "[0-9]+", $attr[0] );
int $storedIdxB = match( "[0-9]+", $attr[4] );
string $res[] = `edgeVertexOrder $edge[0] $facet`;
if ( size($res) > 0)
{
string $tmpIdxA = match( "\[[0-9]+\]", $res[0] );
string $tmpIdxB = match( "\[[0-9]+\]", $res[1] );
int $idxA = match( "[0-9]+", $tmpIdxA );
int $idxB = match( "[0-9]+", $tmpIdxB );
if ( $idxA == $storedIdxB && $idxB == $storedIdxA )
$edges[ $numEdges ] = - $edges[ $numEdges ];
}
$numEdges++;
}
$out = "\tLine Loop(n+"+ ($count+1) +") = {"+($edges[0]);
for( $k = 1; $k < $numEdges; ++$k)
{
$out = $out + "," + ($edges[$k]) ;
}
$out = $out + "};\n";
fprint $fileID $out;
$out = "\tPlane Surface(n+"+ ($count+2) +") = {n+"+ ($count+1) +"} ;\n\n" ;
fprint $fileID $out;
$count = $count + 2 ;
}
$out = "\tm = n +" +$count+ " ; // Last face index \n";
fprint $fileID $out;
$out = "\n//--- Mesh " +$obj+ "---------------------------------------\n\n";
fprint $fileID $out;
string $faceIndices = "n+2";
for ($i=1; $i < $faceCount[0]; ++$i)
{
$faceIndices = $faceIndices + ",n+" + (($i+1)*2);
}
$out = "\tSurface Loop(m+1) = {" +$faceIndices+ "} ;\n";
fprint $fileID $out;
$out = "\tVolume(m+2) = {m+1} ;\n";
fprint $fileID $out;
$out = "\n//--- Set region number of mesh " +$obj+ "---------------------\n\n";
fprint $fileID $out;
$out = "\tMyRegionNumber = " + $region + " ;\n";
fprint $fileID $out;
$out = "\tPhysical Volume (MyRegionNumber) = {m+2} ;\n";
fprint $fileID $out;
string $fullPath = `file -q -exn $fileName`;
fclose $fileID;
print ("Done writing gmsh geometry file: "+$fullPath+"\n");
}
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment