-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assigning dirichlet BC to a component of a vector field #456
Comments
In ex27 I had to do something similar: impose a Dirichlet condition on the velocity at the inlet. That used scikit-fem/docs/examples/ex27.py Lines 124 to 137 in 4aa87e1
You don't need the I'm not sure about |
I just took a look at scikit-fem/skfem/assembly/basis/basis.py Lines 91 to 101 in 4aa87e1
So incorporating it, the code looks much cleaner: dofsold = [
basis["u"].find_dofs({"left":mesh.facets_satisfying(lambda x: x[0] == 0.)}, skip=["u^2", "u^3"]),
basis["u"].find_dofs({"bottom":mesh.facets_satisfying(lambda x: x[1] == 0.)}, skip=["u^1", "u^3"]),
basis["u"].find_dofs({"back":mesh.facets_satisfying(lambda x: x[2] == 0.)}, skip=["u^1", "u^2"]),
basis["u"].find_dofs({"front":mesh.facets_satisfying(lambda x: x[2] == 1.)}, skip=["u^1", "u^2"])
]
dofs = {}
for dof in dofsold:
dofs.update(dof)
du[dofs["left"].all()] = 0.
du[dofs["bottom"].all()] = 0.
du[dofs["back"].all()] = 0.
du[dofs["front"].all()] = stretch_
I = basis["u"].complement_dofs(dofs) Now back to debugging #455 Thanks a lot for the help |
Let me add that ea1e72b introduced these Note: There is some vague performance issue I encountered with |
In a way this is related to #455 but may be relevant in general too. What's the best way to select dofs that belong to a specific component of the solution?
For instance, consider a unit cube where I want to specify u_1 = 0 on the left (x=0), u_2 = 0 on the bottom (y=0) and u_3 = 0 on the back (z=0) faces. Note that the remaining two components on each face are left unconstrained (physically, like in uniaxial tension). Currently I am tempted to think of it in a brute force way:
I am still thinking if the above is correct (as in it doesn't duplicate dofs or selects dofs that have dirichlet boundary specified).
Naturally, what would be the best way to assign dofs such that only the ones corresponding to a component are assigned and the
complement_dofs
method takes care of the rest ? (Is there any other method instead, that I should use?)The text was updated successfully, but these errors were encountered: