[P]arallel [Hi]gh-order [Li]brary for [P]DEs
Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
|
manufactured solution for u More...
#include <diffusion_exact_adjoint.h>
Public Member Functions | |
real | value (const dealii::Point< dim, real > &pos, const unsigned int istate=0) const override |
overriding the function for the value and gradient | |
dealii::Tensor< 1, dim, real > | gradient (const dealii::Point< dim, real > &pos, const unsigned int istate=0) const override |
Gradient of the manufactured solution. | |
dealii::SymmetricTensor< 2, dim, real > | hessian (const dealii::Point< dim, real > &, const unsigned int) const |
Hessian of manufactured solution is unused but needed to make class concrete. | |
![]() | |
ManufacturedSolutionFunction (const unsigned int nstate=1) | |
Constructor that initializes base_values, amplitudes, frequencies. More... | |
dealii::Tensor< 1, dim, real > | gradient_fd (const dealii::Point< dim, real > &point, const unsigned int istate=0) const |
Uses finite-difference to evaluate the gradient. | |
dealii::SymmetricTensor< 2, dim, real > | hessian_fd (const dealii::Point< dim, real > &point, const unsigned int istate=0) const |
Uses finite-difference to evaluate the hessian. | |
std::vector< real > | stdvector_values (const dealii::Point< dim, real > &point) const |
Same as Function::values() except it returns it into a std::vector format. | |
void | vector_gradient (const dealii::Point< dim, real > &p, std::vector< dealii::Tensor< 1, dim, real > > &gradients) const |
See dealii::Function<dim,real>::vector_gradient. | |
Additional Inherited Members | |
![]() | |
const unsigned int | nstate |
![]() | |
std::vector< double > | base_values |
std::vector< double > | amplitudes |
std::vector< dealii::Tensor< 1, dim, real > > | frequencies |
manufactured solution for u
Test to compare adjoint discrete and continuous adjoints for diffusion in 1D
Based on idea from: "Adjoint Recovery of Superconvergent Functionals from PDE Approximations", Pierce and Giles 1998
As the diffusion operator is self adjoint, primal and dual can be be solved in same way then compared. Lu=f, L^*v=g J = <u, g> = <u, L^*v> J = <v, Lu> = <v, f>
L = d^2/dx^2 = L^* (directly from integration by parts)
Similar terms chosen to in paper, except using them for the manufactured solution instead of the source u(x) = x^3 (1-x)^3, v(x) = sin(pi*x) and hence u(0)=u(1)=0 (Dirichlet BC)
Source term in 1D: f(x) = -30x^3+60x63-36x^2+6x g(x) = -pi^2 * sin(pi*x)
In higher dimensions, obtained by taking \( \nabla u(x)*u(y)*u(z) \)
Steps:
Analytic value of the functional was found to be 1D: J = [144*(10 - pi^2)/pi^5] 2D: J = 2*[-144*(10 - pi^2)/pi^7] [144(10 - pi^2)/pi^5] 3D: J = 3*[-144*(10 - pi^2)/pi^7]^2*[144*(10 - pi^2)/pi^5]
Definition at line 55 of file diffusion_exact_adjoint.h.