Skip to content

Commit

Permalink
to_meshtri
Browse files Browse the repository at this point in the history
  • Loading branch information
gdmcbain committed Aug 18, 2020
1 parent 31d9155 commit 7eb3016
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs/examples/ex18.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
r"""Stokes equations.
.. note::
This example requires the external package `dmsh <https://pypi.org/project/dmsh/>`_.
This solves for the creeping flow problem in the primitive variables,
i.e. velocity and pressure instead of the stream-function. These are governed
by the Stokes momentum
Expand Down Expand Up @@ -44,16 +41,18 @@
"""
from skfem import *
from skfem.io.json import from_file
from skfem.models.poisson import vector_laplace, mass, laplace
from skfem.models.general import divergence, rot

from pathlib import Path

import numpy as np
from scipy.sparse import bmat

import dmsh

mesh = MeshTri(*map(np.transpose,
dmsh.generate(dmsh.Circle([0., 0.], 1.), .1)))
mesh = from_file(Path(__file__).with_name("disk.json")).to_meshtri()
mesh.scale(1/np.linalg.norm(mesh.p, axis=0).max()) # unit radius

element = {'u': ElementVectorH1(ElementTriP2()),
'p': ElementTriP1()}
Expand Down

0 comments on commit 7eb3016

Please sign in to comment.