- odeint-v2.zip
- odeint-v2
- boost
- numeric
- doc
- index.html
- Jamroot
- libs
- numeric
- odeint
- code_analyzer
- doc
- concepts.qbk
- concepts
- controlled_stepper.qbk
- dense_output_stepper.qbk
- error_stepper.qbk
- implicit_system.qbk
- observer.qbk
- state_algebra_operations.qbk
- state_wrapper.qbk
- stepper.qbk
- symplectic_system.qbk
- system.qbk
- concepts_old.qbk
- details.qbk
- examples_table.qbk
- extend.qbk
- getting_started.qbk
- html
- boostbook.css
- phase_lattice_2d_0000.jpg
- phase_lattice_2d_0100.jpg
- phase_lattice_2d_1000.jpg
- solar_system.jpg
- Jamfile
- make_controlled_table.qbk
- make_dense_output_table.qbk
- odeint.qbk
- reference.xml
- reference_integrate_functions.qbk
- reference_old.qbk
- reference_steppers.qbk
- stepper_table.qbk
- tutorial.qbk
- tutorial_chaotic_system.qbk
- tutorial_harmonic_oscillator.qbk
- tutorial_solar_system.qbk
- tutorial_special_topics.qbk
- tutorial_stiff_systems.qbk
- tutorial_thrust_cuda.qbk
- examples
- ideas
- performance
- regression_test
- test
- test_external
- README
- tex
- TODO
|
/*
* odeint_rk4_phase_lattice_mkl.cpp
*
* Created on: Jul 19, 2011
* Author: mario
*/
#include <boost/array.hpp>
#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
#include <boost/numeric/odeint/external/mkl/mkl_operations.hpp>
#include "rk_performance_test_case.hpp"
#include "phase_lattice.hpp"
#include "phase_lattice_mkl.hpp"
const size_t N = 1024;
typedef boost::array< double , N > state_type;
typedef boost::numeric::odeint::runge_kutta4< state_type
, double , state_type , double ,
boost::numeric::odeint::vector_space_algebra ,
boost::numeric::odeint::mkl_operations
> rk4_odeint_type;
class odeint_wrapper
{
public:
void reset_init_cond()
{
for( size_t i = 0 ; i<N ; ++i )
m_x[i] = 2.0*3.1415927*rand() / RAND_MAX;
m_t = 0.0;
}
inline void do_step( const double dt )
{
m_stepper.do_step( phase_lattice_mkl<N>() , m_x , m_t , dt );
//m_t += dt;
}
double state( const size_t i ) const
{ return m_x[i]; }
private:
state_type m_x;
double m_t;
rk4_odeint_type m_stepper;
};
int main()
{
srand( 12312354 );
odeint_wrapper stepper;
run( stepper , 10000 , 1E-6 );
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.