Salome HOME
improvement after new version of filtoo
authorsecher <secher>
Wed, 6 Jun 2007 12:34:35 +0000 (12:34 +0000)
committersecher <secher>
Wed, 6 Jun 2007 12:34:35 +0000 (12:34 +0000)
src/FILTER/Filter_Gen_i.cxx

index 4e30125cf3cbb7ae3416fe70dc8eea3631626894..cfd26fe5a5559ecc03ef1b02959aee5bcc4efe3f 100755 (executable)
@@ -389,15 +389,10 @@ void Filter_Gen_i::generateCriteria(CORBA::Long nbthresh,CORBA::Double fthresh,C
 void Filter_Gen_i::createEnsightInputFiles() throw(SALOME_FILTER::FILTER_Gen::FilterError)
 {
   try{
-    MESSAGE("Calculate boundary");
-    // generate MED boundary of geometry
-    SUPPORT *supB = _mesh->getBoundaryElements(MED_FACE);
-
     // call ensight driver MED to generate input ensight mesh ,
     // input ensight boundary mesh and input criteria ensight field for filtoo
     MESSAGE("Create ensight mesh");
     ENSIGHT_MESH_WRONLY_DRIVER myMeshDriver("/tmp/input.case",_mesh);
-    myMeshDriver.addSupport(supB);
     myMeshDriver.open();
     myMeshDriver.write();
     myMeshDriver.close();
@@ -419,7 +414,7 @@ void Filter_Gen_i::filtering() throw(SALOME_FILTER::FILTER_Gen::FilterError)
 
   MESSAGE("call filtoo");
   // send filtoo command
-  command = "cd /tmp;filtoo -f input -o output > /tmp/filter.log";
+  command = "cd /tmp;filtoo -s -m 2 -f input -o output > /tmp/filter.log";
   MESSAGE(command);
   int status = system(command.c_str());
   if(status != 0)
@@ -596,14 +591,25 @@ void Filter_Gen_i::projectFieldsOnDecimateMesh() throw(SALOME_FILTER::FILTER_Gen
 
 void Filter_Gen_i::readMapping()
 {
+  double tmp;
+  string firstline;
   ifstream mapFile("/tmp/output.renum");
 
+  // read first line of file
+  getline(mapFile, firstline);
+
   // read number of vertices to map
-  mapFile >> _nbvmap;
+  string::size_type pos = firstline.find(":");
+  istringstream iss(firstline.substr(pos+1));
+  iss >> _nbvmap;
+
+  // read each vertices in array
   _map = new int[_nbvmap];
   
-  for(int i=0;i<_nbvmap;i++)
-    mapFile >> _map[i];
+  for(int i=0;i<_nbvmap;i++){
+    mapFile >> tmp;
+    _map[i] = (int)tmp;
+  }
 
 }