DMNetwork (Network/Graph Problems)

DMNetwork manages network and graph-based problems, such as power grids, transportation networks, and general graph computations with edge and vertex data.

Overview

DMNetwork provides:

  • Network topology with edges and vertices
  • Component registration for edges and vertices
  • Coupling of network problems with other DM types
  • Distribution across MPI processes
  • Support for algebraic constraints at vertices

Basic Usage Pattern

using PETSc, MPI

# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)

# Create a DMNetwork (returns a PetscDM)
network = LibPETSc.DMNetworkCreate(petsclib, MPI.COMM_WORLD)

# Set network sizes
# For simple examples, provide a name and an explicit edge list vector
nedges = 2
nvertices = 3
LibPETSc.DMNetworkSetNumSubNetworks(petsclib, network, 1, 1)
edgelist = [1, 2, 2, 3]  # pairs of vertex global indices
LibPETSc.DMNetworkAddSubnetwork(petsclib, network, "main", nedges, edgelist)

# Register components (size in bytes; use appropriate struct size in real examples)
# Register a component; the function returns a component key (PetscInt)
compkey = LibPETSc.DMNetworkRegisterComponent(petsclib, network, "bus", Csize_t(0))

# Add components to vertices/edges using DMNetworkAddComponent (omitted here)

# Finalize network and set up
LibPETSc.DMNetworkLayoutSetUp(petsclib, network)
LibPETSc.DMSetUp(petsclib, network)

# Create vectors
x = LibPETSc.DMCreateGlobalVector(petsclib, network)

# Cleanup
LibPETSc.VecDestroy(petsclib, x)
LibPETSc.DMDestroy(petsclib, network)

# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()

DMNetwork Functions

PETSc.LibPETSc.DMNetworkAddComponentMethod
DMNetworkAddComponent(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, componentkey::PetscInt, compvalue::Cvoid, nvar::PetscInt)

Adds a network component and number of variables at the given point (vertex/edge)

Collective

Input Parameters:

  • dm - the DMNetwork
  • p - the vertex/edge point. These points are local indices provided by DMNetworkGetSubnetwork()
  • componentkey - component key returned while registering the component with DMNetworkRegisterComponent()
  • compvalue - pointer to the data structure for the component, or NULL if the component does not require data, this data is not copied so you cannot

free this space until after DMSetUp() is called.

  • nvar - number of variables for the component at the vertex/edge point, zero if the component does not introduce any degrees of freedom at the point

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkGetComponent(), DMNetworkGetSubnetwork(), DMNetworkIsGhostVertex(), DMNetworkLayoutSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkAddSharedVerticesMethod
DMNetworkAddSharedVertices(petsclib::PetscLibType,dm::PetscDM, anetnum::PetscInt, bnetnum::PetscInt, nsvtx::PetscInt, asvtx::Vector{PetscInt}, bsvtx::Vector{PetscInt})

Add shared vertices that connect two given subnetworks

Collective

Input Parameters:

  • dm - the DMNETWORK object
  • anetnum - first subnetwork global numbering returned by DMNetworkAddSubnetwork()
  • bnetnum - second subnetwork global numbering returned by DMNetworkAddSubnetwork()
  • nsvtx - number of vertices that are shared by the two subnetworks
  • asvtx - vertex index in the first subnetwork
  • bsvtx - vertex index in the second subnetwork

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkAddSubnetwork(), DMNetworkGetSharedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkAddSubnetworkMethod
netnum::PetscInt = DMNetworkAddSubnetwork(petsclib::PetscLibType,dm::PetscDM, name::String, ne::PetscInt, edgelist::Vector{PetscInt})

Add a subnetwork

Collective

Input Parameters:

  • dm - the DMNETWORK object
  • name - name of the subnetwork
  • ne - number of local edges of this subnetwork
  • edgelist - list of edges for this subnetwork, this is a one dimensional array with pairs of entries being the two vertices (in global numbering

of the vertices) of each edge: [first vertex of first edge, second vertex of first edge, first vertex of second edge, second vertex of second edge, etc.]

Output Parameter:

  • netnum - global index of the subnetwork

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkSetNumSubnetworks()

External Links

source
PETSc.LibPETSc.DMNetworkCreateMethod
network::PetscDM = DMNetworkCreate(petsclib::PetscLibType,comm::MPI_Comm)

Creates a DMNetwork object, which encapsulates an unstructured network.

Collective

Input Parameter:

  • comm - The communicator for the DMNetwork object

