ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #01928
Re: user defined matrix?
I should have said "adjugate" or "classical adjoint".
I see, matrix can always be treated as vectors, and matrix multiplication, adjugate matrix etc. can be defined accordingly. Thus it's still doable in FFC.
Thank you.
Best,
Chong Luo
________________________________
From: Anders Logg <logg@xxxxxxxxx>
To: ffc-dev@xxxxxxxxxx
Sent: Saturday, November 8, 2008 12:50:53 PM
Subject: Re: [FFC-dev] user defined matrix?
On Sat, Nov 08, 2008 at 10:08:11AM -0800, Chong Luo wrote:
> I'm doing a 2D elasticity problem. In my variational formulation, there are a
> lot of adj(A), like grad(n)*adj(grad(v)):grad(n)*adj(grad(w)), where adj(A) is
> the adjoint of the matrix A. That is if A = (a b, c d), then adj(A) = (d -b, -c
> a).
That looks more like an inverse with a missing determinant than an adjoint.
> If I could define adj(A) in the form file, that would be very handy. Is it
> possible to have user define matrix in FFC?
You can define any operators you want in your form file:
def adj(A):
return [A[0], A[2], A[1]. A[3]]
But note that FFC does not support matrix-valued functions so you'll
have to represent it as a vector.
Matrices (and in general tensors) are supported by the new form
language (UFL) that will be used in FFC in the future.
--
Anders
References