User:Yongtao-Li/HW4.7

=Problem 4.7=

Given
Introduction to Calculix - A non-linear Finite Element Analysis Code

Calculix is an open source Finite Element Analysis code with the authors acknowledging that naming conventions and input style formats for CalculiX are based on those used by ABAQUS, a proprietary and commercial, general purpose finite element code but the results obtained from CalculiX are in no way connected to ABAQUS.

Website for informational and software download (Linux executable) purposes - http://dhondt.de/ Website for informational and software download (Windows executable) purposes - www.bconverged.com/calculix

Calculix in all has 2 major modules, namely- 1. CGX ( Calculix Graphics Module ) - This program is designed to generate and display finite elements (FE) and results coming from CalculiX CrunchiX (ccx).The Concept and File Format sections give some background on functionality and mesher capabilities. The Getting Started section describes how to run the verification examples you should have obtained along with the code of the program.

2. CCX (Calculix CrunchiX (Solver) Module) - This is a theoretical section giving some background on the analysis types, elements, materials etc. Then, an overview is given of all the available keywords in alphabetical order, followed by detailed instructions on the format of the input deck. If CalculiX does not run because your input deck has problems, this is the section to look at. The last section contains a description of the verification examples you should have obtained along with the code of the program. If you try to solve a new kind of problem you haven't dealt with in the past, check this section for examples. You can also use this section to check whether you installed CalculiX correctly (if you do so with the compare script and if you experience problems with some of the examples, please check the comments at the start of the corresponding input deck). Finally, the User's Manual ends with some references used while writing the code.

Find
a) Installation of the Calculix Graphics Module and to explain the installation process for layman(CGX) b) To access the CGX manual c) To sign up with used group for asking the queries,if any and to gain access to the archives where we can access the email conversation from various users,a source of possible learning d) To reproduce the basic inbuilt examples from CGX data base installed on your machine, with a detailed report, about entities such as - 1. Dics 2. Cylinder 3. Sphere 4. Sphere Volume 5. Airofoil The report shall include explanation to all the CGX commands used to generate above example geometries along with their meshes using screen-shots of the useful explanatory steps.

For Linux
For a naiver Linux user now using Windows, we strongly recommend using Ubuntu as your linux operating system which can be easily downloaded and installed at Ubuntu

To install Calculix for Linux, start by downloading the source code and examples available at http://dhondt.de/cgx_2.2.all.tar.bz2. Right now you need open a terminal by selecting that from Applications as in the following picture.



Before installation, you should check openGL on your system by typing the following words in your terminal:

