Assigning displacement on nodes (when using condense) #1068
-
Hi @kinnala, I hope you are well. I'm continuing with my plate deflection project (using some stuff from your Ex 2), and am now adding some stiffeners (like braces). When using the condense function, I know it's possible to replace nodes with displacement equal to zero, for others values. Is there a way to do such a thing by assigning the value by his node? Thanks in advance and I wish you a lovely weekend. Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Something like: x = basis.zeros()
D1 = basis.get_dofs('brace1').all('u')
x[D1] = [...] # your values go here in the correct order
# the order is the same as in basis.doflocs[:, D1]
x = solve(*condense(K, f, x=x, D=D1)) If you have multiple braces then you can do |
Beta Was this translation helpful? Give feedback.
-
Hi @kinnala , thanks a lot for your quick answers. I am using ElementTriMorley: Also, just to add some results, please see the displacement plots (normal direction to the plate) versus the one obtained from the code: I can assume that the normal displacements ("z" axis) are okay, which are very close between both plots. The boundary conditions are defined as: As I am coding the script with the idea of including 2 settings (without or with braces on the plate), I generate a new mesh variable that includes the braces, over the mesh for the braceless setting (called "M"): (The function list_of_faces_and_nodes_indexes.... gives you the close faces and belonging node indexes (for certain x and y positions in the space). For this case I only pick the faces between the start and end point of that brace) Later, they ("left", "top", "right", "bottom", "horiz_1") are restricted as: Then, I calculate the displacement solutions as: The next step I do is to define a variable "u" that stores the interpolation results of "w" into the basis I'm using, and then I use that "u" to obtain the stress fields (sigma_xx, sigma_yy, tau_xy, sigma_vm), using the constitutive relationships. I hope this explanation of what I've done helps. Really, thanks a lot @kinnala for your effort with all my queries. Kind regards, |
Beta Was this translation helpful? Give feedback.
-
Hi @kinnala. Besides, with the function "calculate_list_displacement_brace" I obtain a list of displacements, using the list from D1. So, I obtain a list of displacements and the index position of D1 corresponds to the index position of "calculate_list_displacement_brace". Please tell me if this is what you mean with having the same order. Thanks in advance and wish you a good day, Cheers, |
Beta Was this translation helpful? Give feedback.
Something like:
If you have multiple braces then you can do
D1
,D2
, etc. and concatenate them:D=np.concatenate((D1, D2))
.