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::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 DMNetworkp- the vertex/edge point. These points are local indices provided byDMNetworkGetSubnetwork()componentkey- component key returned while registering the component withDMNetworkRegisterComponent()compvalue- pointer to the data structure for the component, orNULLif 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
- PETSc Manual:
DMNetwork/DMNetworkAddComponent
PETSc.LibPETSc.DMNetworkAddSharedVertices — Method
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- theDMNETWORKobjectanetnum- first subnetwork global numbering returned byDMNetworkAddSubnetwork()bnetnum- second subnetwork global numbering returned byDMNetworkAddSubnetwork()nsvtx- number of vertices that are shared by the two subnetworksasvtx- vertex index in the first subnetworkbsvtx- vertex index in the second subnetwork
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkAddSubnetwork(), DMNetworkGetSharedVertices()
External Links
- PETSc Manual:
DMNetwork/DMNetworkAddSharedVertices
PETSc.LibPETSc.DMNetworkAddSubnetwork — Method
netnum::PetscInt = DMNetworkAddSubnetwork(petsclib::PetscLibType,dm::PetscDM, name::String, ne::PetscInt, edgelist::Vector{PetscInt})Add a subnetwork
Collective
Input Parameters:
dm- theDMNETWORKobjectname- name of the subnetworkne- number of local edges of this subnetworkedgelist- 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
- PETSc Manual:
DMNetwork/DMNetworkAddSubnetwork
PETSc.LibPETSc.DMNetworkAssembleGraphStructures — Method
DMNetworkAssembleGraphStructures(petsclib::PetscLibType,dm::PetscDM)Assembles vertex and edge data structures. Must be called after DMNetworkDistribute()
Collective
Input Parameter:
dm- theDMNETWORKObject
Level: intermediate
-seealso: DMNetworkDistribute()
External Links
- PETSc Manual:
DMNetwork/DMNetworkAssembleGraphStructures
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
-seealso: DMCreate()
External Links
- PETSc Manual:
DMNetwork/DMNetworkCreate
PETSc.LibPETSc.DMNetworkCreateIS — Method
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-DMNETWORKobjectnumkeys- number of keyskeys- array of keys that define the components of the variables you wish to extractblocksize- block size of the variables associated to the componentnselectedvar- number of variables in each block to selectselectedvar- 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
- PETSc Manual:
DMNetwork/DMNetworkCreateIS
PETSc.LibPETSc.DMNetworkCreateLocalIS — Method
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-DMNETWORKobjectnumkeys- number of keyskeys- array of keys that define the components of the variables you wish to extractblocksize- block size of the variables associated to the componentnselectedvar- number of variables in each block to selectselectedvar- 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
- PETSc Manual:
DMNetwork/DMNetworkCreateLocalIS
PETSc.LibPETSc.DMNetworkDistribute — Method
DMNetworkDistribute(petsclib::PetscLibType,dm::PetscDM, overlap::PetscInt)Distributes the network and moves associated component data
Collective
Input Parameters:
dm- theDMNETWORKobjectoverlap- the overlap of partitions, 0 is the default
Options Database Keys:
-dmnetwork_view- CallsDMView()at the conclusion ofDMSetUp()-dmnetwork_view_distributed- CallsDMView()at the conclusion ofDMNetworkDistribute()-dmnetwork_view_tmpdir- Sets the temporary directory to use when viewing with thedrawoption-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
- PETSc Manual:
DMNetwork/DMNetworkDistribute
PETSc.LibPETSc.DMNetworkEdgeSetMatrix — Method
DMNetworkEdgeSetMatrix(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, J::Vector{PetscMat})Sets user
Not Collective
Input Parameters:
dm- theDMNETWORKobjectp- the edge pointJ- 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
- PETSc Manual:
DMNetwork/DMNetworkEdgeSetMatrix
PETSc.LibPETSc.DMNetworkFinalizeComponents — Method
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- theDMNETWORKobject
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkAddComponent(), DMNetworkRegisterComponent(), DMSetUp()
External Links
- PETSc Manual:
DMNetwork/DMNetworkFinalizeComponents
PETSc.LibPETSc.DMNetworkGetComponent — Method
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- theDMNETWORKobjectp- vertex/edge pointcompnum- component number; use ALL_COMPONENTS if sum up all the components
Output Parameters:
compkey- the key obtained when registering the component (useNULLif not required)component- the component data (useNULLif not required)nvar- number of variables (useNULLif not required)
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkAddComponent(), DMNetworkGetNumComponents()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetComponent
PETSc.LibPETSc.DMNetworkGetConnectedVertices — Method
vertices::Vector{PetscInt} = DMNetworkGetConnectedVertices(petsclib::PetscLibType,dm::PetscDM, edge::PetscInt)Return the connected vertices for this edge point
Not Collective
Input Parameters:
dm- theDMNETWORKobjectedge- the edge point
Output Parameter:
vertices- vertices connected to this edge
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetSupportingEdges()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetConnectedVertices
PETSc.LibPETSc.DMNetworkGetEdgeOffset — Method
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- theDMNETWORKobjectp- the edge point
Output Parameter:
offset- the offset
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkGetLocalVecOffset(), DMGetLocalVector()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetEdgeOffset
PETSc.LibPETSc.DMNetworkGetEdgeRange — Method
eStart::PetscInt,eEnd::PetscInt = DMNetworkGetEdgeRange(petsclib::PetscLibType,dm::PetscDM)Get the bounds [start, end) for the local edges
Not Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameters:
eStart- The first edge point, passNULLif not neededeEnd- One beyond the last edge point, passNULLif not needed
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkGetVertexRange()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetEdgeRange
PETSc.LibPETSc.DMNetworkGetGlobalEdgeIndex — Method
index::PetscInt = DMNetworkGetGlobalEdgeIndex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)Get the global numbering for the edge on the network
Not Collective
Input Parameters:
dm-DMNETWORKobjectp- edge point
Output Parameter:
index- the global numbering for the edge
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkGetGlobalVertexIndex()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetGlobalEdgeIndex
PETSc.LibPETSc.DMNetworkGetGlobalVecOffset — Method
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- theDMNETWORKobjectp- the edge or vertex pointcompnum- 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
- PETSc Manual:
DMNetwork/DMNetworkGetGlobalVecOffset
PETSc.LibPETSc.DMNetworkGetGlobalVertexIndex — Method
index::PetscInt = DMNetworkGetGlobalVertexIndex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)Get the global numbering for the vertex on the network
Not Collective
Input Parameters:
dm-DMNETWORKobjectp- vertex point
Output Parameter:
index- the global numbering for the vertex
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkGetGlobalEdgeIndex(), DMNetworkGetLocalVertexIndex()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetGlobalVertexIndex
PETSc.LibPETSc.DMNetworkGetLocalVecOffset — Method
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- theDMNETWORKobjectp- the edge or vertex pointcompnum- 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
- PETSc Manual:
DMNetwork/DMNetworkGetLocalVecOffset
PETSc.LibPETSc.DMNetworkGetNumComponents — Method
numcomponents::PetscInt = DMNetworkGetNumComponents(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)Get the number of components at a vertex/edge
Not Collective
Input Parameters:
dm- theDMNETWORKobjectp- vertex/edge point
Output Parameter:
numcomponents- Number of components at the vertex/edge
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkRegisterComponent(), DMNetworkAddComponent()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetNumComponents
PETSc.LibPETSc.DMNetworkGetNumEdges — Method
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- theDMNETWORKobject
Output Parameters:
nEdges- the local number of edges, passNULLif not neededNEdges- the global number of edges, passNULLif not needed
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkGetNumVertices()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetNumEdges
PETSc.LibPETSc.DMNetworkGetNumSubNetworks — Method
nsubnet::PetscInt,Nsubnet::PetscInt = DMNetworkGetNumSubNetworks(petsclib::PetscLibType,dm::PetscDM)Gets the number of subnetworks
Not Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameters:
nsubnet- local number of subnetworks, passNULLif not neededNsubnet- global number of subnetworks, passNULLif not needed
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkSetNumSubNetworks()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetNumSubNetworks
PETSc.LibPETSc.DMNetworkGetNumVertices — Method
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- theDMNETWORKobject
Output Parameters:
nVertices- the local number of vertices, passNULLif not neededNVertices- the global number of vertices, passNULLif not needed
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkGetNumEdges()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetNumVertices
PETSc.LibPETSc.DMNetworkGetPlex — Method
DMNetworkGetPlex(petsclib::PetscLibType,dm::PetscDM, plexdm::PetscDM)Gets the DMPLEX associated with this DMNETWORK
Not Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameter:
plexdm- theDMPLEXobject
Level: advanced
-seealso: DM, DMNETWORK, DMPLEX, DMNetworkCreate()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetPlex
PETSc.LibPETSc.DMNetworkGetSharedVertices — Method
nsv::PetscInt,svtx::Vector{PetscInt} = DMNetworkGetSharedVertices(petsclib::PetscLibType,dm::PetscDM)Returns the info for the shared vertices
Not Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameters:
nsv- number of local shared vertices, passNULLif not neededsvtx- local shared vertices, passNULLif not needed
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkGetSubnetwork(), DMNetworkLayoutSetUp(), DMNetworkAddSharedVertices()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetSharedVertices
PETSc.LibPETSc.DMNetworkGetSubnetwork — Method
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- theDMNETWORKobjectnetnum- the global index of the subnetwork
Output Parameters:
nv- number of vertices (local)ne- number of edges (local)vtx- local vertices of the subnetworkedge- local edges of the subnetwork
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkAddSubnetwork(), DMNetworkLayoutSetUp()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetSubnetwork
PETSc.LibPETSc.DMNetworkGetSupportingEdges — Method
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- theDMNETWORKobjectvertex- the vertex point
Output Parameters:
nedges- number of edges connected to this vertex pointedges- list of edge points, passNULLif not needed
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetConnectedVertices()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetSupportingEdges
PETSc.LibPETSc.DMNetworkGetVertexLocalToGlobalOrdering — Method
vg::PetscInt = DMNetworkGetVertexLocalToGlobalOrdering(petsclib::PetscLibType,dm::PetscDM, vloc::PetscInt)Get vertex global index
Not Collective
Input Parameters:
dm- theDMNETWORKobjectvloc- local vertex ordering, start from 0
Output Parameter:
vg- global vertex ordering, start from 0
Level: advanced
-seealso: DM, DMNETWORK, DMNetworkSetVertexLocalToGlobalOrdering()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetVertexLocalToGlobalOrdering
PETSc.LibPETSc.DMNetworkGetVertexOffset — Method
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- theDMNETWORKobjectp- the vertex point
Output Parameter:
offset- the offset
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkGetEdgeOffset(), DMGetLocalVector()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetVertexOffset
PETSc.LibPETSc.DMNetworkGetVertexRange — Method
vStart::PetscInt,vEnd::PetscInt = DMNetworkGetVertexRange(petsclib::PetscLibType,dm::PetscDM)Get the bounds [start, end) for the local vertices
Not Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameters:
vStart- the first vertex point, passNULLif not neededvEnd- one beyond the last vertex point, passNULLif not needed
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkGetEdgeRange()
External Links
- PETSc Manual:
DMNetwork/DMNetworkGetVertexRange
PETSc.LibPETSc.DMNetworkHasJacobian — Method
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- theDMNETWORKobjecteflg- turn the option on (PETSC_TRUE) or off (PETSC_FALSE) if user provides Jacobian for edgesvflg- turn the option on (PETSC_TRUE) or off (PETSC_FALSE) if user provides Jacobian for vertices
Level: intermediate
-seealso: DMNetworkSetOption()
External Links
- PETSc Manual:
DMNetwork/DMNetworkHasJacobian
PETSc.LibPETSc.DMNetworkIsGhostVertex — Method
isghost::PetscBool = DMNetworkIsGhostVertex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)Returns PETSC_TRUE if the vertex is a ghost vertex
Not Collective
Input Parameters:
dm- theDMNETWORKobjectp- the vertex point
Output Parameter:
isghost-PETSC_TRUEif the vertex is a ghost point
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkGetConnectedVertices(), DMNetworkGetVertexRange(), DMNetworkIsSharedVertex()
External Links
- PETSc Manual:
DMNetwork/DMNetworkIsGhostVertex
PETSc.LibPETSc.DMNetworkIsSharedVertex — Method
flag::PetscBool = DMNetworkIsSharedVertex(petsclib::PetscLibType,dm::PetscDM, p::PetscInt)Returns PETSC_TRUE if the vertex is shared by subnetworks
Not Collective
Input Parameters:
dm- theDMNETWORKobjectp- the vertex point
Output Parameter:
flag-PETSC_TRUEif the vertex is shared by subnetworks
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkAddSharedVertices(), DMNetworkIsGhostVertex()
External Links
- PETSc Manual:
DMNetwork/DMNetworkIsSharedVertex
PETSc.LibPETSc.DMNetworkLayoutSetUp — Method
DMNetworkLayoutSetUp(petsclib::PetscLibType,dm::PetscDM)Sets up the bare layout (graph) for the network
Not Collective
Input Parameter:
dm- theDMNETWORKobject
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkSetNumSubNetworks(), DMNetworkAddSubnetwork()
External Links
- PETSc Manual:
DMNetwork/DMNetworkLayoutSetUp
PETSc.LibPETSc.DMNetworkRegisterComponent — Method
key::PetscInt = DMNetworkRegisterComponent(petsclib::PetscLibType,dm::PetscDM, name::String, size::Csize_t)Registers the network component
Logically Collective
Input Parameters:
dm- theDMNETWORKobjectname- the component namesize- 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
- PETSc Manual:
DMNetwork/DMNetworkRegisterComponent
PETSc.LibPETSc.DMNetworkSetNumSubNetworks — Method
DMNetworkSetNumSubNetworks(petsclib::PetscLibType,dm::PetscDM, nsubnet::PetscInt, Nsubnet::PetscInt)Sets the number of subnetworks
Collective
Input Parameters:
dm- theDMNETWORKobjectnsubnet- local number of subnetworksNsubnet- global number of subnetworks
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkCreate(), DMNetworkGetNumSubNetworks()
External Links
- PETSc Manual:
DMNetwork/DMNetworkSetNumSubNetworks
PETSc.LibPETSc.DMNetworkSetVertexLocalToGlobalOrdering — Method
DMNetworkSetVertexLocalToGlobalOrdering(petsclib::PetscLibType,dm::PetscDM)Create and setup vertex local to global map
Collective
Input Parameters:
dm- theDMNETWORKobject
Level: advanced
-seealso: DM, DMNETWORK, DMNetworkGetGlobalVertexIndex()
External Links
- PETSc Manual:
DMNetwork/DMNetworkSetVertexLocalToGlobalOrdering
PETSc.LibPETSc.DMNetworkSharedVertexGetInfo — Method
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- theDMobjectv- vertex point
Output Parameters:
gidx- global number of this shared vertex in the internal dmplex, passNULLif not neededn- number of subnetworks that share this vertex, passNULLif not neededsv- array of sizen: sv[2i,2i+1]=(net[i], idx[i]), i=0,...,n-1, passNULLif not needed
Level: intermediate
-seealso: DM, DMNETWORK, DMNetworkGetSharedVertices()
External Links
- PETSc Manual:
DMNetwork/DMNetworkSharedVertexGetInfo
PETSc.LibPETSc.DMNetworkVertexSetMatrix — Method
DMNetworkVertexSetMatrix(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, J::Vector{PetscMat})Sets user
Not Collective
Input Parameters:
dm- TheDMNETWORKobjectp- the vertex pointJ- 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
- PETSc Manual:
DMNetwork/DMNetworkVertexSetMatrix
PETSc.LibPETSc.DMNetworkViewSetShowGlobal — Method
showglobal::PetscBool = DMNetworkViewSetShowGlobal(petsclib::PetscLibType,dm::PetscDM)Set viewing the global network.
Logically Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameter:
showglobal-PETSC_TRUEif viewing the global network
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()
External Links
- PETSc Manual:
DMNetwork/DMNetworkViewSetShowGlobal
PETSc.LibPETSc.DMNetworkViewSetShowNumbering — Method
shownumbering::PetscBool = DMNetworkViewSetShowNumbering(petsclib::PetscLibType,dm::PetscDM)Set displaying the numbering of edges and vertices in viewing routines.
Logically Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameter:
shownumbering-PETSC_TRUEif displaying the numbering of edges and vertices
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetViewRanks()
External Links
- PETSc Manual:
DMNetwork/DMNetworkViewSetShowNumbering
PETSc.LibPETSc.DMNetworkViewSetShowRanks — Method
showranks::PetscBool = DMNetworkViewSetShowRanks(petsclib::PetscLibType,dm::PetscDM)Sets viewing the DMETNWORK on each rank individually.
Logically Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameter:
showranks-PETSC_TRUEif viewing each rank's sub network individually
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()
External Links
- PETSc Manual:
DMNetwork/DMNetworkViewSetShowRanks
PETSc.LibPETSc.DMNetworkViewSetShowVertices — Method
showvertices::PetscBool = DMNetworkViewSetShowVertices(petsclib::PetscLibType,dm::PetscDM)Sets whether to display the vertices in viewing routines.
Logically Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameter:
showvertices-PETSC_TRUEif visualizing the vertices
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowNumbering(), DMNetworkViewSetViewRanks()
External Links
- PETSc Manual:
DMNetwork/DMNetworkViewSetShowVertices
PETSc.LibPETSc.DMNetworkViewSetViewRanks — Method
DMNetworkViewSetViewRanks(petsclib::PetscLibType,dm::PetscDM, viewranks::IS)View the DMNETWORK on each of the specified ranks individually.
Collective
Input Parameter:
dm- theDMNETWORKobject
Output Parameter:
viewranks- set of ranks to view theDMNETWORKon individually
Level: beginner
-seealso: DM, DMNETWORK, DMNetworkViewSetShowRanks(), DMNetworkViewSetShowGlobal(), DMNetworkViewSetShowVertices(), DMNetworkViewSetShowNumbering()
External Links
- PETSc Manual:
DMNetwork/DMNetworkViewSetViewRanks