
// Note : this file contains the definition of the problem geometry.
// To run this example you need to open the .pro file with GetDP.

// ----------------------------------------------------------------- //
//                ____           __          __                      //
//               /  _/___  _____/ /_  ______/ /__  _____             //
//               / // __ \/ ___/ / / / / __  / _ \/ ___/             //
//             _/ // / / / /__/ / /_/ / /_/ /  __(__  )              //
//            /___/_/ /_/\___/_/\__,_/\__,_/\___/____/               //
//                                                                   //
// ----------------------------------------------------------------- //

// Inclusion of the parameters already defined in the .par file
Include "HtsWg_bench1_1c.par";

// ----------------------------------------------------------------- //
//       ____                                  __                    //
//      / __ \____  _________  ____ ___  ___  / /____  __________    //
//     / /_/ / __ `/ ___/ __ `/ __ `__ \/ _ \/ __/ _ \/ ___/ ___/    //
//    / ____/ /_/ / /  / /_/ / / / / / /  __/ /_/  __/ /  (__  )     //
//   /_/    \__,_/_/   \__,_/_/ /_/ /_/\___/\__/\___/_/  /____/      //
//                                                                   //
// ----------------------------------------------------------------- //

// Typical mesh sizes in the conductor and in the air
TapeMeshSize = TapeThick / 8.;
AirMeshSize = (AirExtRadius - AirIntRadius) / 5.;

// Some visualization options (in the interest of clarity)
Geometry.Color.Lines = Black;
Geometry.LineWidth = 1;
Geometry.PointSize = 1;

// ----------------------------------------------------------------- //
//            ______                          __                     //
//           / ____/__  ____  ____ ___  ___  / /________  __         //
//          / / __/ _ \/ __ \/ __ `__ \/ _ \/ __/ ___/ / / /         //
//         / /_/ /  __/ /_/ / / / / / /  __/ /_/ /  / /_/ /          //
//         \____/\___/\____/_/ /_/ /_/\___/\__/_/   \__, /           //
//                                                 /____/            //
//                                                                   //
// ----------------------------------------------------------------- //

// Origin of the space coordinate
Point(0) = {0., 0., 0., AirMeshSize};

// Points 1, 3, 4, 5 are located at the four corners of the tape, but
// to make a cut in the surrounding air region, we add a point 2 at
// the middle of the lower side of the tape :
Point(1) = { -TapeWidth/2. , -TapeThick/2. , 0. , TapeMeshSize };
Point(2) = { 0.            , -TapeThick/2. , 0. , TapeMeshSize };
Point(3) = { TapeWidth/2.  , -TapeThick/2. , 0. , TapeMeshSize };
Point(4) = { TapeWidth/2.  , TapeThick/2.  , 0. , TapeMeshSize };
Point(5) = { -TapeWidth/2. , TapeThick/2.  , 0. , TapeMeshSize };

// Four points are used to define the surrounding air boundary
Point(6) = { AirIntRadius  , 0.            , 0. , AirMeshSize };
Point(7) = { 0.            , AirIntRadius  , 0. , AirMeshSize };
Point(8) = { -AirIntRadius , 0.            , 0. , AirMeshSize };
Point(9) = { 0.            , -AirIntRadius , 0. , AirMeshSize };

// And four additional points on the far limit 
Point(10)  = { AirExtRadius  , 0.            , 0. , AirMeshSize };
Point(11) = { 0.            , AirExtRadius  , 0. , AirMeshSize };
Point(12) = { -AirExtRadius , 0.            , 0. , AirMeshSize };
Point(13) = { 0.            , -AirExtRadius , 0. , AirMeshSize };

// We start the definition of lines with the 4 sides of the tape
// Note that we need Line(1) + Line(2) to define the bottom edge 
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 1};
Line Loop(100) = {1, 2, 3, 4, 5};

// Trace a circle for the limit of the surrounding air and add
// a cut
Circle(6) = {6, 0, 7};
Circle(7) = {7, 0, 8};
Circle(8) = {8, 0, 9};
Circle(9) = {9, 0, 6};
Line(10)  = {2, 9};
Line Loop(101) = {6, 7, 8, -10, -1, -5, -4, -3, -2, 10, 9};

// And one more circle for the far limit plus the extension of
// the cut we made in the air
Circle(11) = {10, 0, 11};
Circle(12) = {11, 0, 12};
Circle(13) = {12, 0, 13};
Circle(14) = {13, 0, 10};
Line(15)   = {9, 13};
Line Loop(102) = {11, 12, 13, -15, -8, -7, -6, -9, 15, 14};

// Surfaces construction
Plane Surface(200) = {100};
Plane Surface(201) = {101};
Plane Surface(202) = {102};

// Finally physical tags are applied to the regions of interest
Physical Surface( "Conductor"       , CONDUCTOR ) = {200};
Physical Surface( "Surrounding air" , AIR ) = {201};
Physical Surface( "Infinite domain" , INFINITE_DOMAIN ) = {202};
Physical Line   ( "Conductor skin"  , CONDUCTOR_SKIN ) = {1, 2, 3, 4, 5};
Physical Line   ( "Far limit"       , FAR_LIMIT ) = {11, 12, 13, 14};
Physical Line   ( "Cut"             , CUT ) = {10, 15};

// Some colors to improve readability
Color Red     { Surface{200}; }
Color SkyBlue { Surface{201}; }
Color SkyBlue { Surface{202}; }
