GithubHelp home page GithubHelp logo

eihabhala / morpho Goto Github PK

View Code? Open in Web Editor NEW

This project forked from morpho-lang/morpho

0.0 0.0 0.0 98.55 MB

The Morpho language ๐Ÿฆ‹. Morpho is a small embeddable language for scientific computing applications.

License: MIT License

Ruby 0.28% Python 2.21% C 86.87% Objective-C 0.01% Lua 0.34% Dart 0.19% TeX 7.86% Makefile 0.16% Batchfile 0.05% Modula-3 0.53% Wren 1.50%

morpho's Introduction

MorphoMorpho

Build and Test Examples

The Morpho language. Morpho is a programmable environment for shape optimization and scientific computing tasks more generally. Morpho aims to be:

  • Familiar. Morpho uses syntax similar to other C-family languages. The syntax fits on a postcard, so it's easy to learn.
  • Fast. Morpho programs run as efficiently as other well-implemented dynamic languages like wren or lua (Morpho is significantly faster than Python, for example). Morpho leverages numerical libraries like BLAS, LAPACK and SUITESPARSE to provide high performance.
  • Class-based. A morpho program involves creating and manipulating objects, which greatly simplifies operation.
  • Extendable. Functionality is easy to add via packages, both in Morpho and in C or other compiled languages.

Morpho is based upon work supported by the National Science Foundation under grants DMR-1654283 and OAC-2003820.

Learn and use morpho

Documentation is available on readthedocs and via an extensive user manual. A Slack community is also available for people interested in using morpho and seeking support.

In academic publications, please cite morpho as:

Joshi, C. et al., "Morpho -- A programmable environment for shape optimization and shapeshifting problems", arXiv:2208.07859 (2022)

We expect to update this once the paper is published.

Participation in the morpho community, both as users and developers, is bound by our Code of Conduct.

Contributing

Morpho is under active development and we welcome contributions! Please see the Contributor's guide for more information about how you can get involved in the morpho project. For those interested in extending morpho or working with the source a Developer guide is also provided.

We provide a Roadmap for future development plans that might give you ideas for how you could contribute.

We also welcome bug reports and suggestions: Please feel free to use the Issues feature on our github repository to bring these to the developers' attention.

Installation

Morpho can be installed as follows:

macOS

The recommended approach to installing morpho on macOS is to use the Homebrew package manager.

1. Install Homebrew, following instructions on the homebrew site.

2. In the terminal type:

brew update
brew tap morpho-lang/morpho
brew install morpho

You may be prompted by homebrew to install additional components. For some users, it may be necessary to install XCode from the App Store. We recommend you also obtain this git repository so that you can try the examples, read the manual etc. which are not installed by homebrew. To do so simply cd to any convenient folder in the Terminal and type:

git clone https://github.com/Morpho-lang/morpho.git

Unix and Linux

These instructions assume a distribution that uses the apt package manager. You may need to find equivalent packages for other distributions.

1. Make sure your version of apt is up to date.

sudo apt update
sudo apt upgrade

2. Ensure you have basic developer tools installed. Some distributions omit these to save space.

sudo apt install build-essential

3. Install morpho's dependencies using your distribution's package manager.

sudo apt install libglfw3-dev libsuitesparse-dev liblapacke-dev povray libfreetype6-dev

4. Obtain the source by cloning this repository:

git clone https://github.com/Morpho-lang/morpho.git

5. Navigate to the morpho5 folder within the downloaded repository and build the application:

cd morpho/morpho5

sudo make -f Makefile.linux install

6. Navigate to the morphoview folder and build the viewer application:

cd ../morphoview

sudo make -f Makefile.linux install

7. Check that the application works by typing

morpho5

Note that the build script places morpho5 and morphoview in the /usr/local file structure; this can easily be changed if a different location is preferred. See the manual for details.

Windows via Windows Subsystem for Linux (WSL)

Install WSL

The instructions to install the Ubuntu App are here.

Once the Ubuntu terminal is working in Windows, you can install Morpho through it in almost the same way as a Linux system, with the addition of an X windows manager to handle visualizations.

Unless mentioned otherwise, all the commands below are run in the Ubuntu terminal.

Install Morpho

Follow the instructions for the linux install above.

Get visualization working in WSL

Now a window manager must be installed so that the WSL can create windows.

1. On Windows, install VcXsrv.

It shows up as XLaunch in the Windows start menu.

2. Open Xlaunch. Then,

  • choose 'Multiple windows', set display number to 0, and hit 'Next'
  • choose `start no client' and hit 'Next'
  • Unselect 'native opengl' and hit 'Next'
  • Hit 'Finish'

3. Within Ubuntu download a package containing a full suite of desktop utilities that allows for the use of windows.

sudo apt install ubuntu-desktop mesa-utils

4. Tell ubuntu which display to use

export DISPLAY=localhost:0

5. To set the DISPLAY variable on login type

echo export DISPLAY=localhost:0 >> ~/.bashrc

6. Test that the window system is working

glxgears

Test that visualization works

Navigate to the thomson example in the examples directory and run it. If you are in the morphoview directory, you can do this by typing,

cd ../examples/thomson

morpho5 thomson.morpho

This example starts with randomly distributed charges on a sphere and minimizing electric potential. It should generate an interactively rotatable figure of points on a sphere. See the manual for details.


Other Tests

NoNaNBoxing Tests Garbage Colletor Stress Test

morpho's People

Contributors

softmattertheory avatar conduitdan avatar mattsep avatar joshichaitanya3 avatar tusmm avatar stevewufeng 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.