Jetstream includes the capability to do high-fidelity aerostructural analysis and optimization via the coupling with a 3rd party finite element solver called TACS (Toolkit for the Analysis of Composite Structures). This solver is coupled to Diablo in a loosly partitioned manner, with load and displacement transfer being handled with the 3rd party tool FUNtoFEM. A description of the coupling method is described below.
To use the aerostructural capability, TACS and FUNtoFEM must first be installed as described here and here, respectively. Once they are installed, Jetstream can be compiled to link to them. Both TACS and FUNtoFEM are written in C++, so Fortran-C++ wrappers must be generated. These wrappers are generated semi-automatically by the tool SWIG-Fortran, described below.
SWIG-Fortran is used to generate the C++-Fortran bindings. The instructions on the Install TACS page will get you a copy and install it. It will be called everytime the Jetstream Makefiles generate the wrappers.
SWIG-Fortran requires an input file, in this case called TACS.swig in the tacs_interface directory, which contains a list of C++ header files which tells it to a) parse the contents of which to generate Fortran code, and b) to #include in wrappers. This TACS.swig file should work as is. If you need any new functionality in TACS that is in header files not included so far, you will have to add those header files to the swig file.
SWIG-Fortran will attempt to handle procedure input/output arguments when generating the wrappers. However, sometimes it can't do this automatically, particularly for double pointers, array pointers, certain classes, etc. In those cases, SWIG-Fortran relies on "type maps" to construct the header. Necessary type maps are specified in the file TACS_typemaps.i. Again, this file currently works for all included TACS functionality to date. If future procedures are added, this file may need to be expanded. If the wrappers fail to generate (see instructions on running them below), the generated swig.log in tacs_interface will give information on what failed and why.
Understanding type maps is the trickiest part of SWIG-Fortran. Type maps are documented very well for SWIG, but not for SWIG-Fortran. My best advice is to look in the SWIG-Fortran manual or the existing TACS_typemaps.i.
Once TACS, FUNtoFEM, and SWIG-Fortran are installed, Jetstream can be compiled. To do so, set
tacs=on
in the Makefile, then do
>> make tacs
This will call SWIG-Fortran to generate the Fortran wrappers for both TACS and FUNtoFEM, and then compile them into the libTACSWrapper.so and libFUNtoFEMWrapper.so libraries. Then, do
>> make
to compile Jetstream and link to the above wrappers.