Skip to content

Commit 9f4d19b

Browse files
committed
update solver docker and drawing pre model
1 parent 812353c commit 9f4d19b

File tree

7 files changed

+43
-34
lines changed

7 files changed

+43
-34
lines changed

doc/source/getting-started/SERVER_SOLVER_README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Run an example on the client side
3434
3535
hostname = "localhost"
3636
port = "5000"
37-
dyna=solver.DynaSolver(hostname,port) # connect to the server
37+
dyna=launch_dyna(ip = hostname,port = port) # connect to the server
3838
dyna.push("./output/ball_plate.k") # push an input file
3939
dyna.start_locally(input = "ball_plate.k",nproc=1)
4040

doc/source/getting-started/example.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ you can get the Python file from ``examples/solver/ball_plate_solver.py``.
9898
9999
hostname = "localhost"
100100
port = "5000"
101-
dyna=solver.DynaSolver(hostname,port) # connect to the container
101+
dyna=launch_dyna(ip = hostname,port = port) # connect to the container
102102
dyna.push("./output/ball_plate.k") # push an input file
103103
dyna.start(4) # start 4 ranks of mppdyna
104104
dyna.run("i=ball_plate.k memory=10m ncycle=20000") # begin execution

docker/pre/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Prerequisites
2525
instructions from `this page <https://docs.docker.com/engine/install/>`_.
2626

2727
* Download the latest Linux release artifacts for the ``pre`` Docker container:
28-
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.3/linux-binaries.zip>`_.
28+
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.6/linux-binaries.zip>`_.
2929

3030
* Move this ZIP file to the ``docker/pre`` directory.
3131

docker/solver/Dockerfile

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ LABEL "com.ansys.description"="Ansys MPPDYNA with gRPC server"
1313

1414
# install some missing stuff we want/need
1515

16-
RUN yum -y install openssh-clients openssh-server bind-utils sudo python3
17-
RUN python3 -m pip install --upgrade pip
18-
RUN python3 -m pip install grpcio
19-
RUN python3 -m pip install grpcio-tools
20-
RUN python3 -m pip install protobuf==4.21.0
16+
RUN yum -y install openssh-clients openssh-server bind-utils sudo python3 unzip &>/dev/null && yum clean all
17+
RUN python3 -m pip install --upgrade pip && \
18+
python3 -m pip install grpcio && \
19+
python3 -m pip install grpcio-tools && \
20+
python3 -m pip install protobuf==4.21.0
2121
#
2222
ENV USER mpirun
2323
ENV HOME /home/mpirun
@@ -27,16 +27,15 @@ ENV LSTC_LICENSE_SERVER license
2727
ENV SSHDIR ${HOME}/.ssh
2828

2929

30-
RUN groupadd ${USER}
31-
RUN useradd -g ${USER} -d ${HOME} ${USER} && \
30+
RUN groupadd ${USER} && useradd -g ${USER} -d ${HOME} ${USER} && \
3231
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
3332
#
34-
RUN mkdir -p /ansys_inc/lib
35-
RUN mkdir -p /rundir
36-
RUN mkdir /var/run/sshd
37-
RUN mkdir -p ${SSHDIR}
38-
RUN chown -R ${USER}:${USER} /rundir
39-
RUN chmod -R 755 /rundir
33+
RUN mkdir -p /ansys_inc/lib && \
34+
mkdir -p /rundir && \
35+
mkdir /var/run/sshd && \
36+
mkdir -p ${SSHDIR} && \
37+
chown -R ${USER}:${USER} /rundir && \
38+
chmod -R 755 /rundir
4039
WORKDIR /rundir
4140

4241
# set up the runtime environment variables for
@@ -73,29 +72,28 @@ RUN echo "export PATH=/opt/openmpi/bin:\${PATH}" >> ${HOME}/.bashrc
7372
#RUN ssh-keygen -A
7473

7574

