Evaluation function for Twist modifier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(twist), | intent(in) | :: | this | |||
type(vector), | intent(in) | :: | pos |
Position to evaluate the modifier at |
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