[cig-commits] r21396 - in seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView: . mesh2vtu

elliott.sales.de.andrade at geodynamics.org elliott.sales.de.andrade at geodynamics.org
Mon Feb 25 23:37:16 PST 2013


Author: elliott.sales.de.andrade
Date: 2013-02-25 23:37:15 -0800 (Mon, 25 Feb 2013)
New Revision: 21396

Removed:
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu.pl
Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number.pl
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number2.pl
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/cell2vtu.pl
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/mesh2vtu.pl
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/points2vtu.pl
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/surf2vtu.pl
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/plot_movie_GMT_binary_VTK.pl
Log:
Use relative paths in VTK perl files.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -4,8 +4,9 @@
 #  uses xglobal_slice_number and xnormal_plane, compile first from global_slice_util/
 # Qinya Liu, May 2007, Caltech
 
-# modify the following line for the correct location of perl libs (UTILS/lib)
-use lib '/opt/seismo-util/lib/perl';
+# modify the following line for the correct location of perl libs (utils/lib)
+use FindBin;
+use lib "$FindBin::Bin/../../lib/";
 use CMT_TOOLS;
 
 if (@ARGV != 3) {die("Usage: global_slice_number.pl CMTSOLUTION STATIONS_ADJOINT Par_file\n");}

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number2.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number2.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/global_slice_number2.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -5,8 +5,9 @@
 #  uses xglobal_slice_number and xnormal_plane, compile first from global_slice_util/
 #  Qinya Liu, Caltech, May 2007
 
-# modify the following line for the correct location of perl libs (UTILS/lib)
-use lib '/opt/seismo-util/lib/perl';
+# modify the following line for the correct location of perl libs (utils/lib)
+use FindBin;
+use lib "$FindBin::Bin/../../lib";
 use CMT_TOOLS;
 
 if (@ARGV != 4) {die("Usage: global_slice_number.pl CMTSOLUTION STATIONS_ADJOINT Par_file lat_belt_width (in degrees)\n");}

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/cell2vtu.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/cell2vtu.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/cell2vtu.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -1,15 +1,13 @@
 #!/usr/bin/perl
 
 use Getopt::Std;
-use File::Basename;
+use FindBin;
 
