Hi,
I'm currently trying implement the following flux-corrected transport scheme for a scalar-advection problem:
http://www.mathematik.uni-dortmund.de/~kuzmin/linfct.pdf
In the low-order step (pg. 9-10), I want to solve the following semi-discrete (probably using Crank-Nicolson) matrix equation:
$$ M_L \frac{du}{dt} = Lu $$
Here, $M_L$ is the lumped mass matrix (which I've figured out thanks to the Q&A forums) and
$L = K + D$, where $K$ is the stiffness matrix from discretizing the advection operator and $D$ is constructed using $K$ by the following conditions:
$$ d_{ij} = \max \left( -k_{ij}, 0, -k_{ji} \right) = d_{ji}, \forall j \not= i $$
$$ d_{ii} = - \sum_{i \not= j} d_{ij} $$
Equation (32) in the paper also suggests a way to construct $L$ without constructing D prior.
I understand that it is possible to modify a form that has been assembled into a GenericMatrix object, but quite unfamiliar with using it.
I currently have FeniCS v1.6 installed on my Ubuntu workstation, using the python interface.
Any advice or demo codes on using the GenericMatrix object, as well as other approaches do this in a clean way would be appreciated!
Thanks!