How to get data structures necessary for assembly for the whole mesh?

Asked by Florian Rathgeber on 2010-05-20

Given a form, is it possible to get all the data structures necessary to assemble the system for all cells of the mesh at once (or at least a range of cells)?

Specifically, I would need the following for all cells of the mesh at once:
- shape functions on the reference element
- derivatives of shape functions on the reference element
- local-to-global mapping for vertex numbers
- coordinates of all vertices
- quadrature points
- quadrature weights

In my understanding, since the DOLFIN assembly loop uses the UFC interface, all the data is retrieved per cell. Is there any way to efficiently extract or construct these data structures without having to loop over all the cells? We want to do the assembly massively parallel (on the GPU) and hence eliminate the loop over the cells.

Access through the python interface (as a first step) would be the preferred if that is possible.

Any hints are highly appreciated,
Florian

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
2010-05-20
Last reply:
2010-05-20
Anders Logg (logg) said : #1

On Thu, May 20, 2010 at 11:47:02AM -0000, Florian Rathgeber wrote:
> New question #111705 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/111705
>
> Given a form, is it possible to get all the data structures necessary to assemble the system for all cells of the mesh at once (or at least a range of cells)?
>
> Specifically, I would need the following for all cells of the mesh at once:
> - shape functions on the reference element
> - derivatives of shape functions on the reference element
> - local-to-global mapping for vertex numbers
> - coordinates of all vertices
> - quadrature points
> - quadrature weights
>
> In my understanding, since the DOLFIN assembly loop uses the UFC interface, all the data is retrieved per cell. Is there any way to efficiently extract or construct these data structures without having to loop over all the cells? We want to do the assembly massively parallel (on the GPU) and hence eliminate the loop over the cells.
>
> Access through the python interface (as a first step) would be the preferred if that is possible.
>
> Any hints are highly appreciated,
> Florian

Do you really need the shape functions? Is it not enough to work
through the UFC interface?

Take a look at the assembly loop in Assembler.cpp. There you will see
how to get the local-to-global mapping, vertex coordinates etc.

--
Anders

The problem is that I get the data only cell-wise through the UFC interface, if I'm not mistaken. I'm looking for a way to get it for a range of cells or even the whole mesh. But I guess that is not efficiently possible and I have to loop over all the cells. If there is a way I'd be happy to learn about it.

Anders Logg (logg) said : #3

On Thu, May 20, 2010 at 01:33:28PM -0000, Florian Rathgeber wrote:
> Question #111705 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/111705
>
> Status: Answered => Open
>
> Florian Rathgeber is still having a problem:
> The problem is that I get the data only cell-wise through the UFC
> interface, if I'm not mistaken. I'm looking for a way to get it for a
> range of cells or even the whole mesh. But I guess that is not
> efficiently possible and I have to loop over all the cells. If there is
> a way I'd be happy to learn about it.

There is no way to get the data (at least not quadrature points etc)
other than cell by cell. Then you would need to modify the form
compiler code to generate different code (which is also a possibility).

--
Anders

Can you help with this problem?

Provide an answer of your own, or ask Florian Rathgeber for more information if necessary.

To post a message you must log in.