/forcad

ForCAD - A parallel Fortran library for geometric modeling using NURBS

Primary LanguageFortranBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

GitHub Documentation fpm doc License DOI

ForCAD: A Fortran library for Geometric Modeling using NURBS (Non-Uniform Rational B-Splines).

ForCAD supports B-Spline, NURBS, Bezier, and Rational Bezier curves, surfaces, and volumes.

Main Features

  • Create NURBS objects by specifying control points, weights and knots.
  • Refine NURBS objects by inserting or removing knots and elevating degree.
  • Compute basis functions and derivatives of NURBS objects.
  • Obtain IGA elements connectivity.
  • Obtain visualized elements connectivity and coordinates for geometry and control geometry.
  • Mesh insertion into a NURBS object.
  • Export NURBS objects to VTK files for visualization.
  • Includes predefined NURBS shapes: Circle, Half Circle, Tetragon, Hexahedron, 2D Ring, Half 2D Ring, 3D Ring, Half 3D Ring, C-shapes.
  • Rotate and translate NURBS objects.
  • Visualization using provided python PyVista scripts.

Installation

Requirements

Clone the repository

Clone the ForCAD repository from GitHub:

git clone https://github.com/gha3mi/forcad.git
cd forcad

Install PyVista (Optional)

To install PyVista, run the following command:

pip install pyvista

Running Examples with fpm

fpm run --example <file name excluding the .f90 extension>

After executing the examples, .vtk files will be generated in the vtk directory. To visualize these files, a show() method is provided which utilizes PyVista. Alternatively, other visualization tools like ParaView can also be used.

Using ForCAD as a fpm Dependency

If you want to use ForCAD as a dependency in your own fpm project, you can easily include it by adding the following line to your fpm.toml file:

[dependencies]
forcad = {git="https://github.com/gha3mi/forcad.git"}

API documentation

The most up-to-date API documentation for the master branch is available here. To generate the API documentation for ForCAD using ford run the following command:

ford ford.yml

Roadmap

For a detailed roadmap outlining upcoming features and enhancements, please refer to ROADMAP.md.

Contributing

Contributions to ForCAD are welcome!

  • If you find any issues or would like to suggest improvements, please open an issue.
  • If you've implemented new features, fixed bugs, or enhanced existing functionality, please consider submitting a pull request (PR).
  • Please share your examples by submitting a pull request (PR).

Citation

If you use ForCAD in your research, please cite it as follows:

@software{seyed_ali_ghasemi_2024_10904447,
  author       = {Ghasemi, S. A.},
  title        = {gha3mi/ForCAD},
  year         = 2024,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.10904447},
  url          = {https://doi.org/10.5281/zenodo.10904447}
}

References