Skip to content

Commit e043da9

Browse files
authored
Fix warnings (#358)
* Added a flag to supress warnings. * Updated the new pyGeo interface for tests. * Fixed the test file.
1 parent d72aef6 commit e043da9

File tree

11 files changed

+55
-13
lines changed

11 files changed

+55
-13
lines changed

.github/workflows/code_coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ jobs:
5151
docker exec -i regtest /bin/bash -c "cd ${{env.DOCKER_WORKING_DIR}}/src && cp -r adjoint adjointAD && cp -r pyDASolvers pyDASolversAD"
5252
if [ "${{matrix.args}}" = "forward" ]; then
5353
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake"
54-
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && . ${{env.DOCKER_OF_ADF_BASHRC}} && cd ${{env.DOCKER_WORKING_DIR}}/src/adjointAD && ./Allmake opt 2> makeWarnings.txt && cd ../pyDASolversAD && ./Allmake opt 2> makeWarnings.txt"
54+
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && . ${{env.DOCKER_OF_ADF_BASHRC}} && cd ${{env.DOCKER_WORKING_DIR}}/src/adjointAD && ./Allmake opt 2> errorLog.txt && cd ../pyDASolversAD && ./Allmake opt 2> errorLog.txt"
5555
elif [ "${{matrix.args}}" = "mphys" ]; then
5656
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake"
57-
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && . ${{env.DOCKER_OF_ADR_BASHRC}} && cd ${{env.DOCKER_WORKING_DIR}}/src/adjointAD && ./Allmake opt 2> makeWarnings.txt && cd ../pyDASolversAD && ./Allmake opt 2> makeWarnings.txt"
57+
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && . ${{env.DOCKER_OF_ADR_BASHRC}} && cd ${{env.DOCKER_WORKING_DIR}}/src/adjointAD && ./Allmake opt 2> errorLog.txt && cd ../pyDASolversAD && ./Allmake opt 2> errorLog.txt"
5858
else
5959
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake ${{matrix.args}}"
60-
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && . ${{env.DOCKER_OF_ADR_BASHRC}} && cd ${{env.DOCKER_WORKING_DIR}}/src/adjointAD && ./Allmake ${{matrix.args}} 2> makeWarnings.txt && cd ../pyDASolversAD && ./Allmake ${{matrix.args}} 2> makeWarnings.txt"
60+
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && . ${{env.DOCKER_OF_ADR_BASHRC}} && cd ${{env.DOCKER_WORKING_DIR}}/src/adjointAD && ./Allmake ${{matrix.args}} 2> errorLog.txt && cd ../pyDASolversAD && ./Allmake ${{matrix.args}} 2> errorLog.txt"
6161
fi
6262
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && pip install ."
6363
docker exec -i -e DF_CHECK_COVERAGE=1 regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}}/tests && ./Allrun ${{matrix.args}}"

.github/workflows/reg_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
docker run -i -d -u dafoamuser --name regtest -v $GITHUB_WORKSPACE:${{env.DOCKER_MOUNT_DIR}} dafoam/opt-packages:${{env.DOCKER_TAG}} /bin/bash
4040
docker exec -i regtest /bin/bash -c "rm -rf ${{env.DOCKER_WORKING_DIR}} && cp -r ${{env.DOCKER_MOUNT_DIR}} ${{env.DOCKER_WORKING_DIR}}"
4141
if [ "${{matrix.args}}" = "forward" ]; then
42-
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake && . ${{env.DOCKER_OF_ADF_BASHRC}} && ./Allclean && ./Allmake 2> makeWarnings.txt"
42+
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake && . ${{env.DOCKER_OF_ADF_BASHRC}} && ./Allclean && ./Allmake 2> errorLog.txt"
4343
elif [ "${{matrix.args}}" = "mphys" ]; then
44-
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake && . ${{env.DOCKER_OF_ADR_BASHRC}} && ./Allclean && ./Allmake 2> makeWarnings.txt"
44+
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake && . ${{env.DOCKER_OF_ADR_BASHRC}} && ./Allclean && ./Allmake 2> errorLog.txt"
4545
else
46-
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake ${{matrix.args}} && . ${{env.DOCKER_OF_ADR_BASHRC}} && ./Allclean && ./Allmake ${{matrix.args}} 2> makeWarnings.txt"
46+
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake ${{matrix.args}} && . ${{env.DOCKER_OF_ADR_BASHRC}} && ./Allclean && ./Allmake ${{matrix.args}} 2> errorLog.txt"
4747
fi
4848
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && pip install ."
4949
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}}/tests && ./Allrun ${{matrix.args}}"

