Galerkin FEM for elliptic PDEs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

toroid.geo 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 02/04/2016 02:58:54 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2016, University of Utah
  15. * @copyright Copyright (c) 2016, Lemma Software, LLC
  16. */
  17. radius = 3.25; // Radius of the damn thing
  18. blc = radius/2; // 0.25; // Target element size
  19. Box = 3*radius; // The down side of potential
  20. lc = radius/10; // toroid characteristic length
  21. ts = 1; // height of toroid
  22. tx = radius; // radial width of toroid, measured in centre of ring
  23. tl = 0; // centre of rotation
  24. // Total Solution Space
  25. X0 = -Box;
  26. X1 = Box;
  27. Y0 = -Box;
  28. Y1 = Box;
  29. Z0 = -Box;
  30. Z1 = Box;
  31. /////////////////////////////////////
  32. // Large Bounding box
  33. pp = newp;
  34. Point(pp) = {X0, Y0, Z0, blc};
  35. Point(pp+1) = {X1, Y0, Z0, blc};
  36. Point(pp+2) = {X1, Y1, Z0, blc};
  37. Point(pp+3) = {X0, Y1, Z0, blc};
  38. lv = newl;
  39. Line(lv) = {pp,pp+1};
  40. Line(lv+1) = {pp+1,pp+2};
  41. Line(lv+2) = {pp+2,pp+3};
  42. Line(lv+3) = {pp+3,pp};
  43. Line Loop(lv+4) = {lv, lv+1, lv+2, lv+3};
  44. bs = news;
  45. Plane Surface(bs) = {lv+4};
  46. v[] = Extrude {0, 0, Z1-Z0} { Surface{bs}; };
  47. tpp = newp;
  48. Point(tpp ) = { tx, 0, 0, lc};
  49. Point(tpp+1) = { ts+tx, 0, 0, lc};
  50. Point(tpp+2) = { tx, ts, 0, lc};
  51. Point(tpp+3) = { tx, -ts, 0, lc};
  52. Point(tpp+4) = {-ts+tx, 0, 0, lc};
  53. cc = newc;
  54. Circle(cc ) = {tpp+1, tpp, tpp+2};
  55. Circle(cc+1) = {tpp+2, tpp, tpp+4};
  56. Circle(cc+2) = {tpp+4, tpp, tpp+3};
  57. Circle(cc+3) = {tpp+3, tpp, tpp+1};
  58. ll = newll;
  59. Line Loop(ll) = {cc, cc+1, cc+2, cc+3};
  60. rs = news;
  61. Ruled Surface (rs) = {ll};
  62. //Surface Loop(rs) = {ll};
  63. ps = news;
  64. Plane Surface(ps) = {ll};
  65. tv1[] = Extrude {{0, 1, 0},{-tl,0,0}, 2*Pi/3} { Surface{ps}; };
  66. //tv2[] = Extrude {{0, 1, 0},{-tl,0,0}, 2*Pi/3} { Surface{28}; };
  67. //tv3[] = Extrude {{0, 1, 0},{-tl,0,0}, 2*Pi/3} { Surface{50}; };
  68. //Extrude Surface {ps, {0,1,0}, {-tl,0,0}, 2*Pi/3};// { Recombine ;};
  69. //Extrude Surface {28, {0,1,0}, {-tl,0,0}, 2*Pi/3}; //{Layers{10,73,1};};
  70. //Extrude Surface {50, {0,1,0}, {-tl,0,0}, 2*Pi/3}; //{Layers{10,73,1};};
  71. /* Make a list of a ring (annulus) of surfaces around the hole */
  72. //allParts[] = {tv1[1], tv2[1], tv3[1]};
  73. /* Make surfaces to be meshed by transfinite algorithm */
  74. //Transfinite Surface {allParts[]};
  75. /* The "Recombine Surface" command is issued in order to
  76. * crate quadrilateral elements.
  77. */
  78. //Recombine
  79. //Surface {allParts[1]};
  80. // Extrude Surface {12, {0,0,1}, {0,0,0}, 2*Pi/3} {
  81. // Recombine ; Layers { 6, 54, 1 } ;
  82. // } ;
  83. //Surface{ ll+1 } In Volume{v[1]};
  84. //Surface{cc} In Volume{v[1]};
  85. Surface{tv1[0]} In Volume{v[1]};
  86. //Surface{t3[0]} In Volume{v[1]};
  87. Physical Volume(1) = {v[1]};