This example should not work. You are assembling a form with only a TrialFunction. If you have a form with only one "argument" (meaning you want to assemble it into a vector), then that argument (basis function) must be a TestFunction.
-- Anders Sat Feb 07 2015 at 11:28:15 AM skrev Jan Heiland <[email protected]>: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dear all, > > until version 1.3 (where it still works) I have used the following > script to compute the discrete divergence of a given velocity field. > > ### =============================================================== > > import dolfin > from dolfin import dx, div > import numpy as np > > N = 10 > mesh = dolfin.UnitSquareMesh(N, N) > > # print 'we use Crouzieux-Raviart elements !' > # V = dolfin.VectorFunctionSpace(mesh, "CR", 1) > # Q = dolfin.FunctionSpace(mesh, "DG", 0) > > print 'we use Taylor-Hood elements' > V = dolfin.VectorFunctionSpace(mesh, "CG", 2) > Q = dolfin.FunctionSpace(mesh, "CG", 1) > > nv = V.dim() > > # make up a test vector > velvec = np.ones((nv, 1)) > v = dolfin.Function(V) > v.vector().set_local(velvec) > > q = dolfin.TrialFunction(Q) > divv = dolfin.assemble(q*div(v)*dx) > > ### ================================================== > > > > Since 1.4 it fails with exception (full traceback is attached) > > **Exception: Unable to extract all indices.** > > > Last time I checked for this I thought it is related to this issue: > > https://bitbucket.org/fenics-project/dolfin/issue/352 > > However, also in version 1.5 this error is still there. > > Any ideas? Workarounds?? > > Best regards, > Jan > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > > iQEcBAEBAgAGBQJU1ei3AAoJED0q33mesbTn0QsH/RsgiUEUeWh/D6Y54LNBZPOR > d8si7yhtYQyu9+eYccknXpf9x4HhciUdR8RKw3bwGcvy2H/nkXT1EgIi5CokvIhq > OYkcZxWppPiANdXR5WI/qwRe14peikKcjzhnV2Y2SbiNkQxkqwakpaDEteKxIlLC > FiPRCVeVmTbE2sWdCJHWBvRIKNH/s3bnCydFolmH+RH8XOKk1sD8oEatoHKLqSQ1 > /BaMk0oJ+YOfR1sk/lqB7JO4Z5o4HbujezVNHrkbmaPVoW0QyzWNq+L3xd9zt7qg > dqzguiIjsFkkjFXFHSM/qZr9hEDadiVzoy2gOtVb8H+ev8Z2wqSqwRKdDe1t67c= > =EHac > -----END PGP SIGNATURE----- >
_______________________________________________ fenics-support mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics-support
