gosl

module
v0.0.0-...-0fb1ef6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2017 License: BSD-3-Clause

README

Gosl – Go scientific library

Gosl is a computing library written in go language (golang) to help with the development of software for scientific research. The library tries to be as general as possible. The use of concurrency for multi-threaded applications and message passing for parallel computations are considered. Functions and structures for geometry calculations, random numbers generation and probability distributions, optimisation algorithms, and plotting and visualisation are implemented as well.

Content

Gosl comprises several subpackages as listed below:

  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 and efficient sparse solvers
  7. fdm – Simple finite differences method
  8. num – Fundamental numerical methods
  9. fun – Scalar functions of one scalar and one vector
  10. gm – Geometry algorithms and structures
  11. gm/msh – Mesh generation and Delaunay triangulation
  12. gm/tri – Mesh generation: triangles
  13. gm/rw – Mesh generation: read/write
  14. graph – Graph theory structures and algorithms
  15. ode – Ordinary differential equations
  16. opt – Optimisation problem solvers
  17. rnd – Random numbers and probability distributions
  18. tsr – Tensor algebra and definitions for continuum mechanics
  19. vtk – 3D Visualisation with the VTK tool kit

Examples

Check out examples here

Normally distributed pseudo-random numbers. Using sub-package `rnd`

Installation

1 To install on Windows, see instructions for Windows here

2 To install on macOS, see instructions for macOS

3 To install on Debian/Ubuntu/Linux, type the following commands:

3.1. Install dependencies:

sudo apt-get install libopenmpi-dev libhwloc-dev libsuitesparse-dev libmumps-dev 
sudo apt-get install gfortran libvtk6-dev python-scipy python-matplotlib dvipng

3.2. Clone and install Gosl

mkdir -p ${GOPATH%:*}/src/github.com/cpmech
cd ${GOPATH%:*}/src/github.com/cpmech
git clone https://github.com/cpmech/gosl.git
cd gosl
./all.bash
Python dependencies

For the plt subpackage, make sure that the following environment variable is defined:

export PYTHONPATH=$PYTHONPATH:${GOPATH%:*}/src/github.com/cpmech/gosl/scripts

Documentation

Here, we call user-defined types as structures. These are simply Go types defined as struct. Some may think of these structures as classes. Gosl has several global functions as well and tries to avoid complicated (unnecessary?) programming techniques.

An allocated structure is called here an object and functions attached to this object are called methods. The variable holding the pointer to an object is always named o in Gosl (e.g. like self or this).

Some objects need to be initialised before usage. In this case, functions named Init have to be called (e.g. like constructors). Some structures require an explicit call to a function to release allocated memory. This function is named Free. Functions that allocate a pointer to a structure are prefixed with New; for instance: NewIsoSurf.

The directories corresponding to each package has a README.md file that should help with understanding the library, including functions and structures.

Gosl has several functions and structures. Check the developer's documentation to see what's available and how to call functions and methods.

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.

Directories

Path Synopsis
package chk contains functions for checking and testing computations
package chk contains functions for checking and testing computations
doc
install command
fun (functions) implements a number of y(t,x) functions and their first and second order derivatives
fun (functions) implements a number of y(t,x) functions and their first and second order derivatives
gm
gm (geometry and meshes) implements auxiliary functions for handling geometry and mesh structures
gm (geometry and meshes) implements auxiliary functions for handling geometry and mesh structures
msh
package msh implements functions to generate meshes
package msh implements functions to generate meshes
rw
package rw implements reader and writers for geometry files such as the STEP file format
package rw implements reader and writers for geometry files such as the STEP file format
tri
package tri wraps Triangle to perform mesh generation a Delaunay triangulation
package tri wraps Triangle to perform mesh generation a Delaunay triangulation
Package io (input/output) implements auxiliary functions for printing, parsing, handling files, directories, etc.
Package io (input/output) implements auxiliary functions for printing, parsing, handling files, directories, etc.
Package la implements routines and structures for linear algebra with matrices and vectors in dense and sparse formats (including complex)
Package la implements routines and structures for linear algebra with matrices and vectors in dense and sparse formats (including complex)
package opt implements routines for solving optimisation problems
package opt implements routines for solving optimisation problems
plt contains functions for plotting
plt contains functions for plotting
rnd
tsr implements routines to conduct tensor operations
tsr implements routines to conduct tensor operations
package utl implements functions for simplifying calculations and allocation of structures such as slices and slices of slices.
package utl implements functions for simplifying calculations and allocation of structures such as slices and slices of slices.
vtk
examples command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL