DMSwarmDataBucketGetDMSwarmDataFieldIdByName — PETSc 3.25.4 documentation

Skip to main content
`Ctrl`+`K`

# DMSwarmDataBucketGetDMSwarmDataFieldIdByName

Return the index of a `DMSwarmDataField` within a `DMSwarmDataBucket` given its name.

## Synopsis

    PetscErrorCode DMSwarmDataBucketGetDMSwarmDataFieldIdByName(DMSwarmDataBucket db, const char name[], PetscInt *idx)

Not Collective

## Input Parameters

- db - the `DMSwarmDataBucket`

- name - the field name

## Output Parameter

- idx - the index of the field within the bucket

## Note

Errors if no field with the given name is registered; use `DMSwarmDataBucketQueryDMSwarmDataFieldByName()` first when the name may be absent.

## See Also

`DMSwarmDataBucket`, `DMSwarmDataField`, `DMSwarmDataBucketGetDMSwarmDataFieldByName()`, `DMSwarmDataBucketQueryDMSwarmDataFieldByName()`

## Level

developer

## Location

src/dm/impls/swarm/data_bucket.c

Index of all DMSwarm routines
Table of Contents for all manual pages
Index of all manual pages