Commit 20c5df86 authored by Cianciosa, Mark's avatar Cianciosa, Mark
Browse files

Add concepts for dispersion functions and solver methods. Minor code...

Add concepts for dispersion functions and solver methods. Minor code formatting and document corrections.
parent 0aa57b24
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ namespace absorption {
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<dispersion::function DISPERSION_FUNCTION>
    class root_finder {
    private:
///  kamp variable.
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ namespace backend {
        }

//------------------------------------------------------------------------------
///  @brief Take cos.
///  @brief Take erfi.
//------------------------------------------------------------------------------
        template<jit::float_scalar D=T>
        typename std::enable_if<jit::is_complex<D> (), void>::type erfi() {
+5 −1
Original line number Diff line number Diff line
@@ -1095,12 +1095,16 @@ namespace dispersion {
//******************************************************************************
//  Dispersion interface.
//******************************************************************************
///  Dispersion concept.
    template<class D>
    concept function = std::is_base_of<dispersion_function<typename D::base, D::safe_math>, D>::value;

//------------------------------------------------------------------------------
///  @brief Class interface to build dispersion relation functions.
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<function DISPERSION_FUNCTION>
    class dispersion_interface {
    protected:
///  Disperison function.
+19 −14
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ namespace solver {
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<dispersion::function DISPERSION_FUNCTION>
    class solver_interface {
    protected:
///  w variable.
@@ -403,11 +403,16 @@ namespace solver {
            kz_next->to_latex();
            std::cout << std::endl;
        }

///  Type def to retrieve the dispersion function.
        typedef DISPERSION_FUNCTION dispersion_function;
///  Type def to retrieve the backend base type.
        typedef typename DISPERSION_FUNCTION::base base;
    };

///  Solver method concept.
    template<class S>
    concept method = std::is_base_of<solver_interface<typename S::dispersion_function>, S>::value;

//******************************************************************************
//  Second Order Runge Kutta.
//******************************************************************************
@@ -416,7 +421,7 @@ namespace solver {
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<dispersion::function DISPERSION_FUNCTION>
    class rk2 : public solver_interface<DISPERSION_FUNCTION> {
    protected:
///  kx1 subexpression.
@@ -546,7 +551,7 @@ namespace solver {
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<dispersion::function DISPERSION_FUNCTION>
    class rk4 : public solver_interface<DISPERSION_FUNCTION> {
    protected:
///  kx1 subexpression.
@@ -799,7 +804,7 @@ namespace solver {
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<dispersion::function DISPERSION_FUNCTION>
    class adaptive_rk4 : public rk4<DISPERSION_FUNCTION> {
    protected:
///  Dispersion residule.
@@ -928,7 +933,7 @@ namespace solver {
///
///  @tparam DISPERSION_FUNCTION Class of dispersion function to use.
//------------------------------------------------------------------------------
    template<class DISPERSION_FUNCTION>
    template<dispersion::function DISPERSION_FUNCTION>
    class split_simplextic : public solver_interface<DISPERSION_FUNCTION> {
    protected:
///  Half step x
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
///  @params[in] omega   Ray frequency.
///  @params[in] k_guess Inital guess for the wave number.
//------------------------------------------------------------------------------
template<typename DISPERSION>
template<dispersion::function DISPERSION>
void test_solve(const typename DISPERSION::base tolarance,
                const typename DISPERSION::base omega,
                const typename DISPERSION::base k_guess,
Loading