.TH "expression" 3rheolef "Sat Mar 13 2021" "Version 7.1" "rheolef" \" -*- nroff -*- .ad l .nh .SH NAME expression \- involved by interpolate and integrate (rheolef-7\&.1) .SH "SYNOPSIS" .PP .PP .nf template field interpolate (const space& Xh, const Expression& expr); template Result integrate (const Expression& expr); .fi .PP .SH "DESCRIPTION" .PP The expressions involved by \fBinterpolate(3)\fP and \fBintegrate(3)\fP functions base on several predefined operators and functions that are reviewed here\&. Let \fCphi\fP, \fCpsi\fP be two scalar-valued \fBfield(2)\fP or \fBtest(2)\fP objects\&. Similarly, let \fCu\fP, \fCv\fP be two vector-valued objects and \fCsigma\fP and \fCtau\fP be two tensor-valued objects\&. In the following table, the indexes i and j are summed from 0 to d-1 where d is the dimension of the physical geometry, as described by the \fBgeo(2)\fP class\&. .PP .nf c++ code | mathematics ------------------------+---------------------------------------------- dot(u,v) | u.v = sum_i u_i v_i ddot(sigma,tau) | sigma:tau = sum_ij sigma_ij tau_ij 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)) ------------------------+---------------------------------------------- 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 ------------------------+---------------------------------------------- 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)) ------------------------+---------------------------------------------- grad_h(phi) | grad(phi|K) broken gradient, piecewise div_h(u) | div(u|K) Dh(u) | D(u|K) ------------------------+---------------------------------------------- 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)) ------------------------+---------------------------------------------- sin, cos, tan, acos, | standard math function extended to field asin, atan, cosh, sinh, | and test functions tanh, log, log10, floor | ceil | pow(phi,psi) | atan2(phi,psi) | atan(psi/phi) fmod(phi,psi) | phi - floor(phi/psi+0.5)*psi min(phi,psi) | max(phi,psi) | ------------------------+---------------------------------------------- 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 .fi .PP See also \fBcompose(3)\fP and \fBcharacteristic(2)\fP for details\&. .SH "IMPLEMENTATION" .PP The practical implementation of expressions involved by \fBinterpolate(3)\fP and \fBintegrate(3)\fP functions bases on two very classical C++ idioms: the \fCexpression template\fP and the \fCSubstitution failure is not an error (SFINAE)\fP\&. These C++ idioms are described in the following book: .PP D\&. Vandevoorde and N\&. M\&. Josuttis, C++ templates: the complete guide, Addison-Wesley, 2002 .SH AUTHOR Pierre Saramito .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.