calc Subroutine

private subroutine calc(self, itype)

计算 dW/dX

Type Bound

nnps_pairs_type

Arguments

Type IntentOptional Attributes Name
class(nnps_pairs_type), intent(inout) :: self
integer, intent(in) :: itype(:)

粒子类型


Contents

Source Code


Source Code

    subroutine calc(self, itype)
        class(nnps_pairs_type), intent(inout) :: self
        integer, intent(in) :: itype(:)     !! 粒子类型
        integer :: i, ix

        call self%extend(size(self%items)/2)

        !$omp parallel do private(i, ix)
        do i = 1, self%len
            ix = 3*i
            call skf_obj%kernel(self%rdx(ix - 2), self%rdx(ix - 1:ix), &
                                self%wdwdx(1, i), self%wdwdx(2:3, i))
            ix = 2*i
            self%contact_type(i) = contact_control(itype, self%items(ix - 1), self%items(ix))
        end do

    end subroutine calc