Lucas:
> I suspect this is a simple task, but I can't find anything which does it
> outright. I'd like to find the local minima associated with some quantity
> derived from a finite element field. The features that I'm looking at are
> reasonably well-behaved, in that they're smooth except exactly at the minimum
> (where they're continuous but not differentiable), and of predictable size.
>
> For a uniform mesh I think a reasonable (naive) approach would be to calculate
> the derived quantity at the quadrature points of each cell, then go through
> each cell and check using the CellAccessor::neighbor() function (possibly in a
> recursive manner, until we reach some distance \delta x from the original
> cell) whether that cell contains the minimum of all its neighbors (or
> neighbors-of-neighbors or whatever). However, for an adaptively refined mesh,
> the cell returned by neighbor() might be further refined, in which case some
> of the child-cells border the original cell, and some do not. One related
> question is: how do I access just those child cells which border the original
> cell? What if those child cells also have children? And are there other
> complications of this sort which might arise from trying to iterate through
> neighbors of different refinement?
cell->neighbor_child_on_subface() is what you're looking for.
> As an additional complication, I'd like to be able to do this process on
> distributed meshes, and I suspect that the features may be cut up by the mesh
> partition given that there is a lot of refinement happening in those regions.
> Is there any way I can easily do some kind of point-to-point communications to
> check whether the local minimum has been split along a mesh partition?
>
> This seems like the kind of thing that is common enough to have already been
> implemented, probably in a more sophisticated way, but I'm not sure where to
> look. Any help is appreciated!
Unless computing the derived quantity is exceptionally expensive, I will
venture the guess that
* computing the derived quantity at all quadrature points of all locally owned
cells
* storing the quadrature point with the currently least value on the current
process
* comparing for the least value among processes
is fast enough. It's a relatively cheap O(N) operation, it should be vastly
faster than assembly or linear solver. It might not be worth optimizing it any
further.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/