Skip to content

Commit

Permalink
Fix bug in set4 and compute_dTgc_bspline_2d_vector
Browse files Browse the repository at this point in the history
Signed-off-by: Seyed Ali Ghasemi <info@gha3mi.com>
  • Loading branch information
gha3mi committed Jul 1, 2024
1 parent f868f79 commit e514129
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/forcad_nurbs_surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ pure subroutine set4(this, degree, nc, Xc, Wc)
integer, intent(in), contiguous :: nc(:)
real(rk), intent(in), contiguous :: Xc(:,:)
real(rk), intent(in), contiguous, optional :: Wc(:)
integer :: m(3), i
integer :: m(2), i

if (allocated(this%Xc)) deallocate(this%Xc)

Expand Down Expand Up @@ -2837,8 +2837,9 @@ impure subroutine compute_dTgc_bspline_2d_vector(Xt, knot1, knot2, degree, nc, n
real(rk), allocatable :: B1(:), B2(:)
integer :: i

allocate(dTgc(ng(1)*ng(2), nc(1)*nc(2), 2))
!$OMP PARALLEL DO PRIVATE(dB1, dB2)
allocate(dTgc(ng(1)*ng(2), nc(1)*nc(2), 2), Tgc(ng(1)*ng(2), nc(1)*nc(2)))
allocate(B1(nc(1)), B2(nc(2)), dB1(nc(1)), dB2(nc(2)))

do i = 1, size(Xt, 1)
call basis_bspline_der(Xt(i,1), knot1, nc(1), degree(1), dB1, B1)
call basis_bspline_der(Xt(i,2), knot2, nc(2), degree(2), dB2, B2)
Expand All @@ -2847,7 +2848,6 @@ impure subroutine compute_dTgc_bspline_2d_vector(Xt, knot1, knot2, degree, nc, n
dTgc(i,:,1) = kron(B2, dB1)
dTgc(i,:,2) = kron(dB2, B1)
end do
!$OMP END PARALLEL DO
end subroutine
!===============================================================================

Expand Down

0 comments on commit e514129

Please sign in to comment.