Giter VIP home page Giter VIP logo

vecfor's Introduction

VecFor GitHub tag Join the chat at https://gitter.im/szaghi/VecFor

License License License License

Status CI Status Coverage Status

VecFor, Vector algebra class for Fortran poor people

A KISS pure Fortran OOD class for computing Vectorial (3D) algebra

  • VecFor is a pure Fortran (KISS) library for building easily nice Command Line Interfaces (CLI) for modern Fortran projects;
  • VecFor is Fortran 2003+ standard compliant;
  • VecFor is OOP designed;
  • VecFor is a Free, Open Source Project.

Table of Contents

Issues

GitHub issues

Compiler Support

Compiler Compiler Compiler Compiler Compiler Compiler

What is VecFor?

VecFor is a user-friendly and Object-Oriented designed API for handling vectors in a (3D) three dimensional frame of reference. It exposes (among others) the object Vector that posses a far complete set of overloaded operators for performing vectorial calculus algebra.

VecFor adheres to the KISS concept: it is a pure Fortran (2003+) library coded into a single module file, vecfor.F90.

Go to Top

Main features

  • Pure Fortran implementation;
  • KISS and user-friendly:
    • simple API (one main object plus few other helpers);
    • easy building and porting on heterogeneous architectures:
      • the vector components are defined as real with parametrized kind; the default kind parameter is set to be 64-bit-like finite precision (defined by means of the portable select_real_kind intrinsic function), but it can be easily changed at compile time;
  • comprehensive (almost complete set of operators for vectorial calculus algebra);
    • all operators accept mixed type/kind arguments: vectors can be mixed with integers and reals of any kinds by means of generic interfaces with dynamic dispatch resolved at compile time;
  • efficient and non intrusive (all object methods and operators are pure or elemental):
    • threads/processes safe;
  • Tests-Driven Developed (TDD);
  • well documented:
    • complete API reference;
    • comprehensive wiki:
  • collaborative developed on GitHub;
  • FOSS licensed;

Any feature request is welcome.

Go to Top

Copyrights

VecFor is an open source project, it is distributed under a multi-licensing system:

Anyone is interest to use, to develop or to contribute to VecFor is welcome, feel free to select the license that best matches your soul!

More details can be found on wiki.

Go to Top

Documentation

Besides this README file the VecFor documentation is contained into its own wiki. Detailed documentation of the API is contained into the GitHub Pages that can also be created locally by means of ford tool.

A Taste of VecFor

VecFor allows a very simple, high-level implementation of vectorial calculus algebra.

Import VecFor

use vecfor ! load vector type and all helpers

Define some vector variables

type(vector) :: point1
type(vector) :: point2
type(vector) :: distance

Initialize vectors by high-level math-like syntax

point1 = 1 * ex ! ex is the versor along x direction exposed by VecFor
point2 = 1 * ex + 2 * ey ! ey is the versor along y direction exposed by VecFor

Note that ex, ey and ez are the Cartesian versors exposed by VecFor.

Perform vectorial calculus algebra

distance = point2 - point1

Use helper methods to simplify your life

print "(A)", " Vectorial distance"
call distance%printf
print "(A)", " Distance module"
print*, distance%normL2()
! expected output
!   Vectorial distance
!   Component x  0.000000000000000E+000
!   Component y +0.200000000000000E+001
!   Component z  0.000000000000000E+000
!   Distance module
!   +0.200000000000000E+001

As you can see from the above example, defining and using a vector become very close to the mathematical formulation. Note that, using the dynamic dispatching resolved at compile time, there is no performance penalty on using a type(vector) variable instead of an hard-coded real, dimension(3) array variable (or even more verbose and less clear real :: x, y, z variables for each vector...).

Go to Top

vecfor's People

Contributors

pdebuyl avatar szaghi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vecfor's Issues

Add FoBiS doctests

Exploit FoBiS doctests for improving code coverage/regression/usage-documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.