Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to Lagrange{refdim,refshape,1}() for geometric mapping #695

Merged
merged 2 commits into from
May 8, 2023

Commits on May 8, 2023

  1. Default to Lagrange{refdim,refshape,1}() for geometric mapping

    This patch changes the default value for the geometric mapping in
    `(Cell|Face)(Scalar|Vector)Values` to linear Lagrange interpolation
    instead of (re)using the function interpolation. This decouples these
    two concepts further.
    
    Some "real world" examples where I think this new default is more sane,
    and the current default is just a stumbling block:
    
    1. Consider the following code with linear cells:
       ```julia
       grid = generate_grid(Triangle, ...)
       ip = Lagrange{2, RefTriangle, 1}()
       cv = CellVectorValues(qr, ip)
       ```
       To update this to use e.g. a quadratic approximation one currently
       have to change more than just the approximation order, i.e. one has
       to use
       ```julia
       grid = generate_grid(Triangle, ...)
       ip  = Lagrange{2, RefTriangle, 2}()
       ipg = Lagrange{2, RefTriangle, 1}()
       cv = CellVectorValues(qr, ip, ipg)
       ```
       instead of simply
       ```julia
       grid = generate_grid(Triangle, ...)
       ip = Lagrange{2, RefTriangle, 2}()
       cv = CellVectorValues(qr, ip)
       ```
    
    2. For the Taylor-Hood element one *always* have to worry about the
       geometric mapping, regardless if it is linear or quadratic:
       ```julia
       ip_g = Lagrange{2, RefTriangle, 1}()
       ip_u = Lagrange{2, RefTriangle, 2}()
       ip_p = Lagrange{2, RefTriangle, 1}()
       cv_u = CellVectorValues(qr, ip_u, ip_g)
       cv_p = CellVectorValues(qr, ip_p, ip_g)
       ```
       instead of just
       ```julia
       ip_u = Lagrange{2, RefTriangle, 2}()
       ip_p = Lagrange{2, RefTriangle, 1}()
       cv_u = CellVectorValues(qr, ip_u)
       cv_p = CellVectorValues(qr, ip_p)
       ```
    
    3. For more exotic elements, such as `VectorizedInterpolation` (#694),
       or `RaviartThomas` it is also a more useful default.
    fredrikekre committed May 8, 2023
    Configuration menu
    Copy the full SHA
    c7e46b5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c660c7 View commit details
    Browse the repository at this point in the history