# PetscDSSetRiemannSolver
Sets the Riemann solver for the given field 
## Synopsis
```
#include "petscds.h" 
PetscErrorCode PetscDSSetRiemannSolver(PetscDS ds, PetscInt f, void (*r)(PetscInt dim, PetscInt Nf, const PetscReal x[], const PetscReal n[], const PetscScalar uL[], const PetscScalar uR[], PetscInt numConstants, const PetscScalar constants[], PetscScalar flux[], void *ctx))
```
Not collective


## Input Parameters

- ***ds -*** The `PetscDS` object
- ***f  -*** The field number
- ***r  -*** Riemann solver



## Calling sequence for r
```none
   r(PetscInt dim, PetscInt Nf, const PetscReal x[], const PetscReal n[], const PetscScalar uL[], const PetscScalar uR[], PetscScalar flux[], void *ctx)
```


- ***dim  -*** The spatial dimension
- ***Nf   -*** The number of fields
- ***x    -*** The coordinates at a point on the interface
- ***n    -*** The normal vector to the interface
- ***uL   -*** The state vector to the left of the interface
- ***uR   -*** The state vector to the right of the interface
- ***flux -*** output array of flux through the interface
- ***numConstants -*** number of constant parameters
- ***constants -*** constant parameters
- ***ctx  -*** optional user context





## See Also
 `PetscDS`, `PetscDSGetRiemannSolver()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/interface/dtds.c.html#PetscDSSetRiemannSolver">src/dm/dt/interface/dtds.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex18.c.html">src/ts/tutorials/ex18.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/dt/interface/dtds.c)


[Index of all DT routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