Output Parameter:

  • network - The DMNetwork object

Level: beginner

-seealso: DMCreate()

External Links

source
PETSc.LibPETSc.DMNetworkCreateISMethod
is::IS = DMNetworkCreateIS(petsclib::PetscLibType,dm::PetscDM, numkeys::PetscInt, keys::Vector{PetscInt}, blocksize::Vector{PetscInt}, nselectedvar::Vector{PetscInt}, selectedvar::Vector{PetscInt})

Create an index set object from the global vector of the network

Collective

Input Parameters:

  • dm - DMNETWORK object
  • numkeys - number of keys
  • keys - array of keys that define the components of the variables you wish to extract
  • blocksize - block size of the variables associated to the component
  • nselectedvar - number of variables in each block to select
  • selectedvar - the offset into the block of each variable in each block to select

Output Parameter:

  • is - the index set

Level: advanced

-seealso: DM, DMNETWORK, DMNetworkCreate(), ISCreateGeneral(), DMNetworkCreateLocalIS()

External Links

source
PETSc.LibPETSc.DMNetworkCreateLocalISMethod
is::IS = DMNetworkCreateLocalIS(petsclib::PetscLibType,dm::PetscDM, numkeys::PetscInt, keys::Vector{PetscInt}, blocksize::Vector{PetscInt}, nselectedvar::Vector{PetscInt}, selectedvar::Vector{PetscInt})

Create an index set object from the local vector of the network

Not Collective

Input Parameters:

  • dm - DMNETWORK object
  • numkeys - number of keys
  • keys - array of keys that define the components of the variables you wish to extract
  • blocksize - block size of the variables associated to the component
  • nselectedvar - number of variables in each block to select
  • selectedvar - the offset into the block of each variable in each block to select

Output Parameter:

  • is - the index set

Level: advanced

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkCreateIS(), ISCreateGeneral()

External Links

source
PETSc.LibPETSc.DMNetworkDistributeMethod
DMNetworkDistribute(petsclib::PetscLibType,dm::PetscDM, overlap::PetscInt)

Distributes the network and moves associated component data

Collective

Input Parameters:

  • dm - the DMNETWORK object
  • overlap - the overlap of partitions, 0 is the default

Options Database Keys:

  • -dmnetwork_view - Calls DMView() at the conclusion of DMSetUp()
  • -dmnetwork_view_distributed - Calls DMView() at the conclusion of DMNetworkDistribute()
  • -dmnetwork_view_tmpdir - Sets the temporary directory to use when viewing with the draw option
  • -dmnetwork_view_all_ranks - Displays all of the subnetworks for each MPI rank
  • -dmnetwork_view_rank_range - Displays the subnetworks for the ranks in a comma-separated list
  • -dmnetwork_view_no_vertices - Disables displaying the vertices in the network visualization
  • -dmnetwork_view_no_numbering - Disables displaying the numbering of edges and vertices in the network visualization

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkCreate()

External Links

source
PETSc.LibPETSc.DMNetworkEdgeSetMatrixMethod
DMNetworkEdgeSetMatrix(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, J::Vector{PetscMat})

Sets user

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the edge point
  • J - array (size = 3) of Jacobian submatrices for this edge point:

J[0]: this edge J[1] and J[2]: connected vertices, obtained by calling DMNetworkGetConnectedVertices()

Level: advanced

-seealso: DM, DMNETWORK, DMNetworkVertexSetMatrix()

External Links

source
PETSc.LibPETSc.DMNetworkFinalizeComponentsMethod
DMNetworkFinalizeComponents(petsclib::PetscLibType,dm::PetscDM)

Sets up internal data structures for the sections and components. It is called after registering new components and adding all components to the cloned network. After calling this subroutine, no new components can be added to the network.

Collective

