Skip to content

Commit

Permalink
Fix Laplacian smoothing demo formatting (#76)
Browse files Browse the repository at this point in the history
Closes #69.
Closes #75.

It seems we missed some LaTeX errors in the Laplacian smoothing demo,
which are fixed here. This PR also makes the linting check happen before
testing in the CI so that we catch formatting issues sooner.
  • Loading branch information
jwallwork23 authored Apr 18, 2024
1 parent b9ba04f commit 96b3f70
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Movement
name: 'Run Movement test suite'

on:
# Run test suite whenever main is updated
Expand All @@ -15,7 +15,7 @@ on:

jobs:
build:
name: "Build Movement"
name: 'Test suite'
# The type of runner that the job will run on
runs-on: ubuntu-latest
# The docker container to use.
Expand All @@ -24,28 +24,34 @@ jobs:
options: --user root
steps:
- uses: actions/checkout@v2
- name: Cleanup

- name: 'Cleanup'
if: ${{ always() }}
run: |
cd ..
rm -rf build
- name: Setup python
- name: 'Setup python'
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install

- name: 'Install Movement'
run: |
. /home/firedrake/firedrake/bin/activate
python -m pip install -e .
- name: Test
- name: 'Lint'
if: ${{ always() }}
run: |
. /home/firedrake/firedrake/bin/activate
make lint
- name: 'Test Animate'
run: |
. /home/firedrake/firedrake/bin/activate
export GITHUB_ACTIONS_TEST_RUN=1
python $(which firedrake-clean)
python -m coverage erase
python -m coverage run --source=movement -m pytest -v --durations=20 test
python -m coverage report
- name: Lint
if: ${{ always() }}
run: |
. /home/firedrake/firedrake/bin/activate
make lint
8 changes: 4 additions & 4 deletions demos/laplacian_smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
#
# where :math:`\mathbf{v}` is the so-called *mesh velocity* that we solve for. Note that
# the derivatives in the Laplace equation are in terms of the *computational coordinates*
# :math:`\boldsymbol{\xi}}`, rather than the physical coordinates :math:`\mathbf{x}`.
# :math:`\boldsymbol{\xi}`, rather than the physical coordinates :math:`\mathbf{x}`.
#
# With the mesh velocity, we update the physical coordinates according to
#
# .. math::
# \mathbf{x} := \mathbf{x} + \mathbf{v} * \Delta t,
# \mathbf{x} := \mathbf{x} + \mathbf{v} \Delta t,
#
# where :math:`\Delta t` is the timestep.
#
# To motivate why we might want to take this sort of approach, consider momentarily the
# 1D case, where we have velocities :math:`\{v_i\}_{i=1}^n at each of a sequence of
# 1D case, where we have velocities :math:`\{v_i\}_{i=1}^n` at each of a sequence of
# :math:`n\in\mathbb{N}` points with uniform separation :math:`h`. If we want to smooth
# out the local variation in the velocities in the vicinity of :math:`v_i, we might
# out the local variation in the velocities in the vicinity of :math:`v_i`, we might
# consider averaging out :math:`(v_{i-1}-v_i)/h` and :math:`(v_{i+1}-v_i)/h`. Doing so
# gives
#
Expand Down

0 comments on commit 96b3f70

Please sign in to comment.