From dcecf05ccff517b9ee1a778175469634d7f9c739 Mon Sep 17 00:00:00 2001 From: secher Date: Wed, 6 Jun 2007 12:34:35 +0000 Subject: [PATCH] improvement after new version of filtoo --- src/FILTER/Filter_Gen_i.cxx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/FILTER/Filter_Gen_i.cxx b/src/FILTER/Filter_Gen_i.cxx index 4e30125..cfd26fe 100755 --- a/src/FILTER/Filter_Gen_i.cxx +++ b/src/FILTER/Filter_Gen_i.cxx @@ -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; + } } -- 2.39.2