libMesh
Loading...
Searching...
No Matches
Functions
exact_solution.C File Reference

Go to the source code of this file.

Functions

Real exact_solution (const Real x, const Real y, const Real z=0.)
 This is the exact solution that we are trying to obtain.
 

Function Documentation

◆ exact_solution()

Real exact_solution ( const Real  x,
const Real  y,
const Real  z = 0. 
)

This is the exact solution that we are trying to obtain.

We will solve

  • (u_xx + u_yy) = f

and take a finite difference approximation using this function to get f. This is the well-known "method of manufactured solutions".

Definition at line 43 of file exact_solution.C.

46{
47 static const Real pi = acos(-1.);
48
49 return cos(.5*pi*x)*sin(.5*pi*y)*cos(.5*pi*z);
50}
const Real pi
.
Definition libmesh.h:292
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

References libMesh::pi, and libMesh::Real.