MyraMath
multifrontal_schur_rankk2


Source: tests/multifrontal/detail/multifrontal_schur_rankk.cpp

1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
11 // Containers.
18 
19 // Algorithms.
21 
22 // JobGraph under test.
25 #include <myramath/multifrontal/detail/schurrankk.h>
26 
27 // Reporting.
28 #include <tests/myratest.h>
29 
30 using namespace myra;
31 typedef multifrontal::Options Options;
32 
33 ADD_TEST("multifrontal_schur_rankk1","[multifrontal][jobgraph]")
34  {
35  // Construct AssemblyTree of a 3D laplacian.
36  int I = 21;
37  int J = 21;
38  int K = 21;
39  int N = I*J*K;
40  Pattern A_pattern = stencil3(I,J,K);
41  Permutation perm = bisect3(I,J,K);
42  AssemblyTree atree(A_pattern,perm);
43  // Construct SchurTree for k=0 plane.
44  Natural3D n(I,J,K);
45  PatternBuilder B_builder(N,I*J);
46  int next = 0;
47  for (int i = 0; i < I; ++i)
48  for (int j = 0; j < J; ++j)
49  B_builder.insert(n(i,j,0),next++);
50  Pattern B_pattern = B_builder.make_Pattern();
51  SchurTree stree(atree,B_pattern);
52  // Verify the JobGraph.
53  typedef ::multifrontal::detail::schurrankk::JobGraphBase1 Graph;
54  Graph graph(&stree);
55  REQUIRE( verify(graph) );
56  // Save .dot file to disk?
57  graphviz(graph,"graph2.dot");
58  }
59 
60 ADD_TEST("multifrontal_schur_rankk2","[multifrontal]")
61  {
62  // Make diagonal Pattern for A.
63  int N = 10;
64  PatternBuilder A_builder(N,N);
65  for (int n = 0; n < N; ++n)
66  A_builder.insert(n,n);
67  Pattern A_pattern = A_builder.make_Pattern();
68  auto perm = Permutation::identity(N);
69  typedef multifrontal::Options Options;
70  Options options = Options::create().set_blocksize(1).set_globsize(1);
71  AssemblyTree atree(A_pattern,perm,options);
72  // Construct SchurTree for single-column SparseMatrix, containing [1 0 1 0 1 0 .. ]
73  PatternBuilder B_builder(N,1);
74  int next = 0;
75  for (int n = 0; n < N; n+=2)
76  B_builder.insert(n,0);
77  Pattern B_pattern = B_builder.make_Pattern();
78  SchurTree stree(atree,B_pattern,options);
79  // Verify the JobGraph.
80  typedef ::multifrontal::detail::schurrankk::JobGraphBase1 Graph;
81  Graph graph(&stree);
82  REQUIRE( verify(graph) );
83  // Save .dot file to disk?
84  graphviz(graph,"graph2.dot");
85  }
Options pack for routines in /multifrontal.
Definition: Options.h:24
Given a JobGraph G, verifies it has valid topology.
Represents a Permutation matrix, used to reorder rows/columns/etc of various numeric containers...
Definition: Permutation.h:34
Symbolic analysis data structure for all multifrontal solvers.
Definition: AssemblyTree.h:38
static Permutation identity(int N)
Generates an identity Matrix of specified size.
Definition: Permutation.cpp:181
A helper class that generates a natural ordering on a 3D structured grid of size IxJxK.
Definition: laplacian3.h:28
Convenience type for building Pattern&#39;s, uses coordinate/couplet format. Note that PatternBuilder may...
Symbolic analysis data structure for multifrontal schur complement.
Definition: SchurTree.h:42
Definition: syntax.dox:1
Describes data layout and job dependencies for symmetric-pattern multifrontal solvers.
Helper routines for reordering/filling 3D structured grids. Used by many unit tests.
Range/Iterator types associated with Pattern.
Holds the nonzero pattern of a sparse matrix.
Definition: Pattern.h:55
Like Pattern, but easier to populate via insert()/erase() methods.
Definition: PatternBuilder.h:51
Container class for a sparse nonzero pattern, used in reordering/symbolic analysis.
Aggregates a (perm, iperm, swaps) triple into a vocabulary type.
Given a JobGraph, produces a .dot file for visualization with graphviz.
Tabulates data layout and dependencies for multifrontal schur complement.


Results: [PASS]


Go back to Summary of /test programs.