Skip to content

warping function as poisson's equation #1031

Answered by kinnala
numenic asked this question in Q&A
Discussion options

You must be logged in to vote

I tried replicating one of the results from you link.

Here is the code. I'm using the version from master, hopefully it also works in your version.

from skfem import *
from skfem.models import laplace
from skfem.helpers import dot, grad
import numpy as np

m1 = MeshQuad.init_tensor(
    np.linspace(0, 200, 41),
    np.linspace(0, 10, 3),
)

m2 = MeshQuad.init_tensor(
    np.linspace(0, 200, 41),
    np.linspace(290, 300, 3),
)

m3 = MeshQuad.init_tensor(
    np.linspace(95, 105, 3),
    np.linspace(10, 290, 40),
)


m = m1 + m2 + m3
# it seems you need to move the origin
# so that it matches the center of mass
# to get similar result as at stackexchange
m = m.translated((-100, -150))

basis 

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kinnala
Comment options

Answer selected by kinnala
Comment options

You must be logged in to vote
1 reply
@kinnala
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants