Skip to content

Commit

Permalink
use MeshTri.init_circle in exx; fixes #476
Browse files Browse the repository at this point in the history
  • Loading branch information
gdmcbain committed Sep 16, 2020
1 parent e292734 commit 9eae8b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions docs/examples/ex12.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@

import numpy as np

m = from_file(Path(__file__).with_name("disk.json"))
m.scale(1/np.linalg.norm(m.p, axis=0).max()) # unit radius
m = MeshTri.init_circle(4)

basis = InteriorBasis(m, ElementQuad2())
basis = InteriorBasis(m, ElementTriP2())

A = asm(laplace, basis)
b = asm(unit_load, basis)
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/ex18.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
from scipy.sparse import bmat


mesh = from_file(Path(__file__).with_name("disk.json")).to_meshtri()
mesh.scale(1/np.linalg.norm(mesh.p, axis=0).max()) # unit radius
mesh = MeshTri.init_circle(4)

element = {'u': ElementVectorH1(ElementTriP2()),
'p': ElementTriP1()}
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/ex20.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
import numpy as np


mesh = from_file(Path(__file__).with_name("disk.json")).to_meshtri()
mesh.scale(1/np.linalg.norm(mesh.p, axis=0).max()) # unit radius
mesh = MeshTri.init_circle(4)
element = ElementTriMorley()
mapping = MappingAffine(mesh)
ib = InteriorBasis(mesh, element, mapping, 2)
Expand Down

0 comments on commit 9eae8b9

Please sign in to comment.