Skip to content

Commit 06c8923

Browse files
author
Francesco Rizzi
authored
Merge pull request #172 from Pressio/release-candidate-0.16.0
Release candidate 0.16.0
2 parents 2648c1d + 43f4d7f commit 06c8923

File tree

2,490 files changed

+435996
-184705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,490 files changed

+435996
-184705
lines changed

.github/workflows/test-all.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ jobs:
4646

4747
- name: Install packages
4848
run: |
49+
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
4950
sudo apt-get update
51+
sudo apt-get install libssl1.1
5052
sudo apt-get install -y --install-suggests $APT_PACKAGES
53+
sudo rm /etc/apt/sources.list.d/focal-security.list
5154
5255
- name: Install CMake
5356
run: |
@@ -93,6 +96,7 @@ jobs:
9396
-DCMAKE_BUILD_TYPE:STRING=${{ matrix.config.mode }} \
9497
-DPRESSIODEMOAPPS_ENABLE_TESTS:BOOL=ON \
9598
-DPRESSIODEMOAPPS_ENABLE_BINDINGS:BOOL=OFF \
99+
-DCMAKE_CXX_FLAGS="-Wall -Wno-unused-but-set-variable -Werror" \
96100
-B $BUILD_DIR -S $DEMOAPPS_HOME
97101
98102
# NOTE: -j2 caused g++ crash (out of memory)

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "tpls/pybind11"]
2-
path = tpls/pybind11
3-
url = https://github.com/Pressio/pybind11.git

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ if(PRESSIODEMOAPPS_ENABLE_BINDINGS)
5757

5858
include_directories(
5959
${CMAKE_CURRENT_SOURCE_DIR}/include
60-
${CMAKE_CURRENT_SOURCE_DIR}/tpls/eigen/eigen3)
61-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tpls/pybind11)
60+
${CMAKE_CURRENT_SOURCE_DIR}/tpls/eigen3)
61+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tpls/pybind11-2.10.4)
6262

6363
if(PRESSIODEMOAPPS_ENABLE_OPENMP)
6464
link_libraries(OpenMP::OpenMP_CXX)
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2D single-species advection-reaction-diffusion
2+
==============================================
3+
4+
This problem focuses on the following 2D PDE:
5+
6+
.. math::
7+
8+
\frac{\partial \phi}{\partial t} + u \frac{\partial \phi}{\partial x} + v \frac{\partial \phi}{\partial y} = D \left(\frac{\partial^2 \phi}{\partial x^2} + \frac{\partial^2 \phi}{\partial y^2} \right) - \sigma \phi + f(x, y, t)
9+
10+
11+
* Initial conditions: :math:`\phi(x, y, 0) = 0`
12+
13+
* Default settings:
14+
15+
- :math:`u = 0.5 \cos(\pi/3), v = 0.5 \sin(\pi/3)`
16+
17+
- :math:`D = 0.001`, :math:`\sigma = 1`
18+
19+
- :math:`f(x, y, t) = 1`
20+
21+
* Domain is unit square :math:`[0,1]^2` with homogeneous Dirichlet BC
22+
23+
* :math:`u, v, D, \sigma` can be customized via the problem constructor (more below)
24+
25+
Mesh
26+
----
27+
28+
.. code-block:: shell
29+
30+
python3 pressio-demoapps/meshing_scripts/create_full_mesh_for.py \
31+
--problem advdiffreac2d_s<stencilSize> -n Nx Ny --outDir <destination-path>
32+
33+
where
34+
35+
- ``Nx, Ny`` is the number of cells you want along :math:`x` and :math:`y` respectively
36+
37+
- ``<stencilSize> = 3 or 5 or 7``: defines the neighboring connectivity of each cell
38+
39+
- ``<destination-path>`` is where you want the mesh files to be generated
40+
41+
42+
C++ synopsis
43+
------------
44+
45+
.. code-block:: c++
46+
47+
#include "pressiodemoapps/advection_diffusion_reaction2d.hpp"
48+
49+
int main(){
50+
namespace pda = pressiodemoapps;
51+
52+
const auto meshObj = pda::load_cellcentered_uniform_mesh_eigen("path-to-mesh");
53+
54+
const auto inviscidScheme = pda::InviscidFluxReconstruction::FirstOder; //or Weno3, Weno5
55+
56+
// A. constructor for problem using default values
57+
{
58+
const auto probId = pda::AdvectionDiffusionReaction2d::ProblemA;
59+
auto problem = pda::create_problem_eigen(meshObj, probId, inviscidScheme);
60+
}
61+
62+
// B. setting custom coefficients
63+
{
64+
using scalar_type = typename decltype(meshObj)::scalar_t;
65+
const scalar_type ux = 0.2;
66+
const scalar_type uy = 0.8;
67+
const scalar_type diff = 0.01;
68+
const scalar_type sigma = 1.5;
69+
auto problem = pda::create_advdiffreac_2d_problem_A_eigen(meshObj, inviscidScheme,
70+
ux, uy, diff, sigma);
71+
}
72+
}
73+
74+
75+
Python synopsis
76+
---------------
77+
78+
.. code-block:: py
79+
80+
import pressiodemoapps as pda
81+
82+
meshObj = pda.load_cellcentered_uniform_mesh("path-to-mesh")
83+
84+
scheme = pda.InviscidFluxReconstruction.FirstOrder # or Weno3, Weno5
85+
86+
# A. constructor for problem using default values
87+
probId = pda.AdvectionDiffusionReaction2d.ProblemA
88+
problem = pda.create_problem(meshObj, probId, scheme)
89+
90+
# B. setting custom coefficients
91+
ux, uy, myD, sigma = 0.1, 0.5, 0.001, 1.5
92+
problem = pda.create_adv_diff_reac_2d_problem_A(meshObj, scheme, ux, uy, myD, sigma)
93+
94+
Notes:
95+
------
96+
97+
.. important::
98+
99+
Currently, for this problem the viscous schemes is fixed
100+
such that it yields a second-order viscuous scheme.
101+
102+
103+
Sample Solution
104+
---------------
105+
106+
Representative plot at :math:`t=0` (left) and :math:`t=3`,
107+
using a ``50x50`` mesh with Weno5 and RK4 time integration with :math:`dt = 0.01`,
108+
and default values for the physical coefficients:
109+
110+
.. image:: ../../figures/wiki_2d_advdiffreac_probA_solution0.png
111+
:width: 44 %
112+
113+
.. image:: ../../figures/wiki_2d_advdiffreac_probA_solution1.png
114+
:width: 44 %

