Skip to content

Commit 312033a

Browse files
author
Francesco Rizzi
authored
Merge pull request #120 from Pressio/version_0130
version 0.13.0
2 parents 69d9eb5 + d3e859f commit 312033a

File tree

1,508 files changed

+34811
-215468
lines changed

Some content is hidden

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

1,508 files changed

+34811
-215468
lines changed

CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,11 @@ else()
7373

7474
if(PRESSIODEMOAPPS_ENABLE_TESTS)
7575
enable_testing()
76-
include_directories(
77-
${CMAKE_CURRENT_SOURCE_DIR}/include
78-
${CMAKE_CURRENT_SOURCE_DIR}/tpls/eigen/eigen3
79-
${CMAKE_CURRENT_SOURCE_DIR}/tpls/pressio/include)
8076
add_subdirectory(tests_mesh)
8177
add_subdirectory(tests_cpp)
8278
endif()
8379

8480
if(PRESSIODEMOAPPS_ENABLE_PERF)
85-
include_directories(
86-
${CMAKE_CURRENT_SOURCE_DIR}/include
87-
${CMAKE_CURRENT_SOURCE_DIR}/tpls/eigen/eigen3
88-
${CMAKE_CURRENT_SOURCE_DIR}/tpls/pressio/include)
8981
add_subdirectory(tests_perf)
9082
endif()
9183

README.md

Lines changed: 0 additions & 242 deletions
Large diffs are not rendered by default.

docs/source/apicpp.rst

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,23 @@ A *pressio-demoapps* C++ problem class meets the following API
2020

2121
The scalar type: this is by default ``double``.
2222

23+
.. cpp:type:: independent_variable_type
24+
25+
This represents "time" and is the same as the ``scalar_type``.
26+
2327
.. cpp:type:: state_type
2428

2529
Data structure type storing the state: this depends on which specific implementation
2630
you use when you instantiate the problem using the ``create_problem_<>`` API
2731
(see `Supported Backends And Types`_ for more details about backends and corresponding types).
2832
For example, if you use ``create_problem_eigen``, the ``state_type`` will be an Eigen vector.
2933

30-
.. cpp:type:: velocity_type
34+
.. cpp:type:: right_hand_side_type
3135

32-
Data structure type to store the velocity (or RHS): this depends on which specific implementation
36+
Data structure type to store the RHS: this depends on which specific implementation
3337
you use when you instantiate the problem using the ``create_problem_<>`` API
3438
(see `Supported Backends And Types`_ for more details about backends and corresponding types).
35-
For example, if you use ``create_problem_eigen``, the ``velocity_type`` will be an Eigen vector.
39+
For example, if you use ``create_problem_eigen``, the ``right_hand_side_type`` will be an Eigen vector.
3640

3741
.. cpp:type:: jacobian_type
3842

@@ -45,31 +49,25 @@ A *pressio-demoapps* C++ problem class meets the following API
4549

4650
Constructs and returns an instance of the initial condition for the target problem.
4751

48-
.. cpp:function:: velocity_type createVelocity()
52+
.. cpp:function:: right_hand_side_type createRightHandSide()
4953

50-
Constructs and returns an instance of the velocity.
54+
Constructs and returns an instance of the right hand side.
5155

5256
.. cpp:function:: jacobian_type createJacobian()
5357

5458
Constructs and returns an instance of the jacobian.
5559

56-
.. cpp:function:: void velocity(const state_type & y, scalar_type time, velocity_type & v)
57-
58-
Given a state :math:`y` and time :math:`time`,
59-
evaluates the RHS of the system and overwrites :math:`v`.
60-
61-
.. cpp:function:: void jacobian(const state_type & y, scalar_type time, jacobian_type & J)
60+
.. cpp:function:: void operator()(const state_type & y, scalar_type time, right_hand_side_type & v)
6261

6362
Given a state :math:`y` and time :math:`time`,
64-
evaluates the Jacobian of the RHS and stores it into :math:`J`.
63+
evaluates the RHS of the system overwriting :math:`v`.
6564

66-
.. cpp:function:: void velocityAndJacobian(const state_type & y, \
67-
scalar_type time, \
68-
velocity_type & v, \
69-
jacobian_type & J)
65+
.. cpp:function:: void operator()(const state_type & y, scalar_type time,\
66+
right_hand_side_type & v, jacobian_type & J, bool computeJac)
7067

7168
Given a state :math:`y` and time :math:`time`,
72-
evaluates the RHS and its Jacobian.
69+
evaluates the RHS of the system overwriting :math:`v` and if ``computeJac == true``,
70+
its Jacobian and stores it into :math:`J`.
7371

7472
.. cpp:function:: auto totalDofSampleMesh()
7573

@@ -100,7 +98,7 @@ C++ Backends and Corresponding Types
10098
- Type alias
10199

102100
* - Eigen
103-
- ``using state_type = Eigen::Matrix<scalar_type, Eigen::Dynamic, 1>`` :raw-html-m2r:`<br/>` :raw-html-m2r:`<br/>` ``using velocity_type = Eigen::Matrix<scalar_type, Eigen::Dynamic, 1>`` :raw-html-m2r:`<br/>` :raw-html-m2r:`<br/>` ``using jacobian_type = Eigen::SparseMatrix<scalar_type, Eigen::RowMajor, int32_t>;``
101+
- ``using state_type = Eigen::Matrix<scalar_type, Eigen::Dynamic, 1>`` :raw-html-m2r:`<br/>` :raw-html-m2r:`<br/>` ``using right_hand_side_type = Eigen::Matrix<scalar_type, Eigen::Dynamic, 1>`` :raw-html-m2r:`<br/>` :raw-html-m2r:`<br/>` ``using jacobian_type = Eigen::SparseMatrix<scalar_type, Eigen::RowMajor, int32_t>;``
104102

