Marine systems simulation
Creating a new SimObject library

Dll simObject libraries are dlls that contain one or more classes of simObjects. They can be compiled independent of fhSim. The procedures for creating and implementing these in fhSim are presented here.

The main file

Which SimObjects which are included in the library is defined in the main file. An example of such a file is found in FhSimBaseLib.h and FhSimBaseLib.cpp. In short, one needs to include the header files of the desired SimObjects in the header file, and to use the macro ADD_SIMOBJECT_REF to add the desired SimObjects to the library. No other changes to the main file is needed.

The two arguments to ADD_SIMOBJECT_REF are

  1. The name of the class
  2. The name to be used for this class in the input file

The usual convention is for classnames to begin with capital C (as in "CMass"), while this is removed for the name in the input file (as in "Mass"). To add a new SimObject CNewObj, which is to be referred to as NewObj in the input files, one would add the following line together with the other ADD_SIMOBJECT_REF lines:


Compiling the library

Usually CMake is used for creating the solution files or make files. The project must either compile the source files for the SimObject, or it must link to a library of these files.