[Gmsh] Attractor inside volume
Octavio Castillo Reyes
ocastilloreyes at gmail.com
Thu Feb 16 15:02:04 CET 2017
Dear all, I'm working with gmsh in order to build a mesh for geophysical
simulation.
My model is compose by 4 layers. Each interface layer needs different mesh
spacing. Furthermore, I need include local refinement at some point, e.g.
point 101. However the attractor does not work. My script is the following:
lc = 5e-01;
lc2 = 1e-01;
lc3 = 2e-01;
lc4 = 3e-01;
// Model dimensions
MIN_X = -0.80000000;
MAX_X = 4.30000000;
MIN_Y = 0.00000000;
MAX_Y = 3.50000000;
MIN_Z = -3.50000000;
MAX_Z = 0.00000000;
// Source position
SRC_X = 1.75000000;
SRC_Y = 1.75000000;
SRC_Z = -0.97500000;
// Number of receivers
num_receivers = 58;
// Offset for sources and receivers
offset = 5e-02;
// #################################################################
// # Define main points #
// #################################################################
Point (1) = {MIN_X, MAX_Y, MIN_Z, lc};
Point (2) = {MAX_X, MAX_Y, MIN_Z, lc};
Point (3) = {MAX_X, MIN_Y, MIN_Z, lc};
Point (4) = {MIN_X, MIN_Y, MIN_Z, lc};
Point (5) = {MIN_X, MAX_Y, -2.10000000, lc2};
Point (6) = {0.05000000, MAX_Y, -2.10000000, lc2};
Point (7) = {0.90000000, MAX_Y, -2.10000000, lc2};
Point (8) = {1.75000000, MAX_Y, -2.10000000, lc2};
Point (9) = {2.60000000, MAX_Y, -2.10000000, lc2};
Point (10) = {3.45000000, MAX_Y, -2.10000000, lc2};
Point (11) = {MAX_X, MAX_Y, -2.10000000, lc2};
Point (12) = {MAX_X, 2.9167, -2.10000000, lc2};
Point (13) = {MAX_X, 2.3333, -2.10000000, lc2};
Point (14) = {MAX_X, 1.7500, -2.10000000, lc2};
Point (15) = {MAX_X, 1.1667, -2.10000000, lc2};
Point (16) = {MAX_X, 0.5833, -2.10000000, lc2};
Point (17) = {MAX_X, MIN_Y, -2.10000000, lc2};
Point (18) = {3.45000000, MIN_Y, -2.10000000, lc2};
Point (19) = {2.60000000, MIN_Y, -2.10000000, lc2};
Point (20) = {1.75000000, MIN_Y, -2.10000000, lc2};
Point (21) = {0.90000000, MIN_Y, -2.10000000, lc2};
Point (22) = {0.05000000, MIN_Y, -2.10000000, lc2};
Point (23) = {MIN_X, MIN_Y, -2.10000000, lc2};
Point (24) = {MIN_X, 0.5833, -2.10000000, lc2};
Point (25) = {MIN_X, 1.1667, -2.10000000, lc2};
Point (26) = {MIN_X, 1.7500, -2.10000000, lc2};
Point (27) = {MIN_X, 2.3333, -2.10000000, lc2};
Point (28) = {MIN_X, 2.9167, -2.10000000, lc2};
Point (29) = {MIN_X, MAX_Y, -2.00000000, lc2};
Point (30) = {0.05000000, MAX_Y, -2.00000000, lc2};
Point (31) = {0.90000000, MAX_Y, -2.00000000, lc2};
Point (32) = {1.75000000, MAX_Y, -2.00000000, lc2};
Point (33) = {2.60000000, MAX_Y, -2.00000000, lc2};
Point (34) = {3.45000000, MAX_Y, -2.00000000, lc2};
Point (35) = {MAX_X, MAX_Y, -2.00000000, lc2};
Point (36) = {MAX_X, 2.9167, -2.00000000, lc2};
Point (37) = {MAX_X, 2.3333, -2.00000000, lc2};
Point (38) = {MAX_X, 1.7500, -2.00000000, lc2};
Point (39) = {MAX_X, 1.1667, -2.00000000, lc2};
Point (40) = {MAX_X, 0.5833, -2.00000000, lc2};
Point (41) = {MAX_X, MIN_Y, -2.00000000, lc2};
Point (42) = {3.45000000, MIN_Y, -2.00000000, lc2};
Point (43) = {2.60000000, MIN_Y, -2.00000000, lc2};
Point (44) = {1.75000000, MIN_Y, -2.00000000, lc2};
Point (45) = {0.90000000, MIN_Y, -2.00000000, lc2};
Point (46) = {0.05000000, MIN_Y, -2.00000000, lc2};
Point (47) = {MIN_X, MIN_Y, -2.00000000, lc2};
Point (48) = {MIN_X, 0.5833, -2.00000000, lc2};
Point (49) = {MIN_X, 1.1667, -2.00000000, lc2};
Point (50) = {MIN_X, 1.7500, -2.00000000, lc2};
Point (51) = {MIN_X, 2.3333, -2.00000000, lc2};
Point (52) = {MIN_X, 2.9167, -2.00000000, lc2};
Point (53) = {MIN_X, MAX_Y, -1.00000000, lc3};
Point (54) = {0.05000000, MAX_Y, -1.00000000, lc3};
Point (55) = {0.90000000, MAX_Y, -1.00000000, lc3};
Point (56) = {1.75000000, MAX_Y, -1.00000000, lc3};
Point (57) = {2.60000000, MAX_Y, -1.00000000, lc3};
Point (58) = {3.45000000, MAX_Y, -1.00000000, lc3};
Point (59) = {MAX_X, MAX_Y, -1.00000000, lc3};
Point (60) = {MAX_X, 2.9167, -1.00000000, lc3};
Point (61) = {MAX_X, 2.3333, -1.00000000, lc3};
Point (62) = {MAX_X, 1.7500, -1.00000000, lc3};
Point (63) = {MAX_X, 1.1667, -1.00000000, lc3};
Point (64) = {MAX_X, 0.5833, -1.00000000, lc3};
Point (65) = {MAX_X, MIN_Y, -1.00000000, lc3};
Point (66) = {3.45000000, MIN_Y, -1.00000000, lc3};
Point (67) = {2.60000000, MIN_Y, -1.00000000, lc3};
Point (68) = {1.75000000, MIN_Y, -1.00000000, lc3};
Point (69) = {0.90000000, MIN_Y, -1.00000000, lc3};
Point (70) = {0.05000000, MIN_Y, -1.00000000, lc3};
Point (71) = {MIN_X, MIN_Y, -1.00000000, lc3};
Point (72) = {MIN_X, 0.5833, -1.00000000, lc3};
Point (73) = {MIN_X, 1.1667, -1.00000000, lc3};
Point (74) = {MIN_X, 1.7500, -1.00000000, lc3};
Point (75) = {MIN_X, 2.3333, -1.00000000, lc3};
Point (76) = {MIN_X, 2.9167, -1.00000000, lc3};
Point (77) = {MIN_X, MAX_Y, 0.00000000, lc};
Point (78) = {0.05000000, MAX_Y, 0.00000000, lc};
Point (79) = {0.90000000, MAX_Y, 0.00000000, lc};
Point (80) = {1.75000000, MAX_Y, 0.00000000, lc};
Point (81) = {2.60000000, MAX_Y, 0.00000000, lc};
Point (82) = {3.45000000, MAX_Y, 0.00000000, lc};
Point (83) = {MAX_X, MAX_Y, 0.00000000, lc};
Point (84) = {MAX_X, 2.9167, 0.00000000, lc};
Point (85) = {MAX_X, 2.3333, 0.00000000, lc};
Point (86) = {MAX_X, 1.7500, 0.00000000, lc};
Point (87) = {MAX_X, 1.1667, 0.00000000, lc};
Point (88) = {MAX_X, 0.5833, 0.00000000, lc};
Point (89) = {MAX_X, MIN_Y, 0.00000000, lc};
Point (90) = {3.45000000, MIN_Y, 0.00000000, lc};
Point (91) = {2.60000000, MIN_Y, 0.00000000, lc};
Point (92) = {1.75000000, MIN_Y, 0.00000000, lc};
Point (93) = {0.90000000, MIN_Y, 0.00000000, lc};
Point (94) = {0.05000000, MIN_Y, 0.00000000, lc};
Point (95) = {MIN_X, MIN_Y, 0.00000000, lc};
Point (96) = {MIN_X, 0.5833, 0.00000000, lc};
Point (97) = {MIN_X, 1.1667, 0.00000000, lc};
Point (98) = {MIN_X, 1.7500, 0.00000000, lc};
Point (99) = {MIN_X, 2.3333, 0.00000000, lc};
Point (100) = {MIN_X, 2.9167, 0.00000000, lc};
// #################################################################
// # Layer 1: Sediments #
// #################################################################
// Side 1
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};
// Vertical (first level)
Line (5) = {2,11};
Line (6) = {3,17};
Line (7) = {4,23};
Line (8) = {1,5};
// Side 2
Line (9) = {5,6};
Line (10) = {6,7};
Line (11) = {7,8};
Line (12) = {8,9};
Line (13) = {9,10};
Line (14) = {10,11};
Line Loop (2) = {9,10,11,12,13,14,-5,-1,8};
Plane Surface (2) = {2};
// Side 3
Line (15) = {11,12};
Line (16) = {12,13};
Line (17) = {13,14};
Line (18) = {14,15};
Line (19) = {15,16};
Line (20) = {16,17};
Line Loop (3) = {15,16,17,18,19,20,-6,-2,5};
Plane Surface (3) = {3};
// Side 4
Line (21) = {17,18};
Line (22) = {18,19};
Line (23) = {19,20};
Line (24) = {20,21};
Line (25) = {21,22};
Line (26) = {22,23};
Line Loop (4) = {21,22,23,24,25,26,-7,-3,6};
Plane Surface (4) = {4};
// Side 5
Line (27) = {23,24};
Line (28) = {24,25};
Line (29) = {25,26};
Line (30) = {26,27};
Line (31) = {27,28};
Line (32) = {28,5};
Line Loop (5) = {27,28,29,30,31,32,-8,-4,7};
Plane Surface (5) = {5};
// Side 6
Line Loop (6) = {9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32};
Plane Surface (6) = {6};
// Define Volume
Surface Loop (1) = {1,2,3,4,5,6};
Volume (1) = {1};
Physical Volume ("Sediments2", 4) = {1};
// #################################################################
// # Layer 2: Oil #
// #################################################################
// Vertical (Second level)
Line (33) = {5,29};
Line (34) = {11,35};
Line (35) = {17,41};
Line (36) = {23,47};
// Side 1
Line (37) = {29,30};
Line (38) = {30,31};
Line (39) = {31,32};
Line (40) = {32,33};
Line (41) = {33,34};
Line (42) = {34,35};
Line Loop (7) = {37,38,39,40,41,42,-34,-9,-10,-11,-12,-13,-14,33};
Plane Surface (7) = {7};
// Side 2
Line (43) = {35,36};
Line (44) = {36,37};
Line (45) = {37,38};
Line (46) = {38,39};
Line (47) = {39,40};
Line (48) = {40,41};
Line Loop (8) = {43,44,45,46,47,48,-35,-15,-16,-17,-18,-19,-20,34};
Plane Surface (8) = {8};
// Side 3
Line (49) = {41,42};
Line (50) = {42,43};
Line (51) = {43,44};
Line (52) = {44,45};
Line (53) = {45,46};
Line (54) = {46,47};
Line Loop (9) = {49,50,51,52,53,54,-36,-21,-22,-23,-24,-25,-26,35};
Plane Surface (9) = {9};
// Side 4
Line (55) = {47,48};
Line (56) = {48,49};
Line (57) = {49,50};
Line (58) = {50,51};
Line (59) = {51,52};
Line (60) = {52,29};
Line Loop (10) = {55,56,57,58,59,60,-33,-27,-28,-29,-30,-31,-32,36};
Plane Surface (10) = {10};
// Side 5
Line Loop (11) = {37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,
54,55,56,57,58,59,60};
Plane Surface (11) = {11};
// Define Volume
Surface Loop (2) = {6,7,8,9,10,11};
Volume (2) = {2};
Physical Volume ("Oil", 3) = {2};
// #################################################################
// # Layer 3: Sediments #
// #################################################################
// Vertical (Third level)
Line (61) = {29,53};
Line (62) = {35,59};
Line (63) = {41,65};
Line (64) = {47,71};
// Side 1
Line (65) = {53,54};
Line (66) = {54,55};
Line (67) = {55,56};
Line (68) = {56,57};
Line (69) = {57,58};
Line (70) = {58,59};
Line Loop (12) = {65,66,67,68,69,70,-62,-37,-38,-39,-40,-41,-42,61};
Plane Surface (12) = {12};
// Side 2
Line (71) = {59,60};
Line (72) = {60,61};
Line (73) = {61,62};
Line (74) = {62,63};
Line (75) = {63,64};
Line (76) = {64,65};
Line Loop (13) = {71,72,73,74,75,76,-63,-43,-44,-45,-46,-47,-48,62};
Plane Surface (13) = {13};
// Side 3
Line (77) = {65,66};
Line (78) = {66,67};
Line (79) = {67,68};
Line (80) = {68,69};
Line (81) = {69,70};
Line (82) = {70,71};
Line Loop (14) = {77,78,79,80,81,82,-64,-49,-50,-51,-52,-53,-54,63};
Plane Surface (14) = {14};
// Side 4
Line (83) = {71,72};
Line (84) = {72,73};
Line (85) = {73,74};
Line (86) = {74,75};
Line (87) = {75,76};
Line (88) = {76,53};
Line Loop (15) = {83,84,85,86,87,88,-61,-55,-56,-57,-58,-59,-60,64};
Plane Surface (15) = {15};
// Side 5
Line Loop (16) = {65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,
82,83,84,85,86,87,88};
Plane Surface (16) = {16};
// Define Volume
Surface Loop (3) = {11,12,13,14,15,16};
Volume (3) = {3};
Physical Volume ("Sediments1", 2) = {3};
// #################################################################
// # Layer 4: Water #
// #################################################################
// Vertical (Fourth level)
Line (89) = {53,77};
Line (90) = {59,83};
Line (91) = {65,89};
Line (92) = {71,95};
// Side 1
Line (93) = {77,78};
Line (94) = {78,79};
Line (95) = {79,80};
Line (96) = {80,81};
Line (97) = {81,82};
Line (98) = {82,83};
Line Loop (17) = {93,94,95,96,97,98,-90,-65,-66,-67,-68,-69,-70,89};
Plane Surface (17) = {17};
// Side 2
Line (99) = {83,84};
Line (100) = {84,85};
Line (101) = {85,86};
Line (102) = {86,87};
Line (103) = {87,88};
Line (104) = {88,89};
Line Loop (18) = {99,100,101,102,103,104,-91,-71,-72,-73,-74,-75,-76,90};
Plane Surface (18) = {18};
// Side 3
Line (105) = {89,90};
Line (106) = {90,91};
Line (107) = {91,92};
Line (108) = {92,93};
Line (109) = {93,94};
Line (110) = {94,95};
Line Loop (19) = {105,106,107,108,109,110,-92,-77,-78,-79,-80,-81,-82,91};
Plane Surface (19) = {19};
// Side 4
Line (111) = {95,96};
Line (112) = {96,97};
Line (113) = {97,98};
Line (114) = {98,99};
Line (115) = {99,100};
Line (116) = {100,77};
Line Loop (20) = {111,112,113,114,115,116,-89,-83,-84,-85,-86,-87,-88,92};
Plane Surface (20) = {20};
// Side 5
Line Loop (21) = {93,94,95,96,97,98,99,100,101,102,103,104,105,
106,107,108,109,110,111,112,113,114,115,116};
Plane Surface (21) = {21};
// Define Volume
Surface Loop (4) = {16,17,18,19,20,21};
Volume (4) = {4};
Physical Volume ("Water", 1) = {4};
// #################################################################
// # Local refinement and scaling #
// #################################################################
// Source
Point (101) = {SRC_X, SRC_Y, SRC_Z+offset, lc4};
Point{101} In Volume{4};
// Local refinement for sources
Field[1] = Attractor;
Field[1].NodesList = {101};
Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = lc4 / 18.;
Field[2].LcMax = lc4;
Field[2].DistMin = lc4 / 4.;
Field[2].DistMax = 2.*lc4;
// 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;
// Scale mesh to real dimensions
Mesh.ScalingFactor = 10000;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20170216/a16c9770/attachment-0001.html>
More information about the gmsh
mailing list