Bim package: Difference between revisions

48 bytes added ,  19 July 2012
no edit summary
No edit summary
No edit summary
Line 106: Line 106:


<pre>
<pre>
GammaD = bim2c_unknowns_on_side (mesh, [1 2]);           ## DIRICHLET NODES LIST
GammaD = bim2c_unknowns_on_side (mesh, [1 2]);     ## DIRICHLET NODES LIST
GammaN = bim2c_unknowns_on_side (mesh, [3 4]);           ## NEUMANN NODES LIST
GammaN = bim2c_unknowns_on_side (mesh, [3 4]);     ## NEUMANN NODES LIST
GammaN = setdiff (GammaN, GammaD);
GammaN = setdiff (GammaN, GammaD);


jn    = zeros (length (GammaN),1);                     ## PRESCRIBED NEUMANN FLUXES
jn    = zeros (length (GammaN),1);               ## PRESCRIBED NEUMANN FLUXES
ud    = 3*xu;                                             ## DIRICHLET DATUM
ud    = 3*xu;                                       ## DIRICHLET DATUM
Omega = setdiff (1:nnodes, union (GammaD, GammaN)); ## INTERIOR NODES LIST
Omega = setdiff (1:nnodes, union (GammaD, GammaN)); ## INTERIOR NODES LIST
</pre>
</pre>
Line 125: Line 125:
Ani = A(GammaN, Omega);  
Ani = A(GammaN, Omega);  


Aid = A(Ilist, GammaD);
Aid = A(Omega, GammaD);
Ain = A(Ilist, GammaN);  
Ain = A(Omega, GammaN);  
Aii = A(Ilist, Omega);  
Aii = A(Omega, Omega);  


bd = b(GammaD);
bd = b(GammaD);
Line 137: Line 137:


<pre>
<pre>
temp = [Ann Ani ; Ain Aii ] \ [ Fn+bn-And*ud(GammaD) ; bi-Aid*ud(GammaD)];
temp = [Ann Ani ; Ain Aii ] \ [ jn+bn-And*ud(GammaD) ; bi-Aid*ud(GammaD)];
u(Nlist)   = temp(1:numel (GammaN));
u = ud;
u(Omega)  = temp(length(un)+1:end);
u(GammaN) = temp(1:numel (GammaN));
u(Omega)  = temp(length(GammaN)+1:end);
</pre>
</pre>


Line 145: Line 146:


<pre>
<pre>
Fd = [Add Adi Adn] * u([GammaD; Omega; GammaN]) - bd;
jd = [Add Adi Adn] * u([GammaD; Omega; GammaN]) - bd;
</pre>
</pre>


Line 158: Line 159:


<pre>
<pre>
[jxglob, jyglob] = bim2c_global_flux (mesh, u, epsilon, 1, phi);
[jxglob, jyglob] = bim2c_global_flux (mesh, u, epsilon*ones(nelems, 1), ones(nnodes, 1), ones(nnodes, 1), phi);
</pre>
</pre>


Line 166: Line 167:
or [[https://wci.llnl.gov/codes/visit/|visit]]
or [[https://wci.llnl.gov/codes/visit/|visit]]
<pre>
<pre>
fpl_vtk_write_field ("vtkdata", mesh, {}, {[gx; gy]', "Gradient"}, 1);
fpl_vtk_write_field ("vtkdata", mesh, {u, "Solution"}, {[gx; gy]', "Gradient"}, 1);
</pre>
</pre>


[[Category:OctaveForge]]
[[Category:OctaveForge]]
[[Category:Packages]]
[[Category:Packages]]
43

edits