diff --git a/TODO b/TODO index 7b64f784..db3aff6e 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ * REFACTORING AND CLEANUP * check if everywhere static_cast< value_type > is used - * check header guards - * check copyright note - * describe every file in the preamble - * check spacings, not tabs + OK * check header guards + OK * check copyright note + OK * describe every file in the preamble + OK * check spacings, not tabs * DOCUMENTATION * Tutorials diff --git a/libs/numeric/odeint/doc/html/phase_lattice_2d_0000.jpg b/libs/numeric/odeint/doc/html/phase_lattice_2d_0000.jpg new file mode 100644 index 00000000..f98703eb Binary files /dev/null and b/libs/numeric/odeint/doc/html/phase_lattice_2d_0000.jpg differ diff --git a/libs/numeric/odeint/doc/html/phase_lattice_2d_0100.jpg b/libs/numeric/odeint/doc/html/phase_lattice_2d_0100.jpg new file mode 100644 index 00000000..78628393 Binary files /dev/null and b/libs/numeric/odeint/doc/html/phase_lattice_2d_0100.jpg differ diff --git a/libs/numeric/odeint/doc/html/phase_lattice_2d_1000.jpg b/libs/numeric/odeint/doc/html/phase_lattice_2d_1000.jpg new file mode 100644 index 00000000..e0ee037c Binary files /dev/null and b/libs/numeric/odeint/doc/html/phase_lattice_2d_1000.jpg differ diff --git a/libs/numeric/odeint/doc/tutorial.qbk b/libs/numeric/odeint/doc/tutorial.qbk index 294e7d78..2318f3b1 100644 --- a/libs/numeric/odeint/doc/tutorial.qbk +++ b/libs/numeric/odeint/doc/tutorial.qbk @@ -10,6 +10,8 @@ [include tutorial_special_topics.qbk] +[include tutorial_thrust_cuda.qbk] + [section Odeint in detail] Different steppers diff --git a/libs/numeric/odeint/doc/tutorial_special_topics.qbk b/libs/numeric/odeint/doc/tutorial_special_topics.qbk index c4cfe65b..0681bb1d 100644 --- a/libs/numeric/odeint/doc/tutorial_special_topics.qbk +++ b/libs/numeric/odeint/doc/tutorial_special_topics.qbk @@ -107,19 +107,29 @@ It is quite easy but the compilation time might take very long. Furthermore, the [units_observer] -The full cpp file for this example can be found here [@../../examples/harmonic_oscillator_units.cpp] +The full cpp file for this example can be found here [@../../examples/harmonic_oscillator_units.cpp]. [endsect] -[section Using Cuda and Thrust] - -blah blah - -[endsect] - [section Using matrices as state types] -Expanding resizing +[import ../examples/two_dimensional_phase_lattice.cpp] + +odeint works well with a variety of different state types. It is not restricted to pure vector-wise types, like `vector< double >`, `array< double , N >`, `fusion::vector< double , double >`, etc. but also works with types having a different topology then simple vectors. Here, we show how odeint can be used with matrices as states type, in the next section we will show how can be used to solve ODEs defined on complex networks. + +By default, odeint can be used with `ublas::matrix< T >` as state type for matrices. A simple example is a two-dimensional lattice of coupled phase oscillators. We like phas oscillators, they are extremly easy and might serve for different demonstration purposes. Other matrix types like `mtl::dense_matrix` or blitz arrays and matrices can used as well but need some kind of activation in order to work with odeint. This activation is described in following sections, + +The definition of the system is + +[two_dimensional_phase_lattice_definition] + +This is in principle all. Please note, that the above code is far from being optimal. Better performance can be achieved if every interaction is only calculated once and iterators for columns and rows are used. Below are some visualizations of the evolution of this lattice equation. + +[$phase_lattice_2d_0000.jpg] [$phase_lattice_2d_0100.jpg] [$phase_lattice_2d_1000.jpg] + +The full cpp for this example can be found here [@../../examples/two_dimensional_phase_lattice.cpp]. + + [endsect] diff --git a/libs/numeric/odeint/doc/tutorial_thrust_cuda.qbk b/libs/numeric/odeint/doc/tutorial_thrust_cuda.qbk new file mode 100644 index 00000000..b6d2fb34 --- /dev/null +++ b/libs/numeric/odeint/doc/tutorial_thrust_cuda.qbk @@ -0,0 +1,21 @@ +[section Using Cuda and Thrust] + +[section Solving large systems] + +phase oscillator ensemble + +phase oscillator lattice + +blah blah + +[endsect] + +[section Parameter studies and bifurcations] + +Bifurcations in the lorenz system + +alternativ lattice with many different disorder realizations + +[endsect] + +[endsect] diff --git a/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp b/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp index bcea191a..cfce8000 100644 --- a/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp +++ b/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp @@ -29,7 +29,8 @@ using namespace std; using namespace boost::numeric::odeint; -typedef boost::numeric::ublas::matrix< double , boost::numeric::ublas::basic_row_major<> , boost::numeric::ublas::unbounded_array< double > > state_type; +//[ two_dimensional_phase_lattice_definition +typedef boost::numeric::ublas::matrix< double > state_type; struct two_dimensional_phase_lattice { @@ -63,6 +64,8 @@ struct two_dimensional_phase_lattice double m_gamma; }; +//] + struct write_for_gnuplot {