expression(3rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

✨ NAME ✨

okay so hi bestie πŸ’– this is expression(3rheolef) β€” the whole page about expression, aka the thing that gets involved by interpolate and integrate (rheolef-7.2, so check your version if things look sus πŸ‘€).


πŸ¦‹ SYNOPSIS πŸ¦‹

template <class Expression>
field interpolate (const space& Xh, const Expression& expr);

template <class Expression>
Result integrate (const Expression& expr);

πŸ’œ DESCRIPTION πŸ’œ

So the expressions that interpolate(3) and integrate(3) drag into the party are built out of a bunch of predefined operators and functions, and we're reviewing every single one of them right here, no skipping, periodt.

Let phi and psi be two scalar-valued field(2) or test(2) objects. Same energy: let u and v be two vector-valued objects, and sigma and tau be two tensor-valued objects. And in all of the stuff below, the indexes i and j are summed from 0 to d-1, where d is the dimension of the physical geometry, exactly as described by the geo(2) class. no cap 🫢

πŸ“ dot, ddot, dddot, traces & norms

  • dot(u,v) β€” u.v = sum_i u_i v_i
  • ddot(sigma,tau) β€” sigma:tau = sum_ij sigma_ij tau_ij
  • dddot(sigma,tau) β€” A:.B = sum_ijk A_ijk B_ijk
  • tr(sigma) β€” sum_i sigma_ii
  • trans(sigma) β€” sigma^T the transpose
  • sqr(phi), norm2(phi) β€” phi^2
  • norm2(u) β€” sum_i u_i^2
  • norm2(sigma) β€” sum_ij sigma_ij^2
  • abs(phi), norm(phi) β€” absolute value
  • norm(u) β€” sqrt(norm2(u))
  • norm(sigma) β€” sqrt(norm2(sigma))

πŸ¦‹ derivatives, div, curl & friends

  • grad(phi) β€” (d phi/d x_i)_i
  • grad(u) β€” (d u_i/d x_j)_ij
  • D(u) β€” (grad(u) + grad(u)^T)/2
  • div(u) β€” sum_i d u_i/d x_i = tr(D(u))
  • curl(phi) β€” (d phi/d x_1, - d phi/d x_0) when d=2
  • curl(u) β€” grad^u when d=3

🌸 normals & surface (s) operators

  • normal() β€” n, the outward unit normal
  • grad_s(phi) β€” P*grad(phi) where P = I - n otimes n
  • grad_s(u) β€” grad(u)*P
  • Ds(u) β€” P*D(u)*P
  • div_s(u) β€” tr(Ds(u))

πŸŽ€ the _h family, aka broken / piecewise

  • grad_h(phi) β€” grad(phi|K) broken gradient, piecewise
  • div_h(u) β€” div(u|K)
  • Dh(u) β€” D(u|K)

πŸ‘‘ jumps, averages & friends (the DG girlies ate)

  • jump(phi) β€” [phi] = phi|K0 - phi|K1 on an oriented side S = dK0 inter dK1
  • average(phi) β€” {phi} = (phi|K0 + phi|K1)/2
  • inner(phi) β€” phi|K0
  • outer(phi) β€” phi|K1
  • h_local() β€” meas(K)^(1/d)
  • penalty() β€” max(meas(dK0)/meas(K0), meas(dK1)/meas(K1))

🌈 math functions but make it fields

  • sin, cos, tan, acos, asin, atan, cosh, sinh, tanh, log, log10, floor, ceil β€” standard math function extended to field and test functions ⭐
  • pow(phi,psi) β€” the classic power move
  • atan2(phi,psi) β€” atan(psi/phi)
  • fmod(phi,psi) β€” phi - floor(phi/psi+0.5)*psi
  • min(phi,psi) β€” minimum vibes only
  • max(phi,psi) β€” maximum vibes only
  • compose(f,phi) β€” f(phi), for a given function f
  • compose(f,phi1,..,phin) β€” f(phi0,...,phin)
  • compose(phi,X) β€” phi(X) for a characteristic X
πŸ’‘ See also compose(3) and characteristic(2) for details β€” go read them, iykyk.

πŸ”₯ IMPLEMENTATION πŸ”₯

Under the hood, the expressions involved by interpolate(3) and integrate(3) are built on two extremely classical C++ idioms:

  • the expression template, and
  • Substitution failure is not an error (SFINAE) β€” yes that's the whole name, iconic honestly πŸ’…

Both of these C++ idioms are described in this book, so if you want the deep lore:

D. Vandevoorde and N. M. Josuttis, C++ templates: the complete guide, Addison-Wesley, 2002


πŸ’– AUTHOR πŸ’–

Pierre Saramito <Pierre.Saramito@imag.fr>


Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>

GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.


aaaand that's the whole page bestie πŸŽ€ this one's straight out of rheolef, Version 7.2 β€” expression(3rheolef), no warranty, all vibes. stay slay, go interpolate something πŸ’…βœ¨

πŸ“¦ where this page comes from