File: MatCreate.html

package info (click to toggle)
petsc 3.2.dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 124,660 kB
  • sloc: ansic: 342,250; cpp: 62,975; python: 32,761; fortran: 17,337; makefile: 15,867; xml: 621; objc: 594; sh: 492; java: 381; f90: 347; csh: 245
file content (85 lines) | stat: -rw-r--r-- 6,075 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>MatCreate</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<A NAME="MatCreate"><H1>MatCreate</H1></A>
Creates a matrix where the type is determined from either a call to <A HREF="../Mat/MatSetType.html#MatSetType">MatSetType</A>() or from the options database with a call to <A HREF="../Mat/MatSetFromOptions.html#MatSetFromOptions">MatSetFromOptions</A>(). The default matrix type is AIJ, using the routines <A HREF="../Mat/MatCreateSeqAIJ.html#MatCreateSeqAIJ">MatCreateSeqAIJ</A>() or <A HREF="../Mat/MatCreateMPIAIJ.html#MatCreateMPIAIJ">MatCreateMPIAIJ</A>() if you do not set a type in the options database. If you never call <A HREF="../Mat/MatSetType.html#MatSetType">MatSetType</A>() or <A HREF="../Mat/MatSetFromOptions.html#MatSetFromOptions">MatSetFromOptions</A>() it will generate an  error when you try to use the matrix. 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscmat.h"  
PetscErrorCode  MatCreate(MPI_Comm comm,Mat *A)
</PRE>
Collective on <A HREF="../Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<DT><B>comm </B> -MPI communicator
<br>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<DT><B>A </B> -the matrix
<br>
<P>
<H3><FONT COLOR="#CC3333">Options Database Keys</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-mat_type seqaij   </B></TD><TD>- AIJ type, uses <A HREF="../Mat/MatCreateSeqAIJ.html#MatCreateSeqAIJ">MatCreateSeqAIJ</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-mat_type mpiaij   </B></TD><TD>- AIJ type, uses <A HREF="../Mat/MatCreateMPIAIJ.html#MatCreateMPIAIJ">MatCreateMPIAIJ</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-mat_type seqdense </B></TD><TD>- dense type, uses <A HREF="../Mat/MatCreateSeqDense.html#MatCreateSeqDense">MatCreateSeqDense</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-mat_type mpidense </B></TD><TD>- dense type, uses <A HREF="../Mat/MatCreateMPIDense.html#MatCreateMPIDense">MatCreateMPIDense</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-mat_type seqbaij  </B></TD><TD>- block AIJ type, uses <A HREF="../Mat/MatCreateSeqBAIJ.html#MatCreateSeqBAIJ">MatCreateSeqBAIJ</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-mat_type mpibaij  </B></TD><TD>- block AIJ type, uses <A HREF="../Mat/MatCreateMPIBAIJ.html#MatCreateMPIBAIJ">MatCreateMPIBAIJ</A>()
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Even More Options Database Keys</FONT></H3>
See the manpages for particular formats (e.g., <A HREF="../Mat/MatCreateSeqAIJ.html#MatCreateSeqAIJ">MatCreateSeqAIJ</A>())
for additional format-specific options.
<P>
<H3><FONT COLOR="#CC3333">C++ variants</FONT></H3><TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD> Mat MatCreate()<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>MatCreate(PETSC_COMM_WORLD,&A); return A;</TR></TD>

<TR><TD WIDTH=40></TD><TD> Mat MatCreate(MPI_Comm comm)<TD WIDTH=20></TD><TD>-></TD><TD WIDTH=20></TD><TD>MatCreate(comm,&A); return A;</TR></TD>

</TABLE>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
<P>

<P>
<H3><FONT COLOR="#CC3333">User manual sections</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../../manual.pdf#section.3.1">Section 3.1 Creating and Assembling Matrices</A></B></TD><TD>- -   <A HREF="../../manual.pdf#chapter.3">Chapter 3 Matrices</A>
</TD></TR>
<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
 matrix, create
<BR>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../Mat/MatCreateSeqAIJ.html#MatCreateSeqAIJ">MatCreateSeqAIJ</A>(), <A HREF="../Mat/MatCreateMPIAIJ.html#MatCreateMPIAIJ">MatCreateMPIAIJ</A>(), 
<BR><A HREF="../Mat/MatCreateSeqDense.html#MatCreateSeqDense">MatCreateSeqDense</A>(), <A HREF="../Mat/MatCreateMPIDense.html#MatCreateMPIDense">MatCreateMPIDense</A>(),
<A HREF="../Mat/MatCreateSeqBAIJ.html#MatCreateSeqBAIJ">MatCreateSeqBAIJ</A>(), <A HREF="../Mat/MatCreateMPIBAIJ.html#MatCreateMPIBAIJ">MatCreateMPIBAIJ</A>(),
<A HREF="../Mat/MatCreateSeqSBAIJ.html#MatCreateSeqSBAIJ">MatCreateSeqSBAIJ</A>(), <A HREF="../Mat/MatCreateMPISBAIJ.html#MatCreateMPISBAIJ">MatCreateMPISBAIJ</A>(),
<A HREF="../Mat/MatConvert.html#MatConvert">MatConvert</A>()
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>beginner
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/mat/utils/gcreate.c.html#MatCreate">src/mat/utils/gcreate.c</A>
<BR><A HREF="./index.html">Index of all Mat routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/mat/examples/tutorials/ex1.c.html">src/mat/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex2.c.html">src/mat/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex4.c.html">src/mat/examples/tutorials/ex4.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex5.c.html">src/mat/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex8.c.html">src/mat/examples/tutorials/ex8.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex9.c.html">src/mat/examples/tutorials/ex9.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex10.c.html">src/mat/examples/tutorials/ex10.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex12.c.html">src/mat/examples/tutorials/ex12.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex13.c.html">src/mat/examples/tutorials/ex13.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex15.c.html">src/mat/examples/tutorials/ex15.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex1.c.html">src/ksp/ksp/examples/tutorials/ex1.c.html</A><BR>
</BODY></HTML>