Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
integrators.hpp File Reference
#include "shambackends/DeviceBuffer.hpp"
#include "shambackends/sycl.hpp"
#include "shambackends/typeAliasVec.hpp"
#include "shambackends/vec.hpp"
#include "shamsys/NodeInstance.hpp"
+ Include dependency graph for integrators.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shamrock
 namespace for the main framework
 

Functions

template<class flt , class T >
void shamrock::integrators::forward_euler (sham::DeviceQueue &queue, sham::DeviceBuffer< T > &buf_val, sham::DeviceBuffer< T > &buf_der, sycl::range< 1 > elem_range, flt dt)
 Perform forward Euler integration step.
 
template<class flt , class T >
void shamrock::integrators::leapfrog_corrector (sham::DeviceQueue &queue, sham::DeviceBuffer< T > &buf_val, sham::DeviceBuffer< T > &buf_der, sham::DeviceBuffer< T > &buf_der_old, sham::DeviceBuffer< flt > &buf_eps_sq, sycl::range< 1 > elem_range, flt hdt)
 Perform leapfrog corrector step with adaptive softening.
 
template<class T >
void shamrock::utilities::sycl_position_modulo (sham::DeviceQueue &queue, sham::DeviceBuffer< T > &buf_xyz, sycl::range< 1 > elem_range, std::pair< T, T > box)
 Apply periodic boundary conditions to positions.
 
template<class T >
void shamrock::utilities::sycl_position_sheared_modulo (sham::DeviceQueue &queue, sham::DeviceBuffer< T > &buf_xyz, sham::DeviceBuffer< T > &buf_vxyz, sycl::range< 1 > elem_range, std::pair< T, T > box, i32_3 shear_base, i32_3 shear_dir, shambase::VecComponent< T > shear_value, shambase::VecComponent< T > shear_speed)
 Apply periodic boundary conditions with shearing.
 
template<class T >
void shamrock::utilities::swap_fields (sham::DeviceQueue &queue, sham::DeviceBuffer< T > &b1, sham::DeviceBuffer< T > &b2, u32 cnt)
 Swap contents of two buffers.
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file integrators.hpp.

Function Documentation

◆ forward_euler()

template<class flt , class T >
void shamrock::integrators::forward_euler ( sham::DeviceQueue queue,
sham::DeviceBuffer< T > &  buf_val,
sham::DeviceBuffer< T > &  buf_der,
sycl::range< 1 >  elem_range,
flt  dt 
)

Perform forward Euler integration step.

Template Parameters
fltFloating point type for time step
TValue type
Parameters
queueDevice queue to submit operation
buf_valValues to integrate
buf_derDerivatives
elem_rangeNumber of elements to process
dtTime step

Definition at line 30 of file integrators.cpp.

+ Here is the call graph for this function:

◆ leapfrog_corrector()

template<class flt , class T >
void shamrock::integrators::leapfrog_corrector ( sham::DeviceQueue queue,
sham::DeviceBuffer< T > &  buf_val,
sham::DeviceBuffer< T > &  buf_der,
sham::DeviceBuffer< T > &  buf_der_old,
sham::DeviceBuffer< flt > &  buf_eps_sq,
sycl::range< 1 >  elem_range,
flt  hdt 
)

Perform leapfrog corrector step with adaptive softening.

Template Parameters
fltFloating point type for time step
TValue type
Parameters
queueDevice queue to submit operation
buf_valValues to integrate
buf_derCurrent derivatives
buf_der_oldPrevious derivatives
buf_eps_sqSquared softening parameter per element
elem_rangeNumber of elements to process
hdtHalf time step

Definition at line 87 of file integrators.cpp.

+ Here is the call graph for this function:

◆ swap_fields()

template<class T >
void shamrock::utilities::swap_fields ( sham::DeviceQueue queue,
sham::DeviceBuffer< T > &  b1,
sham::DeviceBuffer< T > &  b2,
u32  cnt 
)

Swap contents of two buffers.

Template Parameters
TBuffer element type
Parameters
queueDevice queue to submit operation
b1First buffer
b2Second buffer
cntNumber of elements to swap

Definition at line 313 of file integrators.cpp.

+ Here is the call graph for this function:

◆ sycl_position_modulo()

template<class T >
void shamrock::utilities::sycl_position_modulo ( sham::DeviceQueue queue,
sham::DeviceBuffer< T > &  buf_xyz,
sycl::range< 1 >  elem_range,
std::pair< T, T >  box 
)

Apply periodic boundary conditions to positions.

Template Parameters
TVector type for positions
Parameters
queueDevice queue to submit operation
buf_xyzPosition buffer
elem_rangeNumber of elements to process
boxBox bounds (min, max)

Definition at line 162 of file integrators.cpp.

+ Here is the call graph for this function:

◆ sycl_position_sheared_modulo()

template<class T >
void shamrock::utilities::sycl_position_sheared_modulo ( sham::DeviceQueue queue,
sham::DeviceBuffer< T > &  buf_xyz,
sham::DeviceBuffer< T > &  buf_vxyz,
sycl::range< 1 >  elem_range,
std::pair< T, T >  box,
i32_3  shear_base,
i32_3  shear_dir,
shambase::VecComponent< T >  shear_value,
shambase::VecComponent< T >  shear_speed 
)

Apply periodic boundary conditions with shearing.

Template Parameters
TVector type for positions and velocities
Parameters
queueDevice queue to submit operation
buf_xyzPosition buffer
buf_vxyzVelocity buffer
elem_rangeNumber of elements to process
boxBox bounds (min, max)
shear_baseDirection perpendicular to shear plane
shear_dirShear direction
shear_valueShear displacement per box crossing
shear_speedVelocity correction per box crossing

Definition at line 211 of file integrators.cpp.

+ Here is the call graph for this function: