[MOAB-dev] r5428 - MOAB/trunk/tools/mbzoltan

jain at mcs.anl.gov jain at mcs.anl.gov
Tue Mar 13 17:08:02 CDT 2012


Author: jain
Date: 2012-03-13 17:08:02 -0500 (Tue, 13 Mar 2012)
New Revision: 5428

Modified:
   MOAB/trunk/tools/mbzoltan/mbpart.cpp
Log:

o Change option -l or --sets_l to be able to load multiple material sets for partitioning. 
o Note: Material set id's must be seperated by commas.


Modified: MOAB/trunk/tools/mbzoltan/mbpart.cpp
===================================================================
--- MOAB/trunk/tools/mbzoltan/mbpart.cpp	2012-03-13 19:33:07 UTC (rev 5427)
+++ MOAB/trunk/tools/mbzoltan/mbpart.cpp	2012-03-13 22:08:02 UTC (rev 5428)
@@ -34,6 +34,7 @@
 
   Core moab;
   Interface& mb = moab;
+  std::vector<int> set_l;
   
   LONG_DESC << "This utility invokes the MBZoltan componemnt of MOAB/CGM"
     "to partition a mesh/geometry." << std::endl
@@ -60,7 +61,7 @@
   opts.addOpt<void>( "ghost,h", "Specify if partition ghost geometry body.");
   opts.addOpt<int>( "vertex_w,v", "Number of weights associated with a graph vertex.");
   opts.addOpt<int>( "edge_w,e", "Number of weights associated with an edge.");
-  opts.addOpt<int>( "set_l,l", "Load material set with id.");
+  opts.addOpt("set_l,l", "Load material set(s) with specified ids (comma seperated) for partition", &set_l);
   opts.addRequiredArg<int>( "#parts", "Number of parts in partition" );
   opts.addRequiredArg<std::string>( "input_file", "Mesh/geometry to partition" );
   opts.addRequiredArg<std::string>( "output_file", "File to which to write partitioned mesh/geometry" );
@@ -78,7 +79,7 @@
   int power = -1;
   int obj_weight = -1;
   int edge_weight = -1;
-  int set_l = -1;
+  bool load_msets = false;
   bool print_time = opts.getOpt<void>(",T",0);
   
   // check if partition geometry, if it is, should get mesh size for the geometry
@@ -145,9 +146,10 @@
     }
   }
 
-  if (opts.getOpt( "set_l", &set_l )) {
-    if (set_l < 0.0) {
-      std::cerr << set_l << ": invalid setid/setid not found" << std::endl;
+  if (opts.getOpt( "set_l,l", &set_l )) {
+    load_msets = true;
+    if (set_l.size() <= 0) {
+      std::cerr << " No material set id's to load" << std::endl;
       return 1;
     }
   }
@@ -159,7 +161,7 @@
   const char* options = NULL;
   ErrorCode rval;
   if (part_geom_mesh_size > 0.) options = "FACET_DISTANCE_TOLERANCE=0.1";
-  if(set_l == -1){	  
+  if(load_msets == false){	  
     rval = mb.load_file( input_file.c_str(), 0, options );


More information about the moab-dev mailing list