Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Enhancements and Performance Improvements #13

Merged
merged 14 commits into from
May 19, 2024
Prev Previous commit
Next Next commit
Use "do concurrent" within kron and bspline_basis.
Signed-off-by: Seyed Ali Ghasemi <info@gha3mi.com>
  • Loading branch information
gha3mi committed May 19, 2024
commit 8f49ee8df7512b9a1aeeaa887b8fc83fccd97225
11 changes: 4 additions & 7 deletions src/forcad_utils.f90
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ pure function basis_bspline(Xt, knot, nc, degree) result(B)
allocate(Nt(nc, 0:degree), source=0.0_rk)

do p = 0, degree
do i = 1, nc
do concurrent (i = 1:nc)
Xth_i = knot(i)
Xth_i1 = knot(i+1)
Xth_ip = knot(i+p)
@@ -179,15 +179,12 @@ pure function basis_bernstein(Xt, nc) result(B)
pure function kron(u,v) result(w)
real(rk), intent(in), contiguous :: u(:), v(:)
real(rk) :: w(size(u)*size(v))
integer :: i, j, m, n
integer :: i, j, n

m = size(u)
n = size(v)

do i = 1, m
do j = 1, n
w((i-1)*n + j) = u(i)*v(j)
end do
do concurrent(i = 1:size(u), j = 1:n)
w((i-1)*n + j) = u(i)*v(j)
end do
end function
!===============================================================================