petsc-3.15.0 2021-03-30
Report Typos and Errors

# DMNetworkAddSubnetwork

Add a subnetwork

### Synopsis

    #include "petscdmnetwork.h"
    PetscErrorCode DMNetworkAddSubnetwork(DM dm,const char* name,PetscInt nv,PetscInt ne,PetscInt edgelist[],PetscInt *netnum)

Collective on dm

### Input Parameters

| dm | - the dm object
| name | - name of the subnetwork
| nv | - number of local vertices of this subnetwork
| ne | - number of local edges of this subnetwork
| edgelist | - list of edges for this subnetwork

### Output Parameters

| netnum | - global index of the subnetwork

### Notes

There is no copy involved in this operation, only the pointer is referenced. The edgelist should not be destroyed before the call to DMNetworkLayoutSetUp()

### Example usage

### Consider the following network

     network 1: v1 -> v2 -> v0

The resulting input edgelist = [1 2 | 2 0]

### See Also

DMNetworkCreate(), DMNetworkSetNumSubnetworks()

### Level

beginner

### Location

src/dm/impls/network/network.c
Index of all DMNetwork routines
Table of Contents for all manual pages
Index of all manual pages