diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 05b4b71a54e183d90c427d23bbd3ba611ce0cc70..2d03cca6fe825d167af7978d7c1230e23b58359c 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -955,6 +955,8 @@ StringXNumber MeshOptions_Number[] = { { F|O, "Explode" , opt_mesh_explode , 1.0 , "Element shrinking factor (between 0 and 1)" }, + { F|O, "FlexibleTransfinite" , opt_mesh_flexible_transfinite , 0 , + "Allow transfinite contraints to be modified for Blossom or by global mesh size factor" }, { F|O, "Format" , opt_mesh_file_format , FORMAT_AUTO , "Mesh output format (1=msh, 2=unv, 10=automatic, 19=vrml, 27=stl, 30=mesh, 31=bdf, " "32=cgns, 33=med, 40=ply2)" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index 851da3d11f2c6b89cbe7bafb0ad8123e247178be..b656f991f5a27ec07507be9040bda6b3481c5424 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -5433,6 +5433,14 @@ double opt_mesh_recombine3d_all(OPT_ARGS_NUM) return CTX::instance()->mesh.recombine3DAll; } +double opt_mesh_flexible_transfinite(OPT_ARGS_NUM) +{ + if(action & GMSH_SET){ + CTX::instance()->mesh.flexibleTransfinite = (int)val; + } + return CTX::instance()->mesh.flexibleTransfinite; +} + double opt_mesh_do_recombination_test(OPT_ARGS_NUM) { if(action & GMSH_SET){ diff --git a/Common/Options.h b/Common/Options.h index c4f8e3246e0df4f3f52ebba53e4bf11d4cfc9c55..87c0dbe202da82d275de4674e7d2a4ed2a2cd91e 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -433,6 +433,7 @@ double opt_mesh_algo3d(OPT_ARGS_NUM); double opt_mesh_algo_recombine(OPT_ARGS_NUM); double opt_mesh_recombine_all(OPT_ARGS_NUM); double opt_mesh_recombine3d_all(OPT_ARGS_NUM); +double opt_mesh_flexible_transfinite(OPT_ARGS_NUM); double opt_mesh_do_recombination_test(OPT_ARGS_NUM); double opt_mesh_recombination_test_start(OPT_ARGS_NUM); double opt_mesh_recombination_no_greedy_strat(OPT_ARGS_NUM); diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index c82d71fef20118c6f8bc64938d77a33f519d4019..901e4b82be38c90256f9013921a433c4833f2864 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -149,6 +149,9 @@ static double F_Transfinite(GEdge *ge, double t_) int type = ge->meshAttributes.typeTransfinite; int nbpt = ge->meshAttributes.nbPointsTransfinite; + if(CTX::instance()->mesh.flexibleTransfinite && CTX::instance()->mesh.lcFactor) + nbpt /= CTX::instance()->mesh.lcFactor; + Range<double> bounds = ge->parBounds(0); double t_begin = bounds.low(); double t_end = bounds.high(); @@ -388,6 +391,8 @@ void meshGEdge::operator() (GEdge *ge) a = Integration(ge, t_begin, t_end, F_Transfinite, Points, CTX::instance()->mesh.lcIntegrationPrecision); N = ge->meshAttributes.nbPointsTransfinite; + if(CTX::instance()->mesh.flexibleTransfinite && CTX::instance()->mesh.lcFactor) + N /= CTX::instance()->mesh.lcFactor; } else{ if (CTX::instance()->mesh.algo2d == ALGO_2D_BAMG || blf){ @@ -410,9 +415,10 @@ void meshGEdge::operator() (GEdge *ge) } // force odd number of points if blossom is used for recombination - if(ge->meshAttributes.method != MESH_TRANSFINITE && + if((ge->meshAttributes.method != MESH_TRANSFINITE || + CTX::instance()->mesh.flexibleTransfinite) && CTX::instance()->mesh.algoRecombine == 1 && N % 2 == 0){ - if(/* 1 ||*/ CTX::instance()->mesh.recombineAll){ + if(CTX::instance()->mesh.recombineAll){ N++; } else{