Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f0c2294
add compile step
spossann Jun 9, 2026
c292677
add new unit test
spossann Jun 10, 2026
55028f0
improve dev reference on sph evaluation in doc
spossann Jun 10, 2026
923e90a
rename boxed_based to box_based
spossann Jun 10, 2026
cceac63
new dev tutorial on sph evaluation
spossann Jun 10, 2026
46375bd
move sph eval kernerls to new file eval_kernel_sph.py
spossann Jun 10, 2026
3c41a0f
ATTENTION: moved the factor 1/Np into the definition of the weights! …
spossann Jun 11, 2026
bce6104
improve docstgrings of Accumulators
spossann Jun 11, 2026
c7a6d63
improve test for accumulation in Poisson rhs
spossann Jun 11, 2026
228e35d
change pytest params
spossann Jun 11, 2026
5465e55
Merge branch 'devel' into damped-sound-wave
spossann Jun 11, 2026
e62cbd2
fix tests
spossann Jun 11, 2026
506661e
fix bug in viscosity evaluation, and other tests
spossann Jun 12, 2026
7882e81
update matplotlib dep bound
spossann Jun 12, 2026
4fe4d1c
move sph kernels to own file; improve docstrings
spossann Jun 12, 2026
375ecb7
improve some sph docstrings
spossann Jun 12, 2026
e39e970
new unit test for velocity diffusion
spossann Jun 12, 2026
789b4d7
show that the velocity diffusion prodices the correct decay rate
spossann Jun 12, 2026
95a01e3
add a test for damped sound wave
spossann Jun 12, 2026
77e1b66
added damped sound wave verification test
spossann Jun 13, 2026
6719104
added hagen-poiseuile verification test
spossann Jun 13, 2026
d393041
bug fix: update ghost particles in mpi_sort_markers
spossann Jun 13, 2026
850d811
new 2d test for noslip bcs; check interior points for hagen-p test
spossann Jun 13, 2026
3f4ca39
increase acceleration in hagen test, save pngs for video
spossann Jun 13, 2026
bca3253
added dam break verification test
spossann Jun 13, 2026
d04205c
fix boundary bug related to mean_velocity_index for noslip bcs
spossann Jun 14, 2026
c28eba6
added damped sound wave tutorial
spossann Jun 14, 2026
f74644a
add three new tutorials mapping the sph verifiaction tests
spossann Jun 14, 2026
d20bb7a
formatting
spossann Jun 14, 2026
fa736dd
improve plotting of dam break
spossann Jun 15, 2026
f3f0d55
update dependency bounds
spossann Jun 15, 2026
b8658b0
formatting
spossann Jun 15, 2026
3925e13
add new tutorials to doc
spossann Jun 15, 2026
b6b75a6
comment Pytest-MPI plugin check step (hangs with new pytest 9.1)
spossann Jun 15, 2026
3542276
Merge branch 'devel' into damped-sound-wave
spossann Jun 16, 2026
5add884
compile everything in CI
spossann Jun 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ runs:
echo "No env specified, installing outside of any env"
fi
pyccel --version
struphy compile -d
struphy compile -y --language ${{ inputs.language }}
10 changes: 5 additions & 5 deletions .github/workflows/test-PR-pure-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ jobs:
mpirun --version
mpirun --oversubscribe -n 1 python -c "from mpi4py import MPI; print('rank:', MPI.COMM_WORLD.rank); print('size:', MPI.COMM_WORLD.size)"

- name: Pytest-MPI plugin check
shell: bash
run: |
source env/bin/activate
pytest --trace-config | grep mpi || true
# - name: Pytest-MPI plugin check
# shell: bash
# run: |
# source env/bin/activate
# pytest --trace-config | grep mpi || true

- name: Pytest with collect-only
shell: bash
Expand Down
15 changes: 9 additions & 6 deletions doc/sections/dev_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ Developer's guide
This is a collection of tutorials for developers. They are meant to be a practical guide to how to use Struphy
for development purposes, such as implementing new features, propagators or models.

**Getting started with FEEC**: Begin with the :ref:`FEEC basics tutorial <dev_tutorial_feec_basics>` for an introduction to setting up the discrete de Rham complex, creating callable spline functions, and working with differential operators.

**Next FEEC steps**: Continue with the :ref:`FEEC boundary-conditions tutorial <dev_tutorial_feec_bcs>` and then the :ref:`FEEC data-structures tutorial <dev_tutorial_data_structs>` to understand how ``StencilVector`` and ``StencilMatrix`` are used in practice.

The tutorials give an overview of the most important classes used in writing new Propagators.
These include classes for FEEC (finite element exterior calculus), particles and the coupling between them.

Expand All @@ -21,8 +17,15 @@ It is recommended to use the same Python environment as for Struphy, e.g., by in

.. toctree::
:maxdepth: 1
:caption: Notebook tutorials:
:caption: FEEC tutorials:

../_collections/tutorials/dev_tutorial_feec_basics
../_collections/tutorials/dev_tutorial_feec_bcs
../_collections/tutorials/dev_tutorial_data_structs
../_collections/tutorials/dev_tutorial_data_structs


.. toctree::
:maxdepth: 1
:caption: SPH tutorials:

