43
edits
No edit summary |
No edit summary |
||
Line 106: | Line 106: | ||
<pre> | <pre> | ||
GammaD = bim2c_unknowns_on_side (mesh, [1 2]); | GammaD = bim2c_unknowns_on_side (mesh, [1 2]); ## DIRICHLET NODES LIST | ||
GammaN = bim2c_unknowns_on_side (mesh, [3 4]); | GammaN = bim2c_unknowns_on_side (mesh, [3 4]); ## NEUMANN NODES LIST | ||
GammaN = setdiff (GammaN, GammaD); | GammaN = setdiff (GammaN, GammaD); | ||
jn = zeros (length (GammaN),1); | jn = zeros (length (GammaN),1); ## PRESCRIBED NEUMANN FLUXES | ||
ud = 3*xu; | 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( | Aid = A(Omega, GammaD); | ||
Ain = A( | Ain = A(Omega, GammaN); | ||
Aii = A( | Aii = A(Omega, Omega); | ||
bd = b(GammaD); | bd = b(GammaD); | ||
Line 137: | Line 137: | ||
<pre> | <pre> | ||
temp = [Ann Ani ; Ain Aii ] \ [ | temp = [Ann Ani ; Ain Aii ] \ [ jn+bn-And*ud(GammaD) ; bi-Aid*ud(GammaD)]; | ||
u( | u = ud; | ||
u(Omega) = temp(length( | u(GammaN) = temp(1:numel (GammaN)); | ||
u(Omega) = temp(length(GammaN)+1:end); | |||
</pre> | </pre> | ||
Line 145: | Line 146: | ||
<pre> | <pre> | ||
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]] |
edits