# Compliant

Snapshot of CompliantCloth.scn

This plugin introduces a constraint-based approach and a matrix assembly method.

- Design
- Limitations
- Examples
- Plugin structure and installation
- Intellectual property and rights

## Design

This plugin introduces a constraint-based approach and a matrix assembly method. Details are given in compliant.pdf in this directory.
See also the code documentation, which you can generate using doxygen. There is also an embryo of test suite documented in the code documentation.
$
\newcommand{\vect}[1]{\mathbf{#1}}
\newcommand{\mat}[1]{\mathbf{#1}}
\newcommand{\pos}{\vect{x}}
\newcommand{\dx}{\vect{\Delta x}}
\newcommand{\xcur}{\vect{x}_{n}}
\newcommand{\xnext}{\vect{x}_{n+1}}
\newcommand{\vel}{\vect{v}}
\newcommand{\dv}{\vect{\Delta v}}
\newcommand{\vcur}{\vect{v}_{n}}
\newcommand{\vnext}{\vect v_{n+1}}
\newcommand{\acc}{\vect{a}}
\newcommand{\force}{\vect{f}}
\newcommand{\forcext}{\vect{f}_{ext}}
\newcommand{\lam}{\vect{\lambda}}
\newcommand{\lcur}{\lam_{n}}
\newcommand{\lnext}{\lam_{n+1}}
\newcommand{\avlam}{\bar{\lam}}
\newcommand{\fcur}{\vect{f}_{n}}
\newcommand{\fnext}{\vect f_{n+1}}
\newcommand{\M}{\mat M}
\newcommand{\Minv}{\mat M^{-1}}
\renewcommand{\P}{\mat P}
\newcommand{\J}{\mat J}
\newcommand{\Jt}{\mat J^T}
\newcommand{\C}{\mat C}
\newcommand{\violation}{ \phi}
\newcommand{\dviolation}{\dot \violation}
\newcommand{\violcur}{\violation_{n}}
\newcommand{\violnext}{\violation_{n+1}}
\newcommand{\dviolnext}{\dot \violation_{n+1}}
\newcommand{\cmp}{c}
\newcommand{\dampingratio}{d}
$

## Limitations

Currently, the Schur complement $\J\Minv\Jt + \C$ can not be computed for a non-diagonal mass and stiffness matrix $\M$. Consequently, it can not handle the usual mouse interactor based on a stiff spring. However, it is possible to use a constraint-based mouse interactor. To automatically use it, insert the following object near the root in your .scn file description:
`<CompliantAttachButtonSetting button="Left"/>`

## Examples

- CompliantTest.scn : a simple pendulum with one particle.
- CompliantCloth.scn : a cloth-like triangle structure

.

## Plugin structure and installation

Directory structure:

- the C++ code of the library is in toplevel directory Compliant/
- the tests suite is in directory Compliant_test/
- a standalone application to create and run a simulation is in directory Compliant_run/. This is useful to test cases based on MultiMappings, since these are not completely supported yet by the .scn file format.
- the documentation starts in doc/index.html and it is linked to the code documentation

Installation:

- The solver uses external libraries for linear algebra sparse matrix factoring: including blas and cholmod. On ubuntu 12.04, they are packed in libsuitesparse-metis-dev.deb
- The test suite requires the installation of the Boost.Test library. Installatations instructions can be found on the web, e.g.:

- for linux: http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/
- for windows: http://www.beroux.com/english/articles/boost_unit_testing/

- Uncheck DEFINES += SOFA_HAVE_PLUGIN_Compliant in your sofa-local.prf file
- Generate the code documentation using doxygen. In Unix systems, simply type doxygen Doxyfile in the doc/ directory.

Troubleshooting:

- The run and test executables require plugins Compliant and Flexible. For some reason, the order they are declared in the dependency file Sofa-dependencies.prf matters. I had to put Flexible before Compliant otherwise I got a strange run-time crash on not-really-valid component pointers. (FF, linux, 06/2012)

## Intellectual property and rights

Authors | François Faure, Maxime Tournier, …
Contact | Francois Faure
License | This plugin is distributed under the same license as the core of SOFA.
Patents |
APP registration |
Sponsors | No sponsor yet… :-)

## HowTo

#### Code documentation

can be generated using doxygen. In Unix systems, simply type doxygen Doxyfile in the doc directory.

#### LaTeX formulas

can be inserted in this html document thanks to the mathjax config and script included in the header. Basically, an inline \( \LaTeX \) formula starts with \( and ends with \), while a centered formula on a separate line is bracketed using \[ and \] .