../_collections/tutorials/dev_tutorial_sph_eval_kernels
43 changes: 6 additions & 37 deletions doc/sections/dev_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,11 @@
Developer reference
===================

FEEC
----
.. toctree::
:maxdepth: 2
:caption: Contents:

Derham complex
^^^^^^^^^^^^^^
subsections/dev-feec
subsections/dev-pic
subsections/dev-sph

.. automodule:: struphy.feec.psydac_derham
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__

Grids
^^^^^

.. automodule:: struphy.topology.grids
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__

Mass Operators (bilinear forms)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.feec.mass
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__


Projection of spline functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.feec.basis_projection_ops
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__
39 changes: 39 additions & 0 deletions doc/sections/subsections/dev-feec.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FEEC
----

Derham complex
^^^^^^^^^^^^^^

.. automodule:: struphy.feec.psydac_derham
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__

Grids
^^^^^

.. automodule:: struphy.topology.grids
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__

Mass Operators (bilinear forms)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.feec.mass
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__


Projection of spline functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.feec.basis_projection_ops
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__
44 changes: 44 additions & 0 deletions doc/sections/subsections/dev-pic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
PIC
---

Particle base class
^^^^^^^^^^^^^^^^^^^

.. autoclass:: struphy.pic.base.Particles
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__


Particel-to-grid accumulation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.pic.accumulation.particles_to_grid
:members:
:special-members:
:show-inheritance:


Accumulation kernels
^^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.pic.accumulation.accum_kernels
:members:
:special-members:
:show-inheritance:

.. automodule:: struphy.pic.accumulation.accum_kernels_gc
:members:
:special-members:
:show-inheritance:


Pusher class
^^^^^^^^^^^^

.. autoclass:: struphy.pic.pushing.pusher.Pusher
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__
50 changes: 50 additions & 0 deletions doc/sections/subsections/dev-sph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SPH
---


.. _pusher_kernels_sph:

Pusher kernels
^^^^^^^^^^^^^^

.. automodule:: struphy.pic.pushing.pusher_kernels_sph
:members:
:special-members:
:show-inheritance:
:exclude-members: __in


.. _coeff_kernels_sph:

Coefficient kernels
^^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.pic.pushing.eval_kernels_sph
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__


.. _eval_kernels_sph:

Evaluation kernels
^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.pic.sph_eval_kernels
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__


.. _smoothing_kernels:

Smoothing kernels
^^^^^^^^^^^^^^^^^^

.. automodule:: struphy.pic.sph_smoothing_kernels
:members:
:special-members:
:show-inheritance:
:exclude-members: __init__
29 changes: 25 additions & 4 deletions doc/sections/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,36 @@ It is recommended to use the same Python environment as for Struphy, e.g., by in

.. toctree::
:maxdepth: 1
:caption: Notebook tutorials:
:caption: Pure FEEC models:

../_collections/tutorials/tutorial_poisson
../_collections/tutorials/tutorial_maxwell
../_collections/tutorials/tutorial_linear_mhd_slab_waves_1d


.. toctree::
:maxdepth: 1
:caption: PIC models:

../_collections/tutorials/tutorial_vlasov_ampere_one_species_weak_landau
../_collections/tutorials/tutorial_particle_tracing


.. toctree::
:maxdepth: 1
:caption: SPH models:

../_collections/tutorials/tutorial_beltrami_sph
../_collections/tutorials/tutorial_gas_expansion_sph
../_collections/tutorials/tutorial_viscous_euler_sph
../_collections/tutorials/tutorial_velocity_diffsusion_sph
../_collections/tutorials/tutorial_hagen_poiseuille_sph
../_collections/tutorials/tutorial_dam_break_sph


.. toctree::
:maxdepth: 1
:caption: Geometry and equilibria:

../_collections/tutorials/tutorial_domains
../_collections/tutorials/tutorial_mhd_equilibria
../_collections/tutorials/tutorial_viscous_euler_sph
../_collections/tutorials/tutorial_beltrami_sph
../_collections/tutorials/tutorial_gas_expansion_sph
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies = [
"trame-vuetify<=3.2.2",
"nest_asyncio2<=1.7.2",
"vtk<=9.6.1",
"pytest<=9.0.3",
"pytest<=9.1.0",
"pytest-mpi<=0.6",
"pytest-testmon<=2.2.0",
"ruff>=0.15.0, <=0.15.12",
Expand Down
1 change: 1 addition & 0 deletions src/struphy/console/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def struphy_compile(
and "_tmp.py" not in file
and "test" not in file
and "__pycache__" not in subdir
and "__pyccel__" not in subdir
):
state["kernels"] += [os.path.join(subdir, file)]

Expand Down
4 changes: 3 additions & 1 deletion src/struphy/fields_background/equils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,9 @@ def n_xyz(self, x, y, z):
elif self.params["density_profile"] == "gaussian_xy":
return self.params["n"] * xp.exp(-(x**2 + y**2) / self.params["p0"])
elif self.params["density_profile"] == "step_function_xy":
assert isinstance(self.domain, domains.Cuboid)
from struphy.geometry.domains import Cuboid

assert isinstance(self.domain, Cuboid)
l1 = self.domain.params["l1"]
r1 = self.domain.params["r1"]
l2 = self.domain.params["l2"]
Expand Down
Loading
Loading