Skip to content

Commit

Permalink
Add allocate(Tgci) and allocate(dTgci).
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 May 17, 2024
1 parent a93fcc2 commit 952ff44
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
9 changes: 4 additions & 5 deletions src/forcad_nurbs_curve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1596,12 +1596,11 @@ impure function compute_dTgc_nurbs_1d(Xt, knot, degree, nc, ng, Wc) result(dTgc)
integer :: i

allocate(dTgc(ng, nc))

allocate(dTgci(nc))
!$OMP PARALLEL DO PRIVATE(dTgci)
do i = 1, size(Xt)
dTgci = basis_bspline_der(Xt(i), knot, nc, degree)
dTgci = dTgci*(Wc/(dot_product(dTgci,Wc)))
dTgc(i,:) = dTgci
dTgc(i,:) = dTgci*(Wc/(dot_product(dTgci,Wc)))
end do
!$OMP END PARALLEL DO
end function
Expand Down Expand Up @@ -1651,11 +1650,11 @@ impure function compute_Tgc_nurbs_1d(Xt, knot, degree, nc, ng, Wc) result(Tgc)
integer :: i

allocate(Tgc(ng, nc))
allocate(Tgci(nc))
!$OMP PARALLEL DO PRIVATE(Tgci)
do i = 1, size(Xt,1)
Tgci = basis_bspline(Xt(i), knot, nc, degree)
Tgci = Tgci*(Wc/(dot_product(Tgci,Wc)))
Tgc(i,:) = Tgci
Tgc(i,:) = Tgci*(Wc/(dot_product(Tgci,Wc)))
end do
!$OMP END PARALLEL DO
end function
Expand Down
9 changes: 4 additions & 5 deletions src/forcad_nurbs_surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2202,14 +2202,13 @@ impure function compute_dTgc_nurbs_2d(Xt, knot1, knot2, degree, nc, ng, Wc) resu
integer :: i

allocate(dTgc(ng(1)*ng(2), nc(1)*nc(2)))

allocate(dTgci(nc(1)*nc(2)))
!$OMP PARALLEL DO PRIVATE(dTgci)
do i = 1, size(Xt, 1)
dTgci = kron(&
basis_bspline_der(Xt(i,2), knot2, nc(2), degree(2)),&
basis_bspline_der(Xt(i,1), knot1, nc(1), degree(1)))
dTgci = dTgci*(Wc/(dot_product(dTgci,Wc)))
dTgc(i,:) = dTgci
dTgc(i,:) = dTgci*(Wc/(dot_product(dTgci,Wc)))
end do
!$OMP END PARALLEL DO
end function
Expand Down Expand Up @@ -2261,13 +2260,13 @@ impure function compute_Tgc_nurbs_2d(Xt, knot1, knot2, degree, nc, ng, Wc) resul
integer :: i

allocate(Tgc(ng(1)*ng(2), nc(1)*nc(2)))
allocate(Tgci(nc(1)*nc(2)))
!$OMP PARALLEL DO PRIVATE(Tgci)
do i = 1, size(Xt, 1)
Tgci = kron(&
basis_bspline(Xt(i,2), knot2, nc(2), degree(2)),&
basis_bspline(Xt(i,1), knot1, nc(1), degree(1)))
Tgci = Tgci*(Wc/(dot_product(Tgci,Wc)))
Tgc(i,:) = Tgci
Tgc(i,:) = Tgci*(Wc/(dot_product(Tgci,Wc)))
end do
!$OMP END PARALLEL DO
end function
Expand Down
9 changes: 4 additions & 5 deletions src/forcad_nurbs_volume.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2694,14 +2694,13 @@ impure function compute_dTgc_nurbs_3d(Xt, knot1, knot2, knot3, degree, nc, ng, W
integer :: i

allocate(dTgc(ng(1)*ng(2)*ng(3), nc(1)*nc(2)*nc(3)))

allocate(dTgci(nc(1)*nc(2)*nc(3)))
!$OMP PARALLEL DO PRIVATE(dTgci)
do i = 1, size(Xt, 1)
dTgci = kron(basis_bspline_der(Xt(i,3), knot3, nc(3), degree(3)), kron(&
basis_bspline_der(Xt(i,2), knot2, nc(2), degree(2)),&
basis_bspline_der(Xt(i,1), knot1, nc(1), degree(1))))
dTgci = dTgci*(Wc/(dot_product(dTgci,Wc)))
dTgc(i,:) = dTgci
dTgc(i,:) = dTgci*(Wc/(dot_product(dTgci,Wc)))
end do
!$OMP END PARALLEL DO
end function
Expand Down Expand Up @@ -2753,13 +2752,13 @@ impure function compute_Tgc_nurbs_3d(Xt, knot1, knot2, knot3, degree, nc, ng, Wc
integer :: i

allocate(Tgc(ng(1)*ng(2)*ng(3), nc(1)*nc(2)*nc(3)))
allocate(Tgci(nc(1)*nc(2)*nc(3)))
!$OMP PARALLEL DO PRIVATE(Tgci)
do i = 1, size(Xt, 1)
Tgci = kron(basis_bspline(Xt(i,3), knot3, nc(3), degree(3)), kron(&
basis_bspline(Xt(i,2), knot2, nc(2), degree(2)),&
basis_bspline(Xt(i,1), knot1, nc(1), degree(1))))
Tgci = Tgci*(Wc/(dot_product(Tgci,Wc)))
Tgc(i,:) = Tgci
Tgc(i,:) = Tgci*(Wc/(dot_product(Tgci,Wc)))
end do
!$OMP END PARALLEL DO
end function
Expand Down

0 comments on commit 952ff44

Please sign in to comment.