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? Cheers Cjc -- http://www.imperial.ac.uk/people/colin.cotter www.cambridge.org/9781107663916
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
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?
Cheers Cjc
If you don't care about parallel (or can wait a couple more weeks), and you already have an error bound you can turn into a metric field, the current interface to pragmatic in petsc is very simple (and the install process works fine): https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DMPLEX/DMPlexAdapt.... PetscErrorCode DMPlexAdapt(DM dm, Vec metric, const char bdLabelName[], DM *dmAdapt) it simply takes your dmplex, your metric field and gives a new dmplex. Advantages are it is likely to be parallel soon, and if you plan on needing something more than refinement you won't have to change your code. I'm not even sure it's much slower than Matt Knepley's handmade refinement. Drawback is it's not hierarchical refinement if you need that for some reason. -- Nicolas -- Nicolas Barral Dept. of Earth Science and Engineering Imperial College London Royal School of Mines - Office 4.88 London SW7 2AZ
participants (3)
-
Colin Cotter
-
Lawrence Mitchell
-
Nicolas Barral