next up previous contents
Next: How to process results Up: Tips and Hints Previous: How to map loads   Contents


How to run cgx in batch mode

Most commands can be executed in batch-mode. Actually if you read a file with geometry (fbd-file) then you run cgx in batch mode already! You just have to add ''exit'' or ''quit'' at the end of the file and it will be obvious. You might use the ''read'' command in such a command-file to reference other command-files or to read files with mesh-entities for whatever purposes. In such a way you can create and modify geometry or meshes in batch-mode or evaluate results in batch-mode. But you need a graphic-capable computer because cgx needs it also if no graphic output is requested. Nevertheless the pop up of the graphic window can be suppressed by starting cgx with the ``-bg'' parameter.

Some commands make only sense in a batch file like ``if'' and ``while''. Please have a look into ``If and while demo'' on how to work with this commands. Results can be extracted and stored to a file, see ``How to write values to a file''.

Be aware of the 'examples' directory. It holds examples on how to use the command language as a programming language. The 'ifwhiledemo' generates points in a loop and shows how to write cgx generated values to a file. The 'userDataset' shows how to generate a user dataset for a temperature field based on the z coordinate of the nodes.

It should be noted that a successive 'save' or 'exit' command will overwrite the batch file if it has the file-extension 'fbd'. To prevent this the user should use a different extension like 'fbl'.

When executing commands which increase the used space then it might happen that geometry is clipped and can not be seen or accessed anymore. In such a case a ``frame'' command is needed. This command is usually automatically triggered. Especially in batch mode without graphic output it solves sometimes strange situations.

If the command ``init'' or ``wsize'' is used then they have to be used in the very first line. Otherwhise the window dimensions take only effect after the batch file was completely parsed and executed.


next up previous contents
Next: How to process results Up: Tips and Hints Previous: How to map loads   Contents
root 2018-12-15