src/adjoint/Allmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ case $1 in
1717
"opt")
1818
cp Make/files_Incompressible Make/files
1919
cp Make/options_Incompressible Make/options
20+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
21+
sed -i 's/-std=c++11/-std=c++11 -w/g' Make/options
22+
fi
2023
if [ -n "$TENSOR_FLOW_INCLUDE_PATH" ]; then
2124
echo "Tensor flow include path found."
2225
sed -i s#"DAModel/DATurbulenceModel/DAkOmegaSST.C"#"DAModel/DATurbulenceModel/DAkOmegaSST.C DAModel/DATurbulenceModel/DAkOmegaSSTFIML.C"#g Make/files
@@ -28,10 +31,16 @@ case $1 in
2831
./Allclean
2932
cp Make/files_Compressible Make/files
3033
cp Make/options_Compressible Make/options
34+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
35+
sed -i 's/-std=c++11/-std=c++11 -w/g' Make/options
36+
fi
3137
wmake -j 4 || exit 1
3238
./Allclean
3339
cp Make/files_Solid Make/files
3440
cp Make/options_Solid Make/options
41+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
42+
sed -i 's/-std=c++11/-std=c++11 -w/g' Make/options
43+
fi
3544
wmake -j 4 || exit 1
3645
;;
3746
"debug")
@@ -53,6 +62,9 @@ case $1 in
5362
"incompressible")
5463
cp Make/files_Incompressible Make/files
5564
cp Make/options_Incompressible Make/options
65+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
66+
sed -i 's/-std=c++11/-std=c++11 -w/g' Make/options
67+
fi
5668
if [ -n "$TENSOR_FLOW_INCLUDE_PATH" ]; then
5769
echo "Tensor flow include path found."
5870
sed -i s#"DAModel/DATurbulenceModel/DAkOmegaSST.C"#"DAModel/DATurbulenceModel/DAkOmegaSST.C DAModel/DATurbulenceModel/DAkOmegaSSTFIML.C"#g Make/files
@@ -65,11 +77,17 @@ case $1 in
6577
"compressible")
6678
cp Make/files_Compressible Make/files
6779
cp Make/options_Compressible Make/options
80+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
81+
sed -i 's/-std=c++11/-std=c++11 -w/g' Make/options
82+
fi
6883
wmake -j 4 || exit 1
6984
;;
7085
"solid")
7186
cp Make/files_Solid Make/files
7287
cp Make/options_Solid Make/options
88+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
89+
sed -i 's/-std=c++11/-std=c++11 -w/g' Make/options
90+
fi
7391
wmake -j 4 || exit 1
7492
;;
7593
*)

src/include/setArgs.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ char** argv = new char*[argc];
2727
for (int i = 0; i < argc; i++)
2828
{
2929
argv[i] = const_cast<char*>(argvList[i].c_str());
30-
}
30+
}

src/include/setForwardADSeeds.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,4 @@ if (daOptionPtr_->getAllOptions().subDict("useAD").getWord("mode") == "forward")
373373
}
374374
}
375375

376-
#endif
376+
#endif

