diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 409eb7dff254b2dc99a5727b25669569a6a9acba..67dc6cd1b2bea85fc1771a7559155ef858144497 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1292,7 +1292,8 @@ StringXNumber SolverOptions_Number[] = { "Automatically save the ONELAB database after each computation" }, { F|O, "AutoMesh" , opt_solver_auto_mesh , 1. , "Automatically mesh if necesssary (0: never remesh; 1: on startup, use existing " - "mesh on disk if available; 2: always remesh)" }, + "mesh on disk if available; 2: always remesh; -1: the geometry script creates " + "the mesh)" }, { F|O, "AutoMergeFile" , opt_solver_auto_merge_file , 1. , "Automatically merge result files" }, { F|O, "AutoShowViews" , opt_solver_auto_show_views , 2. , diff --git a/Common/onelabUtils.cpp b/Common/onelabUtils.cpp index 382e7c0d1e623f78af5061043988cfb8a4b35a2e..173b8540621e77ab598913ccc9c75d9681e757bf 100644 --- a/Common/onelabUtils.cpp +++ b/Common/onelabUtils.cpp @@ -326,14 +326,14 @@ namespace onelabUtils { { bool redraw = false; + onelab::server::citer it = onelab::server::instance()->findClient("Gmsh"); + if(it == onelab::server::instance()->lastClient()) return redraw; + // do nothing in case of a python metamodel std::vector<onelab::number> pn; onelab::server::instance()->get(pn, "IsPyMetamodel"); if(pn.size() && pn[0].getValue()) return redraw; - onelab::server::citer it = onelab::server::instance()->findClient("Gmsh"); - if(it == onelab::server::instance()->lastClient()) return redraw; - onelab::client *c = *it; std::string mshFileName = onelabUtils::getMshFileName(c); @@ -343,6 +343,11 @@ namespace onelabUtils { // = 2: mesh and save mesh (e.g. if char length changed) // > 2: reload geometry, mesh and save mesh (other things have changed) + if(meshAuto < 0){ // the geometry creates the mesh + meshAuto = 0; + if(changed) changed = 3; + } + Msg::SetOnelabAction(action); if(action == "initialize"){