SymX Documentation¶
Welcome to the SymX documentation pages. SymX is a C++ library for symbolic differentiation, code generation, and evaluation, designed primarily for non-linear optimization in physics simulation and FEM. Check out the SymX GitHub repo.
In these pages you will find an overview on how SymX works and how to use it through its levels of abstraction. Every explanation comes with example snippets. Note that this is more of a tutorial or a walkthrough than an extensive documentation in a traditional Doxygen sense.
Another important goal of this guide is to help you assess whether SymX can be useful to you. There are many different ways to use symbolics, differentiation and just-in-time compilation, and SymX supports a few use cases out-of-the-box. There are three entry points available in SymX:
Single Expression: Compose a symbolic expression (possibly differentiated), compile it, set values, run it, read the output.
Stencil-based Loops: Compose a symbolic expression (possibly differentiated) to be evaluated in a loop over many instances of an stencil. This is the core of FEM assemblers and iterative predictor/corrector solvers such as Jacobi or Gauss-Seidel.
Non-linear Optimization: Define potentials + discretizations + degrees of freedom and let SymX find the global solution using Newton’s Method. It will take care of differentiation, compilation and evaluation automatically.
Depending on your use case, you might choose to skip parts of this tutorial.
Table of Contents¶
Getting Started
Core Concepts (Layers 1, 2)
Symbol-Data Maps (Layer 3)
Second-Order Solver (Layer 4)
Examples