:orphan:
# PCBDDCSetDiscreteGradient
Sets the discrete gradient to be used by the `PCBDDC` preconditioner 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCBDDCSetDiscreteGradient(PC pc, Mat G, PetscInt order, PetscInt field, PetscBool global, PetscBool conforming)
```
Collective


## Input Parameters

- ***pc         -*** the preconditioning context
- ***G          -*** the discrete gradient matrix (in `MATAIJ` format)
- ***order      -*** the order of the Nedelec space (1 for the lowest order)
- ***field      -*** the field id of the Nedelec dofs (not used if the fields have not been specified)
- ***global     -*** the type of global ordering for the rows of `G`
- ***conforming -*** whether the mesh is conforming or not





## Note
The discrete gradient matrix `G` is used to analyze the subdomain edges, and it should not contain any zero entry.
For variable order spaces, the order should be set to zero.
If `global` is `PETSC_TRUE`, the rows of `G` should be given in global ordering for the whole dofs;
if `PETSC_FALSE`, the ordering should be global for the Nedelec field.
In the latter case, it should hold gid[i] < gid[j] iff geid[i] < geid[j], with gid the global orderding for all the dofs
and geid the one for the Nedelec field.


## See Also
 `PCBDDC`, `PCBDDCSetDofsSplitting()`, `PCBDDCSetDofsSplittingLocal()`, `MATAIJ`, `PCBDDCSetDivergenceMat()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bddc/bddc.c.html#PCBDDCSetDiscreteGradient">src/ksp/pc/impls/bddc/bddc.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bddc/bddc.c.html#PCBDDCSetDiscreteGradient_BDDC">PCBDDCSetDiscreteGradient_BDDC in src/ksp/pc/impls/bddc/bddc.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/bddc/bddc.c)


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