Skip to content

Commit

Permalink
Fix Dicker file and test
Browse files Browse the repository at this point in the history
Signed-off-by: Umberto Zerbinati <umberto.zerbinati@maths.ox.ac.uk>
  • Loading branch information
UZerbinati committed Sep 25, 2023
1 parent 5a83b31 commit de8dfe2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ ENV SLEPC_DIR /root/slepc
ENV SLEPC_ARCH linux_debug
#Installing dependencies using aptitude
RUN apt-get update \
&& apt-get -y install git libopenmpi-dev build-essential cmake python3 python3-distutils python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev g++ libglu1-mesa-dev liblapacke-dev libblas-dev liblapack-dev
&& apt-get -y install git libopenmpi-dev build-essential cmake wget libssl-dev python3 python3-distutils python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev g++ libglu1-mesa-dev liblapacke-dev libblas-dev liblapack-dev
#Building cmake
RUN cd ~ && wget https://github.com/Kitware/CMake/releases/download/v3.27.6/cmake-3.27.6.tar.gz \
&& tar -zxvf cmake-3.27.6.tar.gz \
&& cd cmake-3.27.6 \
&& ./configure \
&& make -j 2 \
&& make install
#Installing python dependencies using pip
RUN pip install numpy cython mpi4py pytest pytest-mpi
#Configure PETSc
Expand Down Expand Up @@ -41,7 +48,7 @@ RUN cd ~/slepc \
--with-slepc4py=1 \
&& make
#Building ngsolve
ENV LD_LIBRARY_PATH /root/petsc/linux_debug/lib:/root/slepc/linux_debug/lib
ENV LD_LIBRARY_PATH /root/petsc/linux_debug/lib
RUN mkdir -p ~/ngsuite \
&& cd ~/ngsuite \
&& git clone https://github.com/NGSolve/ngsolve.git ngsolve-src \
Expand All @@ -50,7 +57,7 @@ RUN mkdir -p ~/ngsuite \
&& mkdir ~/ngsuite/ngsolve-build \
&& mkdir ~/ngsuite/ngsolve-install \
&& cd ~/ngsuite/ngsolve-build \
&& LD_LIBRARY_PATH=/root/petsc/linux_debug/lib:/root/slepc/linux_debug/lib cmake -DCMAKE_INSTALL_PREFIX=~/ngsuite/ngsolve-install ~/ngsuite/ngsolve-src -DUSE_MPI=ON -DUSE_MPI4PY=ON\
&& LD_LIBRARY_PATH=/root/petsc/linux_debug/lib:/root/slepc/linux_debug/lib make && LD_LIBRARY_PATH=/root/petsc/linux_debug/lib:/root/slepc/linux_debug/lib make install
&& cmake -DCMAKE_INSTALL_PREFIX=~/ngsuite/ngsolve-install ~/ngsuite/ngsolve-src -DUSE_MPI=ON -DUSE_OCC=OFF\
&& make && make install
#Adding NGS to PYTHONPATH
ENV PYTHONPATH /root/petsc/linux_debug/lib:/root/slepc/linux_debug/lib:/root/ngsuite/ngsolve-install/lib/python3.10/site-packages
5 changes: 3 additions & 2 deletions tests/test_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,6 @@ def tang(u): return u-(u*n)*n
if __name__ == '__main__':
test_pc()
test_pc_gamg()
test_pc_hiptmaier_xu_sor()
test_pc_hiptmaier_xu_bjacobi()
test_pc_hiptmaier_xu_bjacobi()
if COMM_WORLD.size == 1:
test_pc_hiptmaier_xu_sor()
5 changes: 3 additions & 2 deletions tests/test_snes.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def NeoHook (C):
a = BilinearForm(fes, symmetric=True)
a += Variation(NeoHook (C).Compile() * dx
-factor * (InnerProduct(force,u) ).Compile() * dx)
solver = NonLinearSolver(fes, a=a, objective=False,
solver = NonLinearSolver(fes, a=a,
solverParameters={"snes_type": "newtonls",
"snes_max_it": 10,
"snes_monitor": ""})
Expand All @@ -105,4 +105,5 @@ def NeoHook (C):
if __name__ == '__main__':
test_snes_toy_lbfgs()
test_snes_toy_newtonls()
test_snes_elastic_beam_newtonls()
if COMM_WORLD.size == 1:
test_snes_elastic_beam_newtonls()

0 comments on commit de8dfe2

Please sign in to comment.