Skip to main content

22 posts tagged with "API"

View All Tags

Parametric truss

Β· 7 min read
Marco Pellegrino
Nerd Structural Engineer

Hi Everyone πŸ‘‹!

Today, we would like to to show you one simple exercise to get familiar with FEM-Design API through Grasshopper.

The β€œHello World!” for parametric structural engineering. The Parametric Truss!

Untitled

Challenge​

Can you guess which nodes have I constrained?

If you give me the right response, I’ll create a custom example based on your request

Introduction​

The article will highlight the most basic workflow necessary in order to create, analyse and read the results of a generic model.

The workflow consists in the definition of:

  • Geometry
  • Materials
  • Sections
  • Element such Bar, Supports
  • Load
  • Analysis
  • Result Reader

The picture below shows the entire workflow.

Grasshopper script

Grasshopper Script

Geometry definition​

The following script allows you to create a truss with diagonals.

The following parameters can be modified:

  • Length
  • Height
  • Number of Subdivision

Geometry Script

Geometry Script

Truss Geometry Visualisation

Truss Geometry Visualisation

Modifying the parameters will generate a different geometry and therefore, it will be possible to understand their behaviours with the use of a single script. 😎

Pre-processing

The geometries (points, lines and meshes) need to be converted in mechanical elements and in order to do so, the objects require some additional information including:

  • material
  • section
  • connectivity

Material definition​

FEM-Design provide a list of material to choose from. MaterialDatabase.Default component will return some list grouped by material type.

The material can be selected using the provided Material.GetMaterialByName|Index. The material name can be seen directly from the output. It is up to you to decide if you want to use a string or int to select the desired material.

Material Definition Workflow

Material Definition Workflow

Section definition​

The same workflow has been created to select a Section. SectionDatabase.Default component will return some list grouped by section type and Section.GetSectionByName|Index will help you in selecting the right section.

Section Definition Workflow

Section Definition Workflow

Great! πŸŽ‰

We have the minimum ingredients to convert a Line to a Bar.

Element definition​

Bar.Beam is the component necessary to create a Beam element. As you can see from the picture, material and section are plugged in the Bar.Beam component in their respective input. Additionally, you can see a Connectivity component which define the internal release of the element. By default, the connectivity is defined as Connectiviy.Rigid. For our example, Connectiviy.Hinged has been choosen.

Bar.Beam Definition Workflow

Bar.Beam Definition Workflow

Constraint definition​

Every structure needs to be anchored to gain stability. FEM-Design API provides you different way to define the PointSupport and some of them are ready to be use.

Support Constructors

Support Constructors

I personally like to define my anchors with PointSupport.Simple. It is the quickest way to define a generic support if you don’t require to check the uplift.

PointSupport.Simple Definition Workflow

PointSupport.Simple Definition Workflow

Loads​


While I was a student, a teacher of mine use to told me: β€œGravity Load never sleep” πŸ’€

So let’s make sure to apply all the necessary loads!

PS: The article will show you only few type of loads. Make sure to check the load section and see what it is possible.

Load case definition​

Loads have different intensity, different nature, different probability and different risk.

The nature of the load can be translate with the idea of LoadCase .

There are several way to create those and I wanted to show you two. The first option is to use a different component for every load case while the other option (more elegant) is to create a tabular data (it can be a a .csv file or plain text) from which we can read the values.

LoadCase Definition

LoadCase Definition

As you can see from the picture below, the approach is more scalable and it will have less spaghetti 🍝

LoadCase Definition from Tabular Data

LoadCase Definition from Tabular Data

Load combination definition​

LoadCombination are defining if the LoadCase should act together and their GammaFactor.

The easies way to create them is with the Table technique approach as you see in the picture below. I highly suggest you to tried in using my workflow. You should be satisfied. From 21.4.0, it will be possible to see a custom visualisation of the object as it is shown in the white panels. It will be pretty easy to see if the input are read correctly.

Untitled

Load definition​

In the following section, you can see how to apply some PointLoad.Force and LineLoad.Force.

Those components are the one which will define the intensity and location of the forces.

Load Definition Workflow

Load Definition Workflow

Model construct​

As soon as you have defined all the ingredients, it will be time to combine them all together and Construct our FEM-Design model. Remember to flatten if you want to make sure to create only one model.

Model.Construct

Model.Construct

Analysis​

It is finally time to prepare our model to be analyse with FEM-Design. Application.RunAnalysis is the component that will send our model to FEM-Design application and trigger the calculation.

Several analysis can be performed through the API but, in this case, we are only interested in LoadCase and LoadCombination solution. There is also the option to read some results at the end of the calculation. ResultType component will show you what it is possible to extract. Feel free to contact us if you need something different.

Untitled

Run Analysis with Results

Post processing​

It is finally time to investigate the behaviour of our Structural Model. The process of investigation can be done through the API reading the results.

It is important to notice that FEM-Design will generate a Finite Element Model for his calculation and it is a good habit to see what it calculates. FdFeaModelallows you to check the geometry with minimum efforts.

FEA model geometry​

