:orphan:
# DMPlexLandauAddMaxwellians
Add a Maxwellian distribution to a state
## Synopsis
```
#include "petscdmplex.h"
#include "petsclandau.h"
PetscErrorCode DMPlexLandauAddMaxwellians(DM dm, Vec X, PetscReal time, PetscReal temps[], PetscReal ns[], PetscInt grid, PetscInt b_id, PetscInt n_batch, void *actx)
```
Collective
## Input Parameters
. dm - The mesh (local)
+ time - Current time
- temps - Temperatures of each species (global)
. ns - Number density of each species (global)
- grid - index into current grid - just used for offset into temp and ns
. b_id - batch index
- n_batch - number of batches
+ actx - Landau context
## Output Parameter
. X - The state (local to this grid)
.keywords: mesh
## See Also
`DMPlexLandauCreateVelocitySpace()`
## Level
beginner
## Location
src/ts/utils/dmplexlandau/plexland.c
## Examples
src/ts/utils/dmplexlandau/tutorials/ex2.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/utils/dmplexlandau/plexland.c)
[Index of all LANDAU routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)