.TH "interpolate" 3rheolef "Mon Sep 19 2022" "Version 7.2" "rheolef" \" -*- nroff -*- .ad l .nh .SH NAME interpolate \- function or expression interpolation (rheolef-7\&.2) .SH "DESCRIPTION" .PP The \fCinterpolation\fP function implements the usual Lagrange interpolation of a function or a class-function on a finite element \fBspace(2)\fP\&. .SH "SYNOPSIS" .PP .PP .nf template field interpolate (const space& Xh, const Expression& expr); .fi .PP Example The following code compute the Lagrange interpolation \fCpi_h_u\fP the function \fCu(x)\fP: .PP .nf Float u(const point& x) { return exp(x[0]*x[1]); } \&.\&.\&. geo omega('square'); space Xh (omega, 'P1'); field pi_h_u = interpolate (Xh, u); .fi .PP .SH "EXPRESSIONS" .PP It is possible to interpolate an expression involving a combination of functions, class-functions and fields: .PP .nf field vh = interpolate (Xh, sqrt(uh) + 2*max(0\&.,uh)); .fi .PP .SH "REINTERPOLATION" .PP The reinterpolation of a field on another mesh or on another finite element space is also possible: .PP .nf geo omega2 ('square2'); space X2h (omega2, 'P1'); field uh2 = interpolate (X2h, pi_h_u); .fi .PP Such a reinterpolation is very frequent in mesh adaptive loops\&. .SH "IMPLEMENTATION" .PP This documentation has been generated from file main/lib/interpolate\&.h .PP The implementation of expressions bases on the \fCexpression template\fP and \fCSFINAE\fP C++ idioms\&. .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.