[Gmsh] Adding attractor nodes to mesh

Daniel Juncu daj22 at hi.is
Fri Aug 1 16:48:41 CEST 2014


Hello,
I think i have a really simple question but somehow i can't get to the bottom of this.

I have simple cuboid volume, and in its interior a couple of points around which i refine the mesh. 
Problem: When i do the meshing, those attractor nodes are not used for any elements. Is there a way i can change that?

Here is what i do:

**************************************************************
lc = 15e-1;

xSize = 30.;
ySize = 30.;
zSize = -3.5;


Point(1) = {0., 0., 0., lc};
Point(2) = {xSize, 0.,  0., lc} ;
Point(3) = {xSize, ySize, 0., lc} ;
Point(4) = {0.,  ySize, 0., lc} ;
Point(5) = {0., 0., zSize, lc};
Point(6) = {xSize, 0.,  zSize, lc} ;
Point(7) = {xSize, ySize, zSize, lc} ;
Point(8) = {0.,  ySize, zSize, lc} ;

// locations for mesh refinement
Point(9) = {13.018,15.607,-1.682, lc};
Point(10) = {11.088,16.628,-1.693, lc};
Point(11) = {11.647,15.751,-1.759, lc};
Point(12) = {11.325,14.867,-2.27, lc};
Point(13) = {12.116,15.432,-1.604, lc};
Point(14) = {11.663,15.719,-1.39, lc};
Point(15) = {11.293,14.887,-1.637, lc};
Point(16) = {12.126,15.488,-1.611, lc};
Point(17) = {10.53,14.164,-1.538, lc};
Point(18) = {11.256,14.869,-1.725, lc};
Point(19) = {11.709,15.692,-1.397, lc};
Point(20) = {12.056,15.484,-1.533, lc};
Point(21) = {10.624,14.216,-1.461, lc};
Point(22) = {12.379,17.083,-2.587, lc};
Point(23) = {13.04,17.127,-1.885, lc};
Point(24) = {10.863,16.097,-2.167, lc};
Point(25) = {10.555,14.135,-1.914, lc};
Point(26) = {11.989,17.291,-2.285, lc};
Point(27) = {13.037,15.656,-2.124, lc};
Point(28) = {12.436,17.094,-2.498, lc};
Point(29) = {10.942,14.895,-2.541, lc};
Point(30) = {10.957,14.913,-3.322, lc};
Point(31) = {10.9,16.073,-2.157, lc};
Point(32) = {11.986,17.375,-2.326, lc};
Point(33) = {10.95,14.904,-2.164, lc};
Point(34) = {11.034,16.784,-2.444, lc};
Point(35) = {10.594,14.156,-2.241, lc};
Point(36) = {12.008,17.38,-1.896, lc};
Point(37) = {12.011,15.464,-1.955, lc};
Point(38) = {13.038,15.645,-2.329, lc};
Point(39) = {12.014,15.475,-1.341, lc};


//exterior lines 
Line(1) = {1,2} ;
Line(2) = {3,2} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;
Line(5) = {1,5} ;
Line(6) = {2,6} ;
Line(7) = {3,7} ;
Line(8) = {4,8} ;
Line(9) = {5,6} ;
Line(10) = {7,6} ;
Line(11) = {7,8} ;
Line(12) = {8,5} ;

//exterior areas
Line Loop(1) = {4,1,-2,3} ; //front
Line Loop(2) = {12,9,-10,11} ; //back
Line Loop(3) = {4,5,-12,-8}; //left
Line Loop(4) = {2,6,-10,-7}; // right
Line Loop(5) = {5,9,-6,-1}; //bottom
Line Loop(6) = {7,11,-8,-3};//top

Plane Surface(1) = {1} ;
Plane Surface(2) = {2} ;
Plane Surface(3) = {3} ;
Plane Surface(4) = {4} ;
Plane Surface(5) = {5} ;
Plane Surface(6) = {6} ;

// Define Volume
Surface Loop(1) = {1,4,6,-2,-3,-5};
Volume(1) = {1};


// refine mesh locally using attractor field
Field[1] = Attractor;
Field[1].NodesList = {9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39};

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc / 10.;
Field[2].LcMax = lc;
Field[2].DistMin = lc / 4.;
Field[2].DistMax = 2.*lc;

// Use minimum of all the fields as the background field
Field[3] = Min;
Field[3].FieldsList = {2};
Background Field = 3;

// Don't extend the elements sizes from the boundary inside the domain

Mesh.CharacteristicLengthExtendFromBoundary = 0;

**************************************************************

Thanks, Daniel