Bug Summary

File:dm/dt/fe/interface/fe.c
Warning:line 184, column 37
The right operand of '-' is a garbage value due to array index out of bounds

Annotated Source Code

[?] Use j/k keys for keyboard navigation

/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c

1/* Basis Jet Tabulation
2
3We would like to tabulate the nodal basis functions and derivatives at a set of points, usually quadrature points. We
4follow here the derviation in http://www.math.ttu.edu/~kirby/papers/fiat-toms-2004.pdf. The nodal basis $\psi_i$ can
5be expressed in terms of a prime basis $\phi_i$ which can be stably evaluated. In PETSc, we will use the Legendre basis
6as a prime basis.
7
8 \psi_i = \sum_k \alpha_{ki} \phi_k
9
10Our nodal basis is defined in terms of the dual basis $n_j$
11
12 n_j \cdot \psi_i = \delta_{ji}
13
14and we may act on the first equation to obtain
15
16 n_j \cdot \psi_i = \sum_k \alpha_{ki} n_j \cdot \phi_k
17 \delta_{ji} = \sum_k \alpha_{ki} V_{jk}
18 I = V \alpha
19
20so the coefficients of the nodal basis in the prime basis are
21
22 \alpha = V^{-1}
23
24We will define the dual basis vectors $n_j$ using a quadrature rule.
25
26Right now, we will just use the polynomial spaces P^k. I know some elements use the space of symmetric polynomials
27(I think Nedelec), but we will neglect this for now. Constraints in the space, e.g. Arnold-Winther elements, can
28be implemented exactly as in FIAT using functionals $L_j$.
29
30I will have to count the degrees correctly for the Legendre product when we are on simplices.
31
32We will have three objects:
33 - Space, P: this just need point evaluation I think
34 - Dual Space, P'+K: This looks like a set of functionals that can act on members of P, each n is defined by a Q
35 - FEM: This keeps {P, P', Q}
36*/
37#include <petsc/private/petscfeimpl.h> /*I "petscfe.h" I*/
38#include <petscdmplex.h>
39
40PetscBool FEcite = PETSC_FALSE;
41const char FECitation[] = "@article{kirby2004,\n"
42 " title = {Algorithm 839: FIAT, a New Paradigm for Computing Finite Element Basis Functions},\n"
43 " journal = {ACM Transactions on Mathematical Software},\n"
44 " author = {Robert C. Kirby},\n"
45 " volume = {30},\n"
46 " number = {4},\n"
47 " pages = {502--516},\n"
48 " doi = {10.1145/1039813.1039820},\n"
49 " year = {2004}\n}\n";
50
51PetscClassId PETSCFE_CLASSID = 0;
52
53PetscFunctionList PetscFEList = NULL((void*)0);
54PetscBool PetscFERegisterAllCalled = PETSC_FALSE;
55
56/*@C
57 PetscFERegister - Adds a new PetscFE implementation
58
59 Not Collective
60
61 Input Parameters:
62+ name - The name of a new user-defined creation routine
63- create_func - The creation routine itself
64
65 Notes:
66 PetscFERegister() may be called multiple times to add several user-defined PetscFEs
67
68 Sample usage:
69.vb
70 PetscFERegister("my_fe", MyPetscFECreate);
71.ve
72
73 Then, your PetscFE type can be chosen with the procedural interface via
74.vb
75 PetscFECreate(MPI_Comm, PetscFE *);
76 PetscFESetType(PetscFE, "my_fe");
77.ve
78 or at runtime via the option
79.vb
80 -petscfe_type my_fe
81.ve
82
83 Level: advanced
84
85.keywords: PetscFE, register
86.seealso: PetscFERegisterAll(), PetscFERegisterDestroy()
87
88@*/
89PetscErrorCode PetscFERegister(const char sname[], PetscErrorCode (*function)(PetscFE))
90{
91 PetscErrorCode ierr;
92
93 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 93; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
94 ierr = PetscFunctionListAdd(&PetscFEList, sname, function)PetscFunctionListAdd_Private((&PetscFEList),(sname),(PetscVoidFunction
)(function))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),94,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
95 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
96}
97
98/*@C
99 PetscFESetType - Builds a particular PetscFE
100
101 Collective on PetscFE
102
103 Input Parameters:
104+ fem - The PetscFE object
105- name - The kind of FEM space
106
107 Options Database Key:
108. -petscfe_type <type> - Sets the PetscFE type; use -help for a list of available types
109
110 Level: intermediate
111
112.keywords: PetscFE, set, type
113.seealso: PetscFEGetType(), PetscFECreate()
114@*/
115PetscErrorCode PetscFESetType(PetscFE fem, PetscFEType name)
116{
117 PetscErrorCode (*r)(PetscFE);
118 PetscBool match;
119 PetscErrorCode ierr;
120
121 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 121; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
122 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),122,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),122,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),122,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
123 ierr = PetscObjectTypeCompare((PetscObject) fem, name, &match);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),123,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
124 if (match) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
125
126 if (!PetscFERegisterAllCalled) {ierr = PetscFERegisterAll();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),126,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
127 ierr = PetscFunctionListFind(PetscFEList, name, &r)PetscFunctionListFind_Private((PetscFEList),(name),(PetscVoidFunction
*)(&r))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),127,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
128 if (!r) SETERRQ1(PetscObjectComm((PetscObject) fem), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown PetscFE type: %s", name)return PetscError(PetscObjectComm((PetscObject) fem),128,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
86,PETSC_ERROR_INITIAL,"Unknown PetscFE type: %s",name)
;
129
130 if (fem->ops->destroy) {
131 ierr = (*fem->ops->destroy)(fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),131,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
132 fem->ops->destroy = NULL((void*)0);
133 }
134 ierr = (*r)(fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),134,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
135 ierr = PetscObjectChangeTypeName((PetscObject) fem, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),135,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
136 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
137}
138
139/*@C
140 PetscFEGetType - Gets the PetscFE type name (as a string) from the object.
141
142 Not Collective
143
144 Input Parameter:
145. fem - The PetscFE
146
147 Output Parameter:
148. name - The PetscFE type name
149
150 Level: intermediate
151
152.keywords: PetscFE, get, type, name
153.seealso: PetscFESetType(), PetscFECreate()
154@*/
155PetscErrorCode PetscFEGetType(PetscFE fem, PetscFEType *name)
156{
157 PetscErrorCode ierr;
158
159 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 159; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
160 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),160,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),160,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),160,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
161 PetscValidPointer(name, 2)do { if (!name) return PetscError(((MPI_Comm)0x44000001),161,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(name,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),161,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
162 if (!PetscFERegisterAllCalled) {
163 ierr = PetscFERegisterAll();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),163,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
164 }
165 *name = ((PetscObject) fem)->type_name;
166 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
167}
168
169/*@C
170 PetscFEView - Views a PetscFE
171
172 Collective on PetscFE
173
174 Input Parameter:
175+ fem - the PetscFE object to view
176- viewer - the viewer
177
178 Level: developer
179
180.seealso PetscFEDestroy()
181@*/
182PetscErrorCode PetscFEView(PetscFE fem, PetscViewer viewer)
183{
184 PetscBool iascii;
185 PetscErrorCode ierr;
186
187 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 187; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
188 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),188,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),188,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),188,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),188,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
189 if (viewer) PetscValidHeaderSpecific(viewer, PETSC_VIEWER_CLASSID, 2)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),189
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),189,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),189,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),189,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
190 if (!viewer) {ierr = PetscViewerASCIIGetStdout(PetscObjectComm((PetscObject) fem), &viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),190,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
191 ierr = PetscObjectPrintClassNamePrefixType((PetscObject)fem, viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),191,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
192 ierr = PetscObjectTypeCompare((PetscObject) viewer, PETSCVIEWERASCII"ascii", &iascii);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),192,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
193 if (fem->ops->view) {ierr = (*fem->ops->view)(fem, viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),193,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
194 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
195}
196
197/*@
198 PetscFESetFromOptions - sets parameters in a PetscFE from the options database
199
200 Collective on PetscFE
201
202 Input Parameter:
203. fem - the PetscFE object to set options for
204
205 Options Database:
206. -petscfe_num_blocks the number of cell blocks to integrate concurrently
207. -petscfe_num_batches the number of cell batches to integrate serially
208
209 Level: developer
210
211.seealso PetscFEView()
212@*/
213PetscErrorCode PetscFESetFromOptions(PetscFE fem)
214{
215 const char *defaultType;
216 char name[256];
217 PetscBool flg;
218 PetscErrorCode ierr;
219
220 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 220; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
221 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),221,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),221,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),221,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),221,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
222 if (!((PetscObject) fem)->type_name) {
223 defaultType = PETSCFEBASIC"basic";
224 } else {
225 defaultType = ((PetscObject) fem)->type_name;
226 }
227 if (!PetscFERegisterAllCalled) {ierr = PetscFERegisterAll();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),227,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
228
229 ierr = PetscObjectOptionsBegin((PetscObject) fem)0; do { PetscOptionItems PetscOptionsObjectBase; PetscOptionItems
*PetscOptionsObject = &PetscOptionsObjectBase; PetscOptionsObject
->options = ((PetscObject)(PetscObject) fem)->options; for
(PetscOptionsObject->count=(PetscOptionsPublish?-1:1); PetscOptionsObject
->count<2; PetscOptionsObject->count++) { PetscErrorCode
_5_ierr = PetscObjectOptionsBegin_Private(PetscOptionsObject
,(PetscObject) fem);do {if (__builtin_expect(!!(_5_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),229,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,_5_ierr,PETSC_ERROR_REPEAT," ");} while (0);
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),229,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
230 ierr = PetscOptionsFList("-petscfe_type", "Finite element space", "PetscFESetType", PetscFEList, defaultType, name, 256, &flg)PetscOptionsFList_Private(PetscOptionsObject,"-petscfe_type",
"Finite element space","PetscFESetType",PetscFEList,defaultType
,name,256,&flg)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),230,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
231 if (flg) {
232 ierr = PetscFESetType(fem, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),232,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
233 } else if (!((PetscObject) fem)->type_name) {
234 ierr = PetscFESetType(fem, defaultType);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),234,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
235 }
236 ierr = PetscOptionsInt("-petscfe_num_blocks", "The number of cell blocks to integrate concurrently", "PetscSpaceSetTileSizes", fem->numBlocks, &fem->numBlocks, NULL)PetscOptionsInt_Private(PetscOptionsObject,"-petscfe_num_blocks"
,"The number of cell blocks to integrate concurrently","PetscSpaceSetTileSizes"
,fem->numBlocks,&fem->numBlocks,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),236,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
237 ierr = PetscOptionsInt("-petscfe_num_batches", "The number of cell batches to integrate serially", "PetscSpaceSetTileSizes", fem->numBatches, &fem->numBatches, NULL)PetscOptionsInt_Private(PetscOptionsObject,"-petscfe_num_batches"
,"The number of cell batches to integrate serially","PetscSpaceSetTileSizes"
,fem->numBatches,&fem->numBatches,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),237,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
238 if (fem->ops->setfromoptions) {
239 ierr = (*fem->ops->setfromoptions)(PetscOptionsObject,fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),239,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
240 }
241 /* process any options handlers added with PetscObjectAddOptionsHandler() */
242 ierr = PetscObjectProcessOptionsHandlers(PetscOptionsObject,(PetscObject) fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),242,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
243 ierr = PetscOptionsEnd()_5_ierr = PetscOptionsEnd_Private(PetscOptionsObject);do {if (
__builtin_expect(!!(_5_ierr),0)) return PetscError(((MPI_Comm
)0x44000001),243,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,_5_ierr,PETSC_ERROR_REPEAT," ");} while (0);}} while (0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),243,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
244 ierr = PetscFEViewFromOptions(fem, NULL((void*)0), "-petscfe_view");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),244,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
245 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
246}
247
248/*@C
249 PetscFESetUp - Construct data structures for the PetscFE
250
251 Collective on PetscFE
252
253 Input Parameter:
254. fem - the PetscFE object to setup
255
256 Level: developer
257
258.seealso PetscFEView(), PetscFEDestroy()
259@*/
260PetscErrorCode PetscFESetUp(PetscFE fem)
261{
262 PetscErrorCode ierr;
263
264 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 264; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
265 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),265,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),265,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),265,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),265,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
266 if (fem->setupcalled) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
267 fem->setupcalled = PETSC_TRUE;
268 if (fem->ops->setup) {ierr = (*fem->ops->setup)(fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),268,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
269 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
270}
271
272/*@
273 PetscFEDestroy - Destroys a PetscFE object
274
275 Collective on PetscFE
276
277 Input Parameter:
278. fem - the PetscFE object to destroy
279
280 Level: developer
281
282.seealso PetscFEView()
283@*/
284PetscErrorCode PetscFEDestroy(PetscFE *fem)
285{
286 PetscErrorCode ierr;
287
288 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 288; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
289 if (!*fem) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
290 PetscValidHeaderSpecific((*fem), PETSCFE_CLASSID, 1)do { if (!(*fem)) return PetscError(((MPI_Comm)0x44000001),290
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer((*fem),PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),290,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)((*fem)))->classid != PETSCFE_CLASSID
) { if (((PetscObject)((*fem)))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),290,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),290,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
291
292 if (--((PetscObject)(*fem))->refct > 0) {*fem = 0; PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
293 ((PetscObject) (*fem))->refct = 0;
294
295 if ((*fem)->subspaces) {
296 PetscInt dim, d;
297
298 ierr = PetscDualSpaceGetDimension((*fem)->dualSpace, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),298,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
299 for (d = 0; d < dim; ++d) {ierr = PetscFEDestroy(&(*fem)->subspaces[d]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),299,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
300 }
301 ierr = PetscFree((*fem)->subspaces)((*PetscTrFree)((void*)((*fem)->subspaces),301,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
) || (((*fem)->subspaces) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),301,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
302 ierr = PetscFree((*fem)->invV)((*PetscTrFree)((void*)((*fem)->invV),302,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
) || (((*fem)->invV) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),302,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
303 ierr = PetscFERestoreTabulation((*fem), 0, NULL((void*)0), &(*fem)->B, &(*fem)->D, NULL((void*)0) /*&(*fem)->H*/);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),303,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
304 ierr = PetscFERestoreTabulation((*fem), 0, NULL((void*)0), &(*fem)->Bf, &(*fem)->Df, NULL((void*)0) /*&(*fem)->Hf*/);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),304,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
305 ierr = PetscFERestoreTabulation((*fem), 0, NULL((void*)0), &(*fem)->F, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),305,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
306 ierr = PetscSpaceDestroy(&(*fem)->basisSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),306,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
307 ierr = PetscDualSpaceDestroy(&(*fem)->dualSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),307,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
308 ierr = PetscQuadratureDestroy(&(*fem)->quadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),308,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
309 ierr = PetscQuadratureDestroy(&(*fem)->faceQuadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),309,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
310
311 if ((*fem)->ops->destroy) {ierr = (*(*fem)->ops->destroy)(*fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),311,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
312 ierr = PetscHeaderDestroy(fem)(PetscHeaderDestroy_Private((PetscObject)(*fem)) || ((*PetscTrFree
)((void*)(*fem),312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
) || ((*fem) = 0,0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),312,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
313 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
314}
315
316/*@
317 PetscFECreate - Creates an empty PetscFE object. The type can then be set with PetscFESetType().
318
319 Collective on MPI_Comm
320
321 Input Parameter:
322. comm - The communicator for the PetscFE object
323
324 Output Parameter:
325. fem - The PetscFE object
326
327 Level: beginner
328
329.seealso: PetscFESetType(), PETSCFEGALERKIN
330@*/
331PetscErrorCode PetscFECreate(MPI_Comm comm, PetscFE *fem)
332{
333 PetscFE f;
334 PetscErrorCode ierr;
335
336 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 336; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
337 PetscValidPointer(fem, 2)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),337,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(fem,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),337,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
338 ierr = PetscCitationsRegister(FECitation,&FEcite);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),338,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
339 *fem = NULL((void*)0);
340 ierr = PetscFEInitializePackage();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),340,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
341
342 ierr = PetscHeaderCreate(f, PETSCFE_CLASSID, "PetscFE", "Finite Element", "PetscFE", comm, PetscFEDestroy, PetscFEView)(PetscMallocA(1,PETSC_TRUE,342,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(1)*sizeof(**((&(f)))),((&(f)))) || PetscHeaderCreate_Private
((PetscObject)f,PETSCFE_CLASSID,"PetscFE","Finite Element","PetscFE"
,comm,(PetscObjectDestroyFunction)PetscFEDestroy,(PetscObjectViewFunction
)PetscFEView) || ((PetscLogPHC) ? (*PetscLogPHC)((PetscObject
)(f)) : 0) || PetscLogObjectMemory((PetscObject)f,sizeof(*(f)
)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),342,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
343
344 f->basisSpace = NULL((void*)0);
345 f->dualSpace = NULL((void*)0);
346 f->numComponents = 1;
347 f->subspaces = NULL((void*)0);
348 f->invV = NULL((void*)0);
349 f->B = NULL((void*)0);
350 f->D = NULL((void*)0);
351 f->H = NULL((void*)0);
352 f->Bf = NULL((void*)0);
353 f->Df = NULL((void*)0);
354 f->Hf = NULL((void*)0);
355 ierr = PetscMemzero(&f->quadrature, sizeof(PetscQuadrature));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),355,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
356 ierr = PetscMemzero(&f->faceQuadrature, sizeof(PetscQuadrature));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),356,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
357 f->blockSize = 0;
358 f->numBlocks = 1;
359 f->batchSize = 0;
360 f->numBatches = 1;
361
362 *fem = f;
363 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
364}
365
366/*@
367 PetscFEGetSpatialDimension - Returns the spatial dimension of the element
368
369 Not collective
370
371 Input Parameter:
372. fem - The PetscFE object
373
374 Output Parameter:
375. dim - The spatial dimension
376
377 Level: intermediate
378
379.seealso: PetscFECreate()
380@*/
381PetscErrorCode PetscFEGetSpatialDimension(PetscFE fem, PetscInt *dim)
382{
383 DM dm;
384 PetscErrorCode ierr;
385
386 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 386; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
387 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),387,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),387,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),387,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),387,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
388 PetscValidPointer(dim, 2)do { if (!dim) return PetscError(((MPI_Comm)0x44000001),388,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(dim,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),388,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
389 ierr = PetscDualSpaceGetDM(fem->dualSpace, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),389,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
390 ierr = DMGetDimension(dm, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),390,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
391 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
392}
393
394/*@
395 PetscFESetNumComponents - Sets the number of components in the element
396
397 Not collective
398
399 Input Parameters:
400+ fem - The PetscFE object
401- comp - The number of field components
402
403 Level: intermediate
404
405.seealso: PetscFECreate()
406@*/
407PetscErrorCode PetscFESetNumComponents(PetscFE fem, PetscInt comp)
408{
409 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 409; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
410 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),410,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),410,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),410,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),410,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
411 fem->numComponents = comp;
412 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
413}
414
415/*@
416 PetscFEGetNumComponents - Returns the number of components in the element
417
418 Not collective
419
420 Input Parameter:
421. fem - The PetscFE object
422
423 Output Parameter:
424. comp - The number of field components
425
426 Level: intermediate
427
428.seealso: PetscFECreate()
429@*/
430PetscErrorCode PetscFEGetNumComponents(PetscFE fem, PetscInt *comp)
431{
432 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 432; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
433 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),433,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),433,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),433,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),433,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
434 PetscValidPointer(comp, 2)do { if (!comp) return PetscError(((MPI_Comm)0x44000001),434,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(comp,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),434,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
435 *comp = fem->numComponents;
436 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
437}
438
439/*@
440 PetscFESetTileSizes - Sets the tile sizes for evaluation
441
442 Not collective
443
444 Input Parameters:
445+ fem - The PetscFE object
446. blockSize - The number of elements in a block
447. numBlocks - The number of blocks in a batch
448. batchSize - The number of elements in a batch
449- numBatches - The number of batches in a chunk
450
451 Level: intermediate
452
453.seealso: PetscFECreate()
454@*/
455PetscErrorCode PetscFESetTileSizes(PetscFE fem, PetscInt blockSize, PetscInt numBlocks, PetscInt batchSize, PetscInt numBatches)
456{
457 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 457; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
458 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),458,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),458,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),458,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),458,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
459 fem->blockSize = blockSize;
460 fem->numBlocks = numBlocks;
461 fem->batchSize = batchSize;
462 fem->numBatches = numBatches;
463 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
464}
465
466/*@
467 PetscFEGetTileSizes - Returns the tile sizes for evaluation
468
469 Not collective
470
471 Input Parameter:
472. fem - The PetscFE object
473
474 Output Parameters:
475+ blockSize - The number of elements in a block
476. numBlocks - The number of blocks in a batch
477. batchSize - The number of elements in a batch
478- numBatches - The number of batches in a chunk
479
480 Level: intermediate
481
482.seealso: PetscFECreate()
483@*/
484PetscErrorCode PetscFEGetTileSizes(PetscFE fem, PetscInt *blockSize, PetscInt *numBlocks, PetscInt *batchSize, PetscInt *numBatches)
485{
486 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 486; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
487 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),487,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),487,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),487,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),487,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
488 if (blockSize) PetscValidPointer(blockSize, 2)do { if (!blockSize) return PetscError(((MPI_Comm)0x44000001)
,488,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(blockSize,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),488,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
489 if (numBlocks) PetscValidPointer(numBlocks, 3)do { if (!numBlocks) return PetscError(((MPI_Comm)0x44000001)
,489,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(numBlocks,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),489,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
490 if (batchSize) PetscValidPointer(batchSize, 4)do { if (!batchSize) return PetscError(((MPI_Comm)0x44000001)
,490,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",4); if
(!PetscCheckPointer(batchSize,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),490,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",4);
} while (0)
;
491 if (numBatches) PetscValidPointer(numBatches, 5)do { if (!numBatches) return PetscError(((MPI_Comm)0x44000001
),491,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",5); if
(!PetscCheckPointer(numBatches,PETSC_CHAR)) return PetscError
(((MPI_Comm)0x44000001),491,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",5);
} while (0)
;
492 if (blockSize) *blockSize = fem->blockSize;
493 if (numBlocks) *numBlocks = fem->numBlocks;
494 if (batchSize) *batchSize = fem->batchSize;
495 if (numBatches) *numBatches = fem->numBatches;
496 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
497}
498
499/*@
500 PetscFEGetBasisSpace - Returns the PetscSpace used for approximation of the solution
501
502 Not collective
503
504 Input Parameter:
505. fem - The PetscFE object
506
507 Output Parameter:
508. sp - The PetscSpace object
509
510 Level: intermediate
511
512.seealso: PetscFECreate()
513@*/
514PetscErrorCode PetscFEGetBasisSpace(PetscFE fem, PetscSpace *sp)
515{
516 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 516; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
517 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),517,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),517,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),517,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),517,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
518 PetscValidPointer(sp, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),518,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(sp,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),518,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
519 *sp = fem->basisSpace;
520 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
521}
522
523/*@
524 PetscFESetBasisSpace - Sets the PetscSpace used for approximation of the solution
525
526 Not collective
527
528 Input Parameters:
529+ fem - The PetscFE object
530- sp - The PetscSpace object
531
532 Level: intermediate
533
534.seealso: PetscFECreate()
535@*/
536PetscErrorCode PetscFESetBasisSpace(PetscFE fem, PetscSpace sp)
537{
538 PetscErrorCode ierr;
539
540 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 540; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
541 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),541,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),541,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),541,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),541,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
542 PetscValidHeaderSpecific(sp, PETSCSPACE_CLASSID, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),542,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(sp,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),542,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(sp))->classid != PETSCSPACE_CLASSID
) { if (((PetscObject)(sp))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),542,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),542,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
543 ierr = PetscSpaceDestroy(&fem->basisSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),543,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
544 fem->basisSpace = sp;
545 ierr = PetscObjectReference((PetscObject) fem->basisSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),545,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
546 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
547}
548
549/*@
550 PetscFEGetDualSpace - Returns the PetscDualSpace used to define the inner product
551
552 Not collective
553
554 Input Parameter:
555. fem - The PetscFE object
556
557 Output Parameter:
558. sp - The PetscDualSpace object
559
560 Level: intermediate
561
562.seealso: PetscFECreate()
563@*/
564PetscErrorCode PetscFEGetDualSpace(PetscFE fem, PetscDualSpace *sp)
565{
566 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 566; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
567 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),567,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),567,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),567,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),567,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
568 PetscValidPointer(sp, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),568,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(sp,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),568,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
569 *sp = fem->dualSpace;
570 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
571}
572
573/*@
574 PetscFESetDualSpace - Sets the PetscDualSpace used to define the inner product
575
576 Not collective
577
578 Input Parameters:
579+ fem - The PetscFE object
580- sp - The PetscDualSpace object
581
582 Level: intermediate
583
584.seealso: PetscFECreate()
585@*/
586PetscErrorCode PetscFESetDualSpace(PetscFE fem, PetscDualSpace sp)
587{
588 PetscErrorCode ierr;
589
590 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 590; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
591 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),591,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),591,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),591,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),591,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
592 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),592,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(sp,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),592,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(sp))->classid != PETSCDUALSPACE_CLASSID
) { if (((PetscObject)(sp))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),592,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),592,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
593 ierr = PetscDualSpaceDestroy(&fem->dualSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),593,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
594 fem->dualSpace = sp;
595 ierr = PetscObjectReference((PetscObject) fem->dualSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),595,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
596 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
597}
598
599/*@
600 PetscFEGetQuadrature - Returns the PetscQuadrature used to calculate inner products
601
602 Not collective
603
604 Input Parameter:
605. fem - The PetscFE object
606
607 Output Parameter:
608. q - The PetscQuadrature object
609
610 Level: intermediate
611
612.seealso: PetscFECreate()
613@*/
614PetscErrorCode PetscFEGetQuadrature(PetscFE fem, PetscQuadrature *q)
615{
616 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 616; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
617 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),617,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),617,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),617,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
618 PetscValidPointer(q, 2)do { if (!q) return PetscError(((MPI_Comm)0x44000001),618,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(q,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),618,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
619 *q = fem->quadrature;
620 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
621}
622
623/*@
624 PetscFESetQuadrature - Sets the PetscQuadrature used to calculate inner products
625
626 Not collective
627
628 Input Parameters:
629+ fem - The PetscFE object
630- q - The PetscQuadrature object
631
632 Level: intermediate
633
634.seealso: PetscFECreate()
635@*/
636PetscErrorCode PetscFESetQuadrature(PetscFE fem, PetscQuadrature q)
637{
638 PetscInt Nc, qNc;
639 PetscErrorCode ierr;
640
641 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 641; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
642 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),642,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),642,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),642,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),642,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
643 ierr = PetscFEGetNumComponents(fem, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),643,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
644 ierr = PetscQuadratureGetNumComponents(q, &qNc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),644,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
645 if ((qNc != 1) && (Nc != qNc)) SETERRQ2(PetscObjectComm((PetscObject) fem), PETSC_ERR_ARG_SIZ, "FE components %D != Quadrature components %D and non-scalar quadrature", Nc, qNc)return PetscError(PetscObjectComm((PetscObject) fem),645,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
60,PETSC_ERROR_INITIAL,"FE components %D != Quadrature components %D and non-scalar quadrature"
,Nc,qNc)
;
646 ierr = PetscFERestoreTabulation(fem, 0, NULL((void*)0), &fem->B, &fem->D, NULL((void*)0) /*&(*fem)->H*/);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),646,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
647 ierr = PetscQuadratureDestroy(&fem->quadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),647,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
648 fem->quadrature = q;
649 ierr = PetscObjectReference((PetscObject) q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),649,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
650 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
651}
652
653/*@
654 PetscFEGetFaceQuadrature - Returns the PetscQuadrature used to calculate inner products on faces
655
656 Not collective
657
658 Input Parameter:
659. fem - The PetscFE object
660
661 Output Parameter:
662. q - The PetscQuadrature object
663
664 Level: intermediate
665
666.seealso: PetscFECreate()
667@*/
668PetscErrorCode PetscFEGetFaceQuadrature(PetscFE fem, PetscQuadrature *q)
669{
670 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 670; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
671 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),671,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),671,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),671,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),671,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
672 PetscValidPointer(q, 2)do { if (!q) return PetscError(((MPI_Comm)0x44000001),672,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(q,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),672,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
673 *q = fem->faceQuadrature;
674 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
675}
676
677/*@
678 PetscFESetFaceQuadrature - Sets the PetscQuadrature used to calculate inner products on faces
679
680 Not collective
681
682 Input Parameters:
683+ fem - The PetscFE object
684- q - The PetscQuadrature object
685
686 Level: intermediate
687
688.seealso: PetscFECreate()
689@*/
690PetscErrorCode PetscFESetFaceQuadrature(PetscFE fem, PetscQuadrature q)
691{
692 PetscErrorCode ierr;
693
694 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 694; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
695 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),695,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),695,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),695,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),695,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
696 ierr = PetscFERestoreTabulation(fem, 0, NULL((void*)0), &fem->Bf, &fem->Df, NULL((void*)0) /*&(*fem)->Hf*/);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),696,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
697 ierr = PetscQuadratureDestroy(&fem->faceQuadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),697,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
698 fem->faceQuadrature = q;
699 ierr = PetscObjectReference((PetscObject) q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),699,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
700 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
701}
702
703/*@C
704 PetscFEGetNumDof - Returns the number of dofs (dual basis vectors) associated to mesh points on the reference cell of a given dimension
705
706 Not collective
707
708 Input Parameter:
709. fem - The PetscFE object
710
711 Output Parameter:
712. numDof - Array with the number of dofs per dimension
713
714 Level: intermediate
715
716.seealso: PetscFECreate()
717@*/
718PetscErrorCode PetscFEGetNumDof(PetscFE fem, const PetscInt **numDof)
719{
720 PetscErrorCode ierr;
721
722 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 722; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
723 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),723,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),723,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),723,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),723,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
724 PetscValidPointer(numDof, 2)do { if (!numDof) return PetscError(((MPI_Comm)0x44000001),724
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(numDof,PETSC_CHAR)) return PetscError(((
MPI_Comm)0x44000001),724,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
725 ierr = PetscDualSpaceGetNumDof(fem->dualSpace, numDof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),725,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
726 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
727}
728
729/*@C
730 PetscFEGetDefaultTabulation - Returns the tabulation of the basis functions at the quadrature points
731
732 Not collective
733
734 Input Parameter:
735. fem - The PetscFE object
736
737 Output Parameters:
738+ B - The basis function values at quadrature points
739. D - The basis function derivatives at quadrature points
740- H - The basis function second derivatives at quadrature points
741
742 Note:
743$ B[(p*pdim + i)*Nc + c] is the value at point p for basis function i and component c
744$ D[((p*pdim + i)*Nc + c)*dim + d] is the derivative value at point p for basis function i, component c, in direction d
745$ H[(((p*pdim + i)*Nc + c)*dim + d)*dim + e] is the value at point p for basis function i, component c, in directions d and e
746
747 Level: intermediate
748
749.seealso: PetscFEGetTabulation(), PetscFERestoreTabulation()
750@*/
751PetscErrorCode PetscFEGetDefaultTabulation(PetscFE fem, PetscReal **B, PetscReal **D, PetscReal **H)
752{
753 PetscInt npoints;
754 const PetscReal *points;
755 PetscErrorCode ierr;
756
757 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 757; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
758 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),758,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),758,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),758,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),758,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
759 if (B) PetscValidPointer(B, 2)do { if (!B) return PetscError(((MPI_Comm)0x44000001),759,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(B,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),759,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
760 if (D) PetscValidPointer(D, 3)do { if (!D) return PetscError(((MPI_Comm)0x44000001),760,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if (
!PetscCheckPointer(D,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),760,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
761 if (H) PetscValidPointer(H, 4)do { if (!H) return PetscError(((MPI_Comm)0x44000001),761,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",4); if (
!PetscCheckPointer(H,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),761,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",4);
} while (0)
;
762 ierr = PetscQuadratureGetData(fem->quadrature, NULL((void*)0), NULL((void*)0), &npoints, &points, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),762,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
763 if (!fem->B) {ierr = PetscFEGetTabulation(fem, npoints, points, &fem->B, &fem->D, NULL((void*)0)/*&fem->H*/);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),763,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
764 if (B) *B = fem->B;
765 if (D) *D = fem->D;
766 if (H) *H = fem->H;
767 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
768}
769
770PetscErrorCode PetscFEGetFaceTabulation(PetscFE fem, PetscReal **Bf, PetscReal **Df, PetscReal **Hf)
771{
772 PetscErrorCode ierr;
773
774 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 774; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
775 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),775,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),775,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),775,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),775,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
776 if (Bf) PetscValidPointer(Bf, 2)do { if (!Bf) return PetscError(((MPI_Comm)0x44000001),776,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(Bf,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),776,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
1
Assuming 'Bf' is null
2
Taking false branch
777 if (Df) PetscValidPointer(Df, 3)do { if (!Df) return PetscError(((MPI_Comm)0x44000001),777,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if (
!PetscCheckPointer(Df,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),777,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
3
Assuming 'Df' is null
4
Taking false branch
778 if (Hf) PetscValidPointer(Hf, 4)do { if (!Hf) return PetscError(((MPI_Comm)0x44000001),778,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",4); if (
!PetscCheckPointer(Hf,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),778,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",4);
} while (0)
;
5
Assuming 'Hf' is null
6
Taking false branch
779 if (!fem->Bf) {
7
Assuming the condition is true
8
Taking true branch
780 const PetscReal xi0[3] = {-1., -1., -1.};
781 PetscReal v0[3], J[9], detJ;
782 PetscQuadrature fq;
783 PetscDualSpace sp;
784 DM dm;
785 const PetscInt *faces;
786 PetscInt dim, numFaces, f, npoints, q;
787 const PetscReal *points;
788 PetscReal *facePoints;
789
790 ierr = PetscFEGetDualSpace(fem, &sp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),790,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
791 ierr = PetscDualSpaceGetDM(sp, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),791,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
792 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),792,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
793 ierr = DMPlexGetConeSize(dm, 0, &numFaces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),793,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
794 ierr = DMPlexGetCone(dm, 0, &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),794,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
795 ierr = PetscFEGetFaceQuadrature(fem, &fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),795,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
796 if (fq) {
9
Assuming 'fq' is non-null
10
Taking true branch
797 ierr = PetscQuadratureGetData(fq, NULL((void*)0), NULL((void*)0), &npoints, &points, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),797,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
798 ierr = PetscMalloc1(numFaces*npoints*dim, &facePoints)PetscMallocA(1,PETSC_FALSE,798,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(numFaces*npoints*dim)*sizeof(**(&facePoints)),(
&facePoints))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),798,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
799 for (f = 0; f < numFaces; ++f) {
11
Assuming 'f' is < 'numFaces'
12
Loop condition is true. Entering loop body
800 ierr = DMPlexComputeCellGeometryFEM(dm, faces[f], NULL((void*)0), v0, J, NULL((void*)0), &detJ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),800,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
801 for (q = 0; q < npoints; ++q) CoordinatesRefToReal(dim, dim-1, xi0, v0, J, &points[q*(dim-1)], &facePoints[(f*npoints+q)*dim]);
13
Assuming 'q' is < 'npoints'
14
Loop condition is true. Entering loop body
15
Calling 'CoordinatesRefToReal'
802 }
803 ierr = PetscFEGetTabulation(fem, numFaces*npoints, facePoints, &fem->Bf, &fem->Df, NULL((void*)0)/*&fem->Hf*/);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),803,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
804 ierr = PetscFree(facePoints)((*PetscTrFree)((void*)(facePoints),804,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
) || ((facePoints) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),804,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
805 }
806 }
807 if (Bf) *Bf = fem->Bf;
808 if (Df) *Df = fem->Df;
809 if (Hf) *Hf = fem->Hf;
810 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
811}
812
813PetscErrorCode PetscFEGetFaceCentroidTabulation(PetscFE fem, PetscReal **F)
814{
815 PetscErrorCode ierr;
816
817 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 817; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
818 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),818,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),818,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),818,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),818,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
819 PetscValidPointer(F, 2)do { if (!F) return PetscError(((MPI_Comm)0x44000001),819,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (
!PetscCheckPointer(F,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),819,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
820 if (!fem->F) {
821 PetscDualSpace sp;
822 DM dm;
823 const PetscInt *cone;
824 PetscReal *centroids;
825 PetscInt dim, numFaces, f;
826
827 ierr = PetscFEGetDualSpace(fem, &sp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),827,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
828 ierr = PetscDualSpaceGetDM(sp, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),828,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
829 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),829,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
830 ierr = DMPlexGetConeSize(dm, 0, &numFaces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),830,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
831 ierr = DMPlexGetCone(dm, 0, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),831,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
832 ierr = PetscMalloc1(numFaces*dim, &centroids)PetscMallocA(1,PETSC_FALSE,832,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(numFaces*dim)*sizeof(**(&centroids)),(&centroids
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),832,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
833 for (f = 0; f < numFaces; ++f) {ierr = DMPlexComputeCellGeometryFVM(dm, cone[f], NULL((void*)0), &centroids[f*dim], NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),833,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
834 ierr = PetscFEGetTabulation(fem, numFaces, centroids, &fem->F, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),834,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
835 ierr = PetscFree(centroids)((*PetscTrFree)((void*)(centroids),835,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
) || ((centroids) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),835,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
836 }
837 *F = fem->F;
838 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
839}
840
841/*@C
842 PetscFEGetTabulation - Tabulates the basis functions, and perhaps derivatives, at the points provided.
843
844 Not collective
845
846 Input Parameters:
847+ fem - The PetscFE object
848. npoints - The number of tabulation points
849- points - The tabulation point coordinates
850
851 Output Parameters:
852+ B - The basis function values at tabulation points
853. D - The basis function derivatives at tabulation points
854- H - The basis function second derivatives at tabulation points
855
856 Note:
857$ B[(p*pdim + i)*Nc + c] is the value at point p for basis function i and component c
858$ D[((p*pdim + i)*Nc + c)*dim + d] is the derivative value at point p for basis function i, component c, in direction d
859$ H[(((p*pdim + i)*Nc + c)*dim + d)*dim + e] is the value at point p for basis function i, component c, in directions d and e
860
861 Level: intermediate
862
863.seealso: PetscFERestoreTabulation(), PetscFEGetDefaultTabulation()
864@*/
865PetscErrorCode PetscFEGetTabulation(PetscFE fem, PetscInt npoints, const PetscReal points[], PetscReal **B, PetscReal **D, PetscReal **H)
866{
867 DM dm;
868 PetscInt pdim; /* Dimension of FE space P */
869 PetscInt dim; /* Spatial dimension */
870 PetscInt comp; /* Field components */
871 PetscErrorCode ierr;
872
873 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 873; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
874 if (!npoints) {
875 if (B) *B = NULL((void*)0);
876 if (D) *D = NULL((void*)0);
877 if (H) *H = NULL((void*)0);
878 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
879 }
880 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),880,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),880,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),880,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
881 PetscValidPointer(points, 3)do { if (!points) return PetscError(((MPI_Comm)0x44000001),881
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(points,PETSC_CHAR)) return PetscError(((
MPI_Comm)0x44000001),881,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
882 if (B) PetscValidPointer(B, 4)do { if (!B) return PetscError(((MPI_Comm)0x44000001),882,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",4); if (
!PetscCheckPointer(B,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),882,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",4);
} while (0)
;
883 if (D) PetscValidPointer(D, 5)do { if (!D) return PetscError(((MPI_Comm)0x44000001),883,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",5); if (
!PetscCheckPointer(D,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),883,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",5);
} while (0)
;
884 if (H) PetscValidPointer(H, 6)do { if (!H) return PetscError(((MPI_Comm)0x44000001),884,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",6); if (
!PetscCheckPointer(H,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),884,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",6);
} while (0)
;
885 ierr = PetscDualSpaceGetDM(fem->dualSpace, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),885,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
886 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),886,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
887 ierr = PetscDualSpaceGetDimension(fem->dualSpace, &pdim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),887,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
888 ierr = PetscFEGetNumComponents(fem, &comp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),888,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
889 if (B) {ierr = DMGetWorkArray(dm, npoints*pdim*comp, MPIU_REAL((MPI_Datatype)0x4c00080b), B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),889,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
890 if (!dim) {
891 if (D) *D = NULL((void*)0);
892 if (H) *H = NULL((void*)0);
893 } else {
894 if (D) {ierr = DMGetWorkArray(dm, npoints*pdim*comp*dim, MPIU_REAL((MPI_Datatype)0x4c00080b), D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),894,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
895 if (H) {ierr = DMGetWorkArray(dm, npoints*pdim*comp*dim*dim, MPIU_REAL((MPI_Datatype)0x4c00080b), H);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),895,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
896 }
897 ierr = (*fem->ops->gettabulation)(fem, npoints, points, B ? *B : NULL((void*)0), D ? *D : NULL((void*)0), H ? *H : NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),897,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
898 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
899}
900
901PetscErrorCode PetscFERestoreTabulation(PetscFE fem, PetscInt npoints, const PetscReal points[], PetscReal **B, PetscReal **D, PetscReal **H)
902{
903 DM dm;
904 PetscErrorCode ierr;
905
906 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 906; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
907 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),907,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),907,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),907,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),907,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
908 ierr = PetscDualSpaceGetDM(fem->dualSpace, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),908,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
909 if (B && *B) {ierr = DMRestoreWorkArray(dm, 0, MPIU_REAL((MPI_Datatype)0x4c00080b), B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),909,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
910 if (D && *D) {ierr = DMRestoreWorkArray(dm, 0, MPIU_REAL((MPI_Datatype)0x4c00080b), D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),910,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
911 if (H && *H) {ierr = DMRestoreWorkArray(dm, 0, MPIU_REAL((MPI_Datatype)0x4c00080b), H);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),911,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
912 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
913}
914
915PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFECreatePointTrace(PetscFE fe, PetscInt refPoint, PetscFE *trFE)
916{
917 PetscSpace bsp, bsubsp;
918 PetscDualSpace dsp, dsubsp;
919 PetscInt dim, depth, numComp, i, j, coneSize, order;
920 PetscFEType type;
921 DM dm;
922 DMLabel label;
923 PetscReal *xi, *v, *J, detJ;
924 const char *name;
925 PetscQuadrature origin, fullQuad, subQuad;
926 PetscErrorCode ierr;
927
928 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 928; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
929 PetscValidHeaderSpecific(fe,PETSCFE_CLASSID,1)do { if (!fe) return PetscError(((MPI_Comm)0x44000001),929,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fe,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),929,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fe))->classid != PETSCFE_CLASSID) {
if (((PetscObject)(fe))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),929,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),929,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
930 PetscValidPointer(trFE,3)do { if (!trFE) return PetscError(((MPI_Comm)0x44000001),930,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(trFE,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),930,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
931 ierr = PetscFEGetBasisSpace(fe,&bsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),931,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
932 ierr = PetscFEGetDualSpace(fe,&dsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),932,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
933 ierr = PetscDualSpaceGetDM(dsp,&dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),933,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
934 ierr = DMGetDimension(dm,&dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),934,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
935 ierr = DMPlexGetDepthLabel(dm,&label);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),935,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
936 ierr = DMLabelGetValue(label,refPoint,&depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),936,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
937 ierr = PetscCalloc1(depth,&xi)PetscMallocA(1,PETSC_TRUE,937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(depth)*sizeof(**(&xi)),(&xi))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),937,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
938 ierr = PetscMalloc1(dim,&v)PetscMallocA(1,PETSC_FALSE,938,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(dim)*sizeof(**(&v)),(&v))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),938,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
939 ierr = PetscMalloc1(dim*dim,&J)PetscMallocA(1,PETSC_FALSE,939,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(dim*dim)*sizeof(**(&J)),(&J))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),939,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
940 for (i = 0; i < depth; i++) xi[i] = 0.;
941 ierr = PetscQuadratureCreate(PETSC_COMM_SELF((MPI_Comm)0x44000001),&origin);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),941,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
942 ierr = PetscQuadratureSetData(origin,depth,0,1,xi,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),942,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
943 ierr = DMPlexComputeCellGeometryFEM(dm,refPoint,origin,v,J,NULL((void*)0),&detJ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),943,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
944 /* CellGeometryFEM computes the expanded Jacobian, we want the true jacobian */
945 for (i = 1; i < dim; i++) {
946 for (j = 0; j < depth; j++) {
947 J[i * depth + j] = J[i * dim + j];
948 }
949 }
950 ierr = PetscQuadratureDestroy(&origin);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),950,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
951 ierr = PetscDualSpaceGetPointSubspace(dsp,refPoint,&dsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),951,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
952 ierr = PetscSpaceCreateSubspace(bsp,dsubsp,v,J,NULL((void*)0),NULL((void*)0),PETSC_OWN_POINTER,&bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),952,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
953 ierr = PetscSpaceSetUp(bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),953,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
954 ierr = PetscFECreate(PetscObjectComm((PetscObject)fe),trFE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),954,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
955 ierr = PetscFEGetType(fe,&type);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),955,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
956 ierr = PetscFESetType(*trFE,type);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),956,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
957 ierr = PetscFEGetNumComponents(fe,&numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),957,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
958 ierr = PetscFESetNumComponents(*trFE,numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),958,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
959 ierr = PetscFESetBasisSpace(*trFE,bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),959,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
960 ierr = PetscFESetDualSpace(*trFE,dsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),960,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
961 ierr = PetscObjectGetName((PetscObject) fe, &name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),961,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
962 if (name) {ierr = PetscFESetName(*trFE, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),962,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
963 ierr = PetscFEGetQuadrature(fe,&fullQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),963,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
964 ierr = PetscQuadratureGetOrder(fullQuad,&order);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),964,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
965 ierr = DMPlexGetConeSize(dm,refPoint,&coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),965,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
966 if (coneSize == 2 * depth) {
967 ierr = PetscDTGaussTensorQuadrature(depth,1,(order + 1)/2,-1.,1.,&subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),967,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
968 } else {
969 ierr = PetscDTGaussJacobiQuadrature(depth,1,(order + 1)/2,-1.,1.,&subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),969,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
970 }
971 ierr = PetscFESetQuadrature(*trFE,subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),971,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
972 ierr = PetscFESetUp(*trFE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),972,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
973 ierr = PetscQuadratureDestroy(&subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),973,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
974 ierr = PetscSpaceDestroy(&bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),974,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
975 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
976}
977
978PetscErrorCode PetscFECreateHeightTrace(PetscFE fe, PetscInt height, PetscFE *trFE)
979{
980 PetscInt hStart, hEnd;
981 PetscDualSpace dsp;
982 DM dm;
983 PetscErrorCode ierr;
984
985 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 985; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
986 PetscValidHeaderSpecific(fe,PETSCFE_CLASSID,1)do { if (!fe) return PetscError(((MPI_Comm)0x44000001),986,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fe,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),986,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fe))->classid != PETSCFE_CLASSID) {
if (((PetscObject)(fe))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),986,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),986,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
987 PetscValidPointer(trFE,3)do { if (!trFE) return PetscError(((MPI_Comm)0x44000001),987,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(trFE,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),987,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
988 *trFE = NULL((void*)0);
989 ierr = PetscFEGetDualSpace(fe,&dsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),989,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
990 ierr = PetscDualSpaceGetDM(dsp,&dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),990,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
991 ierr = DMPlexGetHeightStratum(dm,height,&hStart,&hEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),991,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
992 if (hEnd <= hStart) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
993 ierr = PetscFECreatePointTrace(fe,hStart,trFE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),993,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
994 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
995}
996
997
998/*@
999 PetscFEGetDimension - Get the dimension of the finite element space on a cell
1000
1001 Not collective
1002
1003 Input Parameter:
1004. fe - The PetscFE
1005
1006 Output Parameter:
1007. dim - The dimension
1008
1009 Level: intermediate
1010
1011.seealso: PetscFECreate(), PetscSpaceGetDimension(), PetscDualSpaceGetDimension()
1012@*/
1013PetscErrorCode PetscFEGetDimension(PetscFE fem, PetscInt *dim)
1014{
1015 PetscErrorCode ierr;
1016
1017 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1017; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1018 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1018,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1018,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1018,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1018,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1019 PetscValidPointer(dim, 2)do { if (!dim) return PetscError(((MPI_Comm)0x44000001),1019,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if
(!PetscCheckPointer(dim,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),1019,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
1020 if (fem->ops->getdimension) {ierr = (*fem->ops->getdimension)(fem, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1020,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1021 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1022}
1023
1024/*
1025Purpose: Compute element vector for chunk of elements
1026
1027Input:
1028 Sizes:
1029 Ne: number of elements
1030 Nf: number of fields
1031 PetscFE
1032 dim: spatial dimension
1033 Nb: number of basis functions
1034 Nc: number of field components
1035 PetscQuadrature
1036 Nq: number of quadrature points
1037
1038 Geometry:
1039 PetscFEGeom[Ne] possibly *Nq
1040 PetscReal v0s[dim]
1041 PetscReal n[dim]
1042 PetscReal jacobians[dim*dim]
1043 PetscReal jacobianInverses[dim*dim]
1044 PetscReal jacobianDeterminants
1045 FEM:
1046 PetscFE
1047 PetscQuadrature
1048 PetscReal quadPoints[Nq*dim]
1049 PetscReal quadWeights[Nq]
1050 PetscReal basis[Nq*Nb*Nc]
1051 PetscReal basisDer[Nq*Nb*Nc*dim]
1052 PetscScalar coefficients[Ne*Nb*Nc]
1053 PetscScalar elemVec[Ne*Nb*Nc]
1054
1055 Problem:
1056 PetscInt f: the active field
1057 f0, f1
1058
1059 Work Space:
1060 PetscFE
1061 PetscScalar f0[Nq*dim];
1062 PetscScalar f1[Nq*dim*dim];
1063 PetscScalar u[Nc];
1064 PetscScalar gradU[Nc*dim];
1065 PetscReal x[dim];
1066 PetscScalar realSpaceDer[dim];
1067
1068Purpose: Compute element vector for N_cb batches of elements
1069
1070Input:
1071 Sizes:
1072 N_cb: Number of serial cell batches
1073
1074 Geometry:
1075 PetscReal v0s[Ne*dim]
1076 PetscReal jacobians[Ne*dim*dim] possibly *Nq
1077 PetscReal jacobianInverses[Ne*dim*dim] possibly *Nq
1078 PetscReal jacobianDeterminants[Ne] possibly *Nq
1079 FEM:
1080 static PetscReal quadPoints[Nq*dim]
1081 static PetscReal quadWeights[Nq]
1082 static PetscReal basis[Nq*Nb*Nc]
1083 static PetscReal basisDer[Nq*Nb*Nc*dim]
1084 PetscScalar coefficients[Ne*Nb*Nc]
1085 PetscScalar elemVec[Ne*Nb*Nc]
1086
1087ex62.c:
1088 PetscErrorCode PetscFEIntegrateResidualBatch(PetscInt Ne, PetscInt numFields, PetscInt field, PetscQuadrature quad[], const PetscScalar coefficients[],
1089 const PetscReal v0s[], const PetscReal jacobians[], const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[],
1090 void (*f0_func)(const PetscScalar u[], const PetscScalar gradU[], const PetscReal x[], PetscScalar f0[]),
1091 void (*f1_func)(const PetscScalar u[], const PetscScalar gradU[], const PetscReal x[], PetscScalar f1[]), PetscScalar elemVec[])
1092
1093ex52.c:
1094 PetscErrorCode IntegrateLaplacianBatchCPU(PetscInt Ne, PetscInt Nb, const PetscScalar coefficients[], const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[], PetscInt Nq, const PetscReal quadPoints[], const PetscReal quadWeights[], const PetscReal basisTabulation[], const PetscReal basisDerTabulation[], PetscScalar elemVec[], AppCtx *user)
1095 PetscErrorCode IntegrateElasticityBatchCPU(PetscInt Ne, PetscInt Nb, PetscInt Ncomp, const PetscScalar coefficients[], const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[], PetscInt Nq, const PetscReal quadPoints[], const PetscReal quadWeights[], const PetscReal basisTabulation[], const PetscReal basisDerTabulation[], PetscScalar elemVec[], AppCtx *user)
1096
1097ex52_integrateElement.cu
1098__global__ void integrateElementQuadrature(int N_cb, realType *coefficients, realType *jacobianInverses, realType *jacobianDeterminants, realType *elemVec)
1099
1100PETSC_EXTERN PetscErrorCode IntegrateElementBatchGPU(PetscInt spatial_dim, PetscInt Ne, PetscInt Ncb, PetscInt Nbc, PetscInt Nbl, const PetscScalar coefficients[],
1101 const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[], PetscScalar elemVec[],
1102 PetscLogEvent event, PetscInt debug, PetscInt pde_op)
1103
1104ex52_integrateElementOpenCL.c:
1105PETSC_EXTERN PetscErrorCode IntegrateElementBatchGPU(PetscInt spatial_dim, PetscInt Ne, PetscInt Ncb, PetscInt Nbc, PetscInt N_bl, const PetscScalar coefficients[],
1106 const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[], PetscScalar elemVec[],
1107 PetscLogEvent event, PetscInt debug, PetscInt pde_op)
1108
1109__kernel void integrateElementQuadrature(int N_cb, __global float *coefficients, __global float *jacobianInverses, __global float *jacobianDeterminants, __global float *elemVec)
1110*/
1111
1112/*@C
1113 PetscFEIntegrate - Produce the integral for the given field for a chunk of elements by quadrature integration
1114
1115 Not collective
1116
1117 Input Parameters:
1118+ fem - The PetscFE object for the field being integrated
1119. prob - The PetscDS specifying the discretizations and continuum functions
1120. field - The field being integrated
1121. Ne - The number of elements in the chunk
1122. cgeom - The cell geometry for each cell in the chunk
1123. coefficients - The array of FEM basis coefficients for the elements
1124. probAux - The PetscDS specifying the auxiliary discretizations
1125- coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1126
1127 Output Parameter
1128. integral - the integral for this field
1129
1130 Level: developer
1131
1132.seealso: PetscFEIntegrateResidual()
1133@*/
1134PetscErrorCode PetscFEIntegrate(PetscFE fem, PetscDS prob, PetscInt field, PetscInt Ne, PetscFEGeom *cgeom,
1135 const PetscScalar coefficients[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscScalar integral[])
1136{
1137 PetscErrorCode ierr;
1138
1139 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1139; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1140 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1140,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1140,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1140,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1140,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1141 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 2)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1141
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1141,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1141,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),1141,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
1142 if (fem->ops->integrate) {ierr = (*fem->ops->integrate)(fem, prob, field, Ne, cgeom, coefficients, probAux, coefficientsAux, integral);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1142,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1143 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1144}
1145
1146/*@C
1147 PetscFEIntegrateBd - Produce the integral for the given field for a chunk of elements by quadrature integration
1148
1149 Not collective
1150
1151 Input Parameters:
1152+ fem - The PetscFE object for the field being integrated
1153. prob - The PetscDS specifying the discretizations and continuum functions
1154. field - The field being integrated
1155. obj_func - The function to be integrated
1156. Ne - The number of elements in the chunk
1157. fgeom - The face geometry for each face in the chunk
1158. coefficients - The array of FEM basis coefficients for the elements
1159. probAux - The PetscDS specifying the auxiliary discretizations
1160- coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1161
1162 Output Parameter
1163. integral - the integral for this field
1164
1165 Level: developer
1166
1167.seealso: PetscFEIntegrateResidual()
1168@*/
1169PetscErrorCode PetscFEIntegrateBd(PetscFE fem, PetscDS prob, PetscInt field,
1170 void (*obj_func)(PetscInt, PetscInt, PetscInt,
1171 const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[],
1172 const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[],
1173 PetscReal, const PetscReal[], const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]),
1174 PetscInt Ne, PetscFEGeom *geom, const PetscScalar coefficients[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscScalar integral[])
1175{
1176 PetscErrorCode ierr;
1177
1178 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1178; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1179 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1179,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1179,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1179,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1179,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1180 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 2)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1180
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1180,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1180,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),1180,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
1181 if (fem->ops->integratebd) {ierr = (*fem->ops->integratebd)(fem, prob, field, obj_func, Ne, geom, coefficients, probAux, coefficientsAux, integral);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1181,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1182 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1183}
1184
1185/*@C
1186 PetscFEIntegrateResidual - Produce the element residual vector for a chunk of elements by quadrature integration
1187
1188 Not collective
1189
1190 Input Parameters:
1191+ fem - The PetscFE object for the field being integrated
1192. prob - The PetscDS specifying the discretizations and continuum functions
1193. field - The field being integrated
1194. Ne - The number of elements in the chunk
1195. cgeom - The cell geometry for each cell in the chunk
1196. coefficients - The array of FEM basis coefficients for the elements
1197. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1198. probAux - The PetscDS specifying the auxiliary discretizations
1199. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1200- t - The time
1201
1202 Output Parameter
1203. elemVec - the element residual vectors from each element
1204
1205 Note:
1206$ Loop over batch of elements (e):
1207$ Loop over quadrature points (q):
1208$ Make u_q and gradU_q (loops over fields,Nb,Ncomp) and x_q
1209$ Call f_0 and f_1
1210$ Loop over element vector entries (f,fc --> i):
1211$ elemVec[i] += \psi^{fc}_f(q) f0_{fc}(u, \nabla u) + \nabla\psi^{fc}_f(q) \cdot f1_{fc,df}(u, \nabla u)
1212
1213 Level: developer
1214
1215.seealso: PetscFEIntegrateResidual()
1216@*/
1217PetscErrorCode PetscFEIntegrateResidual(PetscFE fem, PetscDS prob, PetscInt field, PetscInt Ne, PetscFEGeom *cgeom,
1218 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscScalar elemVec[])
1219{
1220 PetscErrorCode ierr;
1221
1222 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1222; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1223 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1223,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1223,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1223,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1223,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1224 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 2)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1224
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1224,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1224,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),1224,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,2); } } while (0)
;
1225 if (fem->ops->integrateresidual) {ierr = (*fem->ops->integrateresidual)(fem, prob, field, Ne, cgeom, coefficients, coefficients_t, probAux, coefficientsAux, t, elemVec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1225,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1226 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1227}
1228
1229/*@C
1230 PetscFEIntegrateBdResidual - Produce the element residual vector for a chunk of elements by quadrature integration over a boundary
1231
1232 Not collective
1233
1234 Input Parameters:
1235+ fem - The PetscFE object for the field being integrated
1236. prob - The PetscDS specifying the discretizations and continuum functions
1237. field - The field being integrated
1238. Ne - The number of elements in the chunk
1239. fgeom - The face geometry for each cell in the chunk
1240. coefficients - The array of FEM basis coefficients for the elements
1241. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1242. probAux - The PetscDS specifying the auxiliary discretizations
1243. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1244- t - The time
1245
1246 Output Parameter
1247. elemVec - the element residual vectors from each element
1248
1249 Level: developer
1250
1251.seealso: PetscFEIntegrateResidual()
1252@*/
1253PetscErrorCode PetscFEIntegrateBdResidual(PetscFE fem, PetscDS prob, PetscInt field, PetscInt Ne, PetscFEGeom *fgeom,
1254 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscScalar elemVec[])
1255{
1256 PetscErrorCode ierr;
1257
1258 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1258; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1259 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1259,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1259,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1259,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1259,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1260 if (fem->ops->integratebdresidual) {ierr = (*fem->ops->integratebdresidual)(fem, prob, field, Ne, fgeom, coefficients, coefficients_t, probAux, coefficientsAux, t, elemVec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1260,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1261 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1262}
1263
1264/*@C
1265 PetscFEIntegrateJacobian - Produce the element Jacobian for a chunk of elements by quadrature integration
1266
1267 Not collective
1268
1269 Input Parameters:
1270+ fem - The PetscFE object for the field being integrated
1271. prob - The PetscDS specifying the discretizations and continuum functions
1272. jtype - The type of matrix pointwise functions that should be used
1273. fieldI - The test field being integrated
1274. fieldJ - The basis field being integrated
1275. Ne - The number of elements in the chunk
1276. cgeom - The cell geometry for each cell in the chunk
1277. coefficients - The array of FEM basis coefficients for the elements for the Jacobian evaluation point
1278. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1279. probAux - The PetscDS specifying the auxiliary discretizations
1280. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1281. t - The time
1282- u_tShift - A multiplier for the dF/du_t term (as opposed to the dF/du term)
1283
1284 Output Parameter
1285. elemMat - the element matrices for the Jacobian from each element
1286
1287 Note:
1288$ Loop over batch of elements (e):
1289$ Loop over element matrix entries (f,fc,g,gc --> i,j):
1290$ Loop over quadrature points (q):
1291$ Make u_q and gradU_q (loops over fields,Nb,Ncomp)
1292$ elemMat[i,j] += \psi^{fc}_f(q) g0_{fc,gc}(u, \nabla u) \phi^{gc}_g(q)
1293$ + \psi^{fc}_f(q) \cdot g1_{fc,gc,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1294$ + \nabla\psi^{fc}_f(q) \cdot g2_{fc,gc,df}(u, \nabla u) \phi^{gc}_g(q)
1295$ + \nabla\psi^{fc}_f(q) \cdot g3_{fc,gc,df,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1296 Level: developer
1297
1298.seealso: PetscFEIntegrateResidual()
1299@*/
1300PetscErrorCode PetscFEIntegrateJacobian(PetscFE fem, PetscDS prob, PetscFEJacobianType jtype, PetscInt fieldI, PetscInt fieldJ, PetscInt Ne, PetscFEGeom *cgeom,
1301 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscReal u_tshift, PetscScalar elemMat[])
1302{
1303 PetscErrorCode ierr;
1304
1305 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1305; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1306 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1306,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1306,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1306,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1306,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1307 if (fem->ops->integratejacobian) {ierr = (*fem->ops->integratejacobian)(fem, prob, jtype, fieldI, fieldJ, Ne, cgeom, coefficients, coefficients_t, probAux, coefficientsAux, t, u_tshift, elemMat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1307,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1308 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1309}
1310
1311/*@C
1312 PetscFEIntegrateBdJacobian - Produce the boundary element Jacobian for a chunk of elements by quadrature integration
1313
1314 Not collective
1315
1316 Input Parameters:
1317+ fem = The PetscFE object for the field being integrated
1318. prob - The PetscDS specifying the discretizations and continuum functions
1319. fieldI - The test field being integrated
1320. fieldJ - The basis field being integrated
1321. Ne - The number of elements in the chunk
1322. fgeom - The face geometry for each cell in the chunk
1323. coefficients - The array of FEM basis coefficients for the elements for the Jacobian evaluation point
1324. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1325. probAux - The PetscDS specifying the auxiliary discretizations
1326. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1327. t - The time
1328- u_tShift - A multiplier for the dF/du_t term (as opposed to the dF/du term)
1329
1330 Output Parameter
1331. elemMat - the element matrices for the Jacobian from each element
1332
1333 Note:
1334$ Loop over batch of elements (e):
1335$ Loop over element matrix entries (f,fc,g,gc --> i,j):
1336$ Loop over quadrature points (q):
1337$ Make u_q and gradU_q (loops over fields,Nb,Ncomp)
1338$ elemMat[i,j] += \psi^{fc}_f(q) g0_{fc,gc}(u, \nabla u) \phi^{gc}_g(q)
1339$ + \psi^{fc}_f(q) \cdot g1_{fc,gc,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1340$ + \nabla\psi^{fc}_f(q) \cdot g2_{fc,gc,df}(u, \nabla u) \phi^{gc}_g(q)
1341$ + \nabla\psi^{fc}_f(q) \cdot g3_{fc,gc,df,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1342 Level: developer
1343
1344.seealso: PetscFEIntegrateJacobian(), PetscFEIntegrateResidual()
1345@*/
1346PetscErrorCode PetscFEIntegrateBdJacobian(PetscFE fem, PetscDS prob, PetscInt fieldI, PetscInt fieldJ, PetscInt Ne, PetscFEGeom *fgeom,
1347 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscReal u_tshift, PetscScalar elemMat[])
1348{
1349 PetscErrorCode ierr;
1350
1351 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1351; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1352 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1352,
__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fem,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1352,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fem))->classid != PETSCFE_CLASSID)
{ if (((PetscObject)(fem))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1352,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1352,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1353 if (fem->ops->integratebdjacobian) {ierr = (*fem->ops->integratebdjacobian)(fem, prob, fieldI, fieldJ, Ne, fgeom, coefficients, coefficients_t, probAux, coefficientsAux, t, u_tshift, elemMat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1353,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1354 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1355}
1356
1357PetscErrorCode PetscFEGetHeightSubspace(PetscFE fe, PetscInt height, PetscFE *subfe)
1358{
1359 PetscSpace P, subP;
1360 PetscDualSpace Q, subQ;
1361 PetscQuadrature subq;
1362 PetscFEType fetype;
1363 PetscInt dim, Nc;
1364 PetscErrorCode ierr;
1365
1366 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1366; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1367 PetscValidHeaderSpecific(fe, PETSCFE_CLASSID, 1)do { if (!fe) return PetscError(((MPI_Comm)0x44000001),1367,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fe,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1367,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fe))->classid != PETSCFE_CLASSID) {
if (((PetscObject)(fe))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1367,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1367,__func__
,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c",
62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
1368 PetscValidPointer(subfe, 3)do { if (!subfe) return PetscError(((MPI_Comm)0x44000001),1368
,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(subfe,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),1368,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
1369 if (height == 0) {
1370 *subfe = fe;
1371 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1372 }
1373 ierr = PetscFEGetBasisSpace(fe, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1373,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1374 ierr = PetscFEGetDualSpace(fe, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1374,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1375 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1375,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1376 ierr = PetscFEGetFaceQuadrature(fe, &subq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1376,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1377 ierr = PetscDualSpaceGetDimension(Q, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1377,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1378 if (height > dim || height < 0) {SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Asked for space at height %D for dimension %D space", height, dim)return PetscError(((MPI_Comm)0x44000001),1378,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,63,PETSC_ERROR_INITIAL,"Asked for space at height %D for dimension %D space"
,height,dim)
;}
1379 if (!fe->subspaces) {ierr = PetscCalloc1(dim, &fe->subspaces)PetscMallocA(1,PETSC_TRUE,1379,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,(size_t)(dim)*sizeof(**(&fe->subspaces)),(&fe->
subspaces))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1379,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1380 if (height <= dim) {
1381 if (!fe->subspaces[height-1]) {
1382 PetscFE sub;
1383 const char *name;
1384
1385 ierr = PetscSpaceGetHeightSubspace(P, height, &subP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1385,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1386 ierr = PetscDualSpaceGetHeightSubspace(Q, height, &subQ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1386,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1387 ierr = PetscFECreate(PetscObjectComm((PetscObject) fe), &sub);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1387,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1388 ierr = PetscObjectGetName((PetscObject) fe, &name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1388,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1389 ierr = PetscObjectSetName((PetscObject) sub, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1389,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1390 ierr = PetscFEGetType(fe, &fetype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1390,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1391 ierr = PetscFESetType(sub, fetype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1391,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1392 ierr = PetscFESetBasisSpace(sub, subP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1392,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1393 ierr = PetscFESetDualSpace(sub, subQ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1393,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1394 ierr = PetscFESetNumComponents(sub, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1394,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1395 ierr = PetscFESetUp(sub);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1395,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1396 ierr = PetscFESetQuadrature(sub, subq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1396,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1397 fe->subspaces[height-1] = sub;
1398 }
1399 *subfe = fe->subspaces[height-1];
1400 } else {
1401 *subfe = NULL((void*)0);
1402 }
1403 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1404}
1405
1406/*@
1407 PetscFERefine - Create a "refined" PetscFE object that refines the reference cell into smaller copies. This is typically used
1408 to precondition a higher order method with a lower order method on a refined mesh having the same number of dofs (but more
1409 sparsity). It is also used to create an interpolation between regularly refined meshes.
1410
1411 Collective on PetscFE
1412
1413 Input Parameter:
1414. fe - The initial PetscFE
1415
1416 Output Parameter:
1417. feRef - The refined PetscFE
1418
1419 Level: developer
1420
1421.seealso: PetscFEType, PetscFECreate(), PetscFESetType()
1422@*/
1423PetscErrorCode PetscFERefine(PetscFE fe, PetscFE *feRef)
1424{
1425 PetscSpace P, Pref;
1426 PetscDualSpace Q, Qref;
1427 DM K, Kref;
1428 PetscQuadrature q, qref;
1429 const PetscReal *v0, *jac;
1430 PetscInt numComp, numSubelements;
1431 PetscErrorCode ierr;
1432
1433 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1433; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1434 ierr = PetscFEGetBasisSpace(fe, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1434,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1435 ierr = PetscFEGetDualSpace(fe, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1435,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1436 ierr = PetscFEGetQuadrature(fe, &q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1436,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1437 ierr = PetscDualSpaceGetDM(Q, &K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1437,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1438 /* Create space */
1439 ierr = PetscObjectReference((PetscObject) P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1439,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1440 Pref = P;
1441 /* Create dual space */
1442 ierr = PetscDualSpaceDuplicate(Q, &Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1442,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1443 ierr = DMRefine(K, PetscObjectComm((PetscObject) fe), &Kref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1443,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1444 ierr = PetscDualSpaceSetDM(Qref, Kref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1444,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1445 ierr = DMDestroy(&Kref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1445,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1446 ierr = PetscDualSpaceSetUp(Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1446,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1447 /* Create element */
1448 ierr = PetscFECreate(PetscObjectComm((PetscObject) fe), feRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1448,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1449 ierr = PetscFESetType(*feRef, PETSCFECOMPOSITE"composite");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1449,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1450 ierr = PetscFESetBasisSpace(*feRef, Pref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1450,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1451 ierr = PetscFESetDualSpace(*feRef, Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1451,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1452 ierr = PetscFEGetNumComponents(fe, &numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1452,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1453 ierr = PetscFESetNumComponents(*feRef, numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1453,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1454 ierr = PetscFESetUp(*feRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1454,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1455 ierr = PetscSpaceDestroy(&Pref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1455,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1456 ierr = PetscDualSpaceDestroy(&Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1456,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1457 /* Create quadrature */
1458 ierr = PetscFECompositeGetMapping(*feRef, &numSubelements, &v0, &jac, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1458,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1459 ierr = PetscQuadratureExpandComposite(q, numSubelements, v0, jac, &qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1459,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1460 ierr = PetscFESetQuadrature(*feRef, qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1460,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1461 ierr = PetscQuadratureDestroy(&qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1461,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1462 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1463}
1464
1465/*@C
1466 PetscFECreateDefault - Create a PetscFE for basic FEM computation
1467
1468 Collective on DM
1469
1470 Input Parameters:
1471+ comm - The MPI comm
1472. dim - The spatial dimension
1473. Nc - The number of components
1474. isSimplex - Flag for simplex reference cell, otherwise its a tensor product
1475. prefix - The options prefix, or NULL
1476- qorder - The quadrature order
1477
1478 Output Parameter:
1479. fem - The PetscFE object
1480
1481 Level: beginner
1482
1483.keywords: PetscFE, finite element
1484.seealso: PetscFECreate(), PetscSpaceCreate(), PetscDualSpaceCreate()
1485@*/
1486PetscErrorCode PetscFECreateDefault(MPI_Comm comm, PetscInt dim, PetscInt Nc, PetscBool isSimplex, const char prefix[], PetscInt qorder, PetscFE *fem)
1487{
1488 PetscQuadrature q, fq;
1489 DM K;
1490 PetscSpace P;
1491 PetscDualSpace Q;
1492 PetscInt order, quadPointsPerEdge;
1493 PetscBool tensor = isSimplex ? PETSC_FALSE : PETSC_TRUE;
1494 PetscErrorCode ierr;
1495
1496 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1496; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1497 /* Create space */
1498 ierr = PetscSpaceCreate(comm, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1498,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1499 ierr = PetscObjectSetOptionsPrefix((PetscObject) P, prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1499,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1500 ierr = PetscSpacePolynomialSetTensor(P, tensor);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1500,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1501 ierr = PetscSpaceSetNumComponents(P, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1501,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1502 ierr = PetscSpaceSetNumVariables(P, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1502,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1503 ierr = PetscSpaceSetFromOptions(P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1503,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1504 ierr = PetscSpaceSetUp(P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1504,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1505 ierr = PetscSpaceGetDegree(P, &order, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1505,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1506 ierr = PetscSpacePolynomialGetTensor(P, &tensor);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1506,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1507 /* Create dual space */
1508 ierr = PetscDualSpaceCreate(comm, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1508,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1509 ierr = PetscDualSpaceSetType(Q,PETSCDUALSPACELAGRANGE"lagrange");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1509,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1510 ierr = PetscObjectSetOptionsPrefix((PetscObject) Q, prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1510,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1511 ierr = PetscDualSpaceCreateReferenceCell(Q, dim, isSimplex, &K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1511,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1512 ierr = PetscDualSpaceSetDM(Q, K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1512,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1513 ierr = DMDestroy(&K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1513,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1514 ierr = PetscDualSpaceSetNumComponents(Q, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1514,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1515 ierr = PetscDualSpaceSetOrder(Q, order);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1515,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1516 ierr = PetscDualSpaceLagrangeSetTensor(Q, tensor);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1516,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1517 ierr = PetscDualSpaceSetFromOptions(Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1517,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1518 ierr = PetscDualSpaceSetUp(Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1518,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1519 /* Create element */
1520 ierr = PetscFECreate(comm, fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1520,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1521 ierr = PetscObjectSetOptionsPrefix((PetscObject) *fem, prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1521,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1522 ierr = PetscFESetFromOptions(*fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1522,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1523 ierr = PetscFESetBasisSpace(*fem, P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1523,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1524 ierr = PetscFESetDualSpace(*fem, Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1524,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1525 ierr = PetscFESetNumComponents(*fem, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1525,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1526 ierr = PetscFESetUp(*fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1526,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1527 ierr = PetscSpaceDestroy(&P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1527,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1528 ierr = PetscDualSpaceDestroy(&Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1528,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1529 /* Create quadrature (with specified order if given) */
1530 qorder = qorder >= 0 ? qorder : order;
1531 ierr = PetscObjectOptionsBegin((PetscObject)*fem)0; do { PetscOptionItems PetscOptionsObjectBase; PetscOptionItems
*PetscOptionsObject = &PetscOptionsObjectBase; PetscOptionsObject
->options = ((PetscObject)(PetscObject)*fem)->options; for
(PetscOptionsObject->count=(PetscOptionsPublish?-1:1); PetscOptionsObject
->count<2; PetscOptionsObject->count++) { PetscErrorCode
_5_ierr = PetscObjectOptionsBegin_Private(PetscOptionsObject
,(PetscObject)*fem);do {if (__builtin_expect(!!(_5_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),1531,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,_5_ierr,PETSC_ERROR_REPEAT," ");} while (0);
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1531,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1532 ierr = PetscOptionsInt("-petscfe_default_quadrature_order","Quadrature order is one less than quadture points per edge","PetscFECreateDefault",qorder,&qorder,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-petscfe_default_quadrature_order"
,"Quadrature order is one less than quadture points per edge"
,"PetscFECreateDefault",qorder,&qorder,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1532,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1533 ierr = PetscOptionsEnd()_5_ierr = PetscOptionsEnd_Private(PetscOptionsObject);do {if (
__builtin_expect(!!(_5_ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1533,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,_5_ierr,PETSC_ERROR_REPEAT," ");} while (0);}} while (0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1533,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1534 quadPointsPerEdge = PetscMax(qorder + 1,1)(((qorder + 1)<(1)) ? (1) : (qorder + 1));
1535 if (isSimplex) {
1536 ierr = PetscDTGaussJacobiQuadrature(dim, 1, quadPointsPerEdge, -1.0, 1.0, &q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1536,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1537 ierr = PetscDTGaussJacobiQuadrature(dim-1, 1, quadPointsPerEdge, -1.0, 1.0, &fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1537,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1538 } else {
1539 ierr = PetscDTGaussTensorQuadrature(dim, 1, quadPointsPerEdge, -1.0, 1.0, &q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1539,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1540 ierr = PetscDTGaussTensorQuadrature(dim-1, 1, quadPointsPerEdge, -1.0, 1.0, &fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1540,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1541 }
1542 ierr = PetscFESetQuadrature(*fem, q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1542,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1543 ierr = PetscFESetFaceQuadrature(*fem, fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1543,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1544 ierr = PetscQuadratureDestroy(&q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1544,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1545 ierr = PetscQuadratureDestroy(&fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1545,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1546 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1547}
1548
1549/*@C
1550 PetscFESetName - Names the FE and its subobjects
1551
1552 Not collective
1553
1554 Input Parameters:
1555+ fe - The PetscFE
1556- name - The name
1557
1558 Level: beginner
1559
1560.keywords: PetscFE, finite element
1561.seealso: PetscFECreate(), PetscSpaceCreate(), PetscDualSpaceCreate()
1562@*/
1563PetscErrorCode PetscFESetName(PetscFE fe, const char name[])
1564{
1565 PetscSpace P;
1566 PetscDualSpace Q;
1567 PetscErrorCode ierr;
1568
1569 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
; petscstack->line[petscstack->currentsize] = 1569; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1570 ierr = PetscFEGetBasisSpace(fe, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1570,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1571 ierr = PetscFEGetDualSpace(fe, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1571,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1572 ierr = PetscObjectSetName((PetscObject) fe, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1572,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1573 ierr = PetscObjectSetName((PetscObject) P, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1573,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1574 ierr = PetscObjectSetName((PetscObject) Q, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1574,__func__,"/sandbox/petsc/petsc.next-tmp/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1575 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
1576}

/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h

1#if !defined(PETSCFEIMPL_H)
2#define PETSCFEIMPL_H
3
4#include <petscfe.h>
5#include <petscds.h>
6#include <petsc/private/petscimpl.h>
7#include <petsc/private/dmpleximpl.h>
8
9PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscBool PetscSpaceRegisterAllCalled;
10PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscBool PetscDualSpaceRegisterAllCalled;
11PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscBool PetscFERegisterAllCalled;
12PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscSpaceRegisterAll(void);
13PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscDualSpaceRegisterAll(void);
14PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFERegisterAll(void);
15
16PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscBool FEcite;
17PETSC_EXTERNextern __attribute__((visibility ("default"))) const char FECitation[];
18
19typedef struct _PetscSpaceOps *PetscSpaceOps;
20struct _PetscSpaceOps {
21 PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscSpace);
22 PetscErrorCode (*setup)(PetscSpace);
23 PetscErrorCode (*view)(PetscSpace,PetscViewer);
24 PetscErrorCode (*destroy)(PetscSpace);
25
26 PetscErrorCode (*getdimension)(PetscSpace,PetscInt*);
27 PetscErrorCode (*evaluate)(PetscSpace,PetscInt,const PetscReal*,PetscReal*,PetscReal*,PetscReal*);
28 PetscErrorCode (*getheightsubspace)(PetscSpace,PetscInt,PetscSpace *);
29};
30
31struct _p_PetscSpace {
32 PETSCHEADER(struct _PetscSpaceOps)_p_PetscObject hdr; struct _PetscSpaceOps ops[1];
33 void *data; /* Implementation object */
34 PetscInt degree; /* The approximation order of the space */
35 PetscInt maxDegree; /* The containing approximation order of the space */
36 PetscInt Nc; /* The number of components */
37 PetscInt Nv; /* The number of variables in the space, e.g. x and y */
38 PetscInt dim; /* The dimension of the space */
39 DM dm; /* Shell to use for temp allocation */
40};
41
42typedef struct {
43 PetscBool symmetric; /* Use only symmetric polynomials */
44 PetscBool tensor; /* Flag for tensor product */
45 PetscInt *degrees; /* Degrees of single variable which we need to compute */
46 PetscBool setupCalled;
47 PetscSpace *subspaces; /* Subspaces for each dimension */
48} PetscSpace_Poly;
49
50typedef struct {
51 PetscSpace *tensspaces;
52 PetscInt numTensSpaces;
53 PetscInt dim;
54 PetscBool uniform;
55 PetscBool setupCalled;
56 PetscSpace *heightsubspaces; /* Height subspaces */
57} PetscSpace_Tensor;
58
59typedef struct {
60 PetscQuadrature quad; /* The points defining the space */
61} PetscSpace_Point;
62
63typedef struct _PetscDualSpaceOps *PetscDualSpaceOps;
64struct _PetscDualSpaceOps {
65 PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscDualSpace);
66 PetscErrorCode (*setup)(PetscDualSpace);
67 PetscErrorCode (*view)(PetscDualSpace,PetscViewer);
68 PetscErrorCode (*destroy)(PetscDualSpace);
69
70 PetscErrorCode (*duplicate)(PetscDualSpace,PetscDualSpace*);
71 PetscErrorCode (*getdimension)(PetscDualSpace,PetscInt*);
72 PetscErrorCode (*getnumdof)(PetscDualSpace,const PetscInt**);
73 PetscErrorCode (*getheightsubspace)(PetscDualSpace,PetscInt,PetscDualSpace *);
74 PetscErrorCode (*getpointsubspace)(PetscDualSpace,PetscInt,PetscDualSpace *);
75 PetscErrorCode (*getsymmetries)(PetscDualSpace,const PetscInt****,const PetscScalar****);
76 PetscErrorCode (*apply)(PetscDualSpace, PetscInt, PetscReal, PetscFEGeom *, PetscInt, PetscErrorCode (*)(PetscInt, PetscReal, const PetscReal [], PetscInt, PetscScalar *, void *), void *, PetscScalar *);
77 PetscErrorCode (*applyall)(PetscDualSpace, const PetscScalar *, PetscScalar *);
78 PetscErrorCode (*createallpoints)(PetscDualSpace, PetscQuadrature *);
79};
80
81struct _p_PetscDualSpace {
82 PETSCHEADER(struct _PetscDualSpaceOps)_p_PetscObject hdr; struct _PetscDualSpaceOps ops[1];
83 void *data; /* Implementation object */
84 DM dm; /* The integration region K */
85 PetscInt order; /* The approximation order of the space */
86 PetscInt Nc; /* The number of components */
87 PetscQuadrature *functional; /* The basis of functionals for this space */
88 PetscQuadrature allPoints;
89 PetscBool setupcalled;
90};
91
92typedef struct {
93 PetscInt *numDof;
94 PetscBool simplexCell;
95 PetscBool tensorSpace;
96 PetscBool continuous;
97 PetscInt height;
98 PetscDualSpace *subspaces;
99 PetscInt ***symmetries;
100 PetscInt numSelfSym;
101 PetscInt selfSymOff;
102} PetscDualSpace_Lag;
103
104typedef struct {
105 PetscInt dim;
106 PetscInt *numDof;
107} PetscDualSpace_Simple;
108
109typedef struct _PetscFEOps *PetscFEOps;
110struct _PetscFEOps {
111 PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscFE);
112 PetscErrorCode (*setup)(PetscFE);
113 PetscErrorCode (*view)(PetscFE,PetscViewer);
114 PetscErrorCode (*destroy)(PetscFE);
115 PetscErrorCode (*getdimension)(PetscFE,PetscInt*);
116 PetscErrorCode (*gettabulation)(PetscFE,PetscInt,const PetscReal*,PetscReal*,PetscReal*,PetscReal*);
117 /* Element integration */
118 PetscErrorCode (*integrate)(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
119 PetscErrorCode (*integratebd)(PetscFE, PetscDS, PetscInt, PetscBdPointFunc, PetscInt, PetscFEGeom *, const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
120 PetscErrorCode (*integrateresidual)(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscScalar[]);
121 PetscErrorCode (*integratebdresidual)(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscScalar[]);
122 PetscErrorCode (*integratejacobianaction)(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscReal, PetscScalar[]);
123 PetscErrorCode (*integratejacobian)(PetscFE, PetscDS, PetscFEJacobianType, PetscInt, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscReal, PetscScalar[]);
124 PetscErrorCode (*integratebdjacobian)(PetscFE, PetscDS, PetscInt, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscReal, PetscScalar[]);
125};
126
127struct _p_PetscFE {
128 PETSCHEADER(struct _PetscFEOps)_p_PetscObject hdr; struct _PetscFEOps ops[1];
129 void *data; /* Implementation object */
130 PetscSpace basisSpace; /* The basis space P */
131 PetscDualSpace dualSpace; /* The dual space P' */
132 PetscInt numComponents; /* The number of field components */
133 PetscQuadrature quadrature; /* Suitable quadrature on K */
134 PetscQuadrature faceQuadrature; /* Suitable face quadrature on \partial K */
135 PetscFE *subspaces; /* Subspaces for each dimension */
136 PetscReal *invV; /* Change of basis matrix, from prime to nodal basis set */
137 PetscReal *B, *D, *H; /* Tabulation of basis and derivatives at quadrature points */
138 PetscReal *Bf, *Df, *Hf; /* Tabulation of basis and derivatives at quadrature points on each face */
139 PetscReal *F; /* Tabulation of basis at face centroids */
140 PetscInt blockSize, numBlocks; /* Blocks are processed concurrently */
141 PetscInt batchSize, numBatches; /* A batch is made up of blocks, Batches are processed in serial */
142 PetscBool setupcalled;
143};
144
145typedef struct {
146 PetscInt cellType;
147} PetscFE_Basic;
148
149#ifdef PETSC_HAVE_OPENCL
150
151#ifdef __APPLE__
152#include <OpenCL/cl.h>
153#else
154#include <CL/cl.h>
155#endif
156
157typedef struct {
158 cl_platform_id pf_id;
159 cl_device_id dev_id;
160 cl_context ctx_id;
161 cl_command_queue queue_id;
162 PetscDataType realType;
163 PetscLogEvent residualEvent;
164 PetscInt op; /* ANDY: Stand-in for real equation code generation */
165} PetscFE_OpenCL;
166#endif
167
168typedef struct {
169 CellRefiner cellRefiner; /* The cell refiner defining the cell division */
170 PetscInt numSubelements; /* The number of subelements */
171 PetscReal *v0; /* The affine transformation for each subelement */
172 PetscReal *jac, *invjac;
173 PetscInt *embedding; /* Map from subelements dofs to element dofs */
174} PetscFE_Composite;
175
176/* Utility functions */
177PETSC_STATIC_INLINEstatic inline void CoordinatesRefToReal(PetscInt dimReal, PetscInt dimRef, const PetscReal xi0[], const PetscReal v0[], const PetscReal J[], const PetscReal xi[], PetscReal x[])
178{
179 PetscInt d, e;
180
181 for (d = 0; d < dimReal; ++d) {
16
Assuming 'd' is < 'dimReal'
17
Loop condition is true. Entering loop body
182 x[d] = v0[d];
183 for (e = 0; e < dimRef; ++e) {
18
Assuming 'e' is < 'dimRef'
19
Loop condition is true. Entering loop body
20
Assuming 'e' is < 'dimRef'
21
Loop condition is true. Entering loop body
22
Assuming 'e' is < 'dimRef'
23
Loop condition is true. Entering loop body
24
Assuming 'e' is < 'dimRef'
25
Loop condition is true. Entering loop body
184 x[d] += J[d*dimReal+e]*(xi[e] - xi0[e]);
26
The right operand of '-' is a garbage value due to array index out of bounds
185 }
186 }
187}
188
189PETSC_STATIC_INLINEstatic inline void CoordinatesRealToRef(PetscInt dimReal, PetscInt dimRef, const PetscReal xi0[], const PetscReal v0[], const PetscReal invJ[], const PetscReal x[], PetscReal xi[])
190{
191 PetscInt d, e;
192
193 for (d = 0; d < dimRef; ++d) {
194 xi[d] = xi0[d];
195 for (e = 0; e < dimReal; ++e) {
196 xi[d] += invJ[d*dimReal+e]*(x[e] - v0[e]);
197 }
198 }
199}
200
201PETSC_STATIC_INLINEstatic inline void EvaluateFieldJets(PetscInt dim, PetscInt Nf, const PetscInt Nb[], const PetscInt Nc[], PetscInt q, PetscReal *basisField[], PetscReal *basisFieldDer[], PetscScalar refSpaceDer[], const PetscReal invJ[], const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscScalar u[], PetscScalar u_x[], PetscScalar u_t[])
202{
203 PetscInt dOffset = 0, fOffset = 0, f;
204
205 for (f = 0; f < Nf; ++f) {
206 const PetscInt Nbf = Nb[f], Ncf = Nc[f];
207 const PetscReal *Bq = &basisField[f][q*Nbf*Ncf];
208 const PetscReal *Dq = &basisFieldDer[f][q*Nbf*Ncf*dim];
209 PetscInt b, c, d, e;
210
211 for (c = 0; c < Ncf; ++c) u[fOffset+c] = 0.0;
212 for (d = 0; d < dim*Ncf; ++d) refSpaceDer[d] = 0.0;
213 for (b = 0; b < Nbf; ++b) {
214 for (c = 0; c < Ncf; ++c) {
215 const PetscInt cidx = b*Ncf+c;
216
217 u[fOffset+c] += Bq[cidx]*coefficients[dOffset+b];
218 for (d = 0; d < dim; ++d) refSpaceDer[c*dim+d] += Dq[cidx*dim+d]*coefficients[dOffset+b];
219 }
220 }
221 for (c = 0; c < Ncf; ++c) for (d = 0; d < dim; ++d) for (e = 0, u_x[(fOffset+c)*dim+d] = 0.0; e < dim; ++e) u_x[(fOffset+c)*dim+d] += invJ[e*dim+d]*refSpaceDer[c*dim+e];
222 if (u_t) {
223 for (c = 0; c < Ncf; ++c) u_t[fOffset+c] = 0.0;
224 for (b = 0; b < Nbf; ++b) {
225 for (c = 0; c < Ncf; ++c) {
226 const PetscInt cidx = b*Ncf+c;
227
228 u_t[fOffset+c] += Bq[cidx]*coefficients_t[dOffset+b];
229 }
230 }
231 }
232#if 0
233 for (c = 0; c < Ncf; ++c) {
234 ierr = PetscPrintf(PETSC_COMM_SELF((MPI_Comm)0x44000001), " u[%d,%d]: %g\n", f, c, PetscRealPart(u[fOffset+c])(u[fOffset+c]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),234,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
235 if (u_t) {ierr = PetscPrintf(PETSC_COMM_SELF((MPI_Comm)0x44000001), " u_t[%d,%d]: %g\n", f, c, PetscRealPart(u_t[fOffset+c])(u_t[fOffset+c]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),235,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
236 for (d = 0; d < dim; ++d) {
237 ierr = PetscPrintf(PETSC_COMM_SELF((MPI_Comm)0x44000001), " gradU[%d,%d]_%c: %g\n", f, c, 'x'+d, PetscRealPart(u_x[(fOffset+c)*dim+d])(u_x[(fOffset+c)*dim+d]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),237,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
238 }
239 }
240#endif
241 fOffset += Ncf;
242 dOffset += Nbf;
243 }
244}
245
246PETSC_STATIC_INLINEstatic inline PetscErrorCode EvaluateFaceFields(PetscDS prob, PetscInt field, PetscInt faceLoc, const PetscScalar coefficients[], PetscScalar u[])
247{
248 PetscFE fe;
249 PetscReal *faceBasis;
250 PetscInt Nb, Nc, b, c;
251 PetscErrorCode ierr;
252
253 if (!prob) return 0;
254 ierr = PetscDSGetDiscretization(prob, field, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),254,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
255 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),255,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
256 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),256,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
257 ierr = PetscFEGetFaceCentroidTabulation(fe, &faceBasis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),257,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
258 for (c = 0; c < Nc; ++c) {u[c] = 0.0;}
259 for (b = 0; b < Nb; ++b) {
260 for (c = 0; c < Nc; ++c) {
261 const PetscInt cidx = b*Nc+c;
262
263 u[c] += coefficients[cidx]*faceBasis[faceLoc*Nb*Nc+cidx];
264 }
265 }
266 return 0;
267}
268
269PETSC_STATIC_INLINEstatic inline void TransformF(PetscInt dim, PetscInt Nc, PetscInt q, const PetscReal invJ[], PetscReal detJ, const PetscReal quadWeights[], PetscScalar refSpaceDer[], PetscScalar f0[], PetscScalar f1[])
270{
271 const PetscReal w = detJ*quadWeights[q];
272 PetscInt c, d, e;
273
274 if (f0) for (c = 0; c < Nc; ++c) f0[q*Nc+c] *= w;
275 if (f1) {
276 for (c = 0; c < Nc; ++c) {
277 for (d = 0; d < dim; ++d) {
278 f1[(q*Nc + c)*dim+d] = 0.0;
279 for (e = 0; e < dim; ++e) f1[(q*Nc + c)*dim+d] += invJ[d*dim+e]*refSpaceDer[c*dim+e];
280 f1[(q*Nc + c)*dim+d] *= w;
281 }
282 }
283 }
284#if 0
285 if (debug > 1) {
286 for (c = 0; c < Nc; ++c) {
287 ierr = PetscPrintf(PETSC_COMM_SELF((MPI_Comm)0x44000001), " f0[%d]: %g\n", c, PetscRealPart(f0[q*Nc+c])(f0[q*Nc+c]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),287,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
288 for (d = 0; d < dim; ++d) {
289 ierr = PetscPrintf(PETSC_COMM_SELF((MPI_Comm)0x44000001), " f1[%d]_%c: %g\n", c, 'x'+d, PetscRealPart(f1[(q*Nc + c)*dim+d])(f1[(q*Nc + c)*dim+d]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),289,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
290 }
291 }
292 }
293#endif
294}
295
296PETSC_STATIC_INLINEstatic inline void UpdateElementVec(PetscInt dim, PetscInt Nq, PetscInt Nb, PetscInt Nc, PetscReal basis[], PetscReal basisDer[], PetscScalar f0[], PetscScalar f1[], PetscScalar elemVec[])
297{
298 PetscInt b, c;
299
300 for (b = 0; b < Nb; ++b) {
301 elemVec[b] = 0.0;
302
303 for (c = 0; c < Nc; ++c) {
304 const PetscInt cidx = b*Nc+c;
305 PetscInt q;
306
307 for (q = 0; q < Nq; ++q) {
308 PetscInt d;
309
310 elemVec[b] += basis[q*Nb*Nc+cidx]*f0[q*Nc+c];
311 for (d = 0; d < dim; ++d) elemVec[b] += basisDer[(q*Nb*Nc+cidx)*dim+d]*f1[(q*Nc+c)*dim+d];
312 }
313 }
314 }
315#if 0
316 if (debug > 1) {
317 for (b = 0; b < Nb/Nc; ++b) {
318 for (c = 0; c < Nc; ++c) {
319 ierr = PetscPrintf(PETSC_COMM_SELF((MPI_Comm)0x44000001), " elemVec[%d,%d]: %g\n", b, c, PetscRealPart(elemVec[b*Nc+c])(elemVec[b*Nc+c]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),319,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
320 }
321 }
322 }
323#endif
324}
325
326PETSC_STATIC_INLINEstatic inline PetscErrorCode PetscFEInterpolate_Static(PetscFE fe, const PetscScalar x[], PetscInt q, PetscScalar interpolant[])
327{
328 PetscReal *basis;
329 PetscInt Nb, Nc, fc, f;
330 PetscErrorCode ierr;
331
332 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
; petscstack->line[petscstack->currentsize] = 332; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
333 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),333,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
334 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),334,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
335 ierr = PetscFEGetDefaultTabulation(fe, &basis, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),335,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
336 for (fc = 0; fc < Nc; ++fc) {
337 interpolant[fc] = 0.0;
338 for (f = 0; f < Nb; ++f) {
339 interpolant[fc] += x[f]*basis[(q*Nb + f)*Nc + fc];
340 }
341 }
342 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
343}
344
345PETSC_STATIC_INLINEstatic inline PetscErrorCode PetscFEInterpolateGradient_Static(PetscFE fe, const PetscScalar x[], PetscInt dim, const PetscReal invJ[], const PetscReal n[], PetscInt q, PetscScalar interpolant[])
346{
347 PetscReal *basisDer;
348 PetscReal realSpaceDer[3];
349 PetscScalar compGradient[3];
350 PetscInt Nb, Nc, fc, f, d, g;
351 PetscErrorCode ierr;
352
353 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
; petscstack->line[petscstack->currentsize] = 353; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
354 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),354,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
355 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),355,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
356 ierr = PetscFEGetDefaultTabulation(fe, NULL((void*)0), &basisDer, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),356,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
357 for (fc = 0; fc < Nc; ++fc) {
358 interpolant[fc] = 0.0;
359 for (d = 0; d < dim; ++d) compGradient[d] = 0.0;
360 for (f = 0; f < Nb; ++f) {
361
362 for (d = 0; d < dim; ++d) {
363 realSpaceDer[d] = 0.0;
364 for (g = 0; g < dim; ++g) {
365 realSpaceDer[d] += invJ[dim*dim*q + g*dim+d]*basisDer[((q*Nb + f)*Nc + fc)*dim + g];
366 }
367 compGradient[d] += x[f]*realSpaceDer[d];
368 }
369 }
370 if (n) {
371 for (d = 0; d < dim; ++d) interpolant[fc] += compGradient[d]*n[d];
372 } else {
373 for (d = 0; d < dim; ++d) interpolant[fc*dim+d] = compGradient[d];
374 }
375 }
376 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
377}
378
379PETSC_STATIC_INLINEstatic inline PetscErrorCode PetscFEInterpolateFieldAndGradient_Static(PetscFE fe, const PetscScalar x[], PetscInt dim, const PetscReal invJ[], PetscInt q, PetscScalar interpolant[], PetscScalar interpolantGrad[])
380{
381 PetscReal *basis, *basisDer;
382 PetscReal realSpaceDer[3];
383 PetscInt Nb, Nc, fc, f, d, g;
384 PetscErrorCode ierr;
385
386 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
; petscstack->line[petscstack->currentsize] = 386; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
387 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),387,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
388 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),388,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
389 ierr = PetscFEGetDefaultTabulation(fe, &basis, &basisDer, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),389,__func__,"/sandbox/petsc/petsc.next-tmp/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
390 for (fc = 0; fc < Nc; ++fc) {
391 interpolant[fc] = 0.0;
392 for (d = 0; d < dim; ++d) interpolantGrad[fc*dim+d] = 0.0;
393 for (f = 0; f < Nb; ++f) {
394 interpolant[fc] += x[f]*basis[(q*Nb + f)*Nc + fc];
395 for (d = 0; d < dim; ++d) {
396 realSpaceDer[d] = 0.0;
397 for (g = 0; g < dim; ++g) {
398 realSpaceDer[d] += invJ[dim*dim*q + g*dim+d]*basisDer[((q*Nb + f)*Nc + fc)*dim + g];
399 }
400 interpolantGrad[fc*dim+d] += x[f]*realSpaceDer[d];
401 }
402 }
403 }
404 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
405}
406
407PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEGetDimension_Basic(PetscFE, PetscInt *);
408PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEIntegrateResidual_Basic(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar [], const PetscScalar [], PetscDS, const PetscScalar [], PetscReal, PetscScalar []);
409PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEIntegrateBdResidual_Basic(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar [], const PetscScalar [], PetscDS, const PetscScalar [], PetscReal, PetscScalar[]);
410PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEIntegrateJacobian_Basic(PetscFE, PetscDS, PetscFEJacobianType, PetscInt, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar [], const PetscScalar [], PetscDS, const PetscScalar [], PetscReal, PetscReal, PetscScalar []);
411#endif