-
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.
Add ansatz, cmp_volume, cmp_area and cmp_length
- Added `det`, `inv`, `dyad` and `gauss_leg` procedures in the `forcad_utils` module. - Added procedure `set1a` to the `nurbs_curve` derived type. - Added procedure `set4` to the `nurbs_curve` NURBS derived type. - Added optional input variable `elem` to `derivative_scalar` procedures. - Added `ansatz` procedures to compute shape functions, derivatives of shape functions and (dV, dA, dL). - Added `cmp_length()` to compute the length of a NURBS curve. - Added `cmp_area()` to compute the area of a NURBS surface. - Added `cmp_volume()` to compute the volume of a NURBS volume. - Added examples for `cmp_length()`, `cmp_area()`, and `cmp_volume()`. Signed-off-by: Seyed Ali Ghasemi <info@gha3mi.com>
- Loading branch information
Showing
9 changed files
with
827 additions
and
97 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,23 @@ | ||
program compute_area | ||
|
||
use forcad | ||
|
||
implicit none | ||
|
||
type(nurbs_surface) :: shape | ||
real(rk) :: area | ||
real(rk) :: Xc(4,3) | ||
|
||
Xc(1,:) = [0.0_rk, 0.0_rk, 0.0_rk] | ||
Xc(2,:) = [2.0_rk, 0.0_rk, 0.0_rk] | ||
Xc(3,:) = [0.0_rk, 2.0_rk, 0.0_rk] | ||
Xc(4,:) = [2.0_rk, 2.0_rk, 0.0_rk] | ||
|
||
call shape%set(& | ||
knot1=[0.0_rk, 0.0_rk, 1.0_rk, 1.0_rk],& | ||
knot2=[0.0_rk, 0.0_rk, 1.0_rk, 1.0_rk],& | ||
Xc=Xc) | ||
|
||
call shape%cmp_area(area) | ||
print*, area | ||
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,20 @@ | ||
program compute_length | ||
|
||
use forcad | ||
|
||
implicit none | ||
|
||
type(nurbs_curve) :: shape | ||
real(rk) :: length | ||
real(rk) :: Xc(2,3) | ||
|
||
Xc(1,:) = [0.0_rk, 0.0_rk, 0.0_rk] | ||
Xc(2,:) = [2.0_rk, 0.0_rk, 0.0_rk] | ||
|
||
call shape%set(& | ||
knot=[0.0_rk, 0.0_rk, 1.0_rk, 1.0_rk],& | ||
Xc=Xc) | ||
|
||
call shape%cmp_length(length) | ||
print*, length | ||
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,28 @@ | ||
program compute_volume | ||
|
||
use forcad | ||
|
||
implicit none | ||
|
||
type(nurbs_volume) :: shape | ||
real(rk) :: volume | ||
real(rk) :: Xc(8,3) | ||
|
||
Xc(1,:) = [0.0_rk, 0.0_rk, 0.0_rk] | ||
Xc(2,:) = [2.0_rk, 0.0_rk, 0.0_rk] | ||
Xc(3,:) = [0.0_rk, 2.0_rk, 0.0_rk] | ||
Xc(4,:) = [2.0_rk, 2.0_rk, 0.0_rk] | ||
Xc(5,:) = [0.0_rk, 0.0_rk, 2.0_rk] | ||
Xc(6,:) = [2.0_rk, 0.0_rk, 2.0_rk] | ||
Xc(7,:) = [0.0_rk, 2.0_rk, 2.0_rk] | ||
Xc(8,:) = [2.0_rk, 2.0_rk, 2.0_rk] | ||
|
||
call shape%set(& | ||
knot1=[0.0_rk, 0.0_rk, 1.0_rk, 1.0_rk],& | ||
knot2=[0.0_rk, 0.0_rk, 1.0_rk, 1.0_rk],& | ||
knot3=[0.0_rk, 0.0_rk, 1.0_rk, 1.0_rk],& | ||
Xc=Xc) | ||
|
||
call shape%cmp_volume(volume) | ||
print*, volume | ||
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
Oops, something went wrong.