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.DMNetworkAddComponent — Method
DMNetworkAddComponent(petsclib::PetscLibType, dm::AbstractPetscDM, p::PetscInt, componentkey::PetscInt, compvalue::Ptr{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

See also: DM, DMNETWORK, DMNetworkGetComponent(), DMNetworkGetSubnetwork(), DMNetworkIsGhostVertex(), DMNetworkLayoutSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkAddSharedVertices — Method
DMNetworkAddSharedVertices(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkAddSubnetwork(), DMNetworkGetSharedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkAddSubnetwork — Method
netnum::PetscInt = DMNetworkAddSubnetwork(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkSetNumSubnetworks()

External Links

source
PETSc.LibPETSc.DMNetworkCreate — Method
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

See also: DMCreate()

External Links

source
PETSc.LibPETSc.DMNetworkCreateIS — Method
is::IS = DMNetworkCreateIS(petsclib::PetscLibType, dm::AbstractPetscDM, numkeys::PetscInt, keys::Vector{PetscInt}, blocksize::Vector{PetscInt}, nselectedvar::Vector{PetscInt}, selectedvar::Union{Ptr, AbstractArray{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

See also: DM, DMNETWORK, DMNetworkCreate(), ISCreateGeneral(), DMNetworkCreateLocalIS()

External Links

source
PETSc.LibPETSc.DMNetworkCreateLocalIS — Method
is::IS = DMNetworkCreateLocalIS(petsclib::PetscLibType, dm::AbstractPetscDM, numkeys::PetscInt, keys::Vector{PetscInt}, blocksize::Vector{PetscInt}, nselectedvar::Vector{PetscInt}, selectedvar::Union{Ptr, AbstractArray{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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkCreateIS(), ISCreateGeneral()

External Links

source
PETSc.LibPETSc.DMNetworkDistribute — Method
DMNetworkDistribute(petsclib::PetscLibType, dm::AbstractPetscDM, 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 dir - 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

See also: DM, DMNETWORK, DMNetworkCreate()

External Links

source
PETSc.LibPETSc.DMNetworkEdgeSetMatrix — Method
DMNetworkEdgeSetMatrix(petsclib::PetscLibType, dm::AbstractPetscDM, p::PetscInt, J::Vector{<:AbstractPetscMat})

Sets user-provided Jacobian matrices for this edge to the network

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

See also: DM, DMNETWORK, DMNetworkVertexSetMatrix()

External Links

source
PETSc.LibPETSc.DMNetworkFinalizeComponents — Method
DMNetworkFinalizeComponents(petsclib::PetscLibType, dm::AbstractPetscDM)

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

See also: DM, DMNETWORK, DMNetworkAddComponent(), DMNetworkRegisterComponent(), DMSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkGetComponent — Method
compkey::PetscInt,component::Ptr{Cvoid},nvar::PetscInt = DMNetworkGetComponent(petsclib::PetscLibType, dm::AbstractPetscDM, p::PetscInt, compnum::PetscInt)

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

See also: DM, DMNETWORK, DMNetworkAddComponent(), DMNetworkGetNumComponents()

External Links

source
PETSc.LibPETSc.DMNetworkGetConnectedVertices — Method
vertices::Vector{PetscInt} = DMNetworkGetConnectedVertices(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetSupportingEdges()

External Links

source
PETSc.LibPETSc.DMNetworkGetEdgeOffset — Method
offset::PetscInt = DMNetworkGetEdgeOffset(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetLocalVecOffset(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMNetworkGetEdgeRange — Method
eStart::PetscInt,eEnd::PetscInt = DMNetworkGetEdgeRange(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the bounds [start, end) (also sometimes called the chart) 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

See also: DM, DMNETWORK, DMNetworkGetVertexRange(), DMNetworkGetSubnetwork()

External Links

source
PETSc.LibPETSc.DMNetworkGetGlobalEdgeIndex — Method
index::PetscInt = DMNetworkGetGlobalEdgeIndex(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetGlobalVertexIndex()

External Links

source
PETSc.LibPETSc.DMNetworkGetGlobalVecOffset — Method
offsetg::PetscInt = DMNetworkGetGlobalVecOffset(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetLocalVecOffset(), DMGetGlobalVector(), DMNetworkGetComponent(), DMCreateGlobalVector(), VecGetArray(), VecSetValues(), MatSetValues()

External Links

source
PETSc.LibPETSc.DMNetworkGetGlobalVertexIndex — Method
index::PetscInt = DMNetworkGetGlobalVertexIndex(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetGlobalEdgeIndex(), DMNetworkGetLocalVertexIndex()

External Links

source
PETSc.LibPETSc.DMNetworkGetLocalVecOffset — Method
offset::PetscInt = DMNetworkGetLocalVecOffset(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMGetLocalVector(), DMNetworkGetComponent(), DMNetworkGetGlobalVecOffset(), DMCreateGlobalVector(), VecGetArray(), VecSetValuesLocal(), MatSetValuesLocal()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumComponents — Method
numcomponents::PetscInt = DMNetworkGetNumComponents(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkRegisterComponent(), DMNetworkAddComponent()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumEdges — Method
nEdges::PetscInt,M_NEdges::PetscInt = DMNetworkGetNumEdges(petsclib::PetscLibType, dm::AbstractPetscDM)

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

See also: DM, DMNETWORK, DMNetworkGetNumVertices()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumSubNetworks — Method
nsubnet::PetscInt,M_Nsubnet::PetscInt = DMNetworkGetNumSubNetworks(petsclib::PetscLibType, dm::AbstractPetscDM)

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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkSetNumSubNetworks()

External Links

source
PETSc.LibPETSc.DMNetworkGetNumVertices — Method
nVertices::PetscInt,M_NVertices::PetscInt = DMNetworkGetNumVertices(petsclib::PetscLibType, dm::AbstractPetscDM)

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

See also: DM, DMNETWORK, DMNetworkGetNumEdges()

External Links

source
PETSc.LibPETSc.DMNetworkGetPlex — Method
plexdm::PetscDM = DMNetworkGetPlex(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the DMPLEX associated with this DMNETWORK

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Output Parameter:

  • plexdm - the DMPLEX object

Level: advanced

See also: DM, DMNETWORK, DMPLEX, DMNetworkCreate()

External Links

source
PETSc.LibPETSc.DMNetworkGetSharedVertices — Method
nsv::PetscInt,svtx::Vector{PetscInt} = DMNetworkGetSharedVertices(petsclib::PetscLibType, dm::AbstractPetscDM)

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

See also: DM, DMNETWORK, DMNetworkGetSubnetwork(), DMNetworkLayoutSetUp(), DMNetworkAddSharedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkGetSubnetwork — Method
nv::PetscInt,ne::PetscInt,vtx::Vector{PetscInt},edge::Vector{PetscInt} = DMNetworkGetSubnetwork(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkAddSubnetwork(), DMNetworkLayoutSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkGetSupportingEdges — Method
nedges::PetscInt,edges::Vector{PetscInt} = DMNetworkGetSupportingEdges(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetConnectedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkGetVertexLocalToGlobalOrdering — Method
vg::PetscInt = DMNetworkGetVertexLocalToGlobalOrdering(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkSetVertexLocalToGlobalOrdering()

External Links

source
PETSc.LibPETSc.DMNetworkGetVertexOffset — Method
offset::PetscInt = DMNetworkGetVertexOffset(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetEdgeOffset(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMNetworkGetVertexRange — Method
vStart::PetscInt,vEnd::PetscInt = DMNetworkGetVertexRange(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the bounds [start, end) (also sometimes called the chart) 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

See also: DM, DMNETWORK, DMNetworkGetEdgeRange(), DMNetworkGetSubnetwork()

External Links

source
PETSc.LibPETSc.DMNetworkHasJacobian — Method
DMNetworkHasJacobian(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DMNetworkSetOption()

External Links

source
PETSc.LibPETSc.DMNetworkIsGhostVertex — Method
isghost::PetscBool = DMNetworkIsGhostVertex(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetConnectedVertices(), DMNetworkGetVertexRange(), DMNetworkIsSharedVertex()

External Links

source
PETSc.LibPETSc.DMNetworkIsSharedVertex — Method
flag::PetscBool = DMNetworkIsSharedVertex(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkAddSharedVertices(), DMNetworkIsGhostVertex()

External Links

source
PETSc.LibPETSc.DMNetworkLayoutSetUp — Method
DMNetworkLayoutSetUp(petsclib::PetscLibType, dm::AbstractPetscDM)

Sets up the bare layout (graph) for the network

Not Collective

Input Parameter:

  • dm - the DMNETWORK object

Level: beginner

See also: DM, DMNETWORK, DMNetworkSetNumSubNetworks(), DMNetworkAddSubnetwork()

External Links

source
PETSc.LibPETSc.DMNetworkRegisterComponent — Method
key::PetscInt = DMNetworkRegisterComponent(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkLayoutSetUp()

External Links

source
PETSc.LibPETSc.DMNetworkSetNumSubNetworks — Method
DMNetworkSetNumSubNetworks(petsclib::PetscLibType, dm::AbstractPetscDM, nsubnet::PetscInt, M_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

See also: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetNumSubNetworks()

External Links

source
PETSc.LibPETSc.DMNetworkSharedVertexGetInfo — Method
gidx::PetscInt,n::PetscInt,sv::Vector{PetscInt} = DMNetworkSharedVertexGetInfo(petsclib::PetscLibType, dm::AbstractPetscDM, 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

See also: DM, DMNETWORK, DMNetworkGetSharedVertices()

External Links

source
PETSc.LibPETSc.DMNetworkVertexSetMatrix — Method
DMNetworkVertexSetMatrix(petsclib::PetscLibType, dm::AbstractPetscDM, p::PetscInt, J::Vector{<:AbstractPetscMat})

Sets user-provided Jacobian matrix for this vertex to the network

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

See also: DM, DMNETWORK, DMNetworkEdgeSetMatrix()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowGlobal — Method
DMNetworkViewSetShowGlobal(petsclib::PetscLibType, dm::AbstractPetscDM, showglobal::PetscBool)

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

See also: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowNumbering — Method
DMNetworkViewSetShowNumbering(petsclib::PetscLibType, dm::AbstractPetscDM, shownumbering::PetscBool)

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

See also: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowRanks — Method
DMNetworkViewSetShowRanks(petsclib::PetscLibType, dm::AbstractPetscDM, showranks::PetscBool)

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

See also: DM, DMNETWORK, DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetShowVertices — Method
DMNetworkViewSetShowVertices(petsclib::PetscLibType, dm::AbstractPetscDM, showvertices::PetscBool)

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

See also: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()

External Links

source
PETSc.LibPETSc.DMNetworkViewSetViewRanks — Method
DMNetworkViewSetViewRanks(petsclib::PetscLibType, dm::AbstractPetscDM, viewranks::AbstractIS)

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

See also: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering()

External Links

source