It is important to note that these options will differ depending on the whether the user is performing a preprocessing or postprocessing analysis, and that the options needed in each case differ as well.
Two possible configurations of the Top Menu are presented below:
Two main types of functions can be controlled in this menu: 1) the handling of files (i.e. create, read, save, etc.) of GiD projects;and, 2) the importing and exporting of files.
In the view menu (also available from the mouse menu) there are all the visualization commands. These commands change the way to display the information in the graphical window, but they do not change any definition of the geometry or any other data.
This menu allows access to the definition of all data related to materials, boundary conditions, etc., which will be necessary for the calculations that follow. The form of this data will depend on the type of the analysis to be performed.
This command calculates the problem, according to the type of problem defined. This option requires a previously activated interface between GiD and the corresponding calculation program.
This Top Menu of the postprocess phase is the same of that as the preprocess phase and has the same name. The user can read and save files, save screen images, return to preprocess phase options and exit the program.
The Mouse Menu is the auxiliary menu which appears by clicking on the right mouse button while the cursor is over the GiD screen.
The Mouse Menu permits the user to quickly access various image placement and viewing commands, to facilitate easy management and definition of the project.
Furthermore, the Mouse Menu contains the Contextual menu, which permits the user to access to all options available in previously performed commands. The option Contextual is only available after the user has performed a command from the ...
Before presenting all the possibilities that GiD offers, we will present a simple example that will introduce and familiarize the user with the GiD program.
The example will develop a finite element problem in one of its principal phases, the preprocess, and will include the consequent data and parameter description of the problem. This example introduces creation, manipulation and meshing of the geometrical entities used in GiD.
First, we will create a line and the mesh corresponding to the line. Next, we will save the project and it will be described in the...
We will begin the example creating a line by defining its origin and end points, points 1 and 2 in the following figure, whose coordinates are (0,0,0) and (10,0,0) respectively.
It is important to note that in creating and working with geometric entities, GiD follows the following hierarchical order: point, line, surface, and volume.
To begin working with the program, open GiD, and a new ...
We will now present a study of entities of volume. To illustrate this, a cube and a volume mesh will be generated.
Without leaving the project, save the work done up to now by choosing Files->Save, and return to the geometry last created by choosing Geometry->View geometry.
In order to create a volume from the existing geometry, firstly we must create a point that will define the height of the cube. This will be point 5 with coordinates (0,0,10), superimposed on point 1. To view the new point, we must rotate the figure by selecting from the ...
The objective of this case study is implementing a mechanical part in order to study it through meshing analysis. The development of the model consists of the following steps:
A geometric representation is composed of four types of entities, namely points, lines, surfaces, and volumes.
A layer is a grouping of entities. Defining layers in computer-aided design allows us to work collectively with all the entities in one layer.
The creation of a profile of the mechanical part in our case study will be carried out with the help of auxiliary lines. Two layers will be defined in order to prevent these lines from appearing in the final drawing. The lines that define the profile will be assigned to one of the layers, called the "profile" layer, while the auxiliary lines will be assigned to the other layer, called the "aux" layer. When the design of the part has been completed, the entities in the "aux" layer will be erased....
. Choose the Line option, by going to Geometry->Create->Straight line or by going to the GiD Toolbox1.
. Enter the coordinates of the beginning and end points of the auxiliary line2. For our example, the coordinates are (0, 0) and (55, 0), respectively. Besides creating a straight line, this operation implies creating the end points of the line.
Dividing the auxiliary line near "point" (coordinates (40, 0) )
Dividing the auxiliary line near "point" (coordinates (40, 0) )
. Choose Geometry->Edit->Divide->Lines->NearPoint. This option will divide the line at the point ("element") on the line closest to the coordinates entered.
. Enter the coordinates of the point that will divide the line. In this example, the coordinates are (40, 0). On dividing the line, a new point (entity) has been created.
. Choose the option Geometry->Create->Object->Circle.
. The center of the circle (40, 0) is a point that already exists. To select it, go to Contextual->Join Ctrl-a in the mouse menu (right-click). The pointer will become a square, which means that you may click an existing point.
. Use the Move window, which is located in Utilities->Move.
. Within the Move menu and from among the Transformation possibilities, select Rotation. The type of entity to receive the rotation is a surface, so from the Entities Type menu, choose Surfaces. ...
. Use the Copy window, located in Utilities->Copy (see Figure 9).
. Repeat the rotating and copying process from section 2.5 for the two auxiliary lines. Select the option Lines from the Entities type menuand enter an angle of 36 degrees.
. Select the lines to copy and rotate. Do this by clicking ...
Translating the definitive lines to the "profile" layer
Translating the definitive lines to the "profile" layer
. Select the "profile" layer in the Layers window. The auxiliary lines will be eliminated and the "profile" layer will contain only the definitive lines.
. In the Sent To menu of the Layers window, choose Lines in order to select the lines to be translated. Select only the lines that form the profile (Figure 14). To conclude the selection process, press the ESC...
In the previous sections we drew the profile of the part and we created the surface. In this section we will make a hole, an octagon with a radius of 10 units, in the surface of the part. First we will draw the octagon.
. Select from the menu Geometry->Create->Object->Polygon to create a regular polygon.
The mechanical part to be constructed is composed of two volumes: the volume of the wheel (defined by the profile), and the volume of the axle, which is a prism with an octagonal base that fits into the hole in the wheel. Creating this prism will be the first step of this stage. It will be created in a new layer that we will name "prism".
. First copy the octagon a distance of -50 units relative to the surface of the wheel, which is where the base of the prism will be located. In the Copy window, choose Translation and Lines. Since we want to translate 50 units, enter two points that define the vector of this translation, for example (0, 0, 0) and (0, 0, 50). (Make sure that the Multiple Copies value is 1, since the last time the window was used its value was 9).
. Visualize the "profile" layer and activate it. The volume of the wheel will be created in this layer. Deactivate the "prism" layer in order to make the selection of the entities easier.
. In the Copy window, choose Translation and Surfaces. A translation of 10 units will be made. To do this, enter two points that define a vector for this translation, for example (0, 0, 0) and (0, 0, -10).
Now that the part has been drawn and the volumes created, the mesh may be generated. First we will generate a simple mesh by default.
Depending on the form of the entity to be meshed, GiD performs an automatic correction of the element size. This correction option, which by default is activated, may be modified in the Meshing card of the Preferences window, under the option Automatic correct sizes. Automatic correction is sometimes not sufficient. In such cases, it must be indicated where a more precise mesh is needed. Thus, in this example, we will increase the concentration of elements along the profile of the wheel by following two methods: 1) assigning element sizes around points, and 2) assigning element sizes around lines....
. A window comes up in which to enter the maximum element size of the mesh to be generated (Figure 28). Leave the default value given by GiD unaltered and click OK.
Generating the mesh with assignment of size around points
Generating the mesh with assignment of size around points
. Enter view rotate angle -90 90 ESC5 in the command line. This way we will have a side view.
. Choose Mesh->Unstructured->Assign sizes on points. A window appears in which to enter the element size around the point to be selected. Enter 0.7....
Generating the mesh with assignment of size around lines
Generating the mesh with assignment of size around lines
. Open the Preferences window, which is found in Utilities, and select the Meshing card. In this window there is an option called Unstructured Size Transitions which defines the size gradient of the elements. A high gradient number means a greater concentration of elements on the wheel profile. To do this, select a gradient size of 0.8. Click Accept.
The part we have designed can be optimized, thus achieving a more efficient product. Given that the part will rotate clockwise, reshaping the upper part of the teeth could reduce the weight of the part as well as increase its resistance. We could also modify the profile of the hole in order to increase resistance in zones under axle pressure.
To carry out these optimizations, we will use new tools such as NURBS lines. The final steps in this process will be generating a mesh and visualizing the changes made relative to the previous design.
This example begins with a file named "optimizacion.gid"....
. First download the Preprocess Tutorial 1 from our web, www.gidhome.com Inside Support->Tutorials. Choose Open from the Files menu and open the file "optimizacion.gid".
. The file contents appear on the screen. In order to work more comfortably, select Zoom In, thus magnifying the image. This option is located both in the GiD Toolbox and in the mouse menu under Zoom.
. In the Copy window, choose Translation and Surfaces. Enter two points that define a translation of 10 units, for example (0, 0, 10) and (0, 0, 0). (Make sure that the Multiple Copies value is 1).
Generating the mesh for the optimized design is more complex. In this geometry it is especially important to obtain a precise mesh on the surfaces around the hole and on the surfaces of the teeth.
Initially, we will generate a simple mesh by default. Then we will generate a mesh using Chordal Error6 to obtain a more accurate result.
. A window appears in which to enter the maximum element size for the mesh to be generated. Leave the default value provided by GiD unaltered and click OK.
Generating a mesh for the new design by default...
This case study shows the modeling of a more complex piece and concludes with a detailed explanation of the corresponding meshing process. The piece is a cooling pipe composed of two sections forming a 60-degree angle.
The modeling process consists of four steps:
Modeling the main pipes
Modeling the elbow between the two main pipes, using a different file...
Various auxiliary lines will be needed in order to draw the part. Since these auxiliary lines must not appear in the final drawing, they will be in a different layer from the one used for the finished model.
The auxiliary lines used in this project are those that make it possible to determine the center of rotation and the tangential center, which will be used later to create the model.
. Choose the menu option Geometry->Create->Straight line. On the mouse menu, choose Contextual and use Join Ctrl-a to select points (0, 0) and (0, 25). Press ESC.
. In the Copy window, choose Rotation from the Transformation menu and Lines from the EntitiesType menu. Enter an angle of 120 degrees, and the coordinates (0, 25, 0) in ...
In this section the entire model, except the T junction, will be created. The model to be created is composed of two pipes forming a 60-degree angle. To start with, the first pipe will be created. This pipe will then be rotated to create the second pipe.
. Rotation of the profile will be carried out in two rotations of 180 degrees each. This way, the figure will be defined by a greater number of points.
. From the Copy window, select Lines and Rotation. Enter an angle of 180 degrees and from the Do extrude menu, select Surfaces. The axis of rotation is that defined by the line that goes from point (0, 0) to point (200, 0). Enter these two points as the ...
. From the Copy window, select Surfaces and Rotation. Enter an angle of -60 degrees. Since the rotation may be done in 2D, choose the Two Dimensions option. The center of the rotation is the intersection of the axes, namely point (200, 0). Ensure the Do Extrude menu is set to No.
. Click Select and select all the surfaces except those defining the elbow of the pipe. Press ...
. From the Copy window, select Surfaces and Rotation. Enter an angle of 180 degrees. Since the rotation may be done in 2D, choose the option Two Dimensions. The center of rotation is the upper right point of the pipe elbow. Make sure the Do Extrude menu is set to No.
. Click Select and select the surfaces that join the two pipe sections....
Now, an intersection composed of two pipe sections will be created in a separate file and the surfaces will be trimmed. Then this file will be imported to the original model to create the entire piece.
. Choose Geometry->Create->Point and enter points (-20, 9) and (-20, 11). Press ESC to conclude the creation of points.
. From the Copy window, select Points and Rotation. Enter an angle of 180 degrees and from the Do extrude menu, select Lines. Since the rotation can be done on the xy plane, choose Two Dimensions...
. Choose Geometry->Delete->Surfaces and select the small surfaces inside the first pipe. Press ESC to conclude the process of selection.
. Choose Geometry->Delete->Lines. Select the lines defining the end of the second pipe (foreground) that are still inside the first pipe (background). The result is shown in Figure 27.
. The model now has three outlets. The two farthest from the origin of coordinates must be closed. The third will be connected to the rest of the piece when the T junction is imported.
. Choose Geometry->Create->NURBS Surface->By contour and then select the lines defining the outlet in the foreground of Figure 28. Press ESC (see Figure 28).
. Choose Open from the Files menu. Select the file where the first part, created in section 3, was saved. Click Open.
. Choose Files->Import->Insert GiD geometry from the menu. Select the file where the second part, created in section 4, was saved. Click Open.
. The T junction appears. Bear in mind that the lines which define the end of the first pipe (background) of the T junction, and which have been imported, were already present in the first file. Notice that the lines overlap. This overlapping will be remedied by collapsing the lines....
Now that the model is finished, it is ready to be meshed. The mesh will be generated using Chordal Error in order to achieve greater accuracy in the discretization of the geometry. The chordal error is the distance between the element generated by the meshing process and the real profile of the model. By selecting a sufficiently small chordal error, the elements will be smaller in the zones with greater curvature.
Generating the mesh by assignment of sizes on surfaces
Generating the mesh by assignment of sizes on surfaces
. Choose Mesh->Unstructured->Assign sizes on surfaces. A window opens in which to enter the element size for the surfaces to be selected. Enter size 1.
The objective of this example is to mesh a mechanical piece using the various options in GiD for assigning sizes to elements, and the different surface meshers available. In this example a mesh is generated for each of the following methods for assigning sizes, using different surface meshers:
In order to carry out this example, start by opening the project “ToMesh4.gid”. This project contains a geometry that will be meshed using four different methods, each one resulting in a different density of elements in certain zones.
In the Files menu, select Open . Select the project ToMesh4.gid and click Open.
The geometry appears on the screen. It is a set of surfaces.
Select Render->Flat from the mouse menu1.
Select Rotate->Trackball from the mouse menu. (This tool is also available within the GiD Toolbar.) Make several changes in the perspective so as to get a good idea of the geometry of the object.
Finally, return to the normal visualization, selecting ...
GiD automatically corrects element sizes according to the shape of the entity to be meshed and its surrounding entities. This default option may be change by going to the Utilities menu, selecting Preferences, and then Automatic correct sizes2 inside Meshing tab (3).
Press Reset bottom button, click Accept to save preference and Close the window.
Sometimes, however, this type of correction is not sufficient and it is necessary to indicate where on the mesh greater accuracy is needed. In these cases, GiD offers various options and methods allowing sizes to be assigned to elements....
. window appears showing the maximum element size. Leave this default size unaltered and click OK.
. A meshing process window opens. Then another window appears with information about the mesh generated. Click View Mesh to visualize the mesh (see Figure 2).
. Select Mesh->Unstructured->Assign size on points. A window appears in which to enter the element size around the points to be chosen. Enter 0.1 and click OK.
. Select the point indicated in Figure 4. Press ESC 4 to indicate that the selection of points is finished, and Close the window.
. Select Mesh->Unstructured->Assign size on lines. In the window that appears, enter the size of the elements around the lines that will be chosen. Enter 0.5 and click Assign.
. Select the lines defining the base of the prism (i.e. lines 1, 2, 3, 4 and 40). To see entity numbers select Label from the mouse menu or from the View menu. If you wish geometrical entity labels to be displayed, the view mode has to be set to Geometry using ...
. Select Mesh->Unstructured->Assign size on surfaces. In the window that appears, enter the size of the elements to be assigned on the surfaces that will be chosen. Enter 0.5 and click Assign.
. Select the triangular surface resulting from the section of one of the vertexes of the prism (surface number 1). Press ESC.
The RJump mesher is a surface mesher that meshes patches of surfaces (in 3D space) and is able to skip the inner lines of these patches when meshing. By default, the RJump mesher skips the contact lines between surfaces that are tangent enough, and points between lines that are tangent enough. By selecting Mesh->Draw->Skip entities (Rjump), the entities that the actual mesh is going to skip and the ones that it is not going to skip are displayed in different colors. In this chapter we will see the properties of this mesher.
If there is a line or a point that the RJump mesher would usually skip, but that you wish to be meshed, you can specify the entity so that it is not skipped. As an example, we will force Rjump to mesh line number 43, in order to concentrate elements around point number 29, as it was done in chapter 2.2.
. Select Mesh->Mesh criteria->No skip->lines, and select line number 43. Press ESC.
The objective of this example is to mesh a model using the various options available in GiD for controlling the element type in structured, semi-structured and unstructured meshes. It also presents how to concentrate elements and control the distribution of mesh sizes.
The six methods covered are:
Generating a mesh using tetrahedral
Generating a volume mesh using spheres
Generate a mesh using circles
Generating a volume mesh using points
Generating a mesh using quadrilaterals
Generating a structured mesh on surfaces and volumes ...
In order to carry out this example, start from the project "ToMesh3.gid". This project contains a geometry that will be meshed using different types of elements.
. In the Files menu, select Read. Select the project “ToMesh3.gid” and click Open.
. The geometry appears on the screen. It is a set of surfaces and three volumes. Select Render->Flat from the mouse menu1 or from the View menu. In Figure 1 shows the geometrical model loaded.
Using GiD the mesh may be generated in different ways, depending on the needs of each project. The two basic types of meshes are the structured2 mesh and the unstructured mesh. For volumes only there is one additional type, the semi-structured3 mesh.
For all these types of mesh a variety of elements may be used (linear ones, triangles, quadrilaterals, circles,tetrahedra, hexahedra, prisms, spheres or points). In this tutorial you will become familiarized with the mesh-generating combinations available in GiD.
. A window comes up in which to enter the maximum element size for the mesh to be generated. As default value could change from one version of GiD to another, insert 2 to get the same results as shown in images OK.
. A meshing process window comes up. Then another window appears with information about the mesh generated. Click ...
. Select Mesh->Element type->Sphere. Select volume number one and press ESC. To see entity numbers select Label from the mouse menu or from the View menu. If you wish the geometrical entity labels to be displayed, the view mode needs to be changed to Geometry using View->Mode->Geometry (this option may also be found in the GiD Toolbox). Select RenderNormal to see the labels.
To mesh volumes with a semi-structured mesh, select the option Mesh->SemiStructured->Volumes.
A window appears in which to enter the number of divisions for the direction in which it is structured (the prismatic one). Enter 8.
Select volume 3 and press ESC. As volume 3 is prismatic in one direction only (i.e. parallel to Y -axis) GiD will automatically detect this fact and will select it to be the direction in which the semi-structured volume mesh is structured.
Another window appears in which to enter the number of divisions in the direction of the structure. In this case we do not want to select any more volumes, so click ...
Select some structured lines, for example line 43. Press ESC.
A window comes up in which to enter two values for the concentration of elements. Positive values concentrate the elements and negative values spread them. Enter 1 as Start Weight and –0.5 as ...
Select Zoom->In from the mouse menu (this option may also be found in the GiD Toolbox or in the View menu). Enlarge one area of the mesh (e.g. the zone near point number 3).
Select Label->All in->Points . The result is shown in Figure 15.
The objective of this tutorial is to do a postprocess analysis of an already calculated fluid simulations, no preprocess option is used.
Not only the model is already meshed and the constraints are assigned, but also the results have been calculated. For more information about the preprocess part of GiD, please check the preprocess tutorials.
In this tutorial, the model Cylinder.bin has been used. The problem type used to do this simulations is Tdyn, particularly the Ransol model. Tdyn is a fluid dynamic (CFD) simulation environment based on the stabilized Finite Element Method.
There are two ways to load the results simulation information into GiD:
If the model has been calculated inside GiD, and so the results are inside a GiD project, then just loading the GiD project and the changing to postprocess mode is enough. This can be achieved clicking on this icon:
, or selecting the Files->Postprocess menu entry.
If only a mesh and results file(s) is present then GiD should be started, and switched to postprocess mode (...
Through the 'Select & Display style' window several options can be specified for volumes, surfaces and cuts. Among these options volumes, surfaces and cuts can be switched on and off, their colour properties can be changed, and their transparency too.
Other interesting options which can be changed are the style of the set and the width of the edges.
From this window, volumes, surfaces or cuts can be deleted or their names can be modified.
To access this windows select Windows->View Style or Utilities->View style...
With this result visualization a surface, or line, is drawn passing through all the points which have the same result's value inside a volume mesh, or surface mesh. To create isosurfaces there are several options.
. Select View results->Iso Surfaces->Automatic Width->Velocity(m/s)->|V|throught the menu bar or clicking on
After choosing the result, you are asked for a width. This width is used to create as many isosurfaces as are needed between the Minimum and Maximum defined values (these are included). ...
This window allows the user to animate the current visualized results.
If only one step is present, then the Static analysis animation profile button is enabled so that a custom animation profile can be step to animate that one step.
If one result has several steps you can visualize them in an animation. In this case we will use the iso surfaces result.
If you have an anaglyphic glasses you can try this option. The model can be set as an anaglyphic image in order to provide a stereoscopic 3D effect, when viewed with 2 color glasses (each lens a chromatically opposite color, usually red and cyan).
Anaglyphic images are made up of two color layers, superimposed. Since the glasses act as red and cyan filters we should be careful with the model's colors. To avoid problmes we will change the contour fill color scale....
With this option you can see the minimum and maximum value of the chosen result in the chosen analysis step. In our case we will choose the Vy component of velocity result for the first analysis step.
. Select View results->Default Analysis/Step->RANSOL->91.5 throught the menu bar or clicking on
From this menu several graphs types can be created, we will try some of them. Graphs are supported for results defined over nodes.
The Point evolution graph displays a graph of the evolution of the selected result along all the steps, of the default analysis, for the selected nodes.
Finally we will take some snapshots of our model. You can save images in several formats. The properties of the image (resolution, size, etc.) can be assigned in Page and capture settings option.
. Select Files->Page and capture settings...
. Check the Auto crop image option in order to cut the image in the model limits
The objective of this case study is to see how GiD imports files created with other programs. The imported geometry may contain imperfections that must be corrected before generating the mesh.
For this study an IGES formatted geometry representing a stamping die is imported. These steps are followed:
Importing an IGES-formatted file to GiD
Correcting errors in the imported geometry and generating the mesh
Generating a conformal mesh and a non-conformal mesh
GiD is designed to import a variety of file formats. Among them are standard formats such as IGES, DXF, or VDA, which are generated by most CAD programs. GiD can also import meshes generated by other programs, e.g. in NASTRAN or STL formats.
The file importing process is not always error-free. Sometimes the original file has incompatibilities with the format required by GiD. These incompatibilities must be overcome manually. This example deals with various solutions to the difficulties that may arise during the importing process....
The great diversity of versions, formats, and programs frequently results in differences (errors) between the original and the imported geometry. With GiD these differences might give rise to imperfect meshes or prevent meshing altogether. In this section we will see how to detect errors in the imported geometry and how to correct them.
Importing the same file with different versions of GiD might produce slight variations in the results. For this tutorial it's necessary load the project "imported48.gid", which contains the original IGES file translated into GiD format.
A window comes up in which to enter the maximum element size for the mesh to be generated. Leave the default value provided by GiD unaltered and click OK.
When the GiD finishes the meshing process, an error message appears (see Figure 6). This error is due to a defect in the imported geometry. As the window shows, there have been errors meshing surface number 149.
In the previous section, after correcting some errors, we were able to mesh the imported geometry, thus obtaining a non-conformal mesh. A conformal mesh is one in which the elements share nodes and sides. To achieve this condition, contiguous surfaces (of the piece) must share lines and points of the mesh. Most calculating modules require conformal meshes; however, some modules accept non-conformal meshes. A non-conformal mesh normally requires less computation time since it generates fewer elements.
NOTE: Non-conformal meshes may be used with some calculating modules, i.e. stamping a plate. Using non-conformal meshes significantly reduces the number of elements in the mesh. This cuts down on computation time.
Select View->Mode->Geometry.
Select Geometry->Edit->Uncollapse->Surfaces. Select all the surfaces in the model. Press ESC. A sufficient number of lines is created so that no surface (of the object) shares lines with any contiguous surface. ...
NOTE: By using Chordal Error, the geometry may be discretized with great precision. The chordal error is the distance between the elements generated by the meshing program and the profile of the real object. Entering a sufficiently small chordal error results in small elements in zones where there is greater curvature. Accordingly, the approximation of the mesh may be improved in zones with greater curvature by using the option "Chordal Error."
"Chordal Error" generates an increased number of elements in zones where there is curvature. One way of obtaining accurate meshes with few elements is using structured elements in zones where there is curvature. The option ...
This tutorial takes you through the steps involved in defining a problem type using GiD. A problem type is a set of files configured by a solver developer so that the program can prepare data to be analyzed.
A simple example has been chosen which takes us through all the associated configuration files while using few lines of code. Particular emphasis is given to the calculation of the centers of mass for two-dimensional surfaces a simple formulation both conceptually and numerically.
Our aim is to solve a problem that involves calculating the center of gravity (center of mass) of a 2D object. To do this, we need to develop a calculating module that can interact with GiD.
The problem: calculate the center of mass.
The center of mass (XCM,YCM) of a two-dimensional body is defined as
GiD Preprocess makes a discretization of the object under study and generates a mesh of elements, each one of which is assigned a material and some conditions. This preprocessing information in GiD (mesh, materials, and conditions) enables the calculating module to generate results. For the present example, the calculating module will find the distance of each element relative to the center of mass of the object.
Finally, the results generated by the calculating module will be read and visualized in GiD Post-process.
Create the subdirectory "cmas2d.gid". This subdirectory has a .gid extension and will contain all the configuration files and calculating module files (.prb, .mat, .cnd, .bas, .bat, .exe).
NOTE: If you want the problem type to appear in the GiD Data→Problem type menu, create the subdirectory within "problemtypes", located in the GiD folder for instance, C:GiDProblemtypescmas2d.gid
Create the materials file "cmas2d.mat". This file stores the physical properties of the material under study for the problem type. In this case, defining the density will be enough.
Enter the materials in the "cmas2d.mat" file using the following format:
MATERIAL: Name of the material (without spaces)
QUESTION: Property of the material. For this example, we are interested in the density of the material.
Create the "cmas2d.prb" file. This file contains general information for the calculating module, such as the units system for the problem, or the type of resolution algorithm chosen.
Enter the parameters of the general conditions in "cmas2d.prb" using the following format:
PROBLEM DATA
QUESTION: Name of the parameter. If the name is followed by the #CB# instruction, the parameter is displayed as a combo box. The options in the menu must then be entered between parentheses and separated by commas....
Create the "cmas2d.cnd" file, which specifies the boundary and/or load conditions of the problem type in question. In the present case, this file is where the concentrated weights on specific points of the geometry are indicated.
Enter the boundary conditions using the following format:
CONDITION: Name of the condition
CONDTYPE: Type of entity which the condition is to be applied to. This includes the parameters "over points", "over lines", "over surfaces", “over volumes” or "over layers". In this example the condition is applied "over points”....
Create the "cmas2d.bas" file. This file will define the format of the .dat text file created by GiD. It will store the geometric and physical data of the problem. The .dat file will be the input to the calculating module.
NOTE: It is not necessary to have all the information registered in only one .bas file. Each .bas file has a corresponding .dat file.
Write the "cmas2d.bas" file as follows:
The format of the .bas file is based on commands. Text not preceded by an asterisk is reproduced exactly the same in the .dat file created by GiD. A text preceded by an asterisk is interpreted as a command....
Creating the Execution file of the Calculating Module
Creating the Execution file of the Calculating Module
Create the file "cmas2d.c". This file contains the code for the execution program of the calculating module. This execution program reads the problem data provided by GiD, calculates the coordinates of the center of mass of the object and the distance between each element and this point. These results are saved in a text file with the extension .post.res.
Compile and link the "cmas2d.c" file in order to obtain the executable cmas2d.exe file.
The calculating module (cmas2d.exe) reads and generates the files described below.
Create the "cmas2d.win.bat" file. This file connects the data file(s) (.dat) to the calculating module (the cmas2d.exe program). When the GiD Calculate option is selected, it executes the .bat file for the problem type selected.
When GiD executes the .bat file, it transfers three parameters in the following way:
In order to understand the way the calculating module works, simple problems with limited practical use have been chosen. Although these problems do not exemplify the full potential of the GiD program, the user may intuit their answers and, therefore, compare the predicted results with those obtained in the simulations.
Create a surface, for example from the menu Geometry->Create->Object->Polygon
Create a polygon with 5 sides, centered in the (0,0,0) and located in the XY plane (normal = 0,0,1) and whit radius=1.0
The main program is called from the cmas2d.win.bat file and has as parameter the name of the project. This name is stored in the variable projname.
The main program calls the input (), calculate () and output () functions.
The input function reads the .dat file generated by GiD. The .dat file contains information about the mesh. The calculate function read and processes the data and generates the results. The output function creates the results file.