Subject: [UFC-dev] Suggestion for extension

From: Anders Logg <[email-masked]>
Date: Mon, 18 Aug 2008 10:37:47 +0200

I'd like to add something to the *_integral interfaces for evaluating
forms at arbitrary points. This is useful when one needs to do
special-purpose quadrature at run-time, for example when integrating
forms over cut meshes (integrating over only a part of a cell).

The addition would be something like

  virtual void evaluate_tensor(double* A,
                               const double * const * w,
                               const cell& c,
                               const double* coordinates) const = 0;

I imagine the code generation would be fairly simple since we already
have quadrature code generation, both in FFC and SyFi.

-- 
Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Mon, 18 Aug 2008 10:49:32 +0200

So the tensor in question here is the integrand?
Maybe we should include that in the name?
And why "evaluate", how is this operation different from "tabulate_tensor"?

  virtual void tabulate_integrand_tensor(double* A,
                               const double * const * w,
                               const cell& c,
                               const double* coordinates) const = 0;

This should be easy to implement.

--
Martin

2008/8/18 Anders Logg <[email-masked]>:
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIqTTbTuwUCDsYZdERAiAGAJwIRJP5Y07zp2kcSkU6iuaD8JUItgCghSk2
> K+SMgf5fdeDKObSlFmktqoY=
> =44+5
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> UFC-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufc-dev
>
>

---

From: Anders Logg <[email-masked]>
Date: Mon, 18 Aug 2008 11:02:34 +0200

> This should be easy to implement.

One way to look at it is that we want to compute an integral of a
tensor:

  A^K = \int a^K(x) dx

We need two functions, one to compute the integral

  A^K

and another to evaluate the integrand

  a^K(x)

The first one is called tabulate_tensor, but perhaps the two functions
should be named

  evaluate_integral
  evaluate_integrand

or

  compute_integral
  evalute_form

I'm not sure

  tabulate_tensor
  tabulate_integrand

is very logical, considering both functions return a tensor, not just
the first one.

-- 
Anders

---

From: Kent-Andre Mardal <[email-masked]>
Date: Mon, 18 Aug 2008 11:30:32 +0200

> is very logical, considering both functions return a tensor, not just

I think this is a nice extension. 

Just a thought:
We can evaluate forms at cells and facets. Why not include points as
well. Of course it would then affect the form compiler, so it might
not be worth the extra effort. 

Kent

---

From: Anders Logg <[email-masked]>
Date: Tue, 19 Aug 2008 18:59:05 +0200

> not be worth the extra effort. 

This might actually be a good idea, but let's hold that thought for a
while. We need to figure out how to do this (evaluating integrals on
cut meshes). Apparently, there has been some work on XFEM with UFC
which is very close to what we want to do. Maybe Mehdi can comment?

-- 
Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 19 Aug 2008 19:10:06 +0200

> which is very close to what we want to do. Maybe Mehdi can comment?

Concerning extending the finite element space with global functions,
that should more or less fit into UFC as it is, with some abuse of naming
and perhaps some loss of efficiency.

The dof_map for such a function space can simply return the local
dimension equal to the global dimension, and most other functions
can do similar things.

--
Martin

---

From: Anders Logg <[email-masked]>
Date: Tue, 19 Aug 2008 19:15:20 +0200

> dimension equal to the global dimension, and most other functions

Why do we need global functions to handle integrals over cut meshes?

-- 
Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 19 Aug 2008 19:36:23 +0200

> Why do we need global functions to handle integrals over cut meshes?

Sorry, no relation :)

I just thought that XFEM has something to do with global functions,
and Kent may need some global functions (global constant actually)
for some inverse problem application, so I thought about that once eariler.

--
Martin

---

From: Jed Brown <[email-masked]>
Date: Tue, 19 Aug 2008 19:51:20 +0200

> for some inverse problem application, so I thought about that once eariler.

The PETSc DMComposite object supports a ``redundant'' vector which is an
array that is ghosted on every processor, but owned by just one.  This
is where design parameters for LNKS PDE constrained optimization would go.
Of course, if it is a boundary control problem, then a boundary
subdomain would suffice.

Jed

---

From: Anders Logg <[email-masked]>
Date: Tue, 19 Aug 2008 19:53:57 +0200

> > Why do we need global functions to handle integrals over cut meshes?

Good. I thought I was confused. :-)

> for some inverse problem application, so I thought about that once eariler.

As far as I understand it, XFEM is about local enrichment of the
function space to handle discontinuities.

-- 
Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 19 Aug 2008 21:23:56 +0200

> Of course, if it is a boundary control problem, then a boundary

Right. If we want to support this in UFC (and I guess we do),
we should add "something" to make this distinction clear.
Something to think about.

--
Martin