On 06/12/16 11:39, Colin Cotter wrote:
Dear all, We are keen to do some adaptive mesh refinement in Firedrake, but probably don't need the full capabilities of Pragmatic, since we are just solving a time independent problem, computing an error bound and then refining where necessary (not coursening, and not rebalancing to start with). Does dmplex have any built in refinement operations that we can use?
Do you care about parallel? If so, you're out of luck right now, AFAICT. If not, then the following is plausibly a route: You can call DMRefine on a Plex. You get back a refined DM. How is the refinement chosen? One of three ways: - Regular refinement (midpoint bisection) - Refinement to a global cell volume tolerance - Refinement to a per-cell volume tolerance The last is probably what you would like. To do so you do: DMPlexSetRefinementFunction(dm, int (*refFunc)(double[], double*)) Where refFunc is a function of two arguments: PetscErrorCode refFunc(const PetscReal coords[], PetscReal *vol) It gets the coordinates of the centroid of the cell and returns the max allowed volume of the cell. So if you can mark the cells appropriately, I think maybe you could use that callback. Lawrence