FEMClass`

By Edgar Camacho Cota
Universidad Nacional Autonoma de Mexico (UNAM)
ecc@mira.labvis.unam.mx
June 2000.

Example 3 :
Solve
D[ f[x,y], {x,2} ] + D[ f[x,y], {y,2} ] - 1 = 0,
f = 0 on boundary

this load the package

Needs["FEMClass`"]

Pre-Process

this create the mesh

myMalla = 
      new[T3, {{1, 2, 5}, {5, 2, 3}, {5, 3, 4}, {1, 5, 4}}, {{0, 0}, {1, 0}, {
            1, 1}, {0, 1}, {(1/2), (1/2)}}]

this plot the mesh

GrafMalla[myMalla]

this make a refinemet of the mesh

Refinamela[myMalla]; Refinamela[myMalla];

this plot the mesh

GrafMalla[myMalla]

this apply restricctions f = 0 on boundary

argument = 
      Flatten[{(g[D0, #1] == 0&)/@Union[Flatten[Frontera[myMalla]]]}]

myRes = NewRestricciones[argument, {g}]

myCampo = NewCampoEF[T3C0, myMalla]

Principal Process

ao = CreaArgOmega[myCampo, myRes];

in this expression, the weak form of the funcional 
D[ f[x,y], {x,2} ] + D[ f[x,y], {y,2} ] - 1 appear like D[#2,x] D[#1,x] + D[#2,y] D[#1,y] -1
where #2 correspond to f, and #1 correspond to a test-function in the variational problem, or weak formulation of the diferential equation problem.

ieo1 = 
      IntegralesElementalesOmega[myCampo, myRes, 
        ao, {(∂_x) #2 (∂_x) #1 + 
              (∂_y) #2 (∂_y) #1 - 1&}, {x, y}];

ito1 = IntegralesTotales[ieo1];

it = ito1;

si = SistemaIncompleto[it];

sc = SistemaCompleto[si, myRes];

s = 
      (FindRoot[sc, ##1]&)@@
        (Incognitas[myCampo, myRes] /. a_g -> {a, 1});

s//ColumnForm

Post-Process

this show the solution

GrafCampo[myCampo, g, s]

Show[%, ViewPoint -> {-2.738, 0.268, 1.970}]