# Writing Finite Element Code for Structural Analysis

• Hassan2
In summary, the conversation revolved around the development of a 3D finite element structural analysis code and the complexity of assembling the global stiffness matrix and applying boundary conditions. The poster, Hassan, sought advice and shared their experience with the code. They also mentioned using Java programming language for the solver, which may not be the most advantageous.
Hassan2
Structural Analysis-Writing Finite Element Code,

Dear all,

I have written a code ( in fact it is a software) for 3D finite element structural analysis. While developing the code I found that assembling global stiffness matrix is quite complicated. The complication is even more when we want to reduce the degree of freedom of some of the nodes. Also for giving boundary condition, when we set one or two components of deformation rather that all the three. Now these parts of my code has become so complicated even to myself.
My code works well now but I am wondering if the complexity is usual or if I am doing the job in an ineffective way. Since I have not discussed my methods with anyone else, I thought it would be helpful if I post the problem here. Perhaps some of you have experiences to share.

Regards,

Hassan

Dear Hassan, I also developed finite element Solver and automatic mesh generation program in Java, but for 2D only. I getting accurate result for elliptical, parabolic and hyperbolic governing equations. Your description is short.
Could you give information of following questions?
1. What type of boundary condition you applied: Dirichlet or Neumann?
2. which technique, you are using for elimination of boundary nodes?
3. which language, you used for software?

The post is almost two years old and the problems are solved now. For your information the answer to your questions are the following:

1. I use a variety of boundary conditions. In fact they are not limited to the boundary. I may have Dirichlet/ Neumann/Periodic boundary conditions, or "sliders". By sliders, I mean a certain component of the displacement at a defined region is fixed ( usually to zero).

2. I assemble the matrix for the unknowns only. this may make the matrix construction a bit complicated though but I am satisfied with it.

3. I use Java programming language. The language may not be advantageous for the solvers but since I have also developed the visualization software and that is easier in Java using Java3D library, I keep using Java for the solver too.

Thanks again.

## 1. What is finite element code for structural analysis?

Finite element code for structural analysis is a numerical method used to solve complex engineering problems by dividing a structure into smaller, simpler elements. It involves creating a mathematical model of the structure and using computer algorithms to simulate the behavior under different loading conditions.

## 2. Why is writing finite element code important for structural analysis?

Writing finite element code allows for more accurate and efficient analysis of structures. It also enables engineers to study complex and non-linear behaviors that cannot be solved analytically. Additionally, it allows for the exploration of different design scenarios and optimization of structural performance.

## 3. What are the main steps involved in writing finite element code for structural analysis?

The main steps involved in writing finite element code include defining the problem, creating a finite element mesh, assigning material properties and boundary conditions, solving the equations, and analyzing the results. This process may also involve debugging and refining the code to ensure accuracy.

## 4. What are the limitations of using finite element code for structural analysis?

While finite element code is a powerful tool for structural analysis, it also has limitations. One limitation is that it requires a significant amount of computational resources and can be time-consuming for complex problems. Additionally, the accuracy of the results depends on the quality of the model and the assumptions made in the code.

## 5. Are there any resources available for learning how to write finite element code for structural analysis?

Yes, there are many resources available for learning how to write finite element code for structural analysis. These include textbooks, online courses, and tutorials. It is also helpful to have a strong understanding of mathematics, mechanics, and programming in order to effectively write and utilize finite element code.

• Mechanical Engineering
Replies
2
Views
893
• Mechanical Engineering
Replies
9
Views
2K
• Mechanical Engineering
Replies
7
Views
2K
• Mechanical Engineering
Replies
3
Views
2K
• Mechanical Engineering
Replies
5
Views
6K
• Mechanical Engineering
Replies
3
Views
306
• Mechanical Engineering
Replies
2
Views
1K
• Mechanical Engineering
Replies
3
Views
9K
• Mechanical Engineering
Replies
1
Views
996
• Mechanical Engineering
Replies
1
Views
1K