105103

106104
.. _cpp-mesh-api:
@@ -137,7 +135,7 @@ A *pressio-demoapps* C++ cell-centered mesh class meets the following API
137135
.. cpp:function:: index_type sampleMeshSize() const
138136

139137
Returns the number of *sample* cells in the mesh.
140-
This corresponds to all cells where the velocity (or RHS) is defined.
138+
This corresponds to all cells where the RHS is defined.
141139

142140
.. cpp:function:: scalar_type dx() const
143141

docs/source/apipy.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Problem Class
1818

1919
:rtype: numpy array
2020

21-
.. py:method:: createVelocity()
21+
.. py:method:: createRightHandSide()
2222
23-
Constructs and returns an instance of the velocity.
23+
Constructs and returns an instance of the rhs.
2424

2525
:rtype: numpy array
2626

@@ -33,14 +33,14 @@ Problem Class
3333
:rtype: numpy array
3434

3535

36-
.. py:method:: velocity(y, time, v)
36+
.. py:method:: rightHandSide(y, time, rhs)
3737
3838
Given a state :math:`y` and time :math:`time`,
3939
evaluates the RHS of the system and stores it into :math:`v`.
4040

4141
:param numpy array y: state vector
4242
:param float time: evaluation time
43-
:param numpy array v: velocity to overwrite
43+
:param numpy array rhs: rhs to overwrite
4444

4545
.. py:method:: applyJacobian(y, operand, time, result)
4646
@@ -107,7 +107,7 @@ A *pressio-demoapps* Python cell-centered mesh class meets the following API
107107
.. py:method:: sampleMeshSize()
108108
109109
Returns the number of *sample* cells in the mesh.
110-
This corresponds to all cells where the velocity (or RHS) is defined.
110+
This corresponds to all cells where the RHS is defined.
111111

112112
:rtype: int
113113

docs/source/howtouse.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ Here we show some things you can do using the C++ as an example:
109109
auto state = problem.initialCondition();
110110

111111
// having the problem and initial condition, create instance of the RHS
112-
auto rhs = problem.createVelocity()
112+
auto rhs = problem.createRightHandSide()
113113
// compute the rhs of the discrete system at time=0.0
114-
problem.velocity(state, 0.0, rhs);
114+
problem.rightHandSide(state, 0.0, rhs);
115115

116116
// create the Jacobian
117117
auto J = problem.createJacobian()
118118
// compute J at time=0.0
119-
problem.velocityAndJacobian(state, 0.0, rhs, J);
119+
problem.rightHandSideAndJacobian(state, 0.0, rhs, J);
120120
// or we can compute just the Jacobian
121121
problem.jacobian(state, 0.0, J);
122122

docs/source/installation.rst

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ To use it, you need a C++14 compiler and you have to:
1515

1616
2. include the Eigen library (whose headers you can find inside ``pressiodemoapps/tpls``).
1717

18-
3. specify the CMake option ``-DPRESSIODEMOAPPS_ENABLE_TPL_EIGEN=ON`` while building your code.
19-
2018
Building the test suite
2119
~~~~~~~~~~~~~~~~~~~~~~~
2220

@@ -25,7 +23,7 @@ If you want to build the C++ tests, you need CMake > 3.18.0 and then do::
2523
git clone --recursive [email protected]:Pressio/pressio-demoapps.git
2624
export CXX=<path-to-your-CXX-compiler> #must support C++14
2725
cd pressio-demoapps && mkdir build && cd build
28-
cmake -DPRESSIODEMOAPPS_ENABLE_TESTS=On -DPRESSIODEMOAPPS_ENABLE_TPL_EIGEN=ON ..
26+
cmake -DPRESSIODEMOAPPS_ENABLE_TESTS=On ..
2927
make -j4
3028
ctest -j4
3129

@@ -54,18 +52,6 @@ Then, you can do:
5452
5553
This builds/installs pressiodemoapps with default options (build_mode=Release).
5654

57-
58-
59-
..
60-
To build/install pressiodemoapps with OpenMP and Release mode:
61-
git clone --recursive [email protected]:Pressio/pressio-demoapps.git
62-
export CXX=<path-to-your-CXX-compiler> #must support C++14
63-
python3 cmake_build.py --openmp
64-
pip3 install .
65-
# to just build do
66-
python -m build
67-
68-
6955
You can run the tests to verify things::
7056

7157
cd pressio-demoapps

docs/source/meshsample.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ What is a sample mesh and why?
88

99
.. Important::
1010
In practice, a sample mesh is a disjoint collection
11-
of cells where one computes the velocity (or RHS or residual) vector
11+
of cells where one computes the RHS (or residual) vector
1212
and Jacobian matrix of the target system.
1313

1414
The sample mesh is critical, for example, for projection-based ROMs of nonlinear systems.
@@ -26,9 +26,9 @@ and the `discrete empirical interpolation method (DEIM) <https://doi.org/10.1137
2626
While the sample mesh strictly speaking refers to the collection of cells
2727
where we compute the residual and Jacobian, a related concept is what we refer to as **stencil mesh**.
2828
We refer to **stencil mesh** the collection of cells that are needed to compute
29-
the velocity or residual vector on the *sample mesh*.
29+
the RHS or residual vector on the *sample mesh*.
3030
Note that, in general, the sample mesh is a subset of the stencil mesh,
31-
because to compute the velocity or residual at a given cell, one also needs
31+
because to compute the RHS or residual at a given cell, one also needs
3232
the cell-centered values at that target cell.
3333

3434
For more discussion on this, see `this page <https://pressio.github.io/proms/hyper/>`_.

0 commit comments

Comments
 (0)