README.md 4.79 KB
Newer Older
1
# HYKOPS
Roland Gosda's avatar
Roland Gosda committed
2

3 4 5
HYKOPS is a geometry framework for hydrodynamic components such as propellers and rudders. It was first developed by the [Flensburger Schiffbau Gesellschaft](https://www.fsg-ship.de/) and other partners in the research project HYKOPS. Currently HYKOPS is used and improved in the research project [DEffProForm](https://www.tuhh.de/panmare/applications/research-projects/current-projects/deffproform.html).

The framework is licensed under the [LGPL version 3.0](https://www.gnu.org/licenses/lgpl-3.0.html).
6

7
## System requirements
8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
A fairly recent operating system with C++ compiler that supports a C++ standard between 11 and 20, [git](https://git-scm.com/), [cmake](https://cmake.org), and [boost](https://www.boost.org) installed is needed.

The following sections demonstrate how to install, uninstall and compile programs with HYKOPS. All commands are the same for both common Linux terminals and Windows PowerShell.

## Installation

To build and install the HYKOPS framework first create a directory for the build and change into it.
```
mkdir build
cd build
```

Assuming you created the directory in the HYKOPS-repository you cloned, you may build and install HYKOPS as follows.
```
cmake ..
cmake --build . --target install
```

## Deinstallation

To uninstall the HYKOPS library go to the build folder and execute the following command.
```
cmake --build . --target uninstall
```
Please note, that the deinstallation process only works if you did not modify the installation by hand or modified the file `install_manifest.txt` in your build folder. Afterwards you may delete the build folder.

## Makefile under Linux

Under Linux there is a makefile in the HYKOPS repository, that bundles the above commands in
```
make install
make uninstall
```
42
if called from your local clone of the repository. Instead of the latter you may also call `make purge` which both uninstalls the library and removes the build folder. Please note, that the makefile requires CMake 3.12 or newer. There is a fallback for older version, that might fail, if the generator CMake uses does not accept the argument `-j`.
43 44 45 46 47 48

## Linking programs with HYKOPS
The HYKOPS library is build using [cmake](https://cmake.org). To build your own application using the HYKOPS framework, you need to link to the HYKOPS library. Before you can link to the target `HYKOPS` you need to find HYKOPS using `find_package(HYKOPS)`.

Below, you may find a minimal example for a `CMakeLists.txt` for your project.
```
49
cmake_minimum_required(VERSION 3.5.2)
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

enable_language(CXX)
project(project_name CXX)

find_package(HYKOPS)
add_executable(project project.cpp)
target_link_libraries(project HYKOPS)
```
To compile the program run
```
mkdir build
cd build
cmake ..
cmake --build .
```
assuming you start in the directory, where your `CMakeLists.txt` lies.

67 68 69
### Linking under Linux
Beware that the Boost library is usually linked dynamically. If you try to run an executable linked with HYKOPS on another machine, please make sure that Boost is installed the same way it was on the system you compiled the executable on. If you choose to link dynamically to HYKOPS, the HYKOPS library has to be compiled for dynamic linking and be placed in your library path. By default HYKOPS is build as static library.

70
### Linking under Windows
71
Under Windows the library and the external libraries used are linked statically by default. If you choose to link dynamically, an additional step is required to be able to run a successfully build executable. On Windows the necessary dynamically linked libraries (DLLs) are usually not in the path. Therefore, the DLLs of HYKOPS and Boost-filesystem have to be placed in the path, e.g. the directory the executable is located in. To find out which exact DLLs are required, call `dumpbin.exe /dependents name_of_your_executable.exe` from a developer shell.
72 73

## Application Examples
74
There are example applications in [application_examples](application_examples). The examples show how a HYKOPS geometry can be im- and exported, how a propeller can be created from a set of parameters and how a propeller geometry from a PFF-geometry may be modified with parameters.
75 76

### Exporting Geometries
77
In [export_hykops_geometry](application_examples/export_hykops_geometry) a HYKOPS file is imported and the geometry is exported to external formats.
78 79

### Parametric Propeller
80
In [parametric_propeller](application_examples/parametric_propeller) an executable is implemented, that creates a propeller with HYKOPS based on a set of parameters. Both a file describing the geometry based on HYKOPS and an IGES-file are created.
81 82

### Modification of a Propeller
83
In [propeller_from_pff](application_examples/propeller_from_pff) a propeller, that is based on a PFF-file, is modified with HYKOPS beyond what is possible to describe with PFF. Both a file describing the geometry based on HYKOPS and an IGES-file are created.