[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
PHiLiP::Tests::ManufacturedSolutionU< dim, real > Class Template Reference

manufactured solution for u More...

#include <diffusion_exact_adjoint.h>

Inheritance diagram for PHiLiP::Tests::ManufacturedSolutionU< dim, real >:
Collaboration diagram for PHiLiP::Tests::ManufacturedSolutionU< dim, real >:

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.
 
- Public Member Functions inherited from PHiLiP::ManufacturedSolutionFunction< dim, real >
 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

- Public Attributes inherited from PHiLiP::ManufacturedSolutionFunction< dim, real >
const unsigned int nstate
 
- Protected Attributes inherited from PHiLiP::ManufacturedSolutionFunction< dim, real >
std::vector< double > base_values
 
std::vector< double > amplitudes
 
std::vector< dealii::Tensor< 1, dim, real > > frequencies
 

Detailed Description

template<int dim, typename real>
class PHiLiP::Tests::ManufacturedSolutionU< dim, real >

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:

  1. Solve for u and v both directly for primal problems
  2. Perform functional evaluation from both cases (direct way) and check they are within tolerance
  3. Evaluate the discrete adjoint for both using PHiLiP::Adjoint class
  4. Compare (using L2 norm) with the primal solution of the opposing case

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.


The documentation for this class was generated from the following files: