## Example 1: Electric Circuit

This example demonstrates simulation of a linear problem of electric circuit using the DMNetwork interface. Further details:

DO THE FOLLOWING:

• Compile ex1.c
```            cd petsc/src/ksp/ksp/tutorials/network
make ex1
```
• Run a 1 processor example and view solution at edges and vertices
```            mpiexec -n 1 ./ex1
```
• Run a 1 processor example with a convergence reason
```            mpiexec -n 1 ./ex1 -ksp_converged_reason
```
• Run with 2 processors with a partitioning option
```            mpiexec -n 2 ./ex1  -petscpartitioner_type simple
```

## Example 2: AC Power Flow

This example demonstrates simulation of a nonlinear power flow in a grid network using the DMNetwork interface. Further details:

DO THE FOLLOWING:

• Compile power.c
```            cd petsc/src/snes/tutorials/network/power
make power
```
• Run a 1 processor example and view solution at vertices
```            mpiexec -n 1 ./power
```
• Run with 2 processors with edge and vertex visualization
```            mpiexec -n 2 ./power  -dm_view
```

## Example 3: Water Flow in pipes

This example demonstrates simulation of a transient water flow in a pipe network using the DMNetwork interface. Further details:

DO THE FOLLOWING:

• Compile pipes1.c
```            cd petsc/src/ts/tutorials/network/wash
make  pipes1
```
• Run with 2 processors with a partitioning option
```            mpiexec -n 2 ./pipes1 -ts_monitor -case 1 -ts_max_steps 1 -petscpartitioner_type
simple -options_left no -viewX
```
• Run with 3 processors with a different case and more time-stepping options
```            mpiexec -n 3 ./pipes1  -ts_monitor -case 2 -ts_max_steps 10 -petscpartitioner_type
simple -options_left no -viewX
```