0
$\begingroup$

I get 0 node and elements when I use -refine command line flag in gmsh. Explicitly writing RefineMesh; in the script produces the original mesh and not a refined one.

Am I missing something while using refinement feature? I remember command line flag -refine used to work. I am using gmsh after a long a time and I wonder if something has been updated.

Any advice on this issue is most welcome. I am using gmsh version 4.8.4 installed by package manager in Ubuntu-22.04.

The geo script is as follows:

lx = 5.0; // domain length in x-dir
ly = 5.0; // domain length in y-dir

nx = 200; // no of points in x-dir
ny = 200; // no of points in y-dir

Point(1) = {-lx, -ly, 0};
Point(2) = { lx, -ly, 0};
Point(3) = { lx,  ly, 0};
Point(4) = {-lx,  ly, 0};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};

Line Loop(1) = {1,2,3,4};
Plane Surface(1) = {1};

Transfinite Line{1,3} = nx;
Transfinite Line{2,4} = ny;
Transfinite Surface {1} = {1,2,3,4} AlternateLeft ; // "Left", "Right", "AlternateLeft" and "AlternateRight"

Physical Line(1) = {1};  // x dir: left
Physical Line(2) = {2};  // x dir: right
Physical Line(3) = {3};  // y dir: bottom
Physical Line(4) = {4};  // y dir: top
Physical Surface(101) = {1};

RefineMesh;

Best, AB

$\endgroup$
1
  • 1
    $\begingroup$ This is a question for the gmsh forums. $\endgroup$ Commented Dec 10, 2023 at 21:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.