Git Product home page Git Product logo

truss2d's Introduction

Truss2D

This code implements a Finite Element Method for discretization and solution of two-dimensional truss problems. The governing equations are discretized within the FEM and the resulting linear system of equations is solved with a LU Factorization found in PETSc suite.

Dependencies

To use, it is necessary

Input

There are five *.txt files for inputting the nodes, elements connectivity, boundary conditions and properties.

Elements Connectivity (connectivity.txt)

The elements connectivity is written as:

first_node_1 second_node_1 # first_element
first_node_2 second_node_2 # second_element
...

Coordinates (coordinates.txt)

The nodes coordinates (in meters) are listed as:

x_position_1 y_position_1 # first_node
x_position_2 y_position_2 # second_node
...

Dirichlet Boundary Conditions (dirichletBC.txt)

The Dirichlet boundary conditions are given by "node_number direction value", in which direction is 1 for "x" and 2 for "y" and the value should be in meters:

node_number direction value # 1 for x-direction and 2 for y-direction
...

Neumann Boundary Conditions (neumannBC.txt)

The Neumann boundary conditions are also given by "node_number direction value", in which direction is 1 for "x" and 2 for "y" and the value should be in N:

node_number direction value # 1 for x-direction and 2 for y-direction
...

Properties (properties.txt)

The input properties are the Young's modulus and the section area, the former in Pa and the latter in m²:

value_1 # Young's modulus, in Pa
value_2 # Section area, in m2

Run

To run this code, first edit the "CMakeLists.txt" file with the location of PETsc installation. Set the problem with the input files and call the "truss.sh" script.

Results

The results are exported to *.txt files in the export folder and plotted to *.png files in the plot folder.

Displacement

The displacement field obtained by the solution of the linear system of equations is exported to the trussSolution.txt file as:

u_displacement_1 # Displacement (in meters) in x-direction for node 1
v_displacement_1 # Displacement (in meters) in y-direction for node 1
u_displacement_2 # Displacement (in meters) in x-direction for node 2
v_displacement_2 # Displacement (in meters) in y-direction for node 2
...

The nodes position is plotted in initial configuration and deformed configuration. This results are found in the trussDeformed.png file.

deformed

Reaction Forces

The reaction forces obtained by the solution of the truss problem is exported to the trussReactions.txt file as:

reaction_in_x_1 # Reaction force (in N) in x-direction for node 1
reaction_in_y_1 # Reaction force (in N) in y-direction for node 1
reaction_in_x_2 # Reaction force (in N) in x-direction for node 2
reaction_in_y_2 # Reaction force (in N) in y-direction for node 2
...

The applied and reaction forces in the truss are depicted in the trussForces.png file.

forces

truss2d's People

Contributors

casfeq avatar

Watchers

 avatar

Forkers

ovevans

truss2d's Issues

Add some examples (with screenshots) to the documentation

Hello and thank you for this project!

Could you please provide an example or two (with screenshots) of what this program is capable of?
I'm currently researching truss modelling applications and can't decide whether it suits my needs based on current README. And the building process seems quite complicated since it involves building PETSc...

(Specifically, I'm interested in looking what happens to a truss with many degrees of freedom when you drag some node a little. All elements are supposed to be rigid, I only want to obtain displacements).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.