-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
552 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
program shape_C_1d | ||
|
||
use forcad, only: rk, nurbs_curve | ||
|
||
implicit none | ||
type(nurbs_curve) :: shape | ||
|
||
!----------------------------------------------------------------------------- | ||
! Setting up NURBS C-shape | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Set a C-shape with radius 2.0 and center at [0.0, 0.0, 0.0] | ||
call shape%set_C(center = [0.0_rk, 0.0_rk, 0.0_rk], radius = 2.0_rk) | ||
|
||
!> Export control points to a VTK file | ||
call shape%export_Xc('vtk/shape_C_1d_Xc.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Creating C-shape | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Generate the NURBS C-shape with a resolution of 100 | ||
call shape%create(res = 100) | ||
|
||
!> Export the generated cirlce to a VTK file | ||
call shape%export_Xg('vtk/shape_C_1d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Visualization using PyVista | ||
! Note: PyVista is required for visualization. Install it using `pip install pyvista` | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Show the control geometry and geometry using PyVista | ||
call shape%show('vtk/shape_C_1d_Xc.vtk','vtk/shape_C_1d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Finalizing | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Finalize the NURBS curve object | ||
call shape%finalize() | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
program shape_C_2d | ||
|
||
use forcad, only: rk, nurbs_surface | ||
|
||
implicit none | ||
type(nurbs_surface) :: shape | ||
|
||
!----------------------------------------------------------------------------- | ||
! Setting up NURBS C-shape | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Set a C-shape with radius 2.0 and center at [0.0, 0.0, 0.0] | ||
call shape%set_C(center = [0.0_rk, 0.0_rk, 0.0_rk], radius1 = 1.0_rk, radius2 = 2.0_rk) | ||
|
||
!> Export control points to a VTK file | ||
call shape%export_Xc('vtk/shape_C_2d_Xc.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Creating C-shape | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Generate the NURBS C-shape with a resolution of 100 | ||
call shape%create(100, 60) | ||
|
||
!> Export the generated cirlce to a VTK file | ||
call shape%export_Xg('vtk/shape_C_2d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Visualization using PyVista | ||
! Note: PyVista is required for visualization. Install it using `pip install pyvista` | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Show the control geometry and geometry using PyVista | ||
call shape%show('vtk/shape_C_2d_Xc.vtk','vtk/shape_C_2d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Finalizing | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Finalize the NURBS curve object | ||
call shape%finalize() | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
program shape_C_3d | ||
|
||
use forcad, only: rk, nurbs_volume | ||
|
||
implicit none | ||
type(nurbs_volume) :: shape | ||
|
||
!----------------------------------------------------------------------------- | ||
! Setting up NURBS C-shape | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Set a C-shape with radius 2.0 and center at [0.0, 0.0, 0.0] | ||
call shape%set_C(center = [0.0_rk, 0.0_rk, 0.0_rk], radius1 = 1.0_rk, radius2 = 2.0_rk, length = 2.0_rk) | ||
|
||
!> Export control points to a VTK file | ||
call shape%export_Xc('vtk/shape_C_3d_Xc.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Creating C-shape | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Generate the NURBS C-shape with a resolution of 100 | ||
call shape%create(100, 60, 10) | ||
|
||
!> Export the generated cirlce to a VTK file | ||
call shape%export_Xg('vtk/shape_C_3d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Visualization using PyVista | ||
! Note: PyVista is required for visualization. Install it using `pip install pyvista` | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Show the control geometry and geometry using PyVista | ||
call shape%show('vtk/shape_C_3d_Xc.vtk','vtk/shape_C_3d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Finalizing | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Finalize the NURBS curve object | ||
call shape%finalize() | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
program shape_half_circle | ||
|
||
use forcad, only: rk, nurbs_curve | ||
|
||
implicit none | ||
type(nurbs_curve) :: shape | ||
|
||
|
||
!> Set up a half circle shape centered at the 0,0,0 with a radius of 1 | ||
call shape%set_half_circle([0.0_rk, 0.0_rk, 0.0_rk], 1.0_rk) | ||
|
||
!> Export the control points to a VTK file for visualization. | ||
call shape%export_Xc('vtk/shape_half_circle_Xc.vtk') | ||
|
||
!> Create the shape using the specified number of elements in each direction. | ||
call shape%create(60) | ||
|
||
!> Export the geometry to a VTK file for visualization. | ||
call shape%export_Xg('vtk/shape_half_circle_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Visualization using PyVista | ||
! Note: PyVista is required for visualization. Install it using `pip install pyvista` | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Show the control geometry and geometry using PyVista | ||
call shape%show('vtk/shape_half_circle_Xc.vtk','vtk/shape_half_circle_Xg.vtk') | ||
|
||
!> Finalize and clean up the shape object. | ||
call shape%finalize() | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
program shape_half_ring_2d | ||
|
||
use forcad, only: rk, nurbs_surface | ||
|
||
implicit none | ||
type(nurbs_surface) :: shape | ||
|
||
|
||
!> Set up a half ring shape centered at 0,0,0 with inner radius 1 and outer radius 2. | ||
call shape%set_half_ring([0.0_rk, 0.0_rk, 0.0_rk], 1.0_rk, 2.0_rk) | ||
|
||
!> Export the control points to a VTK file for visualization. | ||
call shape%export_Xc('vtk/shape_half_ring_2d_Xc.vtk') | ||
|
||
!> Create the shape using the specified number of elements in each direction. | ||
call shape%create(60, 15) | ||
|
||
!> Export the geometry to a VTK file for visualization. | ||
call shape%export_Xg('vtk/shape_half_ring_2d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Visualization using PyVista | ||
! Note: PyVista is required for visualization. Install it using `pip install pyvista` | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Show the control geometry and geometry using PyVista | ||
call shape%show('vtk/shape_half_ring_2d_Xc.vtk','vtk/shape_half_ring_2d_Xg.vtk') | ||
|
||
!> Finalize and clean up the shape object. | ||
call shape%finalize() | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
program shape_half_ring_3d | ||
|
||
use forcad, only: rk, nurbs_volume | ||
|
||
implicit none | ||
type(nurbs_volume) :: shape | ||
|
||
|
||
!> Set up a half ring centered at 0,0,0 with inner radius 1, outer radius 2, and length 1. | ||
call shape%set_half_ring([0.0_rk, 0.0_rk, 0.0_rk], 1.0_rk, 2.0_rk, 1.0_rk) | ||
|
||
!> Export the control points to a VTK file for visualization. | ||
call shape%export_Xc('vtk/shape_half_ring_3d_Xc.vtk') | ||
|
||
!> Create the shape using the specified number of elements in each direction. | ||
call shape%create(60, 15, 10) | ||
|
||
!> Export the geometry to a VTK file for visualization. | ||
call shape%export_Xg('vtk/shape_half_ring_3d_Xg.vtk') | ||
|
||
!----------------------------------------------------------------------------- | ||
! Visualization using PyVista | ||
! Note: PyVista is required for visualization. Install it using `pip install pyvista` | ||
!----------------------------------------------------------------------------- | ||
|
||
!> Show the control geometry and geometry using PyVista | ||
call shape%show('vtk/shape_half_ring_3d_Xc.vtk','vtk/shape_half_ring_3d_Xg.vtk') | ||
|
||
!> Finalize and clean up the shape object. | ||
call shape%finalize() | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.