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

Clamping both ends (dynamic.py) #1

Open
barancimen opened this issue Mar 16, 2021 · 2 comments
Open

Clamping both ends (dynamic.py) #1

barancimen opened this issue Mar 16, 2021 · 2 comments

Comments

@barancimen
Copy link

barancimen commented Mar 16, 2021

Is it possible to solve this convergence issue when I clamp both ends?

t_root = tangent(coords[0])
n_root = normal(coords[0])  
t_tip = tangent(coords[-1])
n_tip = normal(coords[-1])
w_tip = coords[-1]

bc_t = DirichletBC(V.sub(0), Constant((t_root[0], t_root[1], t_root[2])), root)
bc_n = DirichletBC(V.sub(1), Constant((n_root[0], n_root[1], n_root[2])), root)  
bc_w = DirichletBC(V.sub(4), Constant((0., 0., 0.)), root)
bc_v = DirichletBC(V.sub(5), Constant((0., 0., 0.)), root)

bc_t2 = DirichletBC(V.sub(0), Constant((t_tip[0], t_tip[1], t_tip[2])), tip)
bc_n2 = DirichletBC(V.sub(1), Constant((n_tip[0], n_tip[1], n_tip[2])), tip)  
bc_w2 = DirichletBC(V.sub(4), Constant((w_tip[0], w_tip[1], w_tip[2])), tip)
bc_v2 = DirichletBC(V.sub(5), Constant((0., 0., 0.)), tip)

bc = [bc_t, bc_n, bc_w, bc_v, bc_t2, bc_n2, bc_w2, bc_v2]

I get Newton solver did not converge because maximum number of iterations reached. at the first time step and playing with parameters doesn't help.

Thanks

@mou3adb
Copy link
Collaborator

mou3adb commented Mar 16, 2021

Hi @barancimen,

That's right, though I guess the convergence problem is due to the boundary conditions. I had the same trouble before when I applied a load force on the clamped end, seems that using UserExpressions and point-wise force assignment, Fenics doesn't accept forces applied on points having already boundary conditions. I added in line 242 in dynamic.py another condition and not(np.equal_array(coords[-1], x)) in order to avoid to apply force on the tip. But this didn't help much...

I think Fenics checks all the unknowns if they have a corresponding boundary condition. In your try there isn't any bc for Omega and Fint. Another thing is that there is a surplus of bcs, 8 vs only 6 unknowns to solve for. I suspect that the lagrangian itself should be modified, particularly L_dFds and L_dMds. I'd be curious to see a solution for this issue, despite the scarcity of 1D element Fenics simulations on the web...

Mouad

@barancimen
Copy link
Author

I'll let you know when I fix it. Thanks

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