+ directory +
+ swe+
diff --git a/docs/conf.py b/docs/conf.py index 4889090..71008c6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,12 +36,15 @@ ("Default Implicit Galerkin (custom types)", ) ]), + ("Full Demos", + [ + ("Shallow Water Eq", ) + ]), + ("Github Page", []), # these are here just to make the menu bar spaced better ("", []), - ("", []), - ("", []), # ("Shallow Water Eq.", # [ @@ -52,12 +55,6 @@ # #("End-to-end LSPG example", ) # ]) - # # demos - # ("Demos", #("Full Examples", - # [ - # ("Example1", ) - # ]), - # ('Classes', 'annotated', []), # ('Namespaces', 'namespaces', []) ] diff --git a/docs/html/advancers_8md.html b/docs/html/advancers_8md.html index b2f3f3b..b5596d4 100644 --- a/docs/html/advancers_8md.html +++ b/docs/html/advancers_8md.html @@ -56,12 +56,16 @@
+
Search for symbols, directories, files, pages or
+ modules. You can omit any prefix from the symbol or file path; adding a
+ :
or /
suffix lists all members of given symbol or
+ directory.
Use ↓ + / ↑ to navigate through the list, + Enter to go. + Tab autocompletes common prefix, you can + copy a link to the result using ⌘ + L while ⌘ + M produces a Markdown link.
+This website contains the tutorials covering the pressio C++ library.
Disclaimer: this is still work-in-progress, some coverage might be missing. We plan to improve this over time.
All you need CMake > 3.18.0 and a C++14 compliant compiler.
git clone --recursive git@github.com:Pressio/pressio-tutorials.git +Tutorials suite covering the pressio C++ library.
Build and Run
All you need CMake > 3.18.0 and a C++14 compliant compiler.
git clone --recursive git@github.com:Pressio/pressio-tutorials.git export CXX=<path-to-your-CXX-compiler> cd pressio-tutorials && mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release .. -make -j4Individual executables for all tutorials are built inside the build subdirectory.
License and Citation
The BSD-3 license is available here.
We are working on publishing this. Our arXiv preprint at: https:/
/ arxiv.org/ abs/ 2003.07798 +make -j4 Questions?
Find us on Slack: https:/
/ pressioteam.slack.com or open an issue on github.
Individual executables for all tutorials are built inside the build subdirectory.
This is still work-in-progress, some coverage might be missing. We are actively working on adding more. If you don't find something, you can temporarily look at C++ tests subdirectory, which contains tests for everything. These tests are readable, but are obviously not formatted in a tutorial fashion.
The BSD-3 license is available here.
We are working on publishing this. Our arXiv preprint at: https:/
Find us on Slack: https:/
{ +};
{ /* time-step is fixed */ @@ -182,7 +186,7 @@std::cout << "Final state: [" << state[0] << " " << state[1] << " " << state[2] << "] " << std::endl; -}
{ +}
{ /* time-step is fixed, user passes an observer to monitor state */ @@ -197,7 +201,7 @@MyObserver monitor; pode::advance_n_steps_and_observe(stepper, state, start_time, dt, num_steps, monitor); -}
Similarly works for the other cases accepting the time step setter, etc.
This always needs a functor to set the time step.
{ +}
Similarly works for the other cases accepting the time step setter, etc.
This always needs a functor to set the time step.
{ /* time-step is provided */ @@ -223,7 +227,7 @@}; pode::advance_to_target_time(stepper, state, start_time, final_time, dt_setter); -}
This is like above, but you also need to pass an obsever.
This is like above, but you also need to pass an obsever.
#include "pressio/ode_advancers.hpp" + is time.Include
#include "pressio/ode_advancers.hpp" #include "pressio/ode_steppers_explicit.hpp" -#include <Eigen/Core>Problem class
template<class scalar_t> +#include <Eigen/Core>Problem class
template<class scalar_t> struct MySystem{ using scalar_type = scalar_t; using state_type = Eigen::Matrix<scalar_t,-1,1>; @@ -149,7 +153,7 @@velocity_type createVelocity() const{ return velocity_type(3); }; -};
Main
int main(int argc, char *argv[]) +};Main
int main(int argc, char *argv[]) { pressio::log::initialize(pressio::logto::terminal); @@ -183,7 +187,7 @@pressio::log::finalize(); return 0; -}
+} Full Code
The full code is available here.
The full code is available here.
Suppose that you have an application that uses a custom vector class as follows:
template<class ScalarType> +Custom Vector Class
Suppose that you have an application that uses a custom vector class as follows:
template<class ScalarType> struct CustomVector { using value_type = ScalarType; @@ -99,7 +103,7 @@private: std::vector<ScalarType> d_ = {}; -};
This custom vector class is very simple but the key point is that the
CustomVector
is unknown to Pressio. You can replaceCustomVector
with any type that fits your needs.Problem Class
Here, we want to integrate in time the same system of ODEs shown in tutorial1, but with the problem implemented using the
CustomVector
class as follows:struct MySystem +};This custom vector class is very simple but the key point is that the
CustomVector
is unknown to Pressio. You can replaceCustomVector
with any type that fits your needs.Problem Class
Here, we want to integrate in time the same system of ODEs shown in tutorial1, but with the problem implemented using the
CustomVector
class as follows:struct MySystem { using scalar_type = double; using state_type = CustomVector<scalar_type>; @@ -119,7 +123,7 @@velocity_type createVelocity() const{ return velocity_type(3); }; -};
Specialize trait and ops
Because we are working with custom data types, we need to provide the necessary operations to do the algebra that pressio needs. This is done as follows:
namespace pressio{ +};Specialize trait and ops
Because we are working with custom data types, we need to provide the necessary operations to do the algebra that pressio needs. This is done as follows:
namespace pressio{ template<class T> struct Traits<CustomVector<T>>{ using scalar_type = typename CustomVector<T>::value_type; @@ -166,7 +170,7 @@v[i] = a*v[i] + b*v1[i] + c*v2[i] + d*v3[i] + e*v4[i]; } } -}} //end namespace pressio::ops
Main
int main(int argc, char *argv[]) +}} //end namespace pressio::opsMain
int main(int argc, char *argv[]) { pressio::log::initialize(pressio::logto::terminal); @@ -196,7 +200,7 @@<< std::endl; pressio::log::finalize(); - return 0;
+ return 0; Full Code
The full code is available here.
The full code is available here.
...
...
...
...
Suppose that you have an application that uses arbitrary types. For the sake of this tutorial, let's define these to be:
template<class ScalarType> +Custom Data Class
Suppose that you have an application that uses arbitrary types. For the sake of this tutorial, let's define these to be:
template<class ScalarType> struct CustomVector { using value_type = ScalarType; @@ -123,7 +127,7 @@std::size_t num_rows_ = {}; std::size_t num_cols_ = {}; std::vector<ScalarType> d_ = {}; -};
Specialize trait and ops
Because we are working with custom data types, we need to provide the necessary operations to do the algebra that pressio needs. This is done via specialization as follows:
namespace pressio{ +};Specialize trait and ops
Because we are working with custom data types, we need to provide the necessary operations to do the algebra that pressio needs. This is done via specialization as follows:
namespace pressio{ template<class ScalarType> struct Traits<CustomVector<ScalarType>>{ @@ -252,7 +256,7 @@} } -}}//end namespace pressio::ops
Main
#include "pressio/rom_galerkin.hpp" +}}//end namespace pressio::opsMain
#include "pressio/rom_galerkin.hpp" struct TrivialFomOnlyVelocityCustomTypes { diff --git a/docs/html/md_pages_rom_galerkin_default_implicit.html b/docs/html/md_pages_rom_galerkin_default_implicit.html index 497d638..e54b7d8 100644 --- a/docs/html/md_pages_rom_galerkin_default_implicit.html +++ b/docs/html/md_pages_rom_galerkin_default_implicit.html @@ -56,12 +56,16 @@- Default Implicit Galerkin (custom types)
#include "pressio/solvers_linear.hpp" +Include
#include "pressio/solvers_linear.hpp" #include "pressio/solvers_nonlinear.hpp" -#include <Eigen/Core>Problem class
struct MySystem +#include <Eigen/Core>Problem class
struct MySystem { using scalar_type = double; using state_type = Eigen::VectorXd; @@ -108,7 +112,7 @@jac.coeffRef(1, 0) = -1.0; jac.coeffRef(1, 1) = 3.0*x(1)*x(1); } -};
Main
int main() +};Main
int main() { namespace plog = pressio::log; namespace pls = pressio::linearsolvers; @@ -140,7 +144,7 @@plog::finalize(); return 0; -}
+} Full Code
The full code is available TODO.
The full code is available TODO.
template<class ScalarType> +Custom data types
template<class ScalarType> struct CustomVector { using value_type = ScalarType; @@ -123,7 +127,7 @@std::size_t num_rows_ = {}; std::size_t num_cols_ = {}; std::vector<ScalarType> d_ = {}; -};
Problem class
struct MySystem +};Problem class
struct MySystem { using scalar_type = double; using state_type = CustomVector<scalar_type>; @@ -147,7 +151,7 @@J(1,0) = -1.0; J(1,1) = 3.0*x[1]*x[1]; } -};
Specialize trait and ops
Because we are working with custom data types, we need to provide the necessary operations to do the algebra that pressio needs. This is done via specialization as follows:
namespace pressio{ +};Specialize trait and ops
Because we are working with custom data types, we need to provide the necessary operations to do the algebra that pressio needs. This is done via specialization as follows:
namespace pressio{ template<class T> struct Traits<CustomVector<T>>{ using scalar_type = double; using size_type = std::size_t; @@ -188,7 +192,7 @@v[0] = v[0]*factor; v[1] = v[1]*factor; } -}}//end namespace pressio::ops
Custom Linear solver
In this example, we use a custom linear solver.
template<class ScalarType> +}}//end namespace pressio::opsCustom Linear solver
In this example, we use a custom linear solver.
template<class ScalarType> struct LinearSolver{ using matrix_type = CustomMatrix<ScalarType>; @@ -205,7 +209,7 @@x[0] = (d*rhs[0] - b*rhs[1])/det; x[1] = (-c*rhs[0] + a*rhs[1])/det; } -};
Main
int main() +};Main
int main() { namespace plog = pressio::log; namespace pnonls = pressio::nonlinearsolvers; @@ -233,7 +237,7 @@plog::finalize(); return 0; -}
+} Full Code
The full code is available TODO.
The full code is available TODO.
struct MyRosenbrockSystem +Problem class
struct MyRosenbrockSystem { using scalar_type = double; using state_type = Eigen::VectorXd; @@ -119,7 +123,7 @@JJ(4,1) = -1.; JJ(5,2) = -1.; } -};
Main
int main() +};Main
int main() { namespace plog = pressio::log; namespace pls = pressio::linearsolvers; @@ -152,7 +156,7 @@plog::finalize(); return 0; -}
+} Full Code
The full code is available TODO.
The full code is available TODO.
We consider the shallow water equations (SWE) on the spatial domain :
In the above, is the height of the water surface, is the x-velocity, and is the y-velocity. The system has three parameters:
We are updating the code to use latest pressio, we will repost this soon.
Search for symbols, directories, files, pages or
+ modules. You can omit any prefix from the symbol or file path; adding a
+ :
or /
suffix lists all members of given symbol or
+ directory.
Use ↓ + / ↑ to navigate through the list, + Enter to go. + Tab autocompletes common prefix, you can + copy a link to the result using ⌘ + L while ⌘ + M produces a Markdown link.
+