← Back to team overview

dolfin team mailing list archive

Re: [Question #156272]: Computing numerical integral of a function on a cell

 

Question #156272 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/156272

    Status: Answered => Open

James Avery is still having a problem:
Hi Marie, thanks so much for your swift reply!

I'm not quite sure I understand, though: Once this bit of UFL is FFC'ed,
how do I then compute the cell integrals of the density from Dolfin/C++?

Just to make sure we're on the same page:

1. 'density' is a spatial scalar function given at runtime (I suppose the UFL data type would be Coefficient(mesh)?). 
2. For each cell, I need to evaluate the cell integral of 'density'. If there is more than a given amount in a cell, I mark it for subdivision. This proceeds iteratively until each cell contains no more than a given amount of density.

Now, in your above example, I understand that 'b' defines a vector of
length (number of cells), the entries being the cell integrals of
'density'.

1. This is UFL-code, which is compiled with FFC, is that correct? From the C++-program, how do I then execute the cell-integration and access the results?
2. How are the integrals calculated, then?
3. Can't I just get the quadrature points and quadrature weights in an easy way? Then the operation is essentially trivial.

I think I may still be harboring some confusion about how UFL/FFC and
Dolfin interoperate -- about what is done offf-line by FFC, and what can
be done on-line by Dolfin. I hope the confusion doesn't make it too
difficult to answer my question.

Thanks very much for your help!

Cheers, 
James

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



Follow ups