Changes

Jump to navigation Jump to search
678 bytes added ,  14:51, 19 July 2012
no edit summary
<math> u(x, y) = u_d(x, y)\qquad \mbox{ on } \Gamma_D </math>
<math> -( \varepsilon\ \nabla u(x, y) - \nabla \varphi(x,y)\ u(x, y) ) \cdot \mathbf{n} = j_N(x, y)\qquad \mbox{ on } \Gamma_N</math>
<b> Create the mesh and precompute the mesh properties </b>
The To define the geometry of the domain was created using gmsh and is stored in the file <tt>fiume.geo</tt>created with we can use [http://gmsh.geuz.org gmsh]. the following gmsh input  <pre>Point (1) = {0, 0, 0, 0.1};Point (2) = {1, 1, 0, 0.1};Point (3) = {1, 0.9, 0, 0.1};Point (4) = {0, 0.1, 0, 0.1};Point (5) = {0.3,0.1,-0,0.1};Point (6) = {0.4,0.4,-0,0.1};Point (7) = {0.5,0.6,0,0.1};Point (8) = {0.6,0.9,0,0.1};Point (9) = {0.8,0.8,0,0.1};Point (10) = {0.2,0.2,-0,0.1};Point (11) = {0.3,0.5,0,0.1};Point (12) = {0.4,0.7,0,0.1};Point (13) = {0.5,1,0,0.1};Point (14) = {0.8,0.9,0,0.1}; Line (1) = {3, 2};Line (2) = {4, 1}; CatmullRom(3) = {1,5,6,7,8,9,3};CatmullRom(4) = {4,10,11,12,13,14,2};Line Loop(15) = {3,1,-4,2};Plane Surface(16) = {15};</pre> will produce the geometry below
[[File:fiume.png]]
 
we need to load the mesh into Octave and precompute mesh properties
check out the tutorial for the [[msh_package|msh package]] for info
on the mesh structure
<pre>
</pre>
to see the mesh you can use functions from the [[fpl_package|fplpackage]] package
<pre>
<b> Construct an initial guess</b>
We need this even if our <b> Set the coefficients for the problem is linear and stationaryas we are going to use the values at boundary nodes to set Dirichelet boundary conditions.:</b>
Get the node coordinates from the mesh structure
</pre>
 
<pre>
uin = 3*xu;
</pre>
 
<b> Set the coefficients for the problem:</b>
Get the number of elements and nodes in the mesh
<pre>
epsilon = .1;
phi = xu+yu;
</pre>
<pre>
Dlist GammaD = bim2c_unknowns_on_side(mesh, [8 181 2]); ## DIRICHLET NODES LISTNlist GammaN = bim2c_unknowns_on_side(mesh, [23 243 4]); ## NEUMANN NODES LISTNlist Corners = setdiff(NlistGammaD,DlistGammaN);Fn jn = zeros(length(NlistGammaN),1); ## PRESCRIBED NEUMANN FLUXESud = 3*xu; ## DIRICHLET DATUM
Ilist = setdiff(1:length(uin),union(Dlist,Nlist)); ## INTERNAL NODES LIST
</pre>
43

edits

Navigation menu