-
Notifications
You must be signed in to change notification settings - Fork 97
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
confusion about vectors sizes #973
Comments
@mahdimasmoudi I would probably need to see the code. |
I am following a similar code of this tutorial. I am just changing the input msh file to a simple cube.
|
Is the mesh composed of cubes or tetrahedra? |
Let's assume it's cubes, i.e you have In that case, each reference element has On top of this, you have dirichlet boundary conditions. That means that all dofs on the boundary will be eliminated and their contributions with go to your rhs. So those get subtracted from your total matrix size. When writing to vtk, you are not using the option to store higher-dimensional data. So your solution is interpolated back into first order. Probably the dirichlet dofs are added back, since VTK needs complete nodal data. So it's quite a bit more complicated than you think. If you want the simplest case, I would recommend a cartesian mesh with first order 2D scalar elements without any boundary conditions. You'll probably get easier counts. |
I am trying to undestand few steps from the code and I need help understanding how results are derived.
I start with 45 nodes of a simple cube. I get 100 elements from this mesh.
A=get_matrix gives a 1785 x 1785 matrix
b=get_vector gives a 1785 elements vector. I suppose I am going to solve the system AU=b where U is the displacement I am solving for.
The confusion comes out of the fact that U should have the dimension: number of nodes * number of DoFs which is 135 in this case and not 1785.
When I reach the last step to store the results in a vtk file it turns out that the vector stored is a 400 elements vector which is even more confusing.
I appreciate any help in this regard.
The text was updated successfully, but these errors were encountered: