← Back to team overview

ufl team mailing list archive

Re: [HG UFL] Replaced ListVector and ListMatrix classes with generalized ListTensor class.

 

My suggestion would be something like

  a = as_vector(v1[i] * f1[j], i)
  a = as_matrix(v1[i] * f1[j], (j,i))
  a = as_tensor(v1[i] * f1[j], (i,j))

-- 
Anders


On Thu, Oct 09, 2008 at 01:38:08PM +0200, UFL wrote:
> One or more new changesets pushed to the primary ufl repository.
> A short summary of the last three changesets is included below.
> 
> changeset:   309:a49c11d17e42937fc9574f3b7f0a8ba0cd4b9024
> tag:         tip
> user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date:        Thu Oct 09 13:38:08 2008 +0200
> files:       sandbox/test_transformations.py test/classcoverage.py ufl/algorithms/ad.py ufl/algorithms/checks.py ufl/algorithms/dependencies.py ufl/algorithms/indexalgorithms.py ufl/algorithms/transformations.py ufl/algorithms/ufl2latex.py ufl/classes.py ufl/indexing.py ufl/split.py ufl/tensors.py
> description:
> Replaced ListVector and ListMatrix classes with generalized ListTensor class.
> Renamed Tensor to ComponentTensor, made Tensor a function like Vector and Matrix.
> (We should probably rename these three to something else to avoid name clashes with DOLFIN).
> 
> Example usage (from classcoverage.py):
> 
>         # ListTensor()
>         a = Vector([1.0, 2.0*f0, f0**2])
>         a = Matrix([[1.0, 2.0*f0, f0**2],
>                     [1.0, 2.0*f0, f0**2]])
>         a = Tensor([ [[0.00, 0.01, 0.02],
>                       [0.10, 0.11, 0.12]],
>                      [[1.00, 1.01, 1.02],
>                       [1.10, 1.11, 1.12]] ])
> 
>         # ComponentTensor()
>         a = Vector(v1[i] * f1[j], i)
>         a = Matrix(v1[i] * f1[j], (j,i))
>         a = Tensor(v1[i] * f1[j], (i,j))
>         a = Tensor(v2[i,j] * f2[j,k], (i,k))
> 
> 
> changeset:   308:5c0f0598a9c06777c745812dd3f1df84a6a75e3d
> user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date:        Fri Oct 03 12:51:33 2008 +0200
> files:       ufl/algorithms/checks.py
> description:
> Just a FIXME.
> 
> 
> changeset:   307:859e6ffb26cc9a8ada230ca410a21c0baf55289b
> user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date:        Fri Oct 03 12:19:50 2008 +0200
> files:       ufl/algorithms/ad.py ufl/algorithms/checks.py ufl/algorithms/predicates.py ufl/form.py ufl/integral.py
> description:
> Disabled assertion on is_multilinear in validate_form: it isn't correct in general.
> Some fixes in differentiation functions.
> Added negation of forms and integrals, so I can do:
> 
> f = ...*dx + ...*ds
> F = derivative(f, u)
> J = derivative(-F, u)
> 
> and assemble the Newton system directly from F,J.
> 
> ----------------------------------------------------------------------
> For more details, visit http://www.fenics.org/hg/ufl

> _______________________________________________
> UFL-dev mailing list
> UFL-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/ufl-dev

Attachment: signature.asc
Description: Digital signature


References