GfsPoisson

From Gerris

Jump to: navigation, search

Examples

  • Convergence of the Poisson solver
  • 1 0 GfsPoisson GfsBox GfsGEdge {} {
      Time { iend = 10 }
      Refine LEVEL
      ApproxProjectionParams { nrelax = 4 tolerance = 1e-30 }
      Init {} {
        Div = {
          int k = 3, l = 3;
          return -M_PI*M_PI*(k*k + l*l)*sin (M_PI*k*x)*sin (M_PI*l*y);
        }
      }
      OutputTime { istep = 1 } {
        awk '{print n++, $8}' > time
      }
      OutputProjectionStats { istep = 1 } {
        awk '{
          if ($1 == "niter:") printf ("%d ", $2);
          if ($1 == "residual.infty:") print $3 " " $4;
        }' > proj
      }
      OutputErrorNorm { start = end } {
        awk '{print LEVEL " " $5 " " $7 " " $9}' >> error 
      } { v = P } {
        s = (sin (M_PI*3.*x)*sin (M_PI*3.*y))
        unbiased = 1
      }
    }
    

  • Convergence with a refined circle
  • 1 0 GfsPoisson GfsBox GfsGEdge {} {
      Time { iend = 10 }
      Refine (x*x + y*y <= 0.25*0.25 ? LEVEL + 2 : LEVEL)
      ApproxProjectionParams { nrelax = 4 tolerance = 1e-30 }
      Init {} {
        Div = {
          int k = 3, l = 3;
          return -M_PI*M_PI*(k*k + l*l)*sin (M_PI*k*x)*sin (M_PI*l*y);
        }
      }
      OutputTime { istep = 1 } {
          awk '{print n++, $8}' > time
      }
      OutputProjectionStats { istep = 1 } {
        awk '{
          if ($1 == "niter:") printf ("%d ", $2);
          if ($1 == "residual.infty:") print $3 " " $4;
        }' > proj
      }
      OutputErrorNorm { start = end } {
        awk '{print LEVEL " " $5 " " $7 " " $9}' >> error 
      } { v = P } {
        s = (sin (M_PI*3.*x)*sin (M_PI*3.*y))
        unbiased = 1
      }
    }
    

  • Convergence of the Poisson solver with solid boundaries
  • 1 0 GfsPoisson GfsBox GfsGEdge {} {
      Time { iend = 10 }
      Refine LEVEL
      Solid (ellipse (0, 0, 0.25, 0.25))
      ApproxProjectionParams { nrelax = 4 tolerance = 1e-30 erelax = 2 }
      Init {} {
        Div = {
          int k = 3, l = 3;
          return -M_PI*M_PI*(k*k + l*l)*sin (M_PI*k*x)*sin (M_PI*l*y);
        }
      }
      OutputTime { istep = 1 } {
        awk '{print n++, $8}' > time
      }
      OutputProjectionStats { istep = 1 } {
        awk '{
          if ($1 == "niter:") printf ("%d ", $2);
          if ($1 == "residual.infty:") print $3 " " $4;
        }' > proj
      }
      OutputSimulation { start = end } sim-LEVEL { variables = P }
    }
    

  • Star-shaped solid boundary with refinement
  • 1 0 GfsPoisson GfsBox GfsGEdge {} {
        Time { iend = 10 }
        Refine LEVEL
        RefineSolid (LEVEL + 2)
        Solid ({
                double dr = 0.1;
                double theta = atan2 (y, x);
                double radius = 0.79*(0.45 - dr + dr*cos (6.*theta));
                return x*x + y*y - radius*radius;
              })
        ApproxProjectionParams { nrelax = 4 tolerance = 1e-30 }
        Init {} {
            Div = {
                int k = 3, l = 3;
                return -M_PI*M_PI*(k*k + l*l)*sin (M_PI*k*x)*sin (M_PI*l*y);
            }
        }
        OutputTime { istep = 1 } {
            awk '{print n++, $8}' > time
        }
        OutputProjectionStats { istep = 1 } {
            awk '{
          if ($1 == "niter:") printf ("%d ", $2);
          if ($1 == "residual.infty:") print $3 " " $4;
        }' > proj
        }
        OutputSimulation { start = end } sim-LEVEL { variables = P }
    }
    

  • Star-shaped solid boundary
  • 1 0 GfsPoisson GfsBox GfsGEdge {} {
        Time { iend = 10 }
        Refine LEVEL
        Solid ({
                double dr = 0.1;
                double theta = atan2 (y, x);
                double radius = 0.79*(0.45 - dr + dr*cos (6.*theta));
                return x*x + y*y - radius*radius;
              })
        ApproxProjectionParams { nrelax = 4 tolerance = 1e-30 erelax = 2 }
        Init {} {
            Div = {
                int k = 3, l = 3;
                return -M_PI*M_PI*(k*k + l*l)*sin (M_PI*k*x)*sin (M_PI*l*y);
            }
        }
        OutputTime { istep = 1 } {
            awk '{print n++, $8}' > time
        }
        OutputProjectionStats { istep = 1 } {
            awk '{
          if ($1 == "niter:") printf ("%d ", $2);
          if ($1 == "residual.infty:") print $3 " " $4;
        }' > proj
        }
        OutputSimulation { start = end } sim-LEVEL { variables = P }
    }
    

  • Thin wall at box boundary
  • 4 3 GfsPoisson GfsBox GfsGEdge {} {
      Time { iend = 10 }
      Refine LEVEL
      ApproxProjectionParams { nrelax = 4 tolerance = 1e-30 erelax = 2 }
      Init {} {
        Div = {
          int k = 3, l = 3;
          x = (x - 0.5)/2.;
          y = (y + 0.5)/2.;
          return -M_PI*M_PI*(k*k + l*l)*sin (M_PI*k*x)*sin (M_PI*l*y);
        }
      }
      OutputTime { istep = 1 } {
        awk '{print n++, $8}' > time
      }
      OutputProjectionStats { istep = 1 } {
        awk '{
          if ($1 == "niter:") printf ("%d ", $2);
          if ($1 == "residual.infty:") print $3 " " $4;
        }' > proj
      }
      OutputSimulation { start = end } sim-LEVEL { variables = P }
    }
    

  • Poisson solution in a dumbbell-shaped domain
  • 1 0 GfsPoisson GfsBox GfsGEdge {} {
      Refine 3
      ApproxProjectionParams { nitermax = 1000 minlevel = 1 tolerance = 1e-30 }
      Solid dumbell.gts
      Init {} { Div = y }
      OutputProjectionStats { istep = 1 } stdout
    }
    

Personal tools
communication