File tree 7 files changed +53
-6
lines changed
7 files changed +53
-6
lines changed Original file line number Diff line number Diff line change 1
1
default :
2
- (cd src && python setup.py build_ext --inplace)
3
- (mv src/* .so pyofm)
2
+ (cd src && ./Allmake && cd -)
4
3
5
4
clean :
6
- (cd src && rm -rf * .cpp * .so build )
5
+ (cd src && ./Allclean && cd - )
7
6
(rm -rf * /__pycache__ * /* /__pycache__)
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ rm -rf build * .so * .cpp * .h
4
+ wclean
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # the script will exit if there is any error
4
+ set -e
5
+
6
+ if [ -z " $WM_PROJECT " ]; then
7
+ echo " OpenFOAM environment not found, forgot to source the OpenFOAM bashrc?"
8
+ exit 1
9
+ fi
10
+
11
+ cythonize -3 pyOFMesh.pyx
12
+ wmake -j
13
+ cp -r * .so ../pyofm/
Original file line number Diff line number Diff line change
1
+ OFMesh.C
2
+ pyOFMesh.cpp
3
+
4
+ LIB = pyOFMesh.$(shell python3 -c 'import sysconfig; ext_suffix = sysconfig.get_config_var("EXT_SUFFIX"); print(ext_suffix.split(".")[1])')
Original file line number Diff line number Diff line change
1
+ EXE_INC = \
2
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
3
+ -I$(LIB_SRC)/sampling/lnInclude \
4
+ -I$(LIB_SRC)/meshTools/lnInclude \
5
+ -I$(LIB_SRC)/fileFormats/lnInclude \
6
+ -I$(LIB_SRC)/surfMesh/lnInclude \
7
+ -I$(MPI_ARCH_PATH)/include \
8
+ -I$(MPI_ARCH_PATH)/include64 \
9
+ $(shell python3 -c "import numpy; print('-I' + numpy.get_include())") \
10
+ $(shell python3-config --includes) \
11
+
12
+
13
+ LIB_LIBS = \
14
+ -lmeshTools \
15
+ -lfiniteVolume \
16
+ -L$(MPI_ARCH_PATH)/lib \
17
+ -L$(MPI_ARCH_PATH)/lib64 \
18
+ $(shell python3-config --ldflags)
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public:
66
66
const label pointI,
67
67
const label compI) const
68
68
{
69
- #if defined(CODI_AD_FORWARD ) || defined(CODI_AD_REVERSE )
69
+ #if defined(DAOF_AD_MODE_T1S ) || defined(DAOF_AD_MODE_A1S )
70
70
return meshPtr_ ().points ()[pointI][compI].getValue ();
71
71
#else
72
72
return meshPtr_ ().points ()[pointI][compI];
@@ -192,7 +192,11 @@ public:
192
192
193
193
forAll (state, cellI)
194
194
{
195
+ #if defined(DAOF_AD_MODE_T1S) || defined(DAOF_AD_MODE_A1S)
196
+ field[cellI] = state[cellI].getValue ();
197
+ #else
195
198
field[cellI] = state[cellI];
199
+ #endif
196
200
}
197
201
}
198
202
else if (fieldType == " volVectorField" )
@@ -212,7 +216,11 @@ public:
212
216
{
213
217
for (label i = 0 ; i < 3 ; i++)
214
218
{
215
- field[counterI] = state[cellI][i];
219
+ #if defined(DAOF_AD_MODE_T1S) || defined(DAOF_AD_MODE_A1S)
220
+ field[counterI] = state[cellI][i].getValue ();
221
+ #else
222
+ field[counterI] = state[cellI][i];
223
+ #endif
216
224
counterI++;
217
225
}
218
226
}
Original file line number Diff line number Diff line change 52
52
"-m64" ,
53
53
"-pthread" ,
54
54
"-DOPENFOAM=2112" ,
55
- "-DDAOF_AD_TOOL_DCO_FOAM" ,
55
+ "-DDAOF_AD_TOOL_CODI"
56
+ "-DDAOF_AD_MODE_A1S" ,
56
57
#"-Dlinux64",
57
58
#"-DWM_ARCH_OPTION=64",
58
59
"-DWM_DP" ,
You can’t perform that action at this time.
0 commit comments