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();
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)
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;
+ }
}