Browse Source

Starting inhomogeneous bdry conditions.

iss2
Trevor Irons 8 years ago
parent
commit
3b250886e3
3 changed files with 15 additions and 6 deletions
  1. 3
    3
      examples/borehole/sphere.geo
  2. 2
    2
      examples/borehole/sphereBox.geo
  3. 10
    1
      src/FEM4EllipticPDE.cpp

+ 3
- 3
examples/borehole/sphere.geo View File

8
  */
8
  */
9
 
9
 
10
 radius = 2.25;     // Radius of the damn thing
10
 radius = 2.25;     // Radius of the damn thing
11
-lc = 15*radius;     //  0.25;   // Target element size
11
+lc = radius/6;     //  0.25;   // Target element size
12
 
12
 
13
 // Total Solution Space
13
 // Total Solution Space
14
-Box = 100*radius; // The down side of potential
14
+Box = 12*radius; // The down side of potential
15
 X0 = -Box;
15
 X0 = -Box;
16
 X1 =  Box;
16
 X1 =  Box;
17
 Y0 = -Box;
17
 Y0 = -Box;
19
 Z0 = -Box;
19
 Z0 = -Box;
20
 Z1 =  Box;
20
 Z1 =  Box;
21
 
21
 
22
-cellSize=radius/10; ///10;
22
+cellSize=radius/6; ///10;
23
 dd = 0 ; //  1e-5; //cellSize; // .01;
23
 dd = 0 ; //  1e-5; //cellSize; // .01;
24
 pio2=Pi/2;
24
 pio2=Pi/2;
25
 
25
 

+ 2
- 2
examples/borehole/sphereBox.geo View File

11
 D1 = 11;          // Bottom of magnet
11
 D1 = 11;          // Bottom of magnet
12
 radius = 2.25;     // Radius of the damn thing
12
 radius = 2.25;     // Radius of the damn thing
13
 
13
 
14
-lc = 10*radius;   //  0.25;   // Target element size
14
+lc = 2*radius;   //  0.25;   // Target element size
15
 
15
 
16
 // Total Solution Space
16
 // Total Solution Space
17
-Box = 100*radius; // The down side of potential
17
+Box = 12*radius; // The down side of potential
18
 X0 = -Box;
18
 X0 = -Box;
19
 X1 =  Box;
19
 X1 =  Box;
20
 Y0 = -Box;
20
 Y0 = -Box;

+ 10
- 1
src/FEM4EllipticPDE.cpp View File

309
                 ID[3] = Ids->GetId(3);
309
                 ID[3] = Ids->GetId(3);
310
 
310
 
311
             Real sigma_bar(0);
311
             Real sigma_bar(0);
312
+            /*
312
             if (GCell) {
313
             if (GCell) {
313
                 sigma_bar = vtkGrid->GetCellData()->GetScalars("G")->GetTuple1(ic);
314
                 sigma_bar = vtkGrid->GetCellData()->GetScalars("G")->GetTuple1(ic);
314
             } else {
315
             } else {
318
                 sigma_bar += vtkGrid->GetPointData()->GetScalars("G")->GetTuple1(ID[3]);
319
                 sigma_bar += vtkGrid->GetPointData()->GetScalars("G")->GetTuple1(ID[3]);
319
                 sigma_bar /= 4.;
320
                 sigma_bar /= 4.;
320
             }
321
             }
321
-            sigma_bar = 1.;
322
+            */
323
+            Real xc = C.col(1).array().mean();
324
+            Real yc = C.col(2).array().mean();
325
+            Real zc = C.col(3).array().mean();
326
+            if ( xc >= 2.5 && xc <= 5. && yc>=2.5 && yc <= 5.) {
327
+                sigma_bar = 0.;
328
+            } else {
329
+                sigma_bar = 1.;
330
+            }
322
 
331
 
323
             for (int ii=0; ii<4; ++ii) {
332
             for (int ii=0; ii<4; ++ii) {
324
                 for (int jj=0; jj<4; ++jj) {
333
                 for (int jj=0; jj<4; ++jj) {

Loading…
Cancel
Save