expression(3rheolef)
β¨ 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_iddot(sigma,tau)βsigma:tau = sum_ij sigma_ij tau_ijdddot(sigma,tau)βA:.B = sum_ijk A_ijk B_ijktr(sigma)βsum_i sigma_iitrans(sigma)βsigma^T the transposesqr(phi), norm2(phi)βphi^2norm2(u)βsum_i u_i^2norm2(sigma)βsum_ij sigma_ij^2abs(phi), norm(phi)βabsolute valuenorm(u)βsqrt(norm2(u))norm(sigma)βsqrt(norm2(sigma))
π¦ derivatives, div, curl & friends
grad(phi)β(d phi/d x_i)_igrad(u)β(d u_i/d x_j)_ijD(u)β(grad(u) + grad(u)^T)/2div(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=2curl(u)βgrad^u when d=3
πΈ normals & surface (s) operators
normal()βn, the outward unit normalgrad_s(phi)βP*grad(phi) where P = I - n otimes ngrad_s(u)βgrad(u)*PDs(u)βP*D(u)*Pdiv_s(u)βtr(Ds(u))
π the _h family, aka broken / piecewise
grad_h(phi)βgrad(phi|K) broken gradient, piecewisediv_h(u)βdiv(u|K)Dh(u)βD(u|K)
π jumps, averages & friends (the DG girlies ate)
jump(phi)β[phi] = phi|K0 - phi|K1on an oriented sideS = dK0 inter dK1average(phi)β{phi} = (phi|K0 + phi|K1)/2inner(phi)βphi|K0outer(phi)βphi|K1h_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 moveatan2(phi,psi)βatan(psi/phi)fmod(phi,psi)βphi - floor(phi/psi+0.5)*psimin(phi,psi)β minimum vibes onlymax(phi,psi)β maximum vibes onlycompose(f,phi)βf(phi), for a given function fcompose(f,phi1,..,phin)βf(phi0,...,phin)compose(phi,X)βphi(X) for a characteristic X
π‘ See alsocompose(3)andcharacteristic(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 π«Ά
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
- debian trixie: librheolef-dev 7.2-4 Β· GPL-3.0-or-later
- ubuntu noble: librheolef-dev 7.2-3build5 Β· GPL-3.0-or-later
- ubuntu questing: librheolef-dev 7.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms