Teuchos::RCP<STK_Interface> CubeTetMeshFactory::buildUncommitedMesh(stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::CubeTetMeshFactory::buildUncomittedMesh()");

   RCP<STK_Interface> mesh = rcp(new STK_Interface(3));

   machRank_ = stk_classic::parallel_machine_rank(parallelMach);
   machSize_ = stk_classic::parallel_machine_size(parallelMach);

   if(xProcs_==-1) {
      // default x only decomposition
      xProcs_ = machSize_; 
      yProcs_ = 1;
      zProcs_ = 1;
   }
   TEUCHOS_TEST_FOR_EXCEPTION(int(machSize_)!=xProcs_*yProcs_*zProcs_,std::logic_error,
                      "Cannot build CubeTetMeshFactory, the product of \"X Procs\", \"Y Procs\", and \"Z Procs\""
                      " must equal the number of processors.");
   procTuple_ = procRankToProcTuple(machRank_);

   // build meta information: blocks and side set setups
   buildMetaData(parallelMach,*mesh);
 
   mesh->addPeriodicBCs(periodicBCVec_);

   return mesh;
}
Teuchos::RCP<STK_Interface> SculptMeshFactory::buildUncommitedMesh(stk_classic::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::SculptMeshFactory::buildUncomittedMesh()");

   RCP<STK_Interface> mesh = rcp(new STK_Interface(3));

   machRank_ = stk_classic::parallel_machine_rank(parallelMach);
   machSize_ = stk_classic::parallel_machine_size(parallelMach);

   procTuple_ = procRankToProcTuple(machRank_);

   //if( machRank_ == 0 )
   {
       // call Sculptor
       char diatom_file[1000];
       writeDiatomFile( stlFileDir_, stlFileName_, diatom_file  );
  
       callSculptor( parallelMach, diatom_file );
   
        // build meta information: blocks and side set setups
        buildMetaData(parallelMach,*mesh);

        mesh->addPeriodicBCs(periodicBCVec_);

   }

//   if( machRank_ == 0 )
//                if(mesh->isWritable())
//                               mesh->writeToExodus("STKSculptMesh.exo");
            

   return mesh;
}
Teuchos::RCP<STK_Interface> LineMeshFactory::buildUncommitedMesh(stk::ParallelMachine parallelMach) const
{
   PANZER_FUNC_TIME_MONITOR("panzer::LineMeshFactory::buildUncomittedMesh()");

   RCP<STK_Interface> mesh = rcp(new STK_Interface(1));

   machRank_ = stk::parallel_machine_rank(parallelMach);
   machSize_ = stk::parallel_machine_size(parallelMach);

   procTuple_ = procRankToProcTuple(machRank_);

   // build meta information: blocks and side set setups
   buildMetaData(parallelMach,*mesh);

   mesh->addPeriodicBCs(periodicBCVec_);
 
   return mesh;
}