eval_twist Function

private pure elemental function eval_twist(this, pos) result(res)

Evaluation function for Twist modifier.

Type Bound

twist

Arguments

Type IntentOptional Attributes Name
class(twist), intent(in) :: this
type(vector), intent(in) :: pos

Position to evaluate the modifier at

Return Value real(kind=wp)


Source Code

    pure elemental function eval_twist(this, pos) result(res)
        !! Evaluation function for Twist modifier.

        class(twist), intent(in) :: this
        !> Position to evaluate the modifier at
        type(vector), intent(IN) :: pos
        real(kind=wp) :: res

        real(kind=wp) :: c, s, x2, y2, z2

        c = cos(this%k * pos%z)
        s = sin(this%k * pos%z)
        x2 = c*pos%x - s*pos%y
        y2 = s*pos%x + c*pos%y
        z2 = pos%z

        res = this%prim%evaluate(vector(x2, y2, z2))

    end function eval_twist