Input Parameter:

  • dm - the DMNETWORK object

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkAddComponent(), DMNetworkRegisterComponent(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkGetComponentMethod
compkey::PetscInt,nvar::PetscInt = DMNetworkGetComponent(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, compnum::PetscInt, component::PeCtx)

Gets the component key, the component data, and the number of variables at a given network point

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - vertex/edge point
  • compnum - component number; use ALL_COMPONENTS if sum up all the components

Output Parameters:

  • compkey - the key obtained when registering the component (use NULL if not required)
  • component - the component data (use NULL if not required)
  • nvar - number of variables (use NULL if not required)

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkAddComponent(), DMNetworkGetNumComponents()

External Links

source
PETSc.LibPETSc.DMNetworkGetConnectedVerticesMethod
vertices::Vector{PetscInt} = DMNetworkGetConnectedVertices(petsclib::PetscLibType,dm::PetscDM, edge::PetscInt)

Return the connected vertices for this edge point

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • edge - the edge point

Output Parameter:

  • vertices - vertices connected to this edge

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetSupportingEdges()

External Links

source
PETSc.LibPETSc.DMNetworkGetEdgeOffsetMethod
offset::PetscInt = DMNetworkGetEdgeOffset(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Get the offset for accessing the variables associated with the given edge from the local subvector

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the edge point

Output Parameter:

  • offset - the offset

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetLocalVecOffset(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMNetworkGetEdgeRangeMethod
eStart::PetscInt,eEnd::PetscInt = DMNetworkGetEdgeRange(petsclib::PetscLibType,dm::PetscDM)

Get the bounds [start, end) for the local edges

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameters:

  • eStart - The first edge point, pass NULL if not needed
  • eEnd - One beyond the last edge point, pass NULL if not needed

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkGetVertexRange()

External Links

source
PETSc.LibPETSc.DMNetworkGetGlobalEdgeIndexMethod
index::PetscInt = DMNetworkGetGlobalEdgeIndex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Get the global numbering for the edge on the network

Not Collective

Input Parameters:

  • dm - DMNETWORK object
  • p - edge point

Output Parameter:

  • index - the global numbering for the edge

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetGlobalVertexIndex()

External Links

source
PETSc.LibPETSc.DMNetworkGetGlobalVecOffsetMethod
offsetg::PetscInt = DMNetworkGetGlobalVecOffset(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, compnum::PetscInt)

Get the global offset for accessing the variables associated with a component for the given vertex/edge from the global vector

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the edge or vertex point
  • compnum - component number; use ALL_COMPONENTS if no specific component is requested

Output Parameter:

  • offsetg - the global offset

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetLocalVecOffset(), DMGetGlobalVector(), DMNetworkGetComponent(), DMCreateGlobalVector(), VecGetArray(), VecSetValues(), MatSetValues()

External Links

source
PETSc.LibPETSc.DMNetworkGetGlobalVertexIndexMethod
index::PetscInt = DMNetworkGetGlobalVertexIndex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Get the global numbering for the vertex on the network

Not Collective

Input Parameters:

  • dm - DMNETWORK object
  • p - vertex point

Output Parameter:

  • index - the global numbering for the vertex

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetGlobalEdgeIndex(), DMNetworkGetLocalVertexIndex()

External Links

source
PETSc.LibPETSc.DMNetworkGetLocalVecOffsetMethod
offset::PetscInt = DMNetworkGetLocalVecOffset(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, compnum::PetscInt)

Get the offset for accessing the variables associated with a component at the given vertex/edge from the local vector

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the edge or vertex point
  • compnum - component number; use ALL_COMPONENTS if no specific component is requested

Output Parameter:

  • offset - the local offset

Level: intermediate

-seealso: DM, DMNETWORK, DMGetLocalVector(), DMNetworkGetComponent(), DMNetworkGetGlobalVecOffset(), DMCreateGlobalVector(), VecGetArray(), VecSetValuesLocal(), MatSetValuesLocal()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumComponentsMethod
numcomponents::PetscInt = DMNetworkGetNumComponents(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Get the number of components at a vertex/edge

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - vertex/edge point

Output Parameter:

  • numcomponents - Number of components at the vertex/edge

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkRegisterComponent(), DMNetworkAddComponent()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumEdgesMethod
nEdges::PetscInt,NEdges::PetscInt = DMNetworkGetNumEdges(petsclib::PetscLibType,dm::PetscDM)

Get the local and global number of edges for the entire network.

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameters:

  • nEdges - the local number of edges, pass NULL if not needed
  • NEdges - the global number of edges, pass NULL if not needed

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkGetNumVertices()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumSubNetworksMethod
nsubnet::PetscInt,Nsubnet::PetscInt = DMNetworkGetNumSubNetworks(petsclib::PetscLibType,dm::PetscDM)

Gets the number of subnetworks

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameters:

  • nsubnet - local number of subnetworks, pass NULL if not needed
  • Nsubnet - global number of subnetworks, pass NULL if not needed

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkSetNumSubNetworks()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumVerticesMethod
nVertices::PetscInt,NVertices::PetscInt = DMNetworkGetNumVertices(petsclib::PetscLibType,dm::PetscDM)

Get the local and global number of vertices for the entire network.

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameters:

  • nVertices - the local number of vertices, pass NULL if not needed
  • NVertices - the global number of vertices, pass NULL if not needed

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkGetNumEdges()

External Links

source
PETSc.LibPETSc.DMNetworkGetPlexMethod
DMNetworkGetPlex(petsclib::PetscLibType,dm::PetscDM, plexdm::PetscDM)

Gets the DMPLEX associated with this DMNETWORK

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • plexdm - the DMPLEX object

Level: advanced

-seealso: DM, DMNETWORK, DMPLEX, DMNetworkCreate()

External Links

source
PETSc.LibPETSc.DMNetworkGetSharedVerticesMethod
nsv::PetscInt,svtx::Vector{PetscInt} = DMNetworkGetSharedVertices(petsclib::PetscLibType,dm::PetscDM)

Returns the info for the shared vertices

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameters:

  • nsv - number of local shared vertices, pass NULL if not needed
  • svtx - local shared vertices, pass NULL if not needed

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetSubnetwork(), DMNetworkLayoutSetUp(), DMNetworkAddSharedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkGetSubnetworkMethod
nv::PetscInt,ne::PetscInt,vtx::Vector{PetscInt},edge::Vector{PetscInt} = DMNetworkGetSubnetwork(petsclib::PetscLibType,dm::PetscDM, netnum::PetscInt)

Returns the information about a requested subnetwork

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • netnum - the global index of the subnetwork

Output Parameters:

  • nv - number of vertices (local)
  • ne - number of edges (local)
  • vtx - local vertices of the subnetwork
  • edge - local edges of the subnetwork

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkAddSubnetwork(), DMNetworkLayoutSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkGetSupportingEdgesMethod
nedges::PetscInt,edges::Vector{PetscInt} = DMNetworkGetSupportingEdges(petsclib::PetscLibType,dm::PetscDM, vertex::PetscInt)

Return the supporting edges for this vertex point

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • vertex - the vertex point

Output Parameters:

  • nedges - number of edges connected to this vertex point
  • edges - list of edge points, pass NULL if not needed

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetConnectedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkGetVertexLocalToGlobalOrderingMethod
vg::PetscInt = DMNetworkGetVertexLocalToGlobalOrdering(petsclib::PetscLibType,dm::PetscDM, vloc::PetscInt)

Get vertex global index

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • vloc - local vertex ordering, start from 0

Output Parameter:

  • vg - global vertex ordering, start from 0

Level: advanced

-seealso: DM, DMNETWORK, DMNetworkSetVertexLocalToGlobalOrdering()

External Links

source
PETSc.LibPETSc.DMNetworkGetVertexOffsetMethod
offset::PetscInt = DMNetworkGetVertexOffset(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Get the offset for accessing the variables associated with the given vertex from the local subvector

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the vertex point

Output Parameter:

  • offset - the offset

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetEdgeOffset(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMNetworkGetVertexRangeMethod
vStart::PetscInt,vEnd::PetscInt = DMNetworkGetVertexRange(petsclib::PetscLibType,dm::PetscDM)

Get the bounds [start, end) for the local vertices

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameters:

  • vStart - the first vertex point, pass NULL if not needed
  • vEnd - one beyond the last vertex point, pass NULL if not needed

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkGetEdgeRange()

External Links

source
PETSc.LibPETSc.DMNetworkHasJacobianMethod
DMNetworkHasJacobian(petsclib::PetscLibType,dm::PetscDM, eflg::PetscBool, vflg::PetscBool)

Sets global flag for using user's sub Jacobian matrices – replaced by DMNetworkSetOption(network,userjacobian,PETSC_TRUE)?

Collective

Input Parameters:

  • dm - the DMNETWORK object
  • eflg - turn the option on (PETSC_TRUE) or off (PETSC_FALSE) if user provides Jacobian for edges
  • vflg - turn the option on (PETSC_TRUE) or off (PETSC_FALSE) if user provides Jacobian for vertices

Level: intermediate

-seealso: DMNetworkSetOption()

External Links

source
PETSc.LibPETSc.DMNetworkIsGhostVertexMethod
isghost::PetscBool = DMNetworkIsGhostVertex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Returns PETSC_TRUE if the vertex is a ghost vertex

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the vertex point

Output Parameter:

  • isghost - PETSC_TRUE if the vertex is a ghost point

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkGetConnectedVertices(), DMNetworkGetVertexRange(), DMNetworkIsSharedVertex()

External Links

source
PETSc.LibPETSc.DMNetworkIsSharedVertexMethod
flag::PetscBool = DMNetworkIsSharedVertex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)

Returns PETSC_TRUE if the vertex is shared by subnetworks

Not Collective

Input Parameters:

  • dm - the DMNETWORK object
  • p - the vertex point

Output Parameter:

  • flag - PETSC_TRUE if the vertex is shared by subnetworks

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkAddSharedVertices(), DMNetworkIsGhostVertex()

External Links

source
PETSc.LibPETSc.DMNetworkLayoutSetUpMethod
DMNetworkLayoutSetUp(petsclib::PetscLibType,dm::PetscDM)

Sets up the bare layout (graph) for the network

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkSetNumSubNetworks(), DMNetworkAddSubnetwork()

External Links

source
PETSc.LibPETSc.DMNetworkRegisterComponentMethod
key::PetscInt = DMNetworkRegisterComponent(petsclib::PetscLibType,dm::PetscDM, name::String, size::Csize_t)

Registers the network component

Logically Collective

Input Parameters:

  • dm - the DMNETWORK object
  • name - the component name
  • size - the storage size in bytes for this component data

Output Parameter:

  • key - an integer key that defines the component

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkLayoutSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkSetNumSubNetworksMethod
DMNetworkSetNumSubNetworks(petsclib::PetscLibType,dm::PetscDM, nsubnet::PetscInt, Nsubnet::PetscInt)

Sets the number of subnetworks

Collective

Input Parameters:

  • dm - the DMNETWORK object
  • nsubnet - local number of subnetworks
  • Nsubnet - global number of subnetworks

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetNumSubNetworks()

External Links

source
PETSc.LibPETSc.DMNetworkSharedVertexGetInfoMethod
gidx::PetscInt,n::PetscInt,sv::Vector{PetscInt} = DMNetworkSharedVertexGetInfo(petsclib::PetscLibType,dm::PetscDM, v::PetscInt)

Get info of a shared vertex struct, see petsc/private/dmnetworkimpl.h

Not Collective

Input Parameters:

  • dm - the DM object
  • v - vertex point

Output Parameters:

  • gidx - global number of this shared vertex in the internal dmplex, pass NULL if not needed
  • n - number of subnetworks that share this vertex, pass NULL if not needed
  • sv - array of size n: sv[2i,2i+1]=(net[i], idx[i]), i=0,...,n-1, pass NULL if not needed

Level: intermediate

-seealso: DM, DMNETWORK, DMNetworkGetSharedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkVertexSetMatrixMethod
DMNetworkVertexSetMatrix(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, J::Vector{PetscMat})

Sets user

Not Collective

Input Parameters:

  • dm - The DMNETWORK object
  • p - the vertex point
  • J - array of Jacobian (size = 2*(num of supporting edges) + 1) submatrices for this vertex point:

J[0]: this vertex J[1+2i]: i-th supporting edge J[1+2i+1]: i-th connected vertex

Level: advanced

-seealso: DM, DMNETWORK, DMNetworkEdgeSetMatrix()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowGlobalMethod
showglobal::PetscBool = DMNetworkViewSetShowGlobal(petsclib::PetscLibType,dm::PetscDM)

Set viewing the global network.

Logically Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • showglobal - PETSC_TRUE if viewing the global network

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowNumberingMethod
shownumbering::PetscBool = DMNetworkViewSetShowNumbering(petsclib::PetscLibType,dm::PetscDM)

Set displaying the numbering of edges and vertices in viewing routines.

Logically Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • shownumbering - PETSC_TRUE if displaying the numbering of edges and vertices

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowRanksMethod
showranks::PetscBool = DMNetworkViewSetShowRanks(petsclib::PetscLibType,dm::PetscDM)

Sets viewing the DMETNWORK on each rank individually.

Logically Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • showranks - PETSC_TRUE if viewing each rank's sub network individually

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowVerticesMethod
showvertices::PetscBool = DMNetworkViewSetShowVertices(petsclib::PetscLibType,dm::PetscDM)

Sets whether to display the vertices in viewing routines.

Logically Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • showvertices - PETSC_TRUE if visualizing the vertices

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetViewRanksMethod
DMNetworkViewSetViewRanks(petsclib::PetscLibType,dm::PetscDM, viewranks::IS)

View the DMNETWORK on each of the specified ranks individually.

Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • viewranks - set of ranks to view the DMNETWORK on individually

Level: beginner

-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering()

External Links

source