76-
RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N ""
77-
RUN chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa
78-
RUN echo "Host *" > ${SSHDIR}/config
79-
RUN echo " StrictHostKeyChecking no" >> ${SSHDIR}/config
80-
RUN cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys
81-
RUN ssh-keygen -A
75+
RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N "" && \
76+
chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa && \
77+
echo "Host *" > ${SSHDIR}/config && \
78+
echo " StrictHostKeyChecking no" >> ${SSHDIR}/config && \
79+
cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys && \
80+
ssh-keygen -A
8281

8382
RUN chmod -R 600 ${SSHDIR}* && \
84-
chown -R ${USER}:${USER} ${SSHDIR}
85-
86-
RUN chown -R ${USER}:${USER} ${HOME}
83+
chown -R ${USER}:${USER} ${SSHDIR} && \
84+
chown -R ${USER}:${USER} ${HOME}
8785

8886
# Copy the openmpi libraries
8987

90-
RUN yum install -y unzip
9188
COPY mppdyna_docker_centos7.zip .
92-
RUN unzip -qu mppdyna_docker_centos7.zip && rm mppdyna_docker_centos7.zip
93-
RUN mkdir -p /opt/openmpi
94-
RUN cp -r mpi/* /opt/openmpi
95-
RUN chmod -R 777 /opt/openmpi
89+
RUN unzip -qu mppdyna_docker_centos7.zip && \
90+
rm mppdyna_docker_centos7.zip && \
91+
mkdir -p /opt/openmpi && \
92+
cp -r mpi/* /opt/openmpi && \
93+
chmod -R 777 /opt/openmpi && \
9694

9795
# The executable will go in /ansys_inc, and the
9896
# ifort runtime libraries in /ansys_inc/lib
9997

100-
RUN cp -rpu docker_dir/* /ansys_inc/
101-
RUN chmod -R 777 /ansys_inc/
98+
cp -rpu docker_dir/* /ansys_inc/ && \
99+
chmod -R 777 /ansys_inc/

docker/solver/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Prerequisites
2525
instructions from `this page <https://docs.docker.com/engine/install/>`_.
2626

2727
* Download the latest Linux release artifacts for the ``solver`` Docker container:
28-
`mppdyna_docker_centos7.zip <https://github.com/ansys/pydyna/releases/download/v0.4.3/mppdyna_docker_centos7.zip>`_.
28+
`mppdyna_docker_centos7.zip <https://github.com/ansys/pydyna/releases/download/v0.4.6/mppdyna_docker_centos7.zip>`_.
2929

3030
* Move this ZIP file to the ``docker/solver`` directory.
3131

src/ansys/dyna/core/pre/graphics/graphics.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __call__(self, *args, **kwargs): # pragma: no cover
141141
closest_disp_mesh = None
142142
closest_dist = np.finfo(0.0).max
143143
for disp_mesh in disp_mesh_list:
144-
if disp_mesh.poly_data is None or disp_mesh._type == DisplayMeshType.BEAM:
144+
if disp_mesh.poly_data is None:
145145
continue
146146
point, ix = disp_mesh.poly_data.ray_trace(start, end, first_point=True)
147147
if ix.size != 0:
@@ -786,6 +786,16 @@ def add_to_plotter(self, plotter: Plotter):
786786
self._poly_data, show_edges=True, scalars="colors", rgb=True, pickable=True
787787
)
788788
elif self._type is DisplayMeshType.BEAM:
789+
surf = pv.PolyData(self._vertices, lines=self._facet_list)
790+
fcolor = np.array(self.get_face_color())
791+
colors = np.tile(fcolor, (surf.n_faces, 1))
792+
surf["colors"] = colors
793+
surf.disp_mesh = self
794+
self._poly_data = surf
795+
self._actor = plotter.add_mesh(
796+
self._poly_data, show_edges=True, scalars="colors", rgb=True, pickable=True
797+
)
798+
return
789799
lines = []
790800
for line in self._facet_list:
791801
coord = self._vertices[line[1]]

src/ansys/dyna/core/solver/dynasolver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def run(self, args):
404404
request.b = bytes(args, "utf-8")
405405
response = self.stub.send_request(request)
406406
self._check_return(response)
407+
self.tail(which=1, how=0)
407408
return
408409

409410
def setlc(self, lc, value):

0 commit comments

Comments
 (0)