Hello Christopher,
I'm following up on my earlier questions. I've attached a file with a 2D mesh (SEC_2D_lin_tri.vol) and the python script (try2.py) to set up a simple static elasticity problem in NGSolve. The solution is a 2D vector field with components, say, ux & uy. The Dirichlet BCs to be applied are:
a) uy=0 on Ysym (x>=0 and y=0)
b) ux=0 at the bottom right corner (x=10, y=0)
The top surface (Pres_load) has a non-zero Neumann condition. This is a well-posed problem and is a standard test problem in linear elasticity.
When I use the function space for the trial and test functions and set the flag dirichlet="Ysym", both degrees-of-freedom (ux and uy) are enforced on Ysym - this is not what I want. So I do not set the dirichlet flag while declaring the funtion space. Instead, I use lines 34 to 55 in the python script to define the Dirichlet BCs similar to your suggestion. When I print the FreeDofs() bit array, all the bits corresponding to the Dirichlet BCs are '0', and I verified that the correct DOFs are selected. However, the system matrix seems to be singular and the solution is NaN everywhere.
Can you let me know what I'm getting wrong here? Is there a cleaner way to implement BCs on individual DOFs (something similar to line 92)?
Another unrelated issue: When I read this mesh and try a uniform refinement, mesh.Refine(), the code throws a segmentation fault.
Thanks,
Anand
File Attachment:
File Name:
try2.py
File Size:3 KB