Skip to content

Commit

Permalink
setup.py install (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: Neil Wu <[email protected]>
Co-authored-by: Neil Wu <[email protected]>
Co-authored-by: Eirikur Jonsson <[email protected]>
  • Loading branch information
4 people authored Jun 16, 2020
1 parent fe92eea commit a6d0ac0
Show file tree
Hide file tree
Showing 95 changed files with 125 additions and 233 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install:
# We thrown away the existing repo in Docker, and copy the new one in-place
- docker exec -it app /bin/bash -c "rm -rf $DOCKER_WORKING_DIR && cp -r $DOCKER_MOUNT_DIR $DOCKER_WORKING_DIR"
# Now download the regression input files
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/python && wget http://mdolab.engin.umich.edu/sites/default/files/mdolabwebsite/repos/adflow/adflow_input_files.tar.gz && tar -xzf adflow_input_files.tar.gz"
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && wget http://mdolab.engin.umich.edu/sites/default/files/mdolabwebsite/repos/adflow/adflow_input_files.tar.gz && tar -xzf adflow_input_files.tar.gz"
# Copy over the correct config file and modify as needed
- if [[ "$DOCKER_TAG" == "py3-centos7-impi" ]]; then
docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && cp config/defaults/config.LINUX_INTEL.mk config/config.mk";
Expand All @@ -55,14 +55,16 @@ install:
else
docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && make -f Makefile_CS PETSC_ARCH=complex-opt-\$COMPILERS-\$PETSCVERSION";
fi
# Install Python interface
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && pip install ."

script:
# Some of the complex tests take >10 min, so adding travis_wait to stop travis from timing out after 10min
# the sleep infinity is a workaround since docker exec forks another process which won't work directly with travis_wait
- if [ "$TEST_TYPE" = "REAL" ]; then
travis_wait 120 sleep infinity & docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/python/reg_tests && python run_reg_tests.py";
travis_wait 120 sleep infinity & docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/reg_tests && python run_reg_tests.py";
else
travis_wait 120 sleep infinity & docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/python/reg_tests && export PETSC_ARCH=complex-opt-\$COMPILERS-\$PETSCVERSION && python run_reg_tests_cs.py";
travis_wait 120 sleep infinity & docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR/reg_tests && export PETSC_ARCH=complex-opt-\$COMPILERS-\$PETSCVERSION && python run_reg_tests_cs.py";
fi

after_script:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default:
echo "The modify this config file as required. Typically the CGNS directory "; \
echo "will have to be modified. With the config file specified, rerun "; \
echo "'make' and the build will start"; \
else make adflow;\
else make adflow_build;\
fi;

clean:
Expand All @@ -26,7 +26,7 @@ clean:



adflow:
adflow_build:
ln -sf config/config.mk config.mk;
(cd src/build/ && make)

4 changes: 2 additions & 2 deletions Makefile_CS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default:
echo "The modify this config file as required. Typically the CGNS directory "; \
echo "will have to be modified. With the config file specified, rerun "; \
echo "'make' and the build will start"; \
else make -f Makefile_CS adflow;\
else make -f Makefile_CS adflow_build;\
fi;


Expand Down Expand Up @@ -41,7 +41,7 @@ clean:
rm -fr src_cs/wallDistance
rm -fr src_cs/warping

adflow:
adflow_build:
ln -sf config/config.mk config.mk;
(cd src_cs/build/ && make -f Makefile1 directories)
(cd src_cs/build/ && make -f Makefile1 complexify)
Expand Down
File renamed without changes.
12 changes: 7 additions & 5 deletions __init__.py → adflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
__version__ = '2.2.0'

from mpi4py import MPI

from .python.pyADflow import ADFLOW
from .python.pyADflow_C import ADFLOW_C
from .python.oversetCheck import OversetCheck
from .python.checkZipper import checkZipper
from .pyADflow import ADFLOW
from .pyADflow_C import ADFLOW_C
from .oversetCheck import OversetCheck
from .checkZipper import checkZipper


try:
Expand All @@ -15,7 +17,7 @@
print('Warning: OpenMDAO dependency is not installed. OM_ADFLOW wrapper will not be active')

if openmdao is not None:
from .python.om_adflow import OM_ADFLOW
from .om_adflow import OM_ADFLOW



Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 14 additions & 5 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ It is therefore necessary to build this library before using ``ADflow``.

Requirements
------------
See :ref:`install3rdPartyPackages` for details on installing required 3rd party packages.
ADflow requires the following dependencies:
- CGNS Library
- PETSc
- MPI

See the MDO Lab installation guide `here <http://mdolab.engin.umich.edu/docs/installInstructions/install3rdPartyPackages.html>`_ for the supported versions and installation instructions.

Building
--------
Expand All @@ -24,7 +29,7 @@ If you are a beginner user installing the packages on a linux desktop,
you should use the ``config.LINUX_GFORTRAN`` versions of the configuration
files. The ``config.LINUX_INTEL`` versions are usually used on clusters.
ADflow has been successfully compiled on LINUX with either
ifort or gfortran.
``ifort`` or ``gfortran``.

Once you have copied the config file, compile ADflow by running::

Expand All @@ -36,13 +41,17 @@ the screen (near the end)::
Testing if module adflow can be imported...
Module adflow was successfully imported.

If you don't see this, it will be necessary to configure the build
manually. To configure manually, open ``config/config.mk`` and modify options as necessary.
If you don't see this, it will be necessary to configure the build manually.
To configure manually, open ``config/config.mk`` and modify options as necessary.

It is most likely that you need to modify the ``CGNS_INCLUDE_FLAGS`` and the ``CGNS_LINKER_FLAGS`` variables.
It is also necessary to have``PETSc`` already compiled.
After changes to the configuration file, run ``make clean`` before attempting a new build.

Lastly, to build and install the Python interface, type::

pip install .


Verification
------------
ADflow contains a set of simple tests that can be run automatically
Expand Down
File renamed without changes.
6 changes: 2 additions & 4 deletions python/inputFiles/Readme.md → inputFiles/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

The input files for test need to be downloaded.

From the command line, navigate to the `adflow/python` directory and download and extract the archive
From the command line, navigate to the root directory and download and extract the archive

```
wget http://mdolab.engin.umich.edu/sites/default/files/mdolabwebsite/repos/adflow/adflow_input_files.tar.gz
tar -xzvf adflow_input_files.tar.gz
```

The above should extract the files to the `adflow/python/inputFiles` directory.
The above should extract the files to the root directory.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test1.py → reg_tests/tests/test1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 1: MDO tutorial -- Euler -- Scalar JST')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test10: MDO tutorial -- Solve-CL Test')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test11: MDO tutorial -- Viscous -- Solution Test')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test12: MDO tutorial -- RANS -- Solution Test')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
from idwarp import USMesh
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test13: MDO tutorial -- Euler -- Adjoint Test')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
from idwarp import USMesh
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test14: MDO tutorial -- Rans -- Adjoint Test')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
from adflow import ADFLOW

