Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI and FEniCS integration test cases, addressing Joss review issue 185 #213

Merged
merged 27 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d23af14
DOC: docstring for electrochemistry module
jotelha Jan 9, 2024
319e089
MAINT: installable command line interface
jotelha Jan 9, 2024
e83b042
DOC: created CLI documentation stub
jotelha Jan 9, 2024
5cb81b6
DOC: a few tikz figures for illustrating electrochemistry functionality
jotelha Jan 10, 2024
f3a6b0d
DOC: added svg versions of figures
jotelha Jan 10, 2024
ccce7e3
DOC: add electrochemistry jupyter notebook in form of ipynb and jupyt…
jotelha Jan 10, 2024
4804d33
DOC: electrochemistry in index
jotelha Jan 10, 2024
dc0bfd3
DOC: electrochemistry module documentation draft for pnp solver and s…
jotelha Jan 10, 2024
263be09
DOC: enable use of jupytext in mystnb and store electrochemistry_1 no…
jotelha Jan 11, 2024
7a89f27
DOC: show view of sampled atoms in electrochemistry nb
jotelha Jan 11, 2024
ce6d39f
DOC: added thanks to tsinghua guys
jotelha Jan 11, 2024
7505775
DOC: documentation on steric correction
jotelha Jan 11, 2024
189ae1f
DOC: pre-rendered ovito view of shifted ions
jotelha Jan 11, 2024
318b371
DOC: steric correction in index
jotelha Jan 11, 2024
c72250d
DOC: CLI docs layout optimized
jotelha Jan 11, 2024
1c274cf
DOC: reshuffled structure of electrochem docs a little
jotelha Jan 11, 2024
fed3837
DOC: corrected cli docs link
jotelha Jan 11, 2024
d73a7bd
MAINT: add jupytext to docs requirements for rendering py-percent pla…
jotelha Jan 11, 2024
d3381eb
DOC: typos
jotelha Jan 11, 2024
a9abbb5
DOC: added fenics integration docs
jotelha Jan 11, 2024
9456d8c
CI: provide fenics in CI for building fenics-related docs
jotelha Jan 11, 2024
d0dd7ea
DOC: allow generating spelling reports with 'make spelling'
jotelha Jan 12, 2024
b32deff
DOC: corrected typos in electrochemistry docs
jotelha Jan 12, 2024
f4ebd2b
CLI, TST: resolve https://github.com/libAtoms/matscipy/issues/211 and…
jotelha Jan 12, 2024
fb7a4a2
TST: test PoissonNernstPlanckSystemFEniCS in the same manner as Poiss…
jotelha Jan 12, 2024
da167e5
MAINT: empty lines
jotelha Jan 12, 2024
2cf4fd7
TST: skip test_poisson_nernst_planck_solver_fenics if fenics not avai…
jotelha Jan 12, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
# Upgrade to latest meson and ninja
sudo pip install --upgrade meson ninja

# needs fenics to build fenics integration documentation snippet
- name: install_fenics
run: |
sudo apt-get install -y --no-install-recommends software-properties-common
sudo add-apt-repository -y ppa:fenics-packages/fenics
sudo apt-get update -qy
sudo apt-get install -y fenics python3-dolfin python3-mshr

- name: install_package
run: |
sudo pip install .[docs]
Expand Down
7 changes: 7 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ help:
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " spelling to run spell check on documentation"

