dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #13955
Re: Computation of Norms
You should not need to import anything in the .ufl files. Look at one
of the demo .ufl files.
--
Anders
On Mon, Jun 15, 2009 at 01:53:12PM -0500, Jehanzeb Hameed wrote:
> I imported tetrahedron from dolfin.ufl, is that correct?
>
> I get this error when trying out "element = VectorElement("Lagrange",
> tetrahedron, 3)"
>
> Preprocessing form file: l2ErrNorm.form --> l2ErrNorm.py
>
> *** Cell('tetrahedron', 1)
> *** To get more information about this error, rerun ffc with the option -d1.
>
>
>
> Preprocessing form file: l2ErrNorm.form --> l2ErrNorm.py
>
> *** Cell('tetrahedron', 1)
> *** To get more information about this error, rerun ffc with the option -d1.
>
>
> On Mon, Jun 15, 2009 at 1:21 PM, Anders Logg<logg@xxxxxxxxx> wrote:
> > On Mon, Jun 15, 2009 at 01:09:43PM -0500, Jehanzeb Hameed wrote:
> >> Thanks. That works. I have a related question about forms. Can the
> >> form be defined in python, and then compiled via ffc? For example, I
> >> did,
> >>
> >> from dolfin import *
> >> mesh = Mesh("./mesh_2d.xml")
> >> V = VectorFunctionSpace(mesh, "Lagrange", 1,3)
> >> u = Function(V)
> >> M = dot(u,u)*dx
> >>
> >>
> >> and then called ffc on this form. This generated a header file. Are
> >> there any caveats here that I should be careful about?
> >>
> >> -Jehanzeb
> >
> > It's plain luck this works at all and the mesh will be completely
> > ignored so do I suggest you just write
> >
> > element = VectorElement("Lagrange", tetrahedron, 3)
> > u = Function(element)
> > M = dot(u, u)*dx
> >
> >
> >
> >> > On Mon, Jun 15, 2009 at 10:09:11AM +0200, Patrick Riesen wrote:
> >> >> Hi,
> >> >>
> >> >> ffc looks for the variables a, L or M to generate a form, so you should
> >> >> use L instead of L2, so that ffc notices it.
> >> >
> >> > Should be M unless you want to assemble a vector.
> >> >
> >> >
> >> >
> >> >> regards,
> >> >> patrick
> >> >>
> >> >> Jehanzeb Hameed wrote:
> >> >> > I cant figure out how to generate a form file for norm, in C++. The
> >> >> > problem is that the form is quadratic in its arguments, and so isn't a
> >> >> > valid form according to ffc user manual. I tried it anyway, making a
> >> >> > file like this (just for testing):.
> >> >> >
> >> >> > vecElement = VectorElement("Lagrange", "triangle", 1,3)
> >> >> > u = Function(vecElement)
> >> >> > L2 = dot(u,u)*dx
> >> >> >
> >> >> > ffc doesnt make .h file, and exits with the following message:
> >> >> >
> >> >> > "No forms or elements specified, nothing to do."
> >> >> >
> >> >> > I tried compiling by "ffc -r quadrature l2norm.form", and again got
> >> >> > the same message.
> >> >> >
> >> >> > Can someome please help amd point out what I can do?
> >> >> >
> >> >> > Thanks,
> >> >> > -Jehanzeb
> >> >> >
> >> >> > On Wed, Jun 10, 2009 at 11:14 AM, Anders Logg<logg@xxxxxxxxx> wrote:
> >> >> >> On Wed, Jun 10, 2009 at 09:58:20AM -0500, Jehanzeb Hameed wrote:
> >> >> >>> Thanks. So I guess that means no such facility is available in C/C++ ?
> >> >> >> No, since the computation depends on the space the functions are in
> >> >> >> and so the code needs to be generated. In C++, you need to define a
> >> >> >> form file for the norm. Look at
> >> >> >>
> >> >> >> site-packages/dolfin/norm.py
> >> >> >>
> >> >> >> for how to define the norms.
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>> On Wed, Jun 10, 2009 at 2:03 AM, Anders Logg<logg@xxxxxxxxx> wrote:
> >> >> >>>> On Tue, Jun 09, 2009 at 05:11:48PM -0500, Jehanzeb Hameed wrote:
> >> >> >>>>> Hello,
> >> >> >>>>>
> >> >> >>>>> Is there a builtin function in dolfin to compute L^2 or H_1 norms? If
> >> >> >>>>> so, can you please point it out. If not, are there support functions
> >> >> >>>>> (e.g. a Gauss Quadrature table, computation of Jacobians, etc) which
> >> >> >>>>> can help in this?
> >> >> >>>> Yes, this is available in the DOLFIN Python interface:
> >> >> >>>>
> >> >> >>>> norm(v)
> >> >> >>>>
> >> >> >>>> The default computes the L^2 norm. Several options are available:
> >> >> >>>>
> >> >> >>>> L^2: norm(v, 'L2')
> >> >> >>>> H^1: norm(v, 'H1') includes L^2 term
> >> >> >>>> H^1_0: norm(v, 'H10') does not include L^2 term
> >> >> >>>> H(div): norm(v, 'Hdiv') includes L^2 term
> >> >> >>>> H(div): norm(v, 'Hdiv0') does not include L^2 term
> >> >> >>>> H(curl): norm(v, 'Hcurl') includes L^2 term
> >> >> >>>> H(curl): norm(v, 'Hcurl0') does not include L^2 term
> >> >> >>>>
> >> >> >>>>
> >> >> >>>> -----BEGIN PGP SIGNATURE-----
> >> >> >>>> Version: GnuPG v1.4.9 (GNU/Linux)
> >> >> >>>>
> >> >> >>>> iEYEARECAAYFAkovWqUACgkQTuwUCDsYZdGb3gCfa2gWnzealWzkjPoRj8hf3cr/
> >> >> >>>> 0EUAoJh4mpaIzRU9eCnnC+XWlupu6SV0
> >> >> >>>> =so4c
> >> >> >>>> -----END PGP SIGNATURE-----
> >> >> >>>>
> >> >> >>>> _______________________________________________
> >> >> >>>> DOLFIN-dev mailing list
> >> >> >>>> DOLFIN-dev@xxxxxxxxxx
> >> >> >>>> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >> >> >>>>
> >> >> >>>>
> >> >> >>> _______________________________________________
> >> >> >>> DOLFIN-dev mailing list
> >> >> >>> DOLFIN-dev@xxxxxxxxxx
> >> >> >>> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >> >> >> -----BEGIN PGP SIGNATURE-----
> >> >> >> Version: GnuPG v1.4.9 (GNU/Linux)
> >> >> >>
> >> >> >> iEYEARECAAYFAkov28sACgkQTuwUCDsYZdE8KQCdEI7wS27QaNw9knI2U9L+RVST
> >> >> >> xeUAnRdLrrhAVzsBn6nO1b6CLEpF64ey
> >> >> >> =a7iu
> >> >> >> -----END PGP SIGNATURE-----
> >> >> >>
> >> >> >> _______________________________________________
> >> >> >> DOLFIN-dev mailing list
> >> >> >> DOLFIN-dev@xxxxxxxxxx
> >> >> >> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >> >> >>
> >> >> >>
> >> >> > _______________________________________________
> >> >> > DOLFIN-dev mailing list
> >> >> > DOLFIN-dev@xxxxxxxxxx
> >> >> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> >> >>
> >> >> _______________________________________________
> >> >> DOLFIN-dev mailing list
> >> >> DOLFIN-dev@xxxxxxxxxx
> >> >> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >> >
> >> > -----BEGIN PGP SIGNATURE-----
> >> > Version: GnuPG v1.4.9 (GNU/Linux)
> >> >
> >> > iEYEARECAAYFAko2BFQACgkQTuwUCDsYZdF7qACeJkPnmaCDwkc1ffLUsGyyEOtY
> >> > /kAAnidGRwRLBL7jksqEnf0KsUw4D7hb
> >> > =k8B2
> >> > -----END PGP SIGNATURE-----
> >> >
> >> > _______________________________________________
> >> > DOLFIN-dev mailing list
> >> > DOLFIN-dev@xxxxxxxxxx
> >> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> >> >
> >> >
> >> _______________________________________________
> >> DOLFIN-dev mailing list
> >> DOLFIN-dev@xxxxxxxxxx
> >> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> >
> > iEYEARECAAYFAko2kSsACgkQTuwUCDsYZdEBpQCfRqDGFcLN7miMJsrWt3k8L3t3
> > itwAn3h9c6lFUAaFq18x7JoS+yyjEe4G
> > =nNN2
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> >
> >
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
Attachment:
signature.asc
Description: Digital signature
References
-
Computation of Norms
From: Jehanzeb Hameed, 2009-06-09
-
Re: Computation of Norms
From: Anders Logg, 2009-06-10
-
Re: Computation of Norms
From: Jehanzeb Hameed, 2009-06-10
-
Re: Computation of Norms
From: Anders Logg, 2009-06-10
-
Re: Computation of Norms
From: Jehanzeb Hameed, 2009-06-15
-
Re: Computation of Norms
From: Patrick Riesen, 2009-06-15
-
Re: Computation of Norms
From: Anders Logg, 2009-06-15
-
Re: Computation of Norms
From: Jehanzeb Hameed, 2009-06-15
-
Re: Computation of Norms
From: Anders Logg, 2009-06-15
-
Re: Computation of Norms
From: Jehanzeb Hameed, 2009-06-15