Skip to content

Commit

Permalink
Merge branch 'main' of github.com:gmkoeb/laplace-solver into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gmkoeb committed May 11, 2022
2 parents 8912a31 + f84caab commit 2824c2c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Binary file added Efield.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ The program reads a generated mesh (from gmsh https://gmsh.info/) and uses the F
In this example we have a long hollow cylinder divided into 4 different regions with alternating potentials (V=+1V and V=-1V) (Jackson problem 2.14).

## Example

```
$~python3 laplace-solver.py
Solving linear variational problem.
*** Warning: Degree of exact solution may be inadequate for accurate result in errornorm.
error_L2 = 0.9522140841776902
error_max = 1.0
```
![Sample](images/potentialexample.png)
8 changes: 8 additions & 0 deletions laplace-solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
bc = [Etopleft,Etopright,Ebottomleft,Ebottomright]

u_D=Constant(0.0)
<<<<<<< HEAD
plot(mesh)
=======

>>>>>>> f84caab7e665c850ed6c16ea75a773bce64ad810
# Define variational problem
u = TrialFunction(V)
v = TestFunction(V)
Expand Down Expand Up @@ -45,6 +49,10 @@
E=project(-grad(u))
efieldfile = File('poisson/efield.pvd')
efieldfile << E
<<<<<<< HEAD
=======

>>>>>>> f84caab7e665c850ed6c16ea75a773bce64ad810
plt.figure(figsize=(12,7))
pp = plot(u, zorder=3)
plt.colorbar(pp)
Expand Down

0 comments on commit 2824c2c

Please sign in to comment.