Fem-fenics: Difference between revisions

Jump to navigation Jump to search
27 bytes added ,  6 September 2013
no edit summary
No edit summary
No edit summary
Line 117: Line 117:
</div>
</div>
<div style="clear:both"></div>
<div style="clear:both"></div>


=== Mixed Formulation for Poisson Equation ===
=== Mixed Formulation for Poisson Equation ===
Line 142: Line 144:
#  CG = FiniteElement("CG", triangle, 1)
#  CG = FiniteElement("CG", triangle, 1)
#  f = Coefficient(CG)
#  f = Coefficient(CG)
f = Expression ('f', @(x,y) 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02));
f = Expression ('f',  
                @(x,y) 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02));


# Define variational form
# Define variational form
Line 183: Line 186:
plot (sigma);
plot (sigma);
plot (u);
plot (u);


</syntaxhighlight>}}
</syntaxhighlight>}}
Line 208: Line 212:




f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
f = Expression
    ("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")


# Define variational form
# Define variational form
Line 250: Line 255:
plot(u)
plot(u)
interactive()
interactive()
</syntaxhighlight>}}
</syntaxhighlight>}}
   </div>
   </div>
60

edits

Navigation menu