clean:
rm -rf $(BUILDDIR)/*
Expand Down Expand Up @@ -176,3 +177,9 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

spelling:
$(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
@echo
@echo "Spell check finished. Results are in $(BUILDDIR)/spelling."

22 changes: 22 additions & 0 deletions docs/applications/electrochemistry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Electrochemistry
================

The electrochemistry module provides three components for preparing atomistic
configurations usually encountered in the context of soluted electrolytes.

.. toctree::

electrochemistry_1
electrochemistry_2
electrochemistry_3

Acknowledgements
----------------

We thank Lukas Elflein for supporting the development of
`matscipy.electrochemistry` and the according example notebooks, Christian
Seidl for early experimentation with the module's functionality, Andreas
Greiner for discussions and inspirations on solving transport problems with
controlled-volume and finte-elements methods, as well as Meng Yonggang and
Zhang Jun for posing an interesting tribological problem that sparked the
development of this module initially.
4 changes: 4 additions & 0 deletions docs/applications/electrochemistry/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.pdf
*.gz
*.log
*.aux
13 changes: 13 additions & 0 deletions docs/applications/electrochemistry/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Run

pdflatex file.tex

to build pdf and

pdf2svg file.pdf file.svg

to convert to svg, then

inkscape -h 1024 file.svg -o file.png

to convert to png at 1024 px height.
678 changes: 678 additions & 0 deletions docs/applications/electrochemistry/electrochemicalCellBazant1d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/applications/electrochemistry/electrochemicalCellBazant1d.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
\documentclass[tikz,margin=0mm]{standalone}

\usepackage{amsmath}

\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{shadows,fadings}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{fit}
\usetikzlibrary{calc}

\tikzset{geometry/.style=thick}
\tikzset{feederElectrode/.style={fill=black!30!white, draw=black!80!white}}
\tikzset{electrolyte/.style={fill=black!10!white, draw=black!80!white}}

\begin{document}
\begin{tikzpicture}[geometry]
\def \sternLayerWidth{0.8}
\fill[electrolyte,draw=none] (0,0) rectangle +(10,1) node[pos=0.5,anchor=center,align=center]{electrolyte};
\draw[electrolyte] (0,0) -- +(10,0) +(10,1) -- +(0,1);
\filldraw[feederElectrode] (-0.2,0) rectangle +(0.2,1);
\filldraw[feederElectrode] (10,0) rectangle +(0.2,1);

% electrode BC
\draw (0,2) node[node font=\footnotesize,anchor=south,align=center] {
$\phi + \lambda_S \cdot \mathbf{\hat{n}} \cdot \nabla \phi = \phi_0$\\
$-\mathbf{\hat{n}} \cdot ( -D_i \nabla c_i - z_i F u_i c_i \nabla \phi ) = \sum_{j=1}^M \frac{\nu_{ij} i_j}{F n_j}$
};
\draw (0,2) -- +(0,-0.8);

% bulk BC
\draw (10,2) node[node font=\footnotesize,anchor=south,align=center] {
$\phi + \lambda_S \cdot \mathbf{\hat{n}} \cdot \nabla \phi = 0$\\
$-\mathbf{\hat{n}} \cdot ( -D_i \nabla c_i - z_i F u_i c_i \nabla \phi ) = \sum_{j=1}^M \frac{\nu_{ij} i_j}{F n_j}$
};
\draw (10,2) -- +(0,-0.8);

\draw[->] (-1,0.5) -- (-0.5,0.5) node[pos=0,anchor=east,node font=\footnotesize] {$i_\text{cell} = \sum_{j=1}^M i_j$};
\draw[->] (10.5,0.5) -- (11,0.5) node[anchor=west,node font=\footnotesize] {$i_\text{cell} = \sum_{j=1}^M i_j$};

%% governing eq
\draw [decorate,decoration={brace,amplitude=10pt},xshift=0,yshift=0] (10,-0.2) -- +(-10,0) node [node font=\footnotesize,anchor=north,midway,yshift=-10pt,align=center] {$ \nabla \cdot ( -D_i \nabla c_i - z_i F u_i c_i \nabla \phi ) = 0 $ \\
$\nabla \cdot ( - \epsilon_r \epsilon_0 \nabla \phi ) - F \cdot \sum_{i=1}^N z_i c_i = 0$
};
\end{tikzpicture}
\end{document}
451 changes: 451 additions & 0 deletions docs/applications/electrochemistry/inertElectrode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/applications/electrochemistry/inertElectrode.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
\documentclass[tikz,margin=0mm]{standalone}

\usepackage{amsmath}

\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{shadows,fadings}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{fit}
\usetikzlibrary{calc}

\tikzset{geometry/.style=thick}
\tikzset{feederElectrode/.style={fill=black!30!white, draw=black!80!white}}
\tikzset{electrolyte/.style={fill=black!10!white, draw=black!80!white}}

\begin{document}
\begin{tikzpicture}[geometry]
\fill[electrolyte,draw=none] (0,0) rectangle +(10,1);
\shade[left color=black!10,right color=white,draw=none] (9.5,0) rectangle +(0.5,1);
\draw[electrolyte,fill=none] (0,0) -- +(10,0) +(10,1) -- +(0,1);
\filldraw[feederElectrode] (-0.2,0) rectangle +(0.2,1);
\draw (-0.2,0.5) node[anchor=east] {electrode};
\draw (5,0.5) node[anchor=center] {electrolyte};
\draw (10,0.5) node[anchor=west] {bulk};
%
% electrode BC
\draw (0,2) node[node font=\footnotesize,anchor=south,align=right] {
%$\phi + \lambda_S \cdot \mathbf{\hat{n}} \cdot \nabla \phi = \phi_0$\\
$\phi = \phi_0$\\
$( -D_i \nabla c_i - z_i F u_i c_i \nabla \phi ) = 0$
};
\draw[->] (0,2) -- +(0,-0.8);

% bulk BC
\draw (10,2) node[node font=\footnotesize,anchor=south,align=center] {
$\phi = 0$\\
$c_i = c_i^\infty$
};
\draw[->] (10,2) -- +(0,-0.8);

%% governing eq
\draw [decorate,decoration={brace,amplitude=10pt},xshift=0,yshift=0] (10,-0.2) -- +(-10,0) node [node font=\footnotesize,anchor=north,midway,yshift=-10pt,align=center] {\footnotesize $ \nabla \cdot ( -D_i \nabla c_i - z_i F u_i c_i \nabla \phi ) = 0 $ \\
$\nabla \cdot ( - \epsilon_r \epsilon_0 \nabla \phi ) - F \cdot \sum_{i=1}^N z_i c_i = 0$
};
\end{tikzpicture}
\end{document}
Loading
Loading