Black - Input Geometry, Blue - FEM-Design Model

Black - Input Geometry, Blue - FEM-Design Model

Results​

It is time to see how to visualise some text on display. The picture below show you a simple way to see the nodal displacement with a Magma color map. I want you to remind you that the process of visualising the result is one of the topic where the automatization should be done. Feel free to save the script and use it every time you need to visualise the nodal displacement. It is good habit to save those workflow as cluster so that you don’t need to create them from scratch all the time.

Nodal Displacement Visualisation Workflow

Untitled

Nodal Displacement Visualisation Workflow

Bonus​

It is not always necessary to represent our results to a 3d model. Most of time is enough to have numerical data on screen in form of text.

The following script is to highlight that with FEM-Design API is already possible to create some complex numerical visualisation. It does require some effort but it is definitely possible :)

3d model with result Visualisation Workflow

3D model Preview

3d model with result Visualisation Workflow

FEM-Design API developer are always ready to reply to the user concerns/issues.

Feel free to use one of the following link to reach out πŸ™‚

πŸ”— Github

πŸ”—Β FreshDesk

πŸ”—Β WikiFem

Release 21.3.0

Β· 5 min read
Marco Pellegrino
Nerd Structural Engineer

New feature​

FemDesign API has been constantly developed and new features/updates have been created with the aim to simplify the process. Automating the boring stuff and be focus on creating great and efficient design is the mission.

The following article will be focus on the API implementation for Rhino/Grasshopper but bear in mind that the same is possible in C# and Dynamo.

If you want to follow along, download our tool from:

Result reader​

One of the most important feature that it has been released regards the ResultReader function.

Reading results with the API allows the users to do post-processing without the need to use the GUI that FemDesign provide. It is a pivotal feature because it creates different scenario in the daily work of structural engineering.

Several output can be read directly programmatically and the picture below show the most crucial output. If you need some different results reader, just drop us a line and we will implement what it is required for your project πŸ™‚

Result types

Result types

As soon as you have return the desire results, it will be possible to create all kind of post-processing within your favourite tool.

For example, a user might want to visualise the internal forces in a structure and with a little script it is now possible.

Internal Forces in a Truss Structure

Internal Forces in a Truss Structure

An other user might want to visualise the effect of some load combinations to the reaction forces. Again. A little script will do the job.

Reaction Forces

Reaction Forces

The possibilities are handless. Feel free to drop a line if you get stuck and we will help you out.

Example

ReadResult.zip

Construction stages​

The Construction Stages feature is definitely one of the most particular feature has been asked to develop for a customer project.

Most of our structure are not affected from Construction Stages as the variation of the stress/stiffness distribution can be neglected. However, there are some particular case where the assumption is not valid anymore and the Construction Stages need to be considered.

FemDesign API allows to solve the issue to manually create the stage series and instead, you create those with few lines of code.

Construction Stages Definition

Construction Stages Definition

The result will be a model with stage assigned to the elements and the solver will calculate the structure accordingly.

The FemDesign wiki page has all the information regarding the theory behind the calculation.

Construction Stages Animation

Construction Stages Animation

Example

ConstructionStages.gh

ConstructionStages_Advance.gh

Run design​

FemDesign API does not only allows you to interoperability exchange model from different platform but it gives you the access to the core numerical engine.

Run Design is a key feature that will allow you to understand the structural sections require to hold the input load combinations.

The process will run an iterative calculation and stress check on every single element until it does not find a successful candidate.

Run Design Workflow. Difference between the Input and Output Model.

Run Design Workflow. Difference between the Input and Output Model.

Optimisation Process

Optimisation Process

TrussBridge.3dm

TrussBridge.gh

User friendliness​

Technology can be overwhelming and going across all the API feature might give some confusion. Nevertheless, the user interface is one of the primary aspect that we take in consideration and several improvement are made on a daily basis.

Material​

Some of components have been refactor to speed up the creation of some of the structural elements. Material.Default is now outputting the material divided by type and it does not require any additional work to see what materials are available.

Untitled

Material Component

Point support​

Every single structural model has at least one support. After listening at some user feedback, we have decided to tackle the issue and simplify the process creating a new component PointSupport.Simple. The component is assuming a linear behaviour of the anchorage (i.e. it does lock the DOF in positive and negative direction)

Furthermore, the local axis for the point support can now be set with the use of a plane geometry.

Support Along a Curve

Support Along a Curve

OrientSupport Point.gh

Divider​

Do you like clustering object by colour, material, dimension or type?

If so, you will appreciate the use of divider for all the FEMDesign API section for Grasshopper.

Untitled

Divider

Future work​

The aim is to constantly add new feature and below a short and not exhaustive list of work to be done

  • C# constructor
  • Additional result Reader
  • Create more Analysis type (Stability, Footfall, Response Spectrum, ect ect)

FemDesign API developer are always ready to reply to the user concerns/issues.

Feel free to use one of the following link to reach out πŸ™‚

πŸ”— Github

πŸ”—Β FreshDesk

πŸ”—Β WikiFem