Graph Framework
Loading...
Searching...
No Matches
solver::solver_interface< DISPERSION_FUNCTION > Class Template Reference

Class interface the solver. More...

#include <solver.hpp>

Inheritance diagram for solver::solver_interface< DISPERSION_FUNCTION >:
solver::rk2< DISPERSION_FUNCTION > solver::rk4< DISPERSION_FUNCTION > solver::split_simplextic< DISPERSION_FUNCTION > solver::adaptive_rk4< DISPERSION_FUNCTION >

Public Types

typedef DISPERSION_FUNCTION dispersion_function
 Type def to retrieve the dispersion function.
 
typedef DISPERSION_FUNCTION::base base
 Type def to retrieve the backend base type.
 

Public Member Functions

 solver_interface (graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > w, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kx, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > ky, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kz, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > x, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > y, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > z, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > t, equilibrium::shared< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > &eq, const std::string &filename="", const size_t num_rays=0, const size_t index=0)
 Construct a new solver_interface with inital conditions.
 
 ~solver_interface ()
 Destructor.
 
virtual graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > init (graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > x, const typename DISPERSION_FUNCTION::base tolarance=1.0E-30, const size_t max_iterations=1000) final
 Method to initalize the rays.
 
virtual graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > init () final
 Method to initalize the rays.
 
virtual void compile ()
 Compile the solver function.
 
void sync_device ()
 Syncronize results from host to gpu.
 
void sync_host ()
 Syncronize results from gpu to host.
 
void step ()
 Method to step the rays.
 
DISPERSION_FUNCTION::base check_residule (const size_t index)
 Check the residule.
 
void print (const size_t index)
 Print out the results.
 
void write_step ()
 Write result step.
 
void print_dispersion ()
 Print out the latex expression for the dispersion relation.
 
void print_dkxdt ()
 Print out the latex expression for the dkxdt.
 
void print_dkydt ()
 Print out the latex expression for the dkydt.
 
void print_dkzdt ()
 Print out the latex expression for the dkzdt.
 
void print_dxdt ()
 Print out the latex expression for the dxdt.
 
void print_dydt ()
 Print out the latex expression for the dydt.
 
void print_dzdt ()
 Print out the latex expression for the dzdt.
 
void print_residule ()
 Print out the latex expression for the residule.
 
void print_x_next ()
 Print out the latex expression for the x_next.
 
void print_y_next ()
 Print out the latex expression for the y_next.
 
void print_z_next ()
 Print out the latex expression for the z_next.
 
void print_kx_next ()
 Print out the latex expression for the kx_next.
 
void print_ky_next ()
 Print out the latex expression for the ky_next.
 
void print_kz_next ()
 Print out the latex expression for the kz_next.
 

Static Public Attributes

static constexpr bool safe_math = DISPERSION_FUNCTION::safe_math
 Retrieve template parameter of safe math.
 

Protected Attributes

graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > w
 w variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kx
 kx variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > ky
 ky variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kz
 kz variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > x
 x variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > y
 y variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > z
 z variable.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > t
 t variable.
 
dispersion::dispersion_interface< DISPERSION_FUNCTION > D
 Dispersion function interface.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kx_next
 Next kx value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > ky_next
 Next ky value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kz_next
 Next kz value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > x_next
 Next x value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > y_next
 Next y value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > z_next
 Next z value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > t_next
 Next t value.
 
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > residule
 Residule.
 
workflow::manager< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > work
 Workflow manager.
 
const size_t index
 Concurrent index.
 
output::result_file file
 Output file.
 
output::data_set< typename DISPERSION_FUNCTION::base > dataset
 Output dataset.
 
std::thread sync
 Async thread to write data files.
 

Detailed Description

template<dispersion::function DISPERSION_FUNCTION>
class solver::solver_interface< DISPERSION_FUNCTION >

Class interface the solver.

Template Parameters
DISPERSION_FUNCTIONClass of dispersion function to use.

Constructor & Destructor Documentation

◆ solver_interface()

template<dispersion::function DISPERSION_FUNCTION>
solver::solver_interface< DISPERSION_FUNCTION >::solver_interface ( graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  w,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  kx,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  ky,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  kz,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  x,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  y,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  z,
graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  t,
equilibrium::shared< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > &  eq,
const std::string &  filename = "",
const size_t  num_rays = 0,
const size_t  index = 0 
)
inline

Construct a new solver_interface with inital conditions.

Parameters
[in]wInital w.
[in]kxInital kx.
[in]kyInital ky.
[in]kzInital kz.
[in]xInital x.
[in]yInital y.
[in]zInital z.
[in]tInital t.
[in]eqThe plasma equilibrium.
[in]filenameResult filename, empty names will be blank.
[in]num_raysNumber of rays to write.
[in]indexConcurrent index.

Member Function Documentation

◆ check_residule()

template<dispersion::function DISPERSION_FUNCTION>
DISPERSION_FUNCTION::base solver::solver_interface< DISPERSION_FUNCTION >::check_residule ( const size_t  index)
inline

Check the residule.

Parameters
[in]indexRay index to check residule for.
Returns
The value of the residule at the index.

◆ compile()

template<dispersion::function DISPERSION_FUNCTION>
virtual void solver::solver_interface< DISPERSION_FUNCTION >::compile ( )
inlinevirtual

Compile the solver function.

Reimplemented in solver::adaptive_rk4< DISPERSION_FUNCTION >.

◆ init() [1/2]

template<dispersion::function DISPERSION_FUNCTION>
virtual graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > solver::solver_interface< DISPERSION_FUNCTION >::init ( )
inlinefinalvirtual

Method to initalize the rays.

Returns
The residule graph.

◆ init() [2/2]

template<dispersion::function DISPERSION_FUNCTION>
virtual graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > solver::solver_interface< DISPERSION_FUNCTION >::init ( graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math >  x,
const typename DISPERSION_FUNCTION::base  tolarance = 1.0E-30,
const size_t  max_iterations = 1000 
)
inlinefinalvirtual

Method to initalize the rays.

Parameters
[in,out]xVariable reference to update.
[in]tolaranceTolarance to solve to dispersion function to.
[in]max_iterationsMaximum number of iterations to run.
Returns
The residule graph.

◆ print()

template<dispersion::function DISPERSION_FUNCTION>
void solver::solver_interface< DISPERSION_FUNCTION >::print ( const size_t  index)
inline

Print out the results.

Parameters
[in]indexRay index to print results of.

The documentation for this class was generated from the following file: