sandbox/ggennari/phase_change/mass_refine_prolongation.h

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    void mass_refine (Point point, scalar s)
    {
      scalar f = s.c;
      double s_parent = s[];
      foreach_child() {
        if (f[] > F_ERR && f[] < 1. - F_ERR)
          s[] = s_parent;
        else
          s[] = 0.;
      }
    }
    
    void refinement_avg (Point point, scalar s) {
      scalar f = s.c;
      double sp = s[];
      foreach_child() {
        if (f[] > F_ERR && f[] < 1. - F_ERR)
          s[] = sp;
        else
          s[] = 0.;
      }
    }