printHeader('Test 15: NACA 0012 2D Time-Accurate, Forced motion, Rigid Rotation of Mesh - DADI Smoother')
gridFile = '../inputFiles/naca0012_rans-L2.cgns'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 16: Euler Convergenent Nozzle -- Flow Properties Integration ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ======================================================================
# Input Information -- Modify accordingly!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ======================================================================
# Input Information -- Modify accordingly!
Expand Down
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test2.py → reg_tests/tests/test2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 2: MDO tutorial -- Euler -- Matrix')
Expand Down
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test3.py → reg_tests/tests/test3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 3: MDO tutorial -- Euler -- Matrix')
Expand Down
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test4.py → reg_tests/tests/test4.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 4: MDO tutorial -- Random Mesh -- Euler -- Scalar JST')
Expand Down
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test5.py → reg_tests/tests/test5.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 5: MDO tutorial -- Viscous -- Scalar JST')
Expand Down
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test6.py → reg_tests/tests/test6.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 6: MDO tutorial -- Rans -- Scalar JST')
Expand Down
8 changes: 1 addition & 7 deletions python/reg_tests/tests/test7.py → reg_tests/tests/test7.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
from baseclasses import AeroProblem
from mdo_regression_helper import *
from commonUtils import *

# ###################################################################
# DO NOT USE THIS IMPORT STRATEGY! THIS IS ONLY USED FOR REGRESSION
# SCRIPTS ONLY. Use 'from adflow import ADFLOW' for regular scripts.
sys.path.append(os.path.abspath('../../'))
from python.pyADflow import ADFLOW
# ###################################################################
from adflow import ADFLOW

# ****************************************************************************
printHeader('Test 7: MDO tutorial -- Random -- Rans -- Scalar JST')
Expand Down
Loading

0 comments on commit a6d0ac0

Please sign in to comment.