Skip to content
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

Issue on page /chapter3/component_bc.html #205

Open
tyagi-ankit opened this issue Sep 2, 2024 · 2 comments
Open

Issue on page /chapter3/component_bc.html #205

tyagi-ankit opened this issue Sep 2, 2024 · 2 comments

Comments

@tyagi-ankit
Copy link

It says:

Next, we locate the degrees of freedom on the top boundary. However, as the boundary condition is in a sub space of our solution, we need to supply both the parent space $V$ and the sub space $V_0$ to dolfinx.locate_dofs_topological.

But only the subspace is provided:

boundary_dofs_x = locate_dofs_topological(V.sub(0), mesh.topology.dim - 1, boundary_facets)

Please clarify. I have also seen examples on the discourse where both are specified. It's confusing.

Thanks.

@jorgensd
Copy link
Owner

jorgensd commented Sep 2, 2024

In the case above, we are constraining a single constant value to an interface. Then we only supply a single space in the locate_dofs_topological function.

When we want to use a function to apply the boundary condition in a sub space, we create a function in the collapsed sub-space

V0, _ = V.sub(0).collapse()
u_bc = dolfinx.fem.Function(V0)
u_bc.interpolate(....)

For this use-case, one provides a tuple (V.sub(0), V0) to locate dofs topological, as we want the degrees of freedom in both V0 (to extract data from u_bc) and V.sub(0) (to apply the boundary condition to our system with the full function space V.

@tyagi-ankit
Copy link
Author

Thanks Jørgen for a very quick reply. You are doing a great job. Your reply has clarified things for me.

Still, I think the mentioned chap-3 text still need updating, as it's not consistent with the code.

Also, the clarification you gave, isn't available either in the tutorials or particularly in the API docs. I find many things in FEniCSx to be magical, which the API docs don't clarify.

What you mentioned for locate_dofs_topological, is that true for locate_dofs_geometrical also?

One side question, is there an updated version of "FEniCS book" consistent with the FEniCSx?

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants