123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /* This file is part of Lemma, a geophysical modelling and inversion API.
- * More information is available at http://lemmasoftware.org
- */
-
- /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
- /**
- * @file
- * @date 02/04/2016 02:58:54 PM
- * @version $Id$
- * @author Trevor Irons (ti)
- * @email tirons@egi.utah.edu
- * @copyright Copyright (c) 2016, University of Utah
- * @copyright Copyright (c) 2016, Lemma Software, LLC
- */
-
- radius = 3.25; // Radius of the damn thing
- blc = radius/2; // 0.25; // Target element size
- Box = 3*radius; // The down side of potential
- lc = radius/2; // toroid characteristic length
-
-
- tpp = newp;
- ts = 1; // height of toroid
- tx = radius; // radial width of toroid, measured in centre of ring
- tl = 0; // centre of rotation
-
- Point(tpp ) = { tx, 0, 0, lc};
- Point(tpp+1) = { ts+tx, 0, 0, lc};
- Point(tpp+2) = { tx, ts, 0, lc};
- Point(tpp+3) = { tx, -ts, 0, lc};
- Point(tpp+4) = {-ts+tx, 0, 0, lc};
-
- cc = newc;
- Circle(cc ) = {tpp+1, tpp, tpp+2};
- Circle(cc+1) = {tpp+2, tpp, tpp+4};
- Circle(cc+2) = {tpp+4, tpp, tpp+3};
- Circle(cc+3) = {tpp+3, tpp, tpp+1};
-
- ll = newll;
- Line Loop(ll) = {cc, cc+1, cc+2, cc+3};
-
- ps = news;
- pio2=Pi/2;
- Plane Surface(ps) = {ll};
- tv1[] = Extrude {{0, 1, 0},{-tl,0,0}, 2*Pi/3} { Surface{ps}; };
- tv2[] = Extrude {{0, 1, 0},{-tl,0,0}, 2*Pi/3} { Surface{28}; };
- tv3[] = Extrude {{0, 1, 0},{-tl,0,0}, 2*Pi/3} { Surface{50}; };
- //t1[] = Rotate {{0,0,1},{0,0,0},pio2 } {Duplicata{Surface{ps};}};
- //Extrude Surface {ps, {0,1,0}, {-tl,0,0}, 2*Pi/3} { Recombine ;};
- //Extrude Surface {28, {0,1,0}, {-tl,0,0}, 2*Pi/3}; //{Layers{10,73,1};};
- //Extrude Surface {50, {0,1,0}, {-tl,0,0}, 2*Pi/3}; //{Layers{10,73,1};};
-
- /* Make a list of a ring (annulus) of surfaces around the hole */
- allParts[] = {tv1[0], tv2[0], tv3[0]};
-
- /* Make surfaces to be meshed by transfinite algorithm */
- //Transfinite Surface {allParts[]};
-
- /* The "Recombine Surface" command is issued in order to
- * crate quadrilateral elements.
- */
- //Recombine Surface {allParts[]};
-
- // Extrude Surface {12, {0,0,1}, {0,0,0}, 2*Pi/3} {
- // Recombine ; Layers { 6, 54, 1 } ;
- // } ;
-
- // Total Solution Space
- X0 = -Box;
- X1 = Box;
- Y0 = -Box;
- Y1 = Box;
- Z0 = -Box;
- Z1 = Box;
- /////////////////////////////////////
- // Large Bounding box
- pp = newp;
- Point(pp) = {X0, Y0, Z0, blc};
- Point(pp+1) = {X1, Y0, Z0, blc};
- Point(pp+2) = {X1, Y1, Z0, blc};
- Point(pp+3) = {X0, Y1, Z0, blc};
- //
- lv = newl;
- Line(lv) = {pp,pp+1};
- Line(lv+1) = {pp+1,pp+2};
- Line(lv+2) = {pp+2,pp+3};
- Line(lv+3) = {pp+3,pp};
- Line Loop(lv+4) = {lv, lv+1, lv+2, lv+3};
- //
- // Hard coded doom
- bs = news;
- Plane Surface(bs) = {lv+4};
- //
- //v = newv;
- v[] = Extrude {0, 0, Z1-Z0} { Surface{bs}; };
-
- /* This is GOOD */
- Surface{ allParts } In Volume{v[1]};
- //Surface{t1[0]} In Volume{v[1]};
- //Surface{t2[0]} In Volume{v[1]};
- //Surface{t3[0]} In Volume{v[1]};
|