0
$\begingroup$

I have to program the linear finite element method in 2D, and I d like to ask some question about the method.

The PDE I have to solve is: $-\bigtriangleup u+cu=f$ and $u(x,y)=g(x,y)$ in the boundary. The set is the unit square and the boundary. Triangulization has to be made of $N^2$ squares. c is nonnegative constat. The simplest one.

-First of all I know its equivalent to solve linear system s.t.:

$A \alpha =F$ s.t $F=(f_x)_{x\in N_h}$ with $x \in$ $N_h= (x_k,x_l)$ with $x_k=k/N,x_l=l/N$ and A is the matrix of $a(\phi_x,\phi_y)=\int_{\ [0,1]^2} \bigtriangledown \phi_x \bigtriangledown \phi_y dxdy$ and $\phi_x(y)=$ 1 if x=y, 0 otherwise.

My first question is, this is when $g=0$ but what happens now?

Second one, how can I program this functions in Matlab. Once I have this function defined, how it looks like the matrix, because its sparse matrix, a lot of terms would be 0 due to the definition of $\phi$

  • 0
    For a Dirichlet problem, you explicitly enforce the boundary condition, i.e. you have elements that touch the boundary and you require them to satisfy $u=g$ where they touch the boundary. Otherwise nothing changes. For implementation this is the wrong place to ask.2017-02-25
  • 0
    Where could I ask?2017-02-25
  • 0
    There's a computational science stack exchange, that might be a place to start.2017-02-25
  • 0
    Is there any book or website where I can see mass matrix and stiffness matrix? For 2D2017-03-08

0 Answers 0