Skip to content

Commit

Permalink
Fix test not to use Opencascade
Browse files Browse the repository at this point in the history
Signed-off-by: Umberto Zerbinati <[email protected]>
  • Loading branch information
UZerbinati committed Oct 4, 2023
1 parent 06fcfa7 commit ecebc90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ENV SLEPC_ARCH linux_debug
#Installing dependencies using aptitude
RUN apt-get update \
&& 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
#RUN apt-get update \
# && apt-get -y install libocct-data-exchange-dev libocct-draw-dev occt-misc
#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 \
Expand Down Expand Up @@ -57,7 +59,7 @@ RUN mkdir -p ~/ngsuite \
&& mkdir ~/ngsuite/ngsolve-build \
&& mkdir ~/ngsuite/ngsolve-install \
&& cd ~/ngsuite/ngsolve-build \
&& cmake -DCMAKE_INSTALL_PREFIX=~/ngsuite/ngsolve-install ~/ngsuite/ngsolve-src -DUSE_MPI=ON -DBUILD_OCC=ON\
&& 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
15 changes: 6 additions & 9 deletions tests/test_snes.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,13 @@ def test_snes_elastic_beam_newtonls():
This test run only in serial becasue variational energy as objective only works
in serial, please use objective=False in parallel.
'''
from netgen.occ import Rectangle, OCCGeometry, X, Y
from netgen.geom2d import SplineGeometry
if COMM_WORLD.rank == 0:
shape = Rectangle(1,0.1).Face()
shape.edges.Min(X).name="left"
shape.edges.Min(X).maxh=0.01
shape.edges.Max(X).name="right"
shape.edges.Min(Y).name="bot"
shape.edges.Max(Y).name="top"
geom = OCCGeometry(shape, dim=2)
mesh = Mesh(geom.GenerateMesh(maxh=0.05).Distribute(COMM_WORLD))
geo = SplineGeometry()
pnums = [ geo.AddPoint (x,y,maxh=0.01) for x,y in [(0,0), (1,0), (1,0.1), (0,0.1)] ]
for p1,p2,bc in [(0,1,"bot"), (1,2,"right"), (2,3,"top"), (3,0,"left")]:
geo.Append(["line", pnums[p1], pnums[p2]], bc=bc)
mesh = Mesh(geo.GenerateMesh(maxh=0.05).Distribute(COMM_WORLD))
else:
mesh = Mesh(ngm.Mesh.Receive(COMM_WORLD))
# E module and poisson number:
Expand Down

0 comments on commit ecebc90

Please sign in to comment.