]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge pull request #2395 from masterleinad/periodic_neighbor
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 1 Apr 2016 06:18:41 +0000 (08:18 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 1 Apr 2016 06:18:41 +0000 (08:18 +0200)
Periodic neighbors

1  2 
tests/mpi/periodicity_01.cc

index bfa9e4eb11225fe54f352d40d105eb1e10dfb98f,59924a2639dfb53e810c22a75a9a28d78f1eaebd..aef92fd4c82f2c88bb13cfa9152a877675a52f69
@@@ -333,16 -328,19 +333,19 @@@ namespace Step4
      for (unsigned int i = 0; i<cycle; i++)
        n_points*=2;
  
+     //don't test exactly at the support points, since point_value is not stable there
+     const double eps = 1./(16.*n_points);
      for (unsigned int i=1; i< n_points; i++)
        {
 -        Vector<double> value1(1);
 -        Vector<double> value2(1);
 +        Vector<PetscScalar> value1(1);
 +        Vector<PetscScalar> value2(1);
  
          Point <2> point1;
-         point1(0)=1.*i/n_points;
+         point1(0)=1.*i/n_points+eps;
          point1(1)=0.;
          Point <2> point2;
-         point2(0)=1.*i/n_points;
+         point2(0)=1.*i/n_points+eps;
          point2(1)=1.;
  
          get_point_value (point1, 0, value1);
      for (unsigned int i=1; i< n_points; i++)
        for (unsigned int j=1; j< n_points; j++)
          {
 -          Vector<double> value1(1);
 -          Vector<double> value2(1);
 -          Vector<double> value3(1);
 -          Vector<double> value4(1);
 +          Vector<PetscScalar> value1(1);
 +          Vector<PetscScalar> value2(1);
 +          Vector<PetscScalar> value3(1);
 +          Vector<PetscScalar> value4(1);
  
            Point <3> point1;
-           point1(0)=1.*i/n_points;
-           point1(1)=1.*j/n_points;
-           point1(2)=0.;
+           point1(0)=1.*i/n_points+eps;
+           point1(1)=1.*j/n_points+eps;
+           point1(2)=0;
            Point <3> point2;
-           point2(0)=1.*i/n_points;
-           point2(1)=1.*j/n_points;
+           point2(0)=1.*i/n_points+eps;
+           point2(1)=1.*j/n_points+eps;
            point2(2)=1.;
            Point <3> point3;
-           point3(0)=1.*i/n_points;
+           point3(0)=1.*i/n_points+eps;
            point3(1)=0.;
-           point3(2)=1.*j/n_points;;
+           point3(2)=1.*j/n_points+eps;
            Point <3> point4;
-           point4(0)=1.*i/n_points;
+           point4(0)=1.*i/n_points+eps;
            point4(1)=1.;
-           point4(2)=1.*j/n_points;;
+           point4(2)=1.*j/n_points+eps;
  
            get_point_value (point1, 0, value1);
            get_point_value (point2, 0, value2);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.