Git Product home page Git Product logo

generato's Introduction

Generato

Generate C/C++ code from tensor expression and so on (using xAct)

Pre-Requisites

  • Install free Wolfram Engine for Devolopers from https://www.wolfram.com/developer/. (If you are rich, you can install the totally worth-it Mathematica instead, versions that support 'wolframscript'.)

  • Download xAct from http://www.xact.es and install it properly.

Installation

  • clone repo: git clone [email protected]:lwJi/Generato.git

  • set enviroment variable: export GENERATO="/your/repo/path"

Example

  • Small toy
wolframscript -f test/unit/test.wl
  • GHG formulation of Einstein's equations

Please take a look at the example script for GHG system: test/integration/GHG_rhs.ipynb. Or

wolframscript -f test/integration/GHG_rhs.wl

Recomendations

  • Use lower case to name variables (to aviod conflict with say Pi)

Tips

  • Use SetEQNDelayed if your right-hand side (rhs) includes an If statement to handle different component cases. Otherwise, SetEQN is preferred because it has an option, CheckRHS, which checks if all the terms appearing in the rhs are well-defined.

  • IsDefined[term] is very useful for debugging.

generato's People

Contributors

lwji avatar

Stargazers

 avatar Xiao-Xiao Kou avatar

Watchers

 avatar

generato's Issues

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.