step-22.cc was way over my head because of all of the optimizations.
I need to crawl before I walk.
I want the simplest way to code a sample PDE:
Uxxx(x,y) + g(x,y)*Uxy(x,y) - Uy(x,y) = f(x,y)
Simple Galerkin FEM with no use of Green's Function,
no optimization yet, absolutely primitive.
I have not found the names of some functions, e.g. ???
I use phi for the Galerkin test function, shape function
I use phip for phi prime, first derivative of phi
I use phipp for phi prime prime, second derivative etc.
The 'i' index is the 'x' direction
The 'j' index is the 'y' direction
The 'q' index is the quadrature point
phi(i,q) is fe_values.shape_value(i, q_point) x direction
phip(i,q) is fe_values.shape_grad(i, q_point)
phipp(i,q) is fe_values.shape_grad_grad(i, q_point) ???
phippp(i,q) is fe_values.shape_grad_grad_grad(i, q_point) ???
phixyp(i, j, q) is ??? derivative of phi wrt x, wrt y = d^2 phi/dx dy
Standard Galerkin replacement of partial derivative with
test function of appropriate derivative, times quadrature weight,
then sum to approximate the integral.
cell_matrix(i,j) += (phippp(i,q) +
g(x,y)*phixyp(i,j,q) -
phip(j,q) ) *
fe_values.JxW(q);
How do I get the x,y for my function 'g' ???
Below is question about RHS.
for (; cell!=endc; ++cell)
{
// We are now sitting on one cell
fe_values.reinit (cell);
cell_matrix = 0;
cell_rhs = 0;
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
cell_matrix(i,j) += (fe_values.shape_grad (i, q_point)...
any PDE can get coded here ... ??? above
)
* fe_values.JxW (q_point);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
cell_rhs(i) += (fe_values.shape_value (i, q_point) *
f(x,y) * ??? for non constant, how do
I get value of x and y ???
fe_values.JxW (q_point));
Very powerful tool kit, I need to understand the basics, then grow.
In my simple code I used Lagrange polynomials for test functions and
Gauss-Legendre quadrature, each of whatever order I needed.
Jon Squire [email protected]
_______________________________________________
dealii mailing list
[email protected]
http://poisson.dealii.org/mailman/listinfo/dealii