Newer
Older
This directory is a location for additional OpenFOAM components or
tools to placed and have them built as part of the normal OpenFOAM
build process. It is assumed that each subdirectory contain an
appropriate `Allwmake` (or `Allwmake.override`) file.
The primary distinction between `modules` and `plugins` is that `modules` are
mainly maintained and released by OpenFOAM developers, whereas `plugins` are an
open and welcoming area for add-ons, predominantly maintained and driven by
OpenFOAM community members and groups.
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
### How to use
On the first use, you need to register the submodules, and then update them.
You can execute both steps for all the available submodules (including the
nested ones) as follows while you are at `$WM_PROJECT_DIR`:
```bash
cd $WM_PROJECT_DIR
git submodule update --init --recursive
```
Executing this single-line command clones all the submodules from their
respective repositories and prepares them for compilation. Note that you can
also make only a certain group of submodules ready by explicitly specifying the
requested submodules' names at the end of the command above. For example, if
you would like to use only the `turbulence-community` submodule, you specify:
```bash
git submodule update --init --recursive plugins/turbulence-community
```
You can display information about the status of submodules as follows:
```bash
git submodule status --recursive
```
An easy way to see which submodules are actually in use:
```bash
cat .gitmodules
```
Which will reveal content resembling the following:
```
[submodule "xyz"]
path = plugins/xyz
url = ...
...
```
If you need to remove a specific submodule or wish to restart the process,
you can simply carry out the task as follows:
```bash
git submodule deinit plugins/turbulence-community
```
This command deregisters the specified submodule and clears the
`plugins/turbulence-community` directory.
A quick overview of `git submodules` can be found in this
[*blog*][blog git-submodule] with full details in the
[*manpage*][man git-submodule].
### Build locations
Any individual _plugin_ will normally also be able to exist outside of
the plugins directory structure and will typically build into user
locations (`$FOAM_USER_APPBIN`, `$FOAM_USER_LIBBIN`).
When compiled from the top-level OpenFOAM `Allwmake` or the
`plugins/Allwmake`, they should build into OpenFOAM project locations
(`$FOAM_APPBIN`, `$FOAM_LIBBIN`). This can be adjusted by
supplying an alternative `-prefix=` to the corresponding Allwmake
command.
| Command | Install location |
|------------|------------------|
| ./Allwmake -prefix=user | `$FOAM_USER_APPBIN`, `$FOAM_USER_LIBBIN` |
| ./Allwmake -prefix=group | `$FOAM_SITE_APPBIN`, `$FOAM_SITE_LIBBIN` |
| ./Allwmake -prefix=openfoam | `$FOAM_APPBIN`, `$FOAM_LIBBIN` |
| ./Allwmake -prefix=/some/pathname | `/some/pathname/bin`, `/some/pathname/lib` |
### Documentation (doxygen)
To build the doxygen information for the components, it is also
necessary to link the directories to the doc/ subdirectory.
This is a purely manual operation.
### Developer information
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#### Build locations
To accomodate building into various locations, the plugin code should
be adapted with the following changes:
- ***Make/files***
```
...
EXE = $(FOAM_MODULE_APPBIN)/someExecutable
LIB = $(FOAM_MODULE_LIBBIN)/libSomeLibrary
```
- `Make/options` should include this
```
include $(GENERAL_RULES)/module-path-user
...
```
The following changes to `Make/options` are universally applicable
(ie, work with older or other versions of OpenFOAM), but more verbose.
- `Make/options` with the following
```
sinclude $(GENERAL_RULES)/module-path-user
/* Failsafe - user locations */
ifeq (,$(FOAM_MODULE_APPBIN))
FOAM_MODULE_APPBIN = $(FOAM_USER_APPBIN)
endif
ifeq (,$(FOAM_MODULE_LIBBIN))
FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
endif
...
```
<!-- General Information -->
[man git-submodule]: https://git-scm.com/docs/git-submodule
[blog git-submodule]: http://blog.joncairns.com/2011/10/how-to-use-git-submodules/
---