Skip to content

Commit

Permalink
Add generic get_nc() method.
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 Jun 26, 2024
1 parent 91f2772 commit a1964d2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/forcad_nurbs_surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ module forcad_nurbs_surface
procedure, private :: get_knoti !!> Get i-th knot value
generic :: get_knot => get_knoti, get_knot_all !!> Get knot vector
procedure :: get_ng !!> Get number of geometry points
procedure, private :: get_nc_dir !!> Get number of control points in a specific direction
procedure, private :: get_nc_all !!> Get number of control points in all directions
generic :: get_nc => get_nc_all, get_nc_dir !!> Get number of control points
procedure :: cmp_degree !!> Compute degree of the NURBS surface
procedure, private :: get_degree_all!!> Get degree of the NURBS surface in both directions
procedure, private :: get_degree_dir!!> Get degree of the NURBS surface in a specific direction
Expand All @@ -74,7 +77,6 @@ module forcad_nurbs_surface
procedure :: get_multiplicity !!> Compute and return the multiplicity of the knot vector
procedure :: get_continuity !!> Compute and return the continuity of the NURBS surface
procedure :: cmp_nc !!> Compute number of required control points
procedure :: get_nc !!> Get number of control points
procedure, private :: basis_vector !!> Compute the basis functions of the NURBS surface
procedure, private :: basis_scalar !!> Compute the basis functions of the NURBS surface
generic :: basis => basis_vector, basis_scalar !!> Compute the basis functions of the NURBS surface
Expand Down Expand Up @@ -1129,7 +1131,19 @@ pure subroutine cmp_nc(this, dir)
!===============================================================================
!> author: Seyed Ali Ghasemi
!> license: BSD 3-Clause
pure function get_nc(this, dir) result(nc)
pure function get_nc_all(this) result(nc)
class(nurbs_surface), intent(in) :: this
integer :: nc(2)

nc = this%nc
end function
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
!> license: BSD 3-Clause
pure function get_nc_dir(this, dir) result(nc)
class(nurbs_surface), intent(in) :: this
integer, intent(in) :: dir
integer :: nc
Expand Down
17 changes: 16 additions & 1 deletion src/forcad_nurbs_volume.f90
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ module forcad_nurbs_volume
procedure, private :: get_knoti !!> Get i-th knot value
generic :: get_knot => get_knoti, get_knot_all !!> Get knot vector
procedure :: get_ng !!> Get number of geometry points
procedure, private :: get_nc_dir !!> Get number of control points in a specific direction
procedure, private :: get_nc_all !!> Get number of control points in all directions
generic :: get_nc => get_nc_all, get_nc_dir !!> Get number of control points
procedure :: cmp_degree !!> Compute degree of the NURBS volume
procedure, private :: get_degree_all!!> Get degree of the NURBS volume in all directions
procedure, private :: get_degree_dir!!> Get degree of the NURBS volume in a specific direction
Expand Down Expand Up @@ -1232,7 +1235,19 @@ pure subroutine cmp_nc(this, dir)
!===============================================================================
!> author: Seyed Ali Ghasemi
!> license: BSD 3-Clause
pure function get_nc(this, dir) result(nc)
pure function get_nc_all(this) result(nc)
class(nurbs_volume), intent(in) :: this
integer :: nc(3)

nc = this%nc
end function
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
!> license: BSD 3-Clause
pure function get_nc_dir(this, dir) result(nc)
class(nurbs_volume), intent(in) :: this
integer, intent(in) :: dir
integer :: nc
Expand Down

0 comments on commit a1964d2

Please sign in to comment.