Calculix FEA Beam Part 4: Post Processing Results in CGX

The cgx program provides a rich set of functionality for post processing the results file.  This article will explore some of that functionality by examining the results of the cantilever beam problem from the previous article.  The goal of this series of articles is not to provide an outline for the best practice analysis of a beam.  But rather to educate the reader with respect to the rich functionality available in this dynamic duo of GPL FEA solvers.

Open the input file beam.inp in SciTE.  Choose Tools -> Post Process from the menu system.  This will launch cgx with the beam.frd results file.  Note that this is different from using Tools -> Pre Process in the previous article.  In that article the currently open file was beam.fbd, the cgx batch file.  By choosing Pre Process cgx was activated with the current file as input.  This is not the case when using the Post Process menu option. Choosing to post process will open the file with the same base name, beam, but with the extension .frd.  This way an input file can be adjusted, solved, an post processed quickly. Also note, the Tools -> Pre Process option opens up the current file beam.inp and ignores everything except the mesh, which will be displayed in cgx. If it is necessary to modify the original geometry the beam.fbd batch file will need to be modified.  Obviously if you’re using Linux or Cygwin none of this need apply, just call the command in the shell.

With the beam.inp file open and the Post Process selection completed the screen should show the mesh as a gray shaded body with black outline.  Use the left mouse button to bring up the menu system.  Notice the menu heading Datasets has been added to the list. This menu option is only available when working with an .frb file containing some simulation results.

In this simulation there are two fields available for visualization.  They are displacement and stress.  Clicking on one of the menu items at this level will select the results field of interest.  Then the particular information from the field will need to be specified.  This is done by choosing an option from within the -Entity- submenu will result in a colored plot of the selected field information as shown below.

Now toggle the displacement to visualize the deformed shape.  The resulting displacement from this simulation is quite small.  It will not be noticeably visible.

To scale up the displacement use the keyboard command scal d 10000.  This will scale the deformed shape by a factor of 10000.  The deformation from this load is quite small and requires a large scale factor.  Each repeated use of the scale command with a numerical parameter will act as a multiple of the current scale, thus further exaggerating the deformation.  The shape can be returned to the default scale by using the scal d command without the numerical value.

The viewing mode can be returned to the default gray beam by choosing Viewing->Show All Elements With Light. This will exit the currently active visualization.  This command is often used to reset the display to a known state.

Another option to visualize the shape of the deformed structure is through animation.  This feature will animate the model’s deformation with user specified scale.  Animation can display the real displacements as well.  Use the menu system and select Animate->Start to view the animation.  The image below shows the beam as it oscillates between -100% and 100% of the deformation amplitude.

The following image shows the options available within the animation.

The Tune-Value menu will configure the scale of the animation plot.  Steps per Period will break up the animation into more steps and result in a smoother looking animation.  The Time per Period will allow for adjusted animation length in seconds.  While the animation is playing the middle mouse button can be used to pause it by clicking in the menu area.  Then the right mouse button can advance the animation one step at a time.  To restart the animation use the middle mouse button again.  Also note, after the animation restarts it might be necessary to move your mouse to refresh the screen.  Often times a command will execute and the results will not be immediately visible.  Simply move the mouse without clicking any buttons and the cgx display will refresh.

In addition a movie can be exported using the movi command.  This command uses an animated GIF to create a saved copy of the animation.  The user controls how many frames of the animation are exported to the final movie.  First off the command movi delay 0.01 is used to establish a default delay between frames of the animated GIF. Then the movi start command is used to start exporting frames of the movie. At this point there will be output from cgx showing the creation of individual frames, convert hcpy_0.tga _1.gif.  The animated GIF above has the Animate -> Steps Per Period value set to 36.  This means a total of 36 frames will be written as individual files to disk.  After number 36 comes up on the output log type movi stop.  Now use the command movi make 1 36 to turn the individual files into a single animated GIF.  There will be 36 individual frames in the working directory saved as GIF files.  In addition, there will be a file named movie.gif that was created by the last command.  In order to clean up the individual frames use movi clean to delete the individual frames from disk.  This also readys cgx to export another movie at the user’s discretion.