docs/source/burgers_2d_periodic.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ C++ synopsis
5959

6060
const auto meshObj = pda::load_cellcentered_uniform_mesh_eigen("path-to-mesh");
6161

62+
const auto probId = pda::AdvectionDiffusion2d::BurgersPeriodic;
6263
const auto inviscidScheme = pda::InviscidFluxReconstruction::FirstOrder; // or Weno3, Weno5
6364
const auto viscousScheme = pda::ViscousFluxReconstruction::FirstOrder; // must be FirstOrder
6465

6566
// A. constructor for problem using default values
6667
{
67-
const auto probId = pda::AdvectionDiffusion2d::BurgersPeriodic;
6868
auto problem = pda::create_problem_eigen(meshObj, probId, inviscidScheme, viscousScheme);
6969
}
7070

@@ -76,9 +76,9 @@ C++ synopsis
7676
const auto D = /* something */;
7777
const auto x0 = /* something */;
7878
const auto y0 = /* something */;
79-
auto problem = pda::create_periodic_burgers_2d_problem_eigen(meshObj, inviscidScheme,
80-
viscousScheme, alpha,
81-
delta, D, x0, y0)
79+
auto problem = pda::create_problem_eigen(meshObj, probId, inviscidScheme,
80+
viscousScheme, alpha,
81+
delta, D, x0, y0)
8282
}
8383
}
8484
@@ -91,11 +91,11 @@ Python synopsis
9191
9292
meshObj = pda.load_cellcentered_uniform_mesh("path-to-mesh")
9393
94+
probId = pda.AdvectionDiffusion2d.BurgersPeriodic
9495
inviscidScheme = pda.InviscidFluxReconstruction.FirstOrder; # or Weno3, Weno5
9596
viscousScheme = pda.ViscousFluxReconstruction.FirstOrder; # must be FirstOrder
9697
9798
# A. constructor for problem using default values
98-
probId = pda.AdvectionDiffusion2d.BurgersPeriodic
9999
problem = pda.create_problem(meshObj, probId, inviscidScheme, viscousScheme)
100100
101101
# B. setting custom coefficients
@@ -104,9 +104,9 @@ Python synopsis
104104
D = # something
105105
x0 = # something
106106
y0 = # something
107-
problem = pda.create_periodic_burgers_2d_problem(meshObj, inviscidScheme,
108-
viscousScheme, alpha,
109-
delta, D, x0, y0)
107+
problem = pda.create_burgers_2d_problem(meshObj, probId, inviscidScheme,
108+
viscousScheme, alpha,
109+
delta, D, x0, y0)
110110
111111
112112
Sample Plot

docs/source/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ def get_version():
6363
with open("../../version.txt") as version_file:
6464
return version_file.read().strip()
6565

66-
version = get_version()
67-
6866
# The full version, including alpha/beta/rc tags.
69-
release = version
67+
release = get_version()
7068

7169
# There are two options for replacing |today|: either, you set today to some
7270
# non-false value, then it is used:

0 commit comments

Comments
 (0)