find /usr/* -name libGL* -print

And the following results show that you have the openGL-library which is needed.

/usr/lib/mesa/libGL.so.1 /usr/lib/mesa/libGL.so.1.2 /usr/lib/libGLU.so.1 /usr/lib/libGLU.so.1.3.070701

Another thing you need is c++ complier since we have to compile the source code. You can check where is your c++ complier by typing

which c++

If you don't have these essential things, please typing the following to download and install them sudo apt-get install linux-kernel-headers sudo apt-get install build-essential

Then we start to install cgx.

1.Unpack the file cgx_2.2.all.tar.bz2 in "/usr/local". An easy way is first exacting the compressed file using your right mouse menu and then copy to the destination.

2.Then enter the folder where the source code located by typing

cd /usr/local/CalculiX/cgx_2.2/src/

3.Run "make" as a root and copy the binary "cgx" to "/usr/local/bin/cgx" with

cp cgx /usr/local/bin/cgx

4.Run "latex cgx" in "/usr/local/CalculiX/cgx_2.2/doc" for three times and then run "latex2html cgx".

5.Now your CalculiX has been installed and please enjoy

6.In order to check the installation, type

cgx -b dummy.fbd

and you can see a window appear on your screen as following.



Note:

1.If you are counting any problems for being unable to find any *.h, you can type the following to ensure that you have install all the essential libraries before building the source codes

sudo apt-get install build-essential libsdl1.2debian libsdl1.2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl-image1.2 libsdl-image1.2-dev

For Windows
To install CalculiX for Windows, start by downloading the executable file available at http://www.bconverged.com/download.php.

Before installing CalculiX, we recommend that you create a folder that you will want to use as your workspace for CalculiX files.

Access the zip file, CalculiX_2_2_win_002.zip, and run the executable CalculiX_2_2_win_002.exe. Review the license agreement and select "I agree" when you are prompted to as shown below.



The next screen will ask you to select the directory to which Calculix will be installed. You may use the default directory or click "Browse" to select the directory of your choosing. Once you have the desired directory in the "destination folder" field (1) click the "next" button (2) to continue.



You will now be shown a prompt which allows you to choose which components and/or extensions of the program you wished to have installed. It is recommended to use the default settings unless you are an advanced user. Click "Install" to begin the installation.



When the installation begins you will be asked to specify a folder or directory to use as your workspace. Choose the folder you created prior to starting the installation on the file tree and click "OK"



CalculiX will now begin installing onto your computer. When completed you will be presented with the screen below. Specify if you'd like to view the help file by checking or un-checking the corresponding box and then click "Finish" to complete the installation process.



Congratulations !! You have completed installing CalculiX on your Windows based computer.

Access to CGX manual
To locate the user manual after installation of the software, begin by clicking on the windows start button. All programs will open and select the folder bConverge. This folder will open with all of the calculix programs listed, however to access the manual double-click on the help icon inside of the bConverged folder. This action will open a new window containing several folders. Expand the Calculix folder and then the CGX folder. This will bring you to the Calculix User's Manual -Calculix GraphiX, Version 2.2- as shown below.



To navigate through the manual any of the blue links in the initial index will take the user to that section of the the manual as shown in the above picture. Pressing ctrl+f will allow the user to find a particular word within the manual as well. At the top of the manual, there are four buttons Next, Up, Previous, and Contents as shown below. The function of these buttons is presented below.



Next: Flips to the next page of the manual. Up: Returns to the previously viewed screen before a link was clicked. Previous: Flips to the previous page of the manual. Contents: Takes the user to the index of links of all contents in the manual.

Additional help while Getting Started- The Calculix User Group
Student can join the yahoo user group dedicated to the forums related to knowledge sharing about Calculix. In the very friendly environment of these forums, the student can present their difficulties and queries and can get benefited by the knowledge of many other Calculix users. Student will be given a choice of joining this user group while in some final steps of the software installation. Even if the student misses to join it at the time of installation, he/she can join the group later using help on Calculix or from Calculix website online. With the help of this user group, the student will be able to have access to the email archives of the group members which at times can become useful to answer at least some of the queries or for informational purposes.

Reproducing the basic inbuilt examples from CGX- A report
Here we present the steps, codes, explanation to all the CGX commands used in the codes to generate the sample inbuilt example geometries in CGX database after installation, along with their meshes using screen-shots of the useful explanatory steps. Please refer to the CGX manual (as explained in the above section) for more details.

Figure
Following figure 4.7.1 shows the geometry and the mesh generated by CGX for a disc in four 90 degree segments-



Geometry generation code
Following figure 4.7.2 shows the code to generate the geometry and the mesh by CGX for the disc in Figure 4.7.1. Explanation of the commands used is given in the succeeding subsection.



Explanation of the commands used
This subsection provides the explanation of the CGX commands used in Figure 4.7.2

PNT
The format for entering a point in CGX is as follows -

'pnt' |'!' [  ]|

[  ]|

[  ]|

[]

This keyword is used to define or redefine a point. There are four possibilities to define a point.

To define a point just with coordinates:

pnt p1 11 1.2 34

or,

pnt ! 11 1.2 34

where the name is chosen automatically.

It is also possible to create points on a line or in the direction from P1 to P2 by defining a spacing (ratio) and number-of-points:

pnt ! L1 0.25 3

or

pnt ! P1 P2 0.25 3

This will create 3 new points at the positions 0.25, 0.5 and 0.75 times the length of the line or the distance from P1 to P2.

And it is also possible to create points on the positions of existing nodes. The command

pnt ! set

will create new points on the positions of the nodes included in the specified set.

Usually when points are defined interactive the command qpnt is used. Please refer to the CGX manual for its details

LINE
The format for entering a Line is as follows-

'line' |'!'   

This keyword is used to define or redefine a line. A line depends on points.

A line can only be defined if the necessary points are already defined. There are three different types of lines available.

The straight line -

line l1 p1 p2 4

is defined by: its name l1 (the name could have up to 8 characters), by the points p1 and p2 and optionally by the division.

The arc

line ! p1 p2 cp 4

needs a center point cp. The radius changes linear from p1 to p2 if the center-point cp is excentric. The name is chosen automatically (triggered by the character !).

The spline

line l1 p1 p2 seq 4

needs a so called sequential-set, seq (use the command seqa to define such a set). This set seq stores the spline points between the end-points in the right order. The spline function is described in [14]. Usually, a line is defined interactively with qlin.

GSUR
The format for entering a surface is as follows-

'gsur' |'!' '+|-' 'BLEND| ' '+|-'  '+|-' ->  .. (3-5 times)

This keyword is used to define or redefine a surface in the most basic way (see also qsur). Each surface must have three to five lines or combined lines (see lcmb) to be mesh-able. However, the recommend amount of edges is four. For example,

gsur S004 + BLEND - L002 + L00E + L006 - L00C

will create the surface S004 with a mathematically positive orientation indicated by the + sign after the surface name.

The keyword BLEND indicates that the interior of the surface will be defined according to reference [12] given as- S. A. Coons, 'Surfaces for computer-aided design of space forms'. Project MAC, MIT (1964). Revised to MAC-TR-41 (1967) or a NURBS surface is referenced.

Use a + or - in front of the lines or lcmbs to indicate the orientation. These signs will be corrected automatically if necessary. If automatic name generation is desired, then use ! instead of a name.

ELTY
The format used to assign a specific element type to a set of entities and generating the mesh, is as follows-

'elty' [ ] ['be2'|'be3'|'tr3'|'tr3u'|'tr6'|'qu4'|-> 'qu8'|'he8'|'he8f'||'he8i'|'he8r'|'he20'|'he20r']

This keyword is used to assign a specific element type to a set of entities (see section Element Types in the appendix). The element name is composed of the following parts: The leading two letters define the shape (be: beam, tr: triangle, qu: quadrangle, he: hexahedra), then the number of nodes and at last an attribute describing the mathematical formulation or other features (u: unstructured mesh, r: reduced integration, i: incompatible modes, f: fluid element for ccx). If the element type is omitted, the assignment is deleted. If all parameters are omitted, the actual assignments are posted:

elty

will print only the sets with assigned elements. Multiple definitions are possible. For example,

elty all

deletes all element definitions. If the geometry was already meshed, the mesh will NOT be deleted. If the mesh command is executed again after new assignments has taken place, additional elements will be created.

elty all he20

assigns 20 node brick-elements to all bodies in the set all.

elty part1 he8 <p?

redefines that definition for all bodies in the set part1.

elty part2 qu8

assigns 8 node shell elements to all surfaces in set part2.

Figure
Following figure 4.7.3 shows the geometry and the mesh generated by CGX for a cylinder in four 90 degree segments-



Geometry generation code
Following figure 4.7.4 shows the code to generate the geometry and the mesh by CGX for the cylinder in Figure 4.7.3.

Explanation of the commands used is given in the succeeding subsection.



Explanation of the commands used
Please refer to the 'Disc' section above for explanation of all the following CGX commands used to build the geometry and mesh of the cylinder Following commands are used to generate the geometry and mesh of the cylinder in figure 4.7.3 -

' PNT  For entering a point - (refer to the 'Disc' subsection above for explanation)

' LINE  For entering a Line - (refer to the 'Disc' subsection above for explanation)

' GSUR  For entering a surface - (refer to the 'Disc' subsection above for explanation)

' ELTY  To assign a specific element type to a set of entities and generating the mesh - (refer to the 'Disc' subsection above for explanation)

Figure
Following figure 4.7.5 shows the geometry and the mesh generated by CGX for a sphere created from 32 blended surfaces.-



Geometry generation code
Following code was used to generate the geometry by the CGX for the sphere in Figure 4.7.5.

Explanation of the commands used is given in the succeeding subsection.

Explanation of the commands used
Please refer to the 'Disc' section above for explanation of all the following CGX commands used to build the geometry and mesh of the sphere Following commands are used to generate the geometry and mesh of the sphere in figure 4.7.5 -

' PNT  For entering a point - (refer to the 'Disc' subsection above for explanation)

' LINE  For entering a Line - (refer to the 'Disc' subsection above for explanation)

' GSUR  For entering a surface - (refer to the 'Disc' subsection above for explanation)

' ELTY  To assign a specific element type to a set of entities and generating the mesh - (refer to the 'Disc' subsection above for explanation)

Figure
Following figure 4.7.l3 and figure 4.7.l4 show the geometry and the mesh generated by CGX for an airfoil using many 4 nodes element-





Geometry generation code
Following codes show how to generate the geometry and the mesh by CGX for the cylinder in Figure 4.7.l3.

Explanation of the commands used is given in the succeeding subsection.

Explanation of the commands used
Please refer to the 'Disc' section above for explanation of all the following CGX commands used to build the geometry and mesh of the airfoil Following commands are used to generate the geometry and mesh of the airfoil in figure 4.7.l3 -

' PNT  For entering a point - (refer to the 'Disc' subsection above for explanation)

' LINE  For entering a Line - (refer to the 'Disc' subsection above for explanation)

' GSUR  For entering a surface - (refer to the 'Disc' subsection above for explanation)

' ELTY  To assign a specific element type to a set of entities and generating the mesh - (refer to the 'Disc' subsection above for explanation)