-$progname = basename($0);
-$cell2vtu = "/opt/seismo-util/source/cell2vtu/cell2vtu";
-$REQLIBS  = "env LD_LIBRARY_PATH=/opt/seismo-util/lib/vtk";
+$cell2vtu = "$FindBin::Bin/cell2vtu";
 
 sub Usage {
     print STDERR <<END;
-Usage: $progname -i input-file -o output-file
+Usage: $0 -i input-file -o output-file
     Takes an input file (binary) with a number of points and a number of cells
     and transforms them into an unstructured grid file
 
@@ -41,12 +39,12 @@
 if(!getopts('i:o:')){die "Check input paramaters \n";}
 
 if(!defined($opt_i)) {
-    die "$progname: Must specify input file -i input-file\n";
+    die "$0: Must specify input file -i input-file\n";
 }
 if(!defined($opt_o)) {
-    die "$progname: Must specify output file -o output-file\n";
+    die "$0: Must specify output file -o output-file\n";
 }
-#print "$REQLIBS $cell2vtu $opt_i $opt_o\n";
-system("$REQLIBS $cell2vtu $opt_i $opt_o");
+#print "$cell2vtu $opt_i $opt_o\n";
+system("$cell2vtu $opt_i $opt_o");
 
 1;

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/mesh2vtu.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/mesh2vtu.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/mesh2vtu.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -1,15 +1,13 @@
 #!/usr/bin/perl
 
 use Getopt::Std;
-use File::Basename;
+use FindBin;
 
-$progname = basename($0);
-$mesh2vtu = "/opt/seismo-util/source/mesh2vtu/mesh2vtu";
-$REQLIBS  = "env LD_LIBRARY_PATH=/opt/seismo-util/lib/vtk";
+$mesh2vtu = "$FindBin::Bin/mesh2vtu";
 
 sub Usage {
     print STDERR <<END;
-Usage: $progname -i input-file -o output-file
+Usage: $0 -i input-file -o output-file
     Takes an input file (binary) with a number of points and a number of cells
     and transforms them into an unstructured grid file
 
@@ -41,12 +39,12 @@
 if(!getopts('i:o:')){die "Check input paramaters \n";}
 
 if(!defined($opt_i)) {
-    die "$progname: Must specify input file -i input-file\n";
+    die "$0: Must specify input file -i input-file\n";
 }
 if(!defined($opt_o)) {
-    die "$progname: Must specify output file -o output-file\n";
+    die "$0: Must specify output file -o output-file\n";
 }
-#print "$REQLIBS $mesh2vtu $opt_i $opt_o\n";
-system("$REQLIBS $mesh2vtu $opt_i $opt_o");
+#print "$mesh2vtu $opt_i $opt_o\n";
+system("$mesh2vtu $opt_i $opt_o");
 
 1;

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/points2vtu.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/points2vtu.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/points2vtu.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -1,16 +1,14 @@
 #!/usr/bin/perl
 
 use Getopt::Std;
-use File::Basename;
+use FindBin;
 use POSIX;
 
-$progname = basename($0);
-$ugrid    = "/opt/seismo-util/source/mesh2vtu/ugrid_pts";
-$REQLIBS  = "env LD_LIBRARY_PATH=/opt/seismo-util/lib/vtk";
+$ugrid = "$FindBin::Bin/ugrid_pts";
 
 sub Usage {
     print STDERR <<END;
-Usage: $progname -i input-file -o output-file
+Usage: $0 -i input-file -o output-file
     Takes an input file (ascii) with a number of points
     and transforms them into an unstructured grid file
 
@@ -24,7 +22,7 @@
       ...
       x_n y_n z_n scalar_n   
 
-    This is a wrapper around $ugrid
+    This is a wrapper around ugrid_pts
 
     Brian Savage 6/26/2004
     
@@ -39,12 +37,12 @@
 if(!getopts('i:o:L')){die "Check input paramaters \n";}
 
 if(!defined($opt_i)) {
-    die "$progname: Must specify input file -i input-file\n";
+    die "$0: Must specify input file -i input-file\n";
 }
 if(!defined($opt_o)) {
-    die "$progname: Must specify output file -o output-file\n";
+    die "$0: Must specify output file -o output-file\n";
 }
-#print "$REQLIBS $ugrid $opt_i $opt_o\n";
+#print "$ugrid $opt_i $opt_o\n";
 if($opt_L){
   open(FILE, "$opt_i");
   @lines = <FILE>;
@@ -59,10 +57,10 @@
     print OUT "@pt $mag\n";
   }
   print "Running ugrid\n";
-  system("$REQLIBS $ugrid points2vtu.tempfile $opt_o");
+  system("$ugrid points2vtu.tempfile $opt_o");
 }
 else{
-  system("$REQLIBS $ugrid $opt_i $opt_o");
+  system("$ugrid $opt_i $opt_o");
 }
 
 1;

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/surf2vtu.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/surf2vtu.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu/surf2vtu.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -1,15 +1,13 @@
 #!/usr/bin/perl
 
 use Getopt::Std;
-use File::Basename;
+use FindBin;
 
-$progname = basename($0);
-$surf2vtu = "/opt/seismo-util/source/mesh2vtu/surf2vtu";
-$REQLIBS  = "env LD_LIBRARY_PATH=/opt/seismo-util/lib/vtk";
+$surf2vtu = "$FindBin::Bin/surf2vtu";
 
 sub Usage {
     print STDERR <<END;
-Usage: $progname -i input-file -o output-file
+Usage: $0 -i input-file -o output-file
     Takes an input file (binary) with a number of points and a number of cells
     and transforms them into an unstructured grid file
 
@@ -42,12 +40,12 @@
 if(!getopts('i:o:')){die "Check input paramaters \n";}
 
 if(!defined($opt_i)) {
-    die "$progname: Must specify input file -i input-file\n";
+    die "$0: Must specify input file -i input-file\n";
 }
 if(!defined($opt_o)) {
-    die "$progname: Must specify output file -o output-file\n";
+    die "$0: Must specify output file -o output-file\n";
 }
-#print "$REQLIBS $surf2vtu $opt_i $opt_o\n";
-system("$REQLIBS $surf2vtu $opt_i $opt_o");
+#print "$surf2vtu $opt_i $opt_o\n";
+system("$surf2vtu $opt_i $opt_o");
 
 1;

Deleted: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/mesh2vtu.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -1,55 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-use File::Basename;
-
-$progname = basename($0);
-
-### Please modify the following variables according to your own system setting ###
-$mesh2vtu = "/opt/seismo-util/source/mesh2vtu/mesh2vtu";
-$REQLIBS  = "env LD_LIBRARY_PATH=/opt/seismo-util/lib/vtk";
-#################################################################################
-
-sub Usage {
-    print STDERR <<END;
-Usage: $progname -i input-file -o output-file
-    Takes an input file (binary) with a number of points and a number of cells
-    and transforms them into an unstructured grid file
-
-    -i input-file (Binary file)
-    -o output-file (XML Unstructured Grid File)
-
-    Input Binary files have this structure:
-      number_of_points          integer (4 bytes)
-      x_1, y_1, z_1, scalar_1   4 reals (4 bytes each)
-      ...
-      x_n, y_n, z_n, scalar_n   4 reals (4 bytes each)
-      number_of_cells           integer (4 bytes)
-      cell_1 (eight points)     8 integers (4 bytes each)
-      ...
-      cell_n                    8 integers (4 bytes each)
-
-    This is a wrapper around mesh2vtu
-
-    Brian Savage 6/26/2004
-    
-END
-    exit(-1);
-}
-
-if(@ARGV == 0) {
-    Usage ();
-}
-
-if(!getopts('i:o:')){die "Check input paramaters \n";}
-
-if(!defined($opt_i)) {
-    die "$progname: Must specify input file -i input-file\n";
-}
-if(!defined($opt_o)) {
-    die "$progname: Must specify output file -o output-file\n";
-}
-#print "$REQLIBS $mesh2vtu $opt_i $opt_o\n";
-system("$REQLIBS $mesh2vtu $opt_i $opt_o");
-
-1;

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/plot_movie_GMT_binary_VTK.pl
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/plot_movie_GMT_binary_VTK.pl	2013-02-26 00:26:54 UTC (rev 21395)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/VTK_ParaView/plot_movie_GMT_binary_VTK.pl	2013-02-26 07:37:15 UTC (rev 21396)
@@ -12,9 +12,9 @@
 sub Usage {
   print STDERR <<EOF;
   
-Usage: plot_movie_GMT_binary_VTK.pl file_name
+Usage: $0 file_name
   
-  ex. ./plot_movie_GMT_binary_VTK.pl OUTPUT_FILES/bin_movie_00***.d
+  ex. $0 OUTPUT_FILES/bin_movie_00***.d
   
 EOF
 exit(1)



More information about the CIG-COMMITS mailing list