The cgx post-processing mode allows the user to specify a cut plane.  The plane will cut through the model and show the field results for the intersection of the model and plane.  The cut plane is defined by three nodes.  The nodes can be specified from the menu system using the Cut menu.

The following image shows the result of cutting the beam top to bottom.  The field shown is the normal stress in the x direction.  The results are as we would expect, the top of the beam is in tension and the bottom is in compression.

In addition values from the different result fields can be plotted to a graph for interpretation.  The graph command is accessible from the menu system under Graph.  The graph is also accessible through the command line.  If multiple graphs will be generated for the same set of nodes it is best to add them to a sequence.  This is accomplished using the qadd graphseq s command to create a new sequence of points.  Note that a sequence is different from a set.  A sequence preserves order information.  When using qadd make sure to select nodes one at a time in the desired order.  Bulk add will include nodes according to node number when used with a sequence.  This will put the results out of order on the x-axis when attempting to graph the nodal values.  The following example plots the total displacement of nodes along the top of the beam at y=10 and z=0.  They span along the x-axis starting at the fixed end and progressing towards the free end.  The desired field for plotting must be the currently active field selected from Datasets. The rot -z followed by rot u 45 will result in a view of the beam as shown in the following image.  Node number 101 is located at x=0, y=10, z=0.  Nodes number 97, 93, 89, …, continue out in the positive x direction.  Also note that the numbers are not in order with increasing x which causes problems with bulk add if using the qadd and graph method.

The nodes are selected a few at a time, perhaps three or four, then the tra l 10 command is used to pan the model to the left by translation of 10 units.  At which point another few nodes are selected.  This process is repeated as the translation command moves towards the free end.  Then the last nodes are selected and the right mouse button is used to finish the selection process.  Finally, the following graph is promptly displayed.

While viewing the colored plot of a results field it is also possible to add the nodal values.  The following images shows top side of the beam’s free end, near x=100, y=0, z=0. The nodal values are printed in yellow using the commmand plus nv all y. These values agree with the results of the graph.

The following image shows a reduced set of nodes.  These nodes are spaced every 10 units across the top of the beam.  Viewing the entire beam is difficult when several thousand nodal values are print on the screen.  Limiting the nodal values to an interesting set is likely the best use of this tool.

This concludes the four part tour of Calculix articles.  This series is intended not to focus on the results of a specific problem, but rather to highlight the various functionality within Calculix and serve as a foundation for future articles.  Future articles will delve into specific functionality and examine the application of Calculix.  The functionality outlined in this series will serve as a common denominator amongst readers.  Future articles will document the specific functionality of a subsystem and rely on this document to provide the foundation.

Thanks for reading!
-Ty Beede

About mechanicalguy

My name is Ty Beede and I'm a mechanical engineer currently working in the aerospace sector. My interests include computational structural analysis, metal fabrication, building and modifying Jeeps for extreme off-roading, and design/fabrication of bicycles for on and off road use. I enjoy working hard and my passion in life is building and learning new skills related to mechanical, computer, and electrical engineering.
This entry was posted in Calculix FEA Tutorials. Bookmark the permalink.

2 Responses to Calculix FEA Beam Part 4: Post Processing Results in CGX

  1. Jeff Baylor says:

    This tutorial is great! I love your entire site. Keep up the good work. -Jeff

  2. FB says:

    Hi, I am a civil enginner and I am interested a lot in FE-Programs. A few weeks ago I started to learn Calculix and I liked it a lot. My goal ist it to “couple” Calculix in batch-mode with an Excel-Sheet. I start Calculix in batch-mode from the excel-sheet, Calculix solves the problem and brings results and hardcopies back to the excel. This should be useful to calculate plates (a problem i have quite often at work). I would like to create an Input-File (.inp) with excel, then I mesh and solve it with calculix in batch-mode. I arrived until there, thanks to your tutorials and the Calculix help, and it works great.
    But I wasn´t able to postprocess the problem in the batch-mode. You explained in your article how you postprocess with cgx. Could you tell me how I plot the stress and deformations of such a problem in batchmode, or where I finde an exampel of how to postprocess in batchmode?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s