1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
<center><a href="https://gitlab.com/petsc/petsc/-/blob/966382dc56242773704ef5f5cee7aa2db3ebc577/include/petscmatcoarsen.h">Actual source code: petscmatcoarsen.h</a></center><br>
<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.6">
<meta name="date" content="2025-04-30T18:14:50+00:00">
</head>
<body bgcolor="#FFFFFF">
<pre width=80>
<a name="line1"> 1: </a><font color="#A020F0">#pragma once</font>
<a name="line3"> 3: </a>#include <A href="../include/petscmat.h.html"><petscmat.h></A>
<a name="line5"> 5: </a><font color="#B22222">/* SUBMANSEC = <a href="../manualpages/Mat/Mat.html">Mat</a> */</font>
<a name="line7"> 7: </a>PETSC_EXTERN <a href="../manualpages/Sys/PetscFunctionList.html">PetscFunctionList</a> MatCoarsenList;
<a name="line9"> 9: </a><font color="#B22222">/*S</font>
<a name="line10"> 10: </a><font color="#B22222"> <a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a> - Object for managing the coarsening of a graph (symmetric matrix)</font>
<a name="line12"> 12: </a><font color="#B22222"> Level: advanced</font>
<a name="line14"> 14: </a><font color="#B22222"> Note:</font>
<a name="line15"> 15: </a><font color="#B22222"> This is used by the `<a href="../manualpages/PC/PCGAMG.html">PCGAMG</a>` to generate coarser representations of an algebraic problem</font>
<a name="line17"> 17: </a><font color="#B22222">.seealso: [](ch_matrices), [](sec_graph), `<a href="../manualpages/Mat/Mat.html">Mat</a>`, `<a href="../manualpages/MatGraphOperations/MatCoarsenCreate.html">MatCoarsenCreate</a>()`, `<a href="../manualpages/Mat/MatCoarsenType.html">MatCoarsenType</a>`, `<a href="../manualpages/Mat/MatColoringType.html">MatColoringType</a>`, `<a href="../manualpages/Mat/MatPartitioningType.html">MatPartitioningType</a>`, `<a href="../manualpages/Mat/MatOrderingType.html">MatOrderingType</a>`</font>
<a name="line18"> 18: </a><font color="#B22222"> `<a href="../manualpages/Mat/MatColoring.html">MatColoring</a>`, `<a href="../manualpages/Mat/MatPartitioning.html">MatPartitioning</a>`</font>
<a name="line19"> 19: </a><font color="#B22222">S*/</font>
<a name="line20"> 20: </a><font color="#4169E1">typedef struct _p_MatCoarsen *<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>;</font>
<a name="line22"> 22: </a><font color="#B22222">/*J</font>
<a name="line23"> 23: </a><font color="#B22222"> <a href="../manualpages/Mat/MatCoarsenType.html">MatCoarsenType</a> - String with the name of a PETSc matrix coarsening algorithm</font>
<a name="line25"> 25: </a><font color="#B22222"> Level: beginner</font>
<a name="line27"> 27: </a><font color="#B22222">.seealso: [](ch_matrices), [](sec_graph), `<a href="../manualpages/Mat/Mat.html">Mat</a>`, `<a href="../manualpages/MatGraphOperations/MatCoarsenCreate.html">MatCoarsenCreate</a>()`, `<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>`, `<a href="../manualpages/Mat/MatColoringType.html">MatColoringType</a>`, `<a href="../manualpages/Mat/MatPartitioningType.html">MatPartitioningType</a>`, `<a href="../manualpages/Mat/MatOrderingType.html">MatOrderingType</a>`</font>
<a name="line28"> 28: </a><font color="#B22222">J*/</font>
<a name="line29"> 29: </a><font color="#4169E1">typedef const char *<a href="../manualpages/Mat/MatCoarsenType.html">MatCoarsenType</a>;</font>
<a name="line30"> 30: </a><strong><font color="#228B22">#define <a href="../manualpages/MatGraphOperations/MATCOARSENMIS.html">MATCOARSENMIS</a> </font><font color="#666666">"mis"</font><font color="#228B22"></font></strong>
<a name="line31"> 31: </a><strong><font color="#228B22">#define <a href="../manualpages/MatGraphOperations/MATCOARSENHEM.html">MATCOARSENHEM</a> </font><font color="#666666">"hem"</font><font color="#228B22"></font></strong>
<a name="line32"> 32: </a><strong><font color="#228B22">#define <a href="../manualpages/MatGraphOperations/MATCOARSENMISK.html">MATCOARSENMISK</a> </font><font color="#666666">"misk"</font><font color="#228B22"></font></strong>
<a name="line34"> 34: </a><font color="#B22222">/* linked list for aggregates */</font>
<a name="line35"> 35: </a><font color="#4169E1"><a name="_PetscCDIntNd"></a>typedef struct _PetscCDIntNd </font>{
<a name="line36"> 36: </a> <font color="#4169E1">struct _PetscCDIntNd</font> *next;
<a name="line37"> 37: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> gid;
<a name="line38"> 38: </a>} PetscCDIntNd;
<a name="line40"> 40: </a><font color="#B22222">/* only used by node pool */</font>
<a name="line41"> 41: </a><font color="#4169E1"><a name="_PetscCDArrNd"></a>typedef struct _PetscCDArrNd </font>{
<a name="line42"> 42: </a> <font color="#4169E1">struct _PetscCDArrNd</font> *next;
<a name="line43"> 43: </a> <font color="#4169E1">struct _PetscCDIntNd</font> *array;
<a name="line44"> 44: </a>} PetscCDArrNd;
<a name="line46"> 46: </a><font color="#B22222">/* linked list data structure that encodes aggregates and C-F points with array[idx] == NULL for F point and array of indices in an aggregate or C point (first index is always global index my0 + idx */</font>
<a name="line47"> 47: </a><font color="#4169E1"><a name="_PetscCoarsenData"></a>typedef struct _PetscCoarsenData </font>{
<a name="line48"> 48: </a> PetscCDArrNd pool_list; <font color="#B22222">/* node pool */</font>
<a name="line49"> 49: </a> PetscCDIntNd *new_node;
<a name="line50"> 50: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> new_left;
<a name="line51"> 51: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> chk_sz; <font color="#B22222">/* chunk size */</font>
<a name="line52"> 52: </a> PetscCDIntNd *extra_nodes;
<a name="line53"> 53: </a> PetscCDIntNd **array; <font color="#B22222">/* Array of lists */</font>
<a name="line54"> 54: </a> <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> size; <font color="#B22222">/* size of 'array' */</font>
<a name="line55"> 55: </a> <a href="../manualpages/Mat/Mat.html">Mat</a> mat; <font color="#B22222">/* cache a <a href="../manualpages/Mat/Mat.html">Mat</a> for communication data */</font>
<a name="line56"> 56: </a>} PetscCoarsenData;
<a name="line58"> 58: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenCreate.html">MatCoarsenCreate</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a> *)</font></strong>;
<a name="line59"> 59: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetType.html">MatCoarsenSetType</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Mat/MatCoarsenType.html">MatCoarsenType</a>)</font></strong>;
<a name="line60"> 60: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetAdjacency.html">MatCoarsenSetAdjacency</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Mat/Mat.html">Mat</a>)</font></strong>;
<a name="line61"> 61: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetGreedyOrdering.html">MatCoarsenSetGreedyOrdering</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, const <a href="../manualpages/IS/IS.html">IS</a>)</font></strong>;
<a name="line62"> 62: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetStrictAggs.html">MatCoarsenSetStrictAggs</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>)</font></strong>;
<a name="line63"> 63: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenGetData.html">MatCoarsenGetData</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, PetscCoarsenData **)</font></strong>;
<a name="line64"> 64: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenApply.html">MatCoarsenApply</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>)</font></strong>;
<a name="line65"> 65: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenDestroy.html">MatCoarsenDestroy</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a> *)</font></strong>;
<a name="line66"> 66: </a><strong><font color="#4169E1"><a name="MatCoarsenRegister"></a>PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenRegister.html">MatCoarsenRegister</a>(const char[], <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>)</font></strong>);
<a name="line67"> 67: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenView.html">MatCoarsenView</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Viewer/PetscViewer.html">PetscViewer</a>)</font></strong>;
<a name="line68"> 68: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetFromOptions.html">MatCoarsenSetFromOptions</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>)</font></strong>;
<a name="line69"> 69: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenGetType.html">MatCoarsenGetType</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Mat/MatCoarsenType.html">MatCoarsenType</a> *)</font></strong>;
<a name="line70"> 70: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenViewFromOptions.html">MatCoarsenViewFromOptions</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscObject.html">PetscObject</a>, const char[])</font></strong>;
<a name="line72"> 72: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenMISKSetDistance.html">MatCoarsenMISKSetDistance</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line73"> 73: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenMISKGetDistance.html">MatCoarsenMISKGetDistance</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> *)</font></strong>;
<a name="line74"> 74: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetMaximumIterations.html">MatCoarsenSetMaximumIterations</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line75"> 75: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetThreshold.html">MatCoarsenSetThreshold</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>)</font></strong>;
<a name="line76"> 76: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/MatGraphOperations/MatCoarsenSetStrengthIndex.html">MatCoarsenSetStrengthIndex</a>(<a href="../manualpages/Mat/MatCoarsen.html">MatCoarsen</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[])</font></strong>;
</pre>
</body>
</html>
|