+ output_mesh_file.string() +
" >> " + log_file.string();
- std::cout << "Running command: " << std::endl;
- std::cout << cmd << std::endl;
+ MESSAGE("Running command: ");
+ MESSAGE(cmd);
// Writing command in log
std::ofstream flog(log_file.string());
}
}
if(nodeVec.at(nodeIndex) == nullptr){
- std::cout << "Error could not identify id";
- return false;
+ std::cerr << "Error could not identify id";
+ return true;
}
}
vector< const SMDS_MeshNode* >& nodeVec,
NETGENPlugin_NetgenLibWrapper& ngLib)
{
- auto time0 = std::chrono::high_resolution_clock::now();
-
netgen::multithread.terminate = 0;
netgen::Mesh* ngMesh = ngLib._ngMesh;
try
{
OCC_CATCH_SIGNALS;
- auto time0 = std::chrono::high_resolution_clock::now();
ngLib.CalcLocalH(ngMesh);
err = ngLib.GenerateMesh(occgeo, startWith, endWith);
str << " at " << netgen::multithread.task;
error(str);
}
- auto time1 = std::chrono::high_resolution_clock::now();
- auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(time1-time0);
- std::cout << "Time for seq:compute: " << elapsed.count() * 1e-9 << std::endl;
int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh);
}
}
}
- auto time2 = std::chrono::high_resolution_clock::now();
- elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(time2-time1);
- std::cout << "Time for seq:compute: " << elapsed.count() * 1e-9 << std::endl;
-
return !err;
}
strncmp( netgen::multithread.task, volMeshing, 3 ) == 0 ))
{
res = 0.001 + meshingRatio * netgen::multithread.percent / 100.;
- //cout << netgen::multithread.task << " " <<_progressTic << "-" << netgen::multithread.percent << endl;
}
else // different otimizations
{
if ( _progressByTic < 0. )
((NETGENPlugin_NETGEN_3D*)this)->_progressByTic = meshingRatio / _progressTic;
res = _progressByTic * _progressTic;
- //cout << netgen::multithread.task << " " << _progressTic << " " << res << endl;
}
return Min ( res, 0.98 );
}
//Writing hypo
netgen_params aParams;
- std::cout << _hypParameters << std::endl;
fillParameters(_hypParameters, aParams);
exportNetgenParams(param_file.string(), aParams);
flog << cmd << endl;
flog << endl;
}
- //std::cout << "Running command: " << std::endl;
- //std::cout << cmd << std::endl;
+ MESSAGE("Running command: ");
+ MESSAGE(cmd);
// Building arguments for QProcess
if(ret != 0){
// Run crahed
- std::cout << "Issue with command: " << std::endl;
- std::cout << "See log for more details: " << log_file.string() << std::endl;
- std::cout << cmd << std::endl;
+ std::cerr << "Issue with command: " << std::endl;
+ std::cerr << "See log for more details: " << log_file.string() << std::endl;
+ std::cerr << cmd << std::endl;
return false;
}
// Setting number of threads for netgen
myParams.nbThreads = nbThreads;
- std::cout << "Meshing with netgen3d" << std::endl;
+ MESSAGE("Meshing with netgen3d");
int ret = Compute(myShape, *myMesh, myParams,
new_element_file, element_orientation_file,
!output_mesh_file.empty());
if(ret){
- std::cout << "Meshing failed" << std::endl;
+ std::cerr << "Meshing failed" << std::endl;
return ret;
}
if(!output_mesh_file.empty()){
- exportMesh(output_mesh_file, *myMesh, mesh_name);
+ std::string meshName = "MESH";
+ exportMesh(output_mesh_file, *myMesh, meshName);
}
return ret;
{
// Setting all element orientation to false if there no element orientation file
if(_element_orientation_file.empty()){
- std::cout << "No element orientation file" << std::endl;
+ MESSAGE("No element orientation file");
SMDS_ElemIteratorPtr iteratorElem = meshDS->elementsIterator(SMDSAbs_Face);
while ( iteratorElem->more() ) // loop on elements on a geom face
elemOrientation[elem->GetID()] = false;
}
} else {
- std::cout << "Reading from elements from file: " << _element_orientation_file << std::endl;
+ MESSAGE("Reading from elements from file: " << _element_orientation_file);
std::ifstream df(_element_orientation_file, ios::binary|ios::in);
int nbElement;
bool orient;