File: DMSetNullSpaceConstructor.html

package info (click to toggle)
petsc 3.14.5%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 266,472 kB
  • sloc: ansic: 680,898; python: 33,303; cpp: 16,324; makefile: 14,022; f90: 13,731; javascript: 10,713; fortran: 9,581; sh: 1,373; xml: 619; objc: 445; csh: 192; pascal: 148; java: 13
file content (244 lines) | stat: -rw-r--r-- 15,774 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMSetNullSpaceConstructor.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>DMSetNullSpaceConstructor</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>petsc-3.14.5 2021-03-03</b></div>
   <div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.14.5 v3.14.5 docs/manualpages/DM/DMSetNullSpaceConstructor.html "><small>Report Typos and Errors</small></a></div>
<A NAME="DMSetNullSpaceConstructor"><H1>DMSetNullSpaceConstructor</H1></A>
Provide a callback function which constructs the nullspace for a given field 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> DMCreateFieldIS(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> *numFields, char ***fieldNames, <A HREF="../IS/IS.html#IS">IS</A> **fields)
</PRE>
Logically collective on <A HREF="../DM/DM.html#DM">DM</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>dm     </B></TD><TD>- The <A HREF="../DM/DM.html#DM">DM</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>field  </B></TD><TD>- The field number for the nullspace
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nullsp </B></TD><TD>- A callback to create the nullspace
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The callback is intended to provide nullspaces when function spaces are joined or split, such as in <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(). The calling sequence is
<pre>
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> nullsp(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace)
</pre>
<pre>
dm        - The present <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
origField - The field number given above, in the original <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
field     - The field number in dm
</pre>
<pre>
nullSpace - The nullspace for the given field
</pre>
<P>
This function is currently not available from Fortran.
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 DMGetNullSpaceConstructor(), DMSetNearNullSpaceConstructor(), DMGetNearNullSpaceConstructor(), <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(), <A HREF="../DM/DMCreateSuperDM.html#DMCreateSuperDM">DMCreateSuperDM</A>()
<BR>*/
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../DM/DMSetNullSpaceConstructor.html#DMSetNullSpaceConstructor">DMSetNullSpaceConstructor</A>(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*nullsp)(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace))
{
<A HREF="../Sys/PetscFunctionBegin.html#PetscFunctionBegin">PetscFunctionBegin</A>;
PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
if (field &gt;= 10) <A HREF="../Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(<A HREF="../Sys/PetscObjectComm.html#PetscObjectComm">PetscObjectComm</A>((<A HREF="../Sys/PetscObject.html#PetscObject">PetscObject</A>)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %d &gt;= 10 fields", field);
dm-&gt;nullspaceConstructors[field] = nullsp;
<A HREF="../Sys/PetscFunctionReturn.html#PetscFunctionReturn">PetscFunctionReturn</A>(0);
}
<P>
/*@C
DMGetNullSpaceConstructor - Return the callback function which constructs the nullspace for a given field, or NULL
<P>
Not collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>dm     </B></TD><TD>- The <A HREF="../DM/DM.html#DM">DM</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>field  </B></TD><TD>- The field number for the nullspace
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nullsp </B></TD><TD>- A callback to create the nullspace
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The callback is intended to provide nullspaces when function spaces are joined or split, such as in <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(). The calling sequence is
<pre>
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> nullsp(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace)
</pre>
<pre>
dm        - The present <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
origField - The field number given above, in the original <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
field     - The field number in dm
</pre>
<pre>
nullSpace - The nullspace for the given field
</pre>
<P>
This function is currently not available from Fortran.
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../DM/DMSetNullSpaceConstructor.html#DMSetNullSpaceConstructor">DMSetNullSpaceConstructor</A>(), DMSetNearNullSpaceConstructor(), DMGetNearNullSpaceConstructor(), <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(), <A HREF="../DM/DMCreateSuperDM.html#DMCreateSuperDM">DMCreateSuperDM</A>()
<BR>*/
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> DMGetNullSpaceConstructor(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (**nullsp)(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace))
{
<A HREF="../Sys/PetscFunctionBegin.html#PetscFunctionBegin">PetscFunctionBegin</A>;
PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
PetscValidPointer(nullsp, 3);
if (field &gt;= 10) <A HREF="../Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(<A HREF="../Sys/PetscObjectComm.html#PetscObjectComm">PetscObjectComm</A>((<A HREF="../Sys/PetscObject.html#PetscObject">PetscObject</A>)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %d &gt;= 10 fields", field);
*nullsp = dm-&gt;nullspaceConstructors[field];
<A HREF="../Sys/PetscFunctionReturn.html#PetscFunctionReturn">PetscFunctionReturn</A>(0);
}
<P>
/*@C
DMSetNearNullSpaceConstructor - Provide a callback function which constructs the near-nullspace for a given field
<P>
Logically collective on <A HREF="../DM/DM.html#DM">DM</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>dm     </B></TD><TD>- The <A HREF="../DM/DM.html#DM">DM</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>field  </B></TD><TD>- The field number for the nullspace
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nullsp </B></TD><TD>- A callback to create the near-nullspace
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The callback is intended to provide nullspaces when function spaces are joined or split, such as in <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(). The calling sequence is
<pre>
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> nullsp(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace)
</pre>
<pre>
dm        - The present <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
origField - The field number given above, in the original <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
field     - The field number in dm
</pre>
<pre>
nullSpace - The nullspace for the given field
</pre>
<P>
This function is currently not available from Fortran.
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 DMGetNearNullSpaceConstructor(), <A HREF="../DM/DMSetNullSpaceConstructor.html#DMSetNullSpaceConstructor">DMSetNullSpaceConstructor</A>(), DMGetNullSpaceConstructor(), <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(), <A HREF="../DM/DMCreateSuperDM.html#DMCreateSuperDM">DMCreateSuperDM</A>()
<BR>*/
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> DMSetNearNullSpaceConstructor(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*nullsp)(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace))
{
<A HREF="../Sys/PetscFunctionBegin.html#PetscFunctionBegin">PetscFunctionBegin</A>;
PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
if (field &gt;= 10) <A HREF="../Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(<A HREF="../Sys/PetscObjectComm.html#PetscObjectComm">PetscObjectComm</A>((<A HREF="../Sys/PetscObject.html#PetscObject">PetscObject</A>)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %d &gt;= 10 fields", field);
dm-&gt;nearnullspaceConstructors[field] = nullsp;
<A HREF="../Sys/PetscFunctionReturn.html#PetscFunctionReturn">PetscFunctionReturn</A>(0);
}
<P>
/*@C
DMGetNearNullSpaceConstructor - Return the callback function which constructs the near-nullspace for a given field, or NULL
<P>
Not collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>dm     </B></TD><TD>- The <A HREF="../DM/DM.html#DM">DM</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>field  </B></TD><TD>- The field number for the nullspace
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nullsp </B></TD><TD>- A callback to create the near-nullspace
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The callback is intended to provide nullspaces when function spaces are joined or split, such as in <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(). The calling sequence is
<pre>
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> nullsp(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace)
</pre>
<pre>
dm        - The present <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
origField - The field number given above, in the original <A HREF="../DM/DM.html#DM">DM</A>
</pre>
<pre>
field     - The field number in dm
</pre>
<pre>
nullSpace - The nullspace for the given field
</pre>
<P>
This function is currently not available from Fortran.
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 DMSetNearNullSpaceConstructor(), <A HREF="../DM/DMSetNullSpaceConstructor.html#DMSetNullSpaceConstructor">DMSetNullSpaceConstructor</A>(), DMGetNullSpaceConstructor(), <A HREF="../DM/DMCreateSubDM.html#DMCreateSubDM">DMCreateSubDM</A>(), <A HREF="../DM/DMCreateSuperDM.html#DMCreateSuperDM">DMCreateSuperDM</A>()
<BR>*/
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> DMGetNearNullSpaceConstructor(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (**nullsp)(<A HREF="../DM/DM.html#DM">DM</A> dm, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> origField, <A HREF="../Sys/PetscInt.html#PetscInt">PetscInt</A> field, <A HREF="../Mat/MatNullSpace.html#MatNullSpace">MatNullSpace</A> *nullSpace))
{
<A HREF="../Sys/PetscFunctionBegin.html#PetscFunctionBegin">PetscFunctionBegin</A>;
PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
PetscValidPointer(nullsp, 3);
if (field &gt;= 10) <A HREF="../Sys/SETERRQ1.html#SETERRQ1">SETERRQ1</A>(<A HREF="../Sys/PetscObjectComm.html#PetscObjectComm">PetscObjectComm</A>((<A HREF="../Sys/PetscObject.html#PetscObject">PetscObject</A>)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %d &gt;= 10 fields", field);
*nullsp = dm-&gt;nearnullspaceConstructors[field];
<A HREF="../Sys/PetscFunctionReturn.html#PetscFunctionReturn">PetscFunctionReturn</A>(0);
}
<P>
/*@C
DMCreateFieldIS - Creates a set of <A HREF="../IS/IS.html#IS">IS</A> objects with the global indices of dofs for each field
<P>
Not collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>dm </B></TD><TD>- the <A HREF="../DM/DM.html#DM">DM</A> object
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>numFields  </B></TD><TD>- The number of fields (or NULL if not requested)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>fieldNames </B></TD><TD>- The name for each field (or NULL if not requested)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>fields     </B></TD><TD>- The global indices for each field (or NULL if not requested)
</TD></TR></TABLE>
<P>

<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The user is responsible for freeing all requested arrays. In particular, every entry of names should be freed with
<A HREF="../Sys/PetscFree.html#PetscFree">PetscFree</A>(), every entry of fields should be destroyed with <A HREF="../IS/ISDestroy.html#ISDestroy">ISDestroy</A>(), and both arrays should be freed with
<A HREF="../Sys/PetscFree.html#PetscFree">PetscFree</A>().
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../DM/DMDestroy.html#DMDestroy">DMDestroy</A>(), <A HREF="../DM/DMView.html#DMView">DMView</A>(), <A HREF="../DM/DMCreateInterpolation.html#DMCreateInterpolation">DMCreateInterpolation</A>(), <A HREF="../DM/DMCreateColoring.html#DMCreateColoring">DMCreateColoring</A>(), <A HREF="../DM/DMCreateMatrix.html#DMCreateMatrix">DMCreateMatrix</A>()
<BR><P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>intermediate<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/dm/interface/dm.c.html#DMSetNullSpaceConstructor">src/dm/interface/dm.c</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/snes/tutorials/ex62.c.html">src/snes/tutorials/ex62.c.html</A><BR>
<BR><A HREF="./index.html">Index of all DM 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>
</BODY></HTML>