GiD - The personal pre and post processor

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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:
(parameter 3) / *.bat (parameter 2) / (parameter 1)
parameter 1: project name
parameter 2: project directory
parameter 3: Problem type location directory



NOTE: The .win.bat fiile as used in Windows is explained below; the shell script for UNIX systems is also included with the documentation of this tutorial.

rem OutputFile: %2%1.log

The process window

rem ErrorFile: %2%1.err

A comment line such as "rem OutputFile: file_name.log" means that the contents of the file indicated will be shown if the user clicks Output View in Calculate->Calculate window.
In this example the .log file is shown. This file contains the coordinates of the center of mass.

A comment line such as "rem ErrorFile: file_name.err" means that the indicated file will contain the errors (if any). If the .err file is present at the end of the execution, a window comes up showing the error. The absence of the .err file indicates that the calculation is considered satisfactory.
GiD automatically deletes the .err files before initiating a calculation to avoid confusion.

del %2%1.log
del %2%1.post.res


This deletes results files from any previous calculations to avoid confusion.

%3\cmas2d.exe %2%1

This executing the cmas2d.exe and provide the .dat as input file file.


Appendix>'Classic' problemtype implementation>Using the problemtype with an example
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.

  1. . Create a surface, for example from the menu Geometry->Create->Object->Polygon
  2. . 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


Surface used for this example

  1. . Load the problemtype: menu Data->Problem type->cmas2d.
  2. . Choose Data->Materials.
  3. . The materials window is opened. From the Materials menu in this window, choose the option Air.



Materials window

  1. . Click Assign->Surfaces and select the surface. Press <Esc> when this step is finished.
  2. . Choose the Data->Conditions option. A window is opened in which the conditions of the problem should be entered.



The conditions window

  1. . Enter the value 1e3 in the Weight box. Click Assign and select the upper corner point. Press <Esc> when this step is finished.
  2. . Choose the Mesh->Generate option.
  3. . A window appears in which to enter the maximum element size for the mesh to be generated. Accept the default value and click OK. The mesh shown will be obtained.


The mesh of the object

  1. . Now the calculation may be initiated, but first the model must be saved (Files->Save), use 'example_cmas2d' as name for the model.
  2. . Choose the Calculate option from the Calculate menu to start the calculation module.
  3. . Wait until a box appears indicating the calculation has finished.



End process notification window

  1. . Select the option Files->Postprocess.
  2. . Select Window->View results.
  3. . A window appears from which to visualize the results. By default when changing to postprocesses mode no results is visualized.
  4. . From the View combo box in the View Results window, choose the Contour Fill option. A set of available results (only one for this case) are displayed.
  5. . Now choose the MC-DISTANCE result and click Apply. A graphic representation of the calculation is obtained.


Visualizing the distance from the weighted center of mass to each point
The results shown on the screen reproduce those we anticipated at the outset of the problem: the center of mass of an object is not in its geometric center because a concentrated mass on the top. The .log file will provide the exact coordinates of the calculated mass center.

  • No labels