petsc-3.7.7 2017-09-25
Report Typos and Errors

# DMLocatePoints

Locate the points in v in the mesh and return a PetscSF of the containing cells

### Synopsis

    #include "petscdm.h"
    #include "petscdmlabel.h"
    PetscErrorCode DMLocatePoints(DM dm, Vec v, PetscSF *cellSF)

Collective on Vec v (see explanation below)

### Input Parameters

| dm | - The DM
| v | - The Vec of points
| cells | - Points to either NULL, or a PetscSF with guesses for which cells contain each point.

### Output Parameter

cells -The PetscSF containing the ranks and local indices of the containing points.

To do a search of the local cells of the mesh, v should have PETSC_COMM_SELF as its communicator.

To do a search of all the cells in the distributed mesh, v should have the same communicator as dm.

If *cellSF is NULL on input, a PetscSF will be created.

If *cellSF is not NULL on input, it should point to an existing PetscSF, whose graph will be used as initial guesses.

An array that maps each point to its containing cell can be obtained with

const PetscSFNode *cells; PetscInt nFound; const PetscSFNode *found;

PetscSFGetGraph(cells,NULL,&nFound,&found,&cells);

Where cells[i].rank is the rank of the cell containing point found[i] (or i if found == NULL), and cells[i].index is the index of the cell in its rank's local numbering.

### Keywords

point location, mesh

### See Also

DMSetCoordinates(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal()

Level:developer
Location:src/dm/interface/dm.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages