Giter Site home page Giter Site logo

gitter-badger / gosl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpmech/gosl

0.0 0.0 0.0 16.88 MB

Go scientific library for scientific computations involving linear algebra, special functions, Bessel, fast Fourier transforms, geometry calculations, NURBS, numerical quadrature, polyhedra, random numbers, Mersenne twister, probability distributions, optimisation, plotting, visualisation, tensors, eigenvalues, and much more.

License: BSD 3-Clause "New" or "Revised" License

Shell 0.39% Go 42.38% Python 1.46% C++ 16.63% C 30.20% Fortran 8.21% R 0.09% Makefile 0.61% XSLT 0.02%

gosl's Introduction

Gosl – Go scientific library

GoDoc

Gosl is a library written in Go to develop high-performance scientific computing with ease. The library tries to be as general and easy as possible. Gosl considers the use of both Go concurrency routines and parallel computing using the message passing interface. Gosl has several modules (sub-libraries/sub-packages) for a variety of tasks in scientific computing, image analysis, and data post-processing. For example, it includes high-performant linear algebra functions (e.g. wrapping MKL/OpenBLAS/LAPACK/SuiteSparse/UMFPACK etc.), fast Fourier transform algorithms (e.g. wrapping FFTW), functions and structures for geometry calculations, random numbers generation and probability distributions, optimisation algorithms, plotting and visualisation using the VTK, and much more. Gosl has also solvers to (stiff or not) ordinary differential equations and several tools for mesh generation to assist on the development of solvers to partial differential equations.

See the documentation for more details (e.g. how to call functions and use structures).

Welcome to contributing! + TODO list.

Contents

Gosl includes the following packages:

  1. chk – Check code and unit test tools
  2. io – Input/output, read/write files, and print commands
  3. utl – Utilities. Lists. Dictionaries. Simple Numerics
  4. plt – Plotting and drawing (png and eps)
  5. mpi – Message Passing Interface for parallel computing
  6. la – Linear Algebra: vector, matrix, efficient sparse solvers, eigenvalues, decompositions, etc.
  7. la/mkl – Lower level linear algebra using Intel MKL
  8. la/oblas – Lower level linear algebra using OpenBLAS
  9. num/qpck – Go wrapper to QUADPACK for numerical integration
  10. num – Fundamental numerical methods such as root solvers, non-linear solvers, numerical derivatives and quadrature
  11. fun – Special functions, DFT, FFT, Bessel, elliptical integrals, orthogonal polynomials, interpolators
  12. fun/dbf – Database of functions of a scalar and a vector like f(t,{x}) (e.g. time-space)
  13. fun/fftw – Go wrapper to FFTW for fast Fourier Transforms
  14. gm – Geometry algorithms and structures
  15. gm/msh – Mesh structures and interpolation functions for FEA, including quadrature over polyhedra
  16. gm/tri – Mesh generation: triangles and Delaunay triangulation (wrapping Triangle)
  17. gm/rw – Mesh generation: read/write routines
  18. graph – Graph theory structures and algorithms
  19. opt – Solvers for optimisation problems (e.g. interior point method)
  20. rnd – Random numbers and probability distributions
  21. rnd/dsfmt – Go wrapper to dSIMD-oriented Fast Mersenne Twister
  22. rnd/sfmt – Go wrapper to SIMD-oriented Fast Mersenne Twister
  23. vtk – 3D Visualisation with the VTK tool kit
  24. ode – Solvers for ordinary differential equations

Examples

See all examples here

See benchmarks here

Selected:

Installation

Since Gosl needs some other C and Fortran codes, not all sub-packages can be directly installed using go get .... Nonetheless, Gosl is pretty easy to install! See links below:

  1. Ubuntu
  2. Windows
  3. macOS

The following subpackages are available on Linux only at the moment: mpi, la/mkl, and vtk. The following subpackages are not available for Windows at the moment: gm/tri, rnd/sfmt, and rnd/dsfmt. Help to compile these packages in all platforms is much welcome and appreciated.

About the filenames

  1. t_something_test.go is a unit test. We have several of them! Some usage information can be learned from these files.
  2. t_something_main.go is a test with a main function to be run with go run ... or mpirun -np ? go run ... (replace ? with the number of cpus). There very few of these files.
  3. t_b_something_test.go is a benchmark test. There a few of them. Run benchmarks with go test -run=XXX -bench=.

Design strategies

Here, we call structure any user-defined type. These are simply Go types defined as struct. One may think of these structures as classes. Gosl has several global functions as well and tries to avoid complicated constructions.

An allocated structure (instance) is called an object and functions attached to this object are called methods. In Gosl, the variable holding the pointer to an object is always named o (lower case "o"). This variable is similar to the self or this keywords in other languages (Python, C++, respectively).

Functions that allocate a pointer to a structure are prefixed with New; for instance: NewIsoSurf. Some structures require an explicit call to another function to release allocated memory. Be aware of this requirement! In this case, the function is named Free and appears in a few sub-packages that use CGO. Also, some objects may need to be initialised before use. In this case, functions named Init have to be called.

The directories corresponding to each package has a README.md file that should help with understanding the library. Also, there are links to godoc.org where all functions, structures, and variables are well explained.

Bibliography

The following works take advantage of Gosl:

  1. Pedroso DM, Bonyadi MR, Gallagher M (2017) Parallel evolutionary algorithm for single and multi-objective optimisation: differential evolution and constraints handling, Applied Soft Computing http://dx.doi.org/10.1016/j.asoc.2017.09.006
  2. Pedroso DM (2017) FORM reliability analysis using a parallel evolutionary algorithm, Structural Safety 65:84-99 http://dx.doi.org/10.1016/j.strusafe.2017.01.001
  3. Pedroso DM, Zhang YP, Ehlers W (2017) Solution of liquid-gas-solid coupled equations for porous media considering dynamics and hysteretic retention behaviour, Journal of Engineering Mechanics 04017021 http://dx.doi.org/10.1061/(ASCE)EM.1943-7889.0001208
  4. Pedroso DM (2015) A solution to transient seepage in unsaturated porous media. Computer Methods in Applied Mechanics and Engineering, 285:791-816 http://dx.doi.org/10.1016/j.cma.2014.12.009
  5. Pedroso DM (2015) A consistent u-p formulation for porous media with hysteresis. Int. Journal for Numerical Methods in Engineering, 101(8):606-634 http://dx.doi.org/10.1002/nme.4808

Authors and license

See the AUTHORS file.

Unless otherwise noted, the Gosl source files are distributed under the BSD-style license found in the LICENSE file.

gosl's People

Contributors

cpmech avatar radarhere avatar rauldurand avatar yunpeng1 avatar

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.