Skip to content

Commit

Permalink
fix: Force render in example (#2046)
Browse files Browse the repository at this point in the history
* Force render in example

* Test revert

* fix: solve warnings on docs build

* Test

* Test pyvista example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Close plotter

* Remove pyvista example

* Don't force render contact mesh

* Test

* Update pyvista in docs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Test double gif

* Change gif name

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Test palettesize

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Test smaller window size

* Remove second plotter

* Change window size to better aspect ratio

* Test no contact

* Revert changes

* Bump pyvista version

* Update pyvista docs dependency

* Bump sphinx version

* test gif generation

* Add xvfb

* Move example run to another place

* Add OFF SCREEN flag

* Move example run to doc build

* Fix path

* Manually add gif

* copy image to build folder

* Resolve comments

---------

Co-authored-by: Roberto Pastor Muela <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: German <[email protected]>
  • Loading branch information
4 people authored Jul 26, 2023
1 parent a3e9be6 commit e6f1c36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ jobs:
run: |
xvfb-run make -C doc html SPHINXOPTS="-j auto -W --keep-going"
- name: "Substitute defective GIF"
run: |
cd doc/_build/html/examples/gallery_examples/00-mapdl-examples
cp ../../../../../source/images/dcb.gif ../../../_images/
sed -i 's+../../../_images/sphx_glr_composite_dcb_004.gif+../../../_images/dcb.gif+g' composite_dcb.html
cd ../../../../../../
- name: "Upload HTML Documentation"
uses: actions/upload-artifact@v3
with:
Expand Down
Binary file added doc/source/images/dcb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions examples/00-mapdl-examples/composite_dcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
opacity=0.3,
)


# Add the contact mesh to the scene
mesh_contact = result_mesh.grid
plotter.add_mesh(
Expand All @@ -381,7 +382,6 @@
clim=[0, 1],
scalars=np.zeros((mesh_contact.n_cells)),
)

for i in range(1, 100):
# Get displacements
disp = model.results.displacement(time_scoping=i).eval()
Expand All @@ -402,10 +402,9 @@
plotter.update_coordinates(disp_result.data, mesh=mesh_beam, render=False)
plotter.update_coordinates(disp_cohesive.data, mesh=mesh_contact, render=False)
plotter.update_scalars(cohesive_damage.data, mesh=mesh_contact, render=False)

plotter.write_frame()

plotter.show()
plotter.close()


###############################################################################
Expand Down

0 comments on commit e6f1c36

Please sign in to comment.