src/pyDASolvers/Allmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,23 @@ fi
88
case $1 in
99
"opt")
1010
cp setup_Incompressible.py setup.py
11+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
12+
sed -i 's/"-std=c++11",/"-std=c++11","-w",/g' setup.py
13+
fi
1114
python setup.py build_ext --inplace || exit 1
1215
mv *.so ../../dafoam
1316
./Allclean
1417
cp setup_Compressible.py setup.py
18+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
19+
sed -i 's/"-std=c++11",/"-std=c++11","-w",/g' setup.py
20+
fi
1521
python setup.py build_ext --inplace || exit 1
1622
mv *.so ../../dafoam
1723
./Allclean
1824
cp setup_Solid.py setup.py
25+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
26+
sed -i 's/"-std=c++11",/"-std=c++11","-w",/g' setup.py
27+
fi
1928
python setup.py build_ext --inplace || exit 1
2029
mv *.so ../../dafoam
2130
;;
@@ -37,16 +46,25 @@ case $1 in
3746
;;
3847
"incompressible")
3948
cp setup_Incompressible.py setup.py
49+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
50+
sed -i 's/"-std=c++11",/"-std=c++11","-w",/g' setup.py
51+
fi
4052
python setup.py build_ext --inplace || exit 1
4153
mv *.so ../../dafoam
4254
;;
4355
"compressible")
4456
cp setup_Compressible.py setup.py
57+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
58+
sed -i 's/"-std=c++11",/"-std=c++11","-w",/g' setup.py
59+
fi
4560
python setup.py build_ext --inplace || exit 1
4661
mv *.so ../../dafoam
4762
;;
4863
"solid")
4964
cp setup_Solid.py setup.py
65+
if [ -n "$DAFOAM_NO_WARNINGS" ]; then
66+
sed -i 's/"-std=c++11",/"-std=c++11","-w",/g' setup.py
67+
fi
5068
python setup.py build_ext --inplace || exit 1
5169
mv *.so ../../dafoam
5270
;;

src/utilities/coloring/Allmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ if [ -z "$WM_PROJECT" ]; then
55
exit 1
66
fi
77

8+
if [ "$WM_CODI_AD_MODE" = "CODI_AD_FORWARD" ]; then
9+
exit 0
10+
elif [ "$WM_CODI_AD_MODE" = "CODI_AD_REVERSE" ]; then
11+
exit 0
12+
fi
13+
814
case $1 in
915
"opt")
1016
for d in ./*/ ; do

tests/runTests_DASimpleFoamFixedPoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def setup(self):
9090
self.add_subsystem("mesh", dafoam_builder.get_mesh_coordinate_subsystem())
9191

9292
# add the geometry component (FFD)
93-
self.add_subsystem("geometry", OM_DVGEOCOMP(ffd_file="FFD/bumpFFD.xyz"))
93+
self.add_subsystem("geometry", OM_DVGEOCOMP(file="FFD/bumpFFD.xyz", type="ffd"))
9494

9595
# add a scenario (flow condition) for optimization, we pass the builder
9696
# to the scenario to actually run the flow and adjoint

tests/runTests_MphysAero.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def setup(self):
146146
self.add_subsystem("mesh", dafoam_builder.get_mesh_coordinate_subsystem())
147147

148148
# add the geometry component, we dont need a builder because we do it here.
149-
self.add_subsystem("geometry", OM_DVGEOCOMP(ffd_file="FFD/wingFFD.xyz"))
149+
self.add_subsystem("geometry", OM_DVGEOCOMP(file="FFD/wingFFD.xyz", type="ffd"))
150150

151151
self.mphys_add_scenario("cruise", ScenarioAerodynamic(aero_builder=dafoam_builder))
152152

tests/runTests_MphysAeroField.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def setup(self):
9393
self.add_subsystem("mesh", dafoam_builder.get_mesh_coordinate_subsystem())
9494

9595
# add the geometry component, we dont need a builder because we do it here.
96-
self.add_subsystem("geometry", OM_DVGEOCOMP(ffd_file="FFD/wingFFD.xyz"))
96+
self.add_subsystem("geometry", OM_DVGEOCOMP(file="FFD/wingFFD.xyz", type="ffd"))
9797

9898
self.mphys_add_scenario("cruise", ScenarioAerodynamic(aero_builder=dafoam_builder))
9999

0 commit comments

Comments
 (0)