Skip to content

Commit

Permalink
Merge pull request #17 from gha3mi/dev
Browse files Browse the repository at this point in the history
Added New Features
  • Loading branch information
gha3mi authored Jun 28, 2024
2 parents d7f1f08 + 7455eff commit d9a6d11
Show file tree
Hide file tree
Showing 15 changed files with 868 additions and 108 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to [ForCAD](https://github.com/gha3mi/forcad) will be docume

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

## [0.6.0]

### Added

- Added generic `get_nc()` method to `nurbs_surface` and `nurbs_volume` derived types.
- 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 `nurbs_curve`, `nurbs_area` and `nurbs_volume` derived types.
- 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()`.

## [0.5.1]

### Changed
Expand Down
3 changes: 2 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This roadmap outlines upcoming features and enhancements for ForCAD. Contributio
- [x] Improvements and bug fixes.

- Additional Ideas:
- [ ] Improve `ROADMAP.md`.
- [ ] Add `reduce_degree()` method for curves, surfaces and volumes.
- [ ] Add `morph()` method for morphing box.
- [ ] Add support binary `vtk` files.
Expand All @@ -48,5 +49,5 @@ This roadmap outlines upcoming features and enhancements for ForCAD. Contributio
- [ ] Improve documentation.
- [ ] Add offset method.
- [ ] Add curve, surface and volume fitting.
- [ ] Calculate length, area and volume.
- [x] Calculate length, area and volume.
- [ ] Think about a GUI.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.1
0.6.0
23 changes: 23 additions & 0 deletions example/cmp_area.f90
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
20 changes: 20 additions & 0 deletions example/cmp_length.f90
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
28 changes: 28 additions & 0 deletions example/cmp_volume.f90
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
2 changes: 1 addition & 1 deletion ford.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project: ForCAD
version: 0.5.1
version: 0.6.0
year: 2024
summary: <p style="text-align: center"><img alt="ForCAD" src="https://github.com/gha3mi/forcad/raw/main/logo/logo.png" style="max-width: 100%; height: auto;"></p>
project_github: https://github.com/gha3mi/forcad
Expand Down
20 changes: 18 additions & 2 deletions fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "forcad"
version = "0.5.1"
version = "0.6.0"
license = "BSD 3-Clause License"
author = "Seyed Ali Ghasemi"
maintainer = "info@gha3mi.com"
Expand All @@ -26,6 +26,7 @@ forimage = {git="https://github.com/gha3mi/forimage.git"}
forcolormap = {git="https://github.com/vmagnin/forcolormap.git"}
fortime = {git="https://github.com/gha3mi/fortime.git"}
openmp = "*"
stdlib = "*"

[dev-dependencies]
forunittest = {git="https://github.com/gha3mi/forunittest"}
Expand Down Expand Up @@ -158,4 +159,19 @@ main = "nearest_point_3d.f90"
[[example]]
name = "nearest_point_2d_bench"
source-dir = "example"
main = "nearest_point_2d_bench.f90"
main = "nearest_point_2d_bench.f90"

[[example]]
name = "cmp_length"
source-dir = "example"
main = "cmp_length.f90"

[[example]]
name = "cmp_area"
source-dir = "example"
main = "cmp_area.f90"

[[example]]
name = "cmp_volume"
source-dir = "example"
main = "cmp_volume.f90"
Loading

0 comments on commit d9a6d11

Please sign in to comment.