Bug Summary

File:dm/dt/fe/interface/fe.c
Warning:line 199, 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/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.seealso: PetscFERegisterAll(), PetscFERegisterDestroy()
86
87@*/
88PetscErrorCode PetscFERegister(const char sname[], PetscErrorCode (*function)(PetscFE))
89{
90 PetscErrorCode ierr;
91
92 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 92; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
93 ierr = PetscFunctionListAdd(&PetscFEList, sname, function)PetscFunctionListAdd_Private((&PetscFEList),(sname),(PetscVoidFunction
)(function))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),93,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
94 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)
;
95}
96
97/*@C
98 PetscFESetType - Builds a particular PetscFE
99
100 Collective on fem
101
102 Input Parameters:
103+ fem - The PetscFE object
104- name - The kind of FEM space
105
106 Options Database Key:
107. -petscfe_type <type> - Sets the PetscFE type; use -help for a list of available types
108
109 Level: intermediate
110
111.seealso: PetscFEGetType(), PetscFECreate()
112@*/
113PetscErrorCode PetscFESetType(PetscFE fem, PetscFEType name)
114{
115 PetscErrorCode (*r)(PetscFE);
116 PetscBool match;
117 PetscErrorCode ierr;
118
119 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 119; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
120 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),120,__func__
,"/sandbox/petsc/petsc.next/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),120,
__func__,"/sandbox/petsc/petsc.next/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),120,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),120,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
121 ierr = PetscObjectTypeCompare((PetscObject) fem, name, &match);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),121,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
122 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)
;
123
124 if (!PetscFERegisterAllCalled) {ierr = PetscFERegisterAll();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),124,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
125 ierr = PetscFunctionListFind(PetscFEList, name, &r)PetscFunctionListFind_Private((PetscFEList),(name),(PetscVoidFunction
*)(&r))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),125,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
126 if (!r) SETERRQ1(PetscObjectComm((PetscObject) fem), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown PetscFE type: %s", name)return PetscError(PetscObjectComm((PetscObject) fem),126,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",86,PETSC_ERROR_INITIAL
,"Unknown PetscFE type: %s",name)
;
127
128 if (fem->ops->destroy) {
129 ierr = (*fem->ops->destroy)(fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),129,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
130 fem->ops->destroy = NULL((void*)0);
131 }
132 ierr = (*r)(fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),132,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
133 ierr = PetscObjectChangeTypeName((PetscObject) fem, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),133,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
134 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)
;
135}
136
137/*@C
138 PetscFEGetType - Gets the PetscFE type name (as a string) from the object.
139
140 Not Collective
141
142 Input Parameter:
143. fem - The PetscFE
144
145 Output Parameter:
146. name - The PetscFE type name
147
148 Level: intermediate
149
150.seealso: PetscFESetType(), PetscFECreate()
151@*/
152PetscErrorCode PetscFEGetType(PetscFE fem, PetscFEType *name)
153{
154 PetscErrorCode ierr;
155
156 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 156; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
157 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),157,__func__
,"/sandbox/petsc/petsc.next/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),157,
__func__,"/sandbox/petsc/petsc.next/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),157,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),157,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
158 PetscValidPointer(name, 2)do { if (!name) return PetscError(((MPI_Comm)0x44000001),158,
__func__,"/sandbox/petsc/petsc.next/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),158,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
159 if (!PetscFERegisterAllCalled) {
160 ierr = PetscFERegisterAll();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),160,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
161 }
162 *name = ((PetscObject) fem)->type_name;
163 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)
;
164}
165
166/*@C
167 PetscFEView - Views a PetscFE
168
169 Collective on fem
170
171 Input Parameter:
172+ fem - the PetscFE object to view
173- viewer - the viewer
174
175 Level: developer
176
177.seealso PetscFEDestroy()
178@*/
179PetscErrorCode PetscFEView(PetscFE fem, PetscViewer viewer)
180{
181 PetscBool iascii;
182 PetscErrorCode ierr;
183
184 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 184; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
185 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),185,__func__
,"/sandbox/petsc/petsc.next/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),185,
__func__,"/sandbox/petsc/petsc.next/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),185,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),185,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
186 if (viewer) PetscValidHeaderSpecific(viewer, PETSC_VIEWER_CLASSID, 2)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),186
,__func__,"/sandbox/petsc/petsc.next/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),186,__func__,"/sandbox/petsc/petsc.next/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),186,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),186,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",2); } } while (0)
;
187 if (!viewer) {ierr = PetscViewerASCIIGetStdout(PetscObjectComm((PetscObject) fem), &viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),187,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
188 ierr = PetscObjectPrintClassNamePrefixType((PetscObject)fem, viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),188,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
189 ierr = PetscObjectTypeCompare((PetscObject) viewer, PETSCVIEWERASCII"ascii", &iascii);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),189,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
190 if (fem->ops->view) {ierr = (*fem->ops->view)(fem, viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),190,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
191 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)
;
192}
193
194/*@
195 PetscFESetFromOptions - sets parameters in a PetscFE from the options database
196
197 Collective on fem
198
199 Input Parameter:
200. fem - the PetscFE object to set options for
201
202 Options Database:
203+ -petscfe_num_blocks - the number of cell blocks to integrate concurrently
204- -petscfe_num_batches - the number of cell batches to integrate serially
205
206 Level: developer
207
208.seealso PetscFEView()
209@*/
210PetscErrorCode PetscFESetFromOptions(PetscFE fem)
211{
212 const char *defaultType;
213 char name[256];
214 PetscBool flg;
215 PetscErrorCode ierr;
216
217 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 217; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
218 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),218,__func__
,"/sandbox/petsc/petsc.next/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),218,
__func__,"/sandbox/petsc/petsc.next/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),218,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),218,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
219 if (!((PetscObject) fem)->type_name) {
220 defaultType = PETSCFEBASIC"basic";
221 } else {
222 defaultType = ((PetscObject) fem)->type_name;
223 }
224 if (!PetscFERegisterAllCalled) {ierr = PetscFERegisterAll();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),224,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
225
226 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),226,__func__,"/sandbox/petsc/petsc.next/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),226,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
227 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),227,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
228 if (flg) {
229 ierr = PetscFESetType(fem, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),229,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
230 } else if (!((PetscObject) fem)->type_name) {
231 ierr = PetscFESetType(fem, defaultType);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),231,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
232 }
233 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),233,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
234 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),234,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
235 if (fem->ops->setfromoptions) {
236 ierr = (*fem->ops->setfromoptions)(PetscOptionsObject,fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),236,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
237 }
238 /* process any options handlers added with PetscObjectAddOptionsHandler() */
239 ierr = PetscObjectProcessOptionsHandlers(PetscOptionsObject,(PetscObject) fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),239,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
240 ierr = PetscOptionsEnd()_5_ierr = PetscOptionsEnd_Private(PetscOptionsObject);do {if (
__builtin_expect(!!(_5_ierr),0)) return PetscError(((MPI_Comm
)0x44000001),240,__func__,"/sandbox/petsc/petsc.next/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),240,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
241 ierr = PetscFEViewFromOptions(fem, NULL((void*)0), "-petscfe_view");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),241,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
242 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)
;
243}
244
245/*@C
246 PetscFESetUp - Construct data structures for the PetscFE
247
248 Collective on fem
249
250 Input Parameter:
251. fem - the PetscFE object to setup
252
253 Level: developer
254
255.seealso PetscFEView(), PetscFEDestroy()
256@*/
257PetscErrorCode PetscFESetUp(PetscFE fem)
258{
259 PetscErrorCode ierr;
260
261 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 261; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
262 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),262,__func__
,"/sandbox/petsc/petsc.next/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),262,
__func__,"/sandbox/petsc/petsc.next/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),262,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),262,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
263 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)
;
264 fem->setupcalled = PETSC_TRUE;
265 if (fem->ops->setup) {ierr = (*fem->ops->setup)(fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),265,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
266 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}
268
269/*@
270 PetscFEDestroy - Destroys a PetscFE object
271
272 Collective on fem
273
274 Input Parameter:
275. fem - the PetscFE object to destroy
276
277 Level: developer
278
279.seealso PetscFEView()
280@*/
281PetscErrorCode PetscFEDestroy(PetscFE *fem)
282{
283 PetscErrorCode ierr;
284
285 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 285; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
286 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)
;
287 PetscValidHeaderSpecific((*fem), PETSCFE_CLASSID, 1)do { if (!(*fem)) return PetscError(((MPI_Comm)0x44000001),287
,__func__,"/sandbox/petsc/petsc.next/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),287,__func__,"/sandbox/petsc/petsc.next/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),287,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),287,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
288
289 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)
;}
290 ((PetscObject) (*fem))->refct = 0;
291
292 if ((*fem)->subspaces) {
293 PetscInt dim, d;
294
295 ierr = PetscDualSpaceGetDimension((*fem)->dualSpace, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),295,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
296 for (d = 0; d < dim; ++d) {ierr = PetscFEDestroy(&(*fem)->subspaces[d]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),296,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
297 }
298 ierr = PetscFree((*fem)->subspaces)((*PetscTrFree)((void*)((*fem)->subspaces),298,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || (((*fem)->subspaces) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),298,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
299 ierr = PetscFree((*fem)->invV)((*PetscTrFree)((void*)((*fem)->invV),299,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || (((*fem)->invV) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),299,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
300 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),300,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
301 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),301,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
302 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),302,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
303 ierr = PetscSpaceDestroy(&(*fem)->basisSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),303,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
304 ierr = PetscDualSpaceDestroy(&(*fem)->dualSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),304,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
305 ierr = PetscQuadratureDestroy(&(*fem)->quadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),305,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
306 ierr = PetscQuadratureDestroy(&(*fem)->faceQuadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),306,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
307
308 if ((*fem)->ops->destroy) {ierr = (*(*fem)->ops->destroy)(*fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),308,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
309 ierr = PetscHeaderDestroy(fem)(PetscHeaderDestroy_Private((PetscObject)(*fem)) || ((*PetscTrFree
)((void*)(*fem),309,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((*fem) = 0,0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),309,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
310 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)
;
311}
312
313/*@
314 PetscFECreate - Creates an empty PetscFE object. The type can then be set with PetscFESetType().
315
316 Collective
317
318 Input Parameter:
319. comm - The communicator for the PetscFE object
320
321 Output Parameter:
322. fem - The PetscFE object
323
324 Level: beginner
325
326.seealso: PetscFESetType(), PETSCFEGALERKIN
327@*/
328PetscErrorCode PetscFECreate(MPI_Comm comm, PetscFE *fem)
329{
330 PetscFE f;
331 PetscErrorCode ierr;
332
333 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 333; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
334 PetscValidPointer(fem, 2)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),334,__func__
,"/sandbox/petsc/petsc.next/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),334,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
335 ierr = PetscCitationsRegister(FECitation,&FEcite);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),335,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
336 *fem = NULL((void*)0);
337 ierr = PetscFEInitializePackage();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),337,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
338
339 ierr = PetscHeaderCreate(f, PETSCFE_CLASSID, "PetscFE", "Finite Element", "PetscFE", comm, PetscFEDestroy, PetscFEView)(PetscMallocA(1,PETSC_TRUE,339,__func__,"/sandbox/petsc/petsc.next/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),339,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
340
341 f->basisSpace = NULL((void*)0);
342 f->dualSpace = NULL((void*)0);
343 f->numComponents = 1;
344 f->subspaces = NULL((void*)0);
345 f->invV = NULL((void*)0);
346 f->B = NULL((void*)0);
347 f->D = NULL((void*)0);
348 f->H = NULL((void*)0);
349 f->Bf = NULL((void*)0);
350 f->Df = NULL((void*)0);
351 f->Hf = NULL((void*)0);
352 ierr = PetscArrayzero(&f->quadrature, 1)PetscMemzero(&f->quadrature,(1)*sizeof(*(&f->quadrature
)));
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),352,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
353 ierr = PetscArrayzero(&f->faceQuadrature, 1)PetscMemzero(&f->faceQuadrature,(1)*sizeof(*(&f->
faceQuadrature)));
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),353,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
354 f->blockSize = 0;
355 f->numBlocks = 1;
356 f->batchSize = 0;
357 f->numBatches = 1;
358
359 *fem = f;
360 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)
;
361}
362
363/*@
364 PetscFEGetSpatialDimension - Returns the spatial dimension of the element
365
366 Not collective
367
368 Input Parameter:
369. fem - The PetscFE object
370
371 Output Parameter:
372. dim - The spatial dimension
373
374 Level: intermediate
375
376.seealso: PetscFECreate()
377@*/
378PetscErrorCode PetscFEGetSpatialDimension(PetscFE fem, PetscInt *dim)
379{
380 DM dm;
381 PetscErrorCode ierr;
382
383 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 383; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
384 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),384,__func__
,"/sandbox/petsc/petsc.next/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),384,
__func__,"/sandbox/petsc/petsc.next/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),384,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),384,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
385 PetscValidPointer(dim, 2)do { if (!dim) return PetscError(((MPI_Comm)0x44000001),385,__func__
,"/sandbox/petsc/petsc.next/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),385,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
386 ierr = PetscDualSpaceGetDM(fem->dualSpace, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),386,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
387 ierr = DMGetDimension(dm, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),387,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
388 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)
;
389}
390
391/*@
392 PetscFESetNumComponents - Sets the number of components in the element
393
394 Not collective
395
396 Input Parameters:
397+ fem - The PetscFE object
398- comp - The number of field components
399
400 Level: intermediate
401
402.seealso: PetscFECreate()
403@*/
404PetscErrorCode PetscFESetNumComponents(PetscFE fem, PetscInt comp)
405{
406 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 406; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
407 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),407,__func__
,"/sandbox/petsc/petsc.next/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),407,
__func__,"/sandbox/petsc/petsc.next/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),407,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),407,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
408 fem->numComponents = comp;
409 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)
;
410}
411
412/*@
413 PetscFEGetNumComponents - Returns the number of components in the element
414
415 Not collective
416
417 Input Parameter:
418. fem - The PetscFE object
419
420 Output Parameter:
421. comp - The number of field components
422
423 Level: intermediate
424
425.seealso: PetscFECreate()
426@*/
427PetscErrorCode PetscFEGetNumComponents(PetscFE fem, PetscInt *comp)
428{
429 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 429; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
430 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),430,__func__
,"/sandbox/petsc/petsc.next/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),430,
__func__,"/sandbox/petsc/petsc.next/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),430,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),430,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
431 PetscValidPointer(comp, 2)do { if (!comp) return PetscError(((MPI_Comm)0x44000001),431,
__func__,"/sandbox/petsc/petsc.next/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),431,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
432 *comp = fem->numComponents;
433 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)
;
434}
435
436/*@
437 PetscFESetTileSizes - Sets the tile sizes for evaluation
438
439 Not collective
440
441 Input Parameters:
442+ fem - The PetscFE object
443. blockSize - The number of elements in a block
444. numBlocks - The number of blocks in a batch
445. batchSize - The number of elements in a batch
446- numBatches - The number of batches in a chunk
447
448 Level: intermediate
449
450.seealso: PetscFECreate()
451@*/
452PetscErrorCode PetscFESetTileSizes(PetscFE fem, PetscInt blockSize, PetscInt numBlocks, PetscInt batchSize, PetscInt numBatches)
453{
454 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 454; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
455 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),455,__func__
,"/sandbox/petsc/petsc.next/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),455,
__func__,"/sandbox/petsc/petsc.next/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),455,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),455,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
456 fem->blockSize = blockSize;
457 fem->numBlocks = numBlocks;
458 fem->batchSize = batchSize;
459 fem->numBatches = numBatches;
460 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)
;
461}
462
463/*@
464 PetscFEGetTileSizes - Returns the tile sizes for evaluation
465
466 Not collective
467
468 Input Parameter:
469. fem - The PetscFE object
470
471 Output Parameters:
472+ blockSize - The number of elements in a block
473. numBlocks - The number of blocks in a batch
474. batchSize - The number of elements in a batch
475- numBatches - The number of batches in a chunk
476
477 Level: intermediate
478
479.seealso: PetscFECreate()
480@*/
481PetscErrorCode PetscFEGetTileSizes(PetscFE fem, PetscInt *blockSize, PetscInt *numBlocks, PetscInt *batchSize, PetscInt *numBatches)
482{
483 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 483; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
484 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),484,__func__
,"/sandbox/petsc/petsc.next/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),484,
__func__,"/sandbox/petsc/petsc.next/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),484,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),484,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
485 if (blockSize) PetscValidPointer(blockSize, 2)do { if (!blockSize) return PetscError(((MPI_Comm)0x44000001)
,485,__func__,"/sandbox/petsc/petsc.next/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),485,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
486 if (numBlocks) PetscValidPointer(numBlocks, 3)do { if (!numBlocks) return PetscError(((MPI_Comm)0x44000001)
,486,__func__,"/sandbox/petsc/petsc.next/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),486,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
487 if (batchSize) PetscValidPointer(batchSize, 4)do { if (!batchSize) return PetscError(((MPI_Comm)0x44000001)
,487,__func__,"/sandbox/petsc/petsc.next/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),487,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",4);
} while (0)
;
488 if (numBatches) PetscValidPointer(numBatches, 5)do { if (!numBatches) return PetscError(((MPI_Comm)0x44000001
),488,__func__,"/sandbox/petsc/petsc.next/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),488,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",5);
} while (0)
;
489 if (blockSize) *blockSize = fem->blockSize;
490 if (numBlocks) *numBlocks = fem->numBlocks;
491 if (batchSize) *batchSize = fem->batchSize;
492 if (numBatches) *numBatches = fem->numBatches;
493 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)
;
494}
495
496/*@
497 PetscFEGetBasisSpace - Returns the PetscSpace used for approximation of the solution
498
499 Not collective
500
501 Input Parameter:
502. fem - The PetscFE object
503
504 Output Parameter:
505. sp - The PetscSpace object
506
507 Level: intermediate
508
509.seealso: PetscFECreate()
510@*/
511PetscErrorCode PetscFEGetBasisSpace(PetscFE fem, PetscSpace *sp)
512{
513 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 513; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
514 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),514,__func__
,"/sandbox/petsc/petsc.next/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),514,
__func__,"/sandbox/petsc/petsc.next/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),514,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),514,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
515 PetscValidPointer(sp, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),515,__func__
,"/sandbox/petsc/petsc.next/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),515,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
516 *sp = fem->basisSpace;
517 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)
;
518}
519
520/*@
521 PetscFESetBasisSpace - Sets the PetscSpace used for approximation of the solution
522
523 Not collective
524
525 Input Parameters:
526+ fem - The PetscFE object
527- sp - The PetscSpace object
528
529 Level: intermediate
530
531.seealso: PetscFECreate()
532@*/
533PetscErrorCode PetscFESetBasisSpace(PetscFE fem, PetscSpace sp)
534{
535 PetscErrorCode ierr;
536
537 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 537; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
538 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),538,__func__
,"/sandbox/petsc/petsc.next/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),538,
__func__,"/sandbox/petsc/petsc.next/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),538,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),538,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
539 PetscValidHeaderSpecific(sp, PETSCSPACE_CLASSID, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),539,__func__
,"/sandbox/petsc/petsc.next/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),539,__func__
,"/sandbox/petsc/petsc.next/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
),539,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),539,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",2); } } while (0)
;
540 ierr = PetscSpaceDestroy(&fem->basisSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),540,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
541 fem->basisSpace = sp;
542 ierr = PetscObjectReference((PetscObject) fem->basisSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),542,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
543 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)
;
544}
545
546/*@
547 PetscFEGetDualSpace - Returns the PetscDualSpace used to define the inner product
548
549 Not collective
550
551 Input Parameter:
552. fem - The PetscFE object
553
554 Output Parameter:
555. sp - The PetscDualSpace object
556
557 Level: intermediate
558
559.seealso: PetscFECreate()
560@*/
561PetscErrorCode PetscFEGetDualSpace(PetscFE fem, PetscDualSpace *sp)
562{
563 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 563; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
564 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),564,__func__
,"/sandbox/petsc/petsc.next/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),564,
__func__,"/sandbox/petsc/petsc.next/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),564,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),564,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
565 PetscValidPointer(sp, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),565,__func__
,"/sandbox/petsc/petsc.next/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),565,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
566 *sp = fem->dualSpace;
567 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)
;
568}
569
570/*@
571 PetscFESetDualSpace - Sets the PetscDualSpace used to define the inner product
572
573 Not collective
574
575 Input Parameters:
576+ fem - The PetscFE object
577- sp - The PetscDualSpace object
578
579 Level: intermediate
580
581.seealso: PetscFECreate()
582@*/
583PetscErrorCode PetscFESetDualSpace(PetscFE fem, PetscDualSpace sp)
584{
585 PetscErrorCode ierr;
586
587 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 587; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
588 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),588,__func__
,"/sandbox/petsc/petsc.next/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),588,
__func__,"/sandbox/petsc/petsc.next/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),588,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),588,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
589 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 2)do { if (!sp) return PetscError(((MPI_Comm)0x44000001),589,__func__
,"/sandbox/petsc/petsc.next/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),589,__func__
,"/sandbox/petsc/petsc.next/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
),589,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),589,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",2); } } while (0)
;
590 ierr = PetscDualSpaceDestroy(&fem->dualSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),590,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
591 fem->dualSpace = sp;
592 ierr = PetscObjectReference((PetscObject) fem->dualSpace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),592,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
593 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)
;
594}
595
596/*@
597 PetscFEGetQuadrature - Returns the PetscQuadrature used to calculate inner products
598
599 Not collective
600
601 Input Parameter:
602. fem - The PetscFE object
603
604 Output Parameter:
605. q - The PetscQuadrature object
606
607 Level: intermediate
608
609.seealso: PetscFECreate()
610@*/
611PetscErrorCode PetscFEGetQuadrature(PetscFE fem, PetscQuadrature *q)
612{
613 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 613; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
614 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),614,__func__
,"/sandbox/petsc/petsc.next/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),614,
__func__,"/sandbox/petsc/petsc.next/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),614,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),614,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
615 PetscValidPointer(q, 2)do { if (!q) return PetscError(((MPI_Comm)0x44000001),615,__func__
,"/sandbox/petsc/petsc.next/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),615,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
616 *q = fem->quadrature;
617 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)
;
618}
619
620/*@
621 PetscFESetQuadrature - Sets the PetscQuadrature used to calculate inner products
622
623 Not collective
624
625 Input Parameters:
626+ fem - The PetscFE object
627- q - The PetscQuadrature object
628
629 Level: intermediate
630
631.seealso: PetscFECreate()
632@*/
633PetscErrorCode PetscFESetQuadrature(PetscFE fem, PetscQuadrature q)
634{
635 PetscInt Nc, qNc;
636 PetscErrorCode ierr;
637
638 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 638; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
639 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),639,__func__
,"/sandbox/petsc/petsc.next/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),639,
__func__,"/sandbox/petsc/petsc.next/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),639,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),639,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
640 ierr = PetscFEGetNumComponents(fem, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),640,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
641 ierr = PetscQuadratureGetNumComponents(q, &qNc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),641,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
642 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),642,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",60,PETSC_ERROR_INITIAL
,"FE components %D != Quadrature components %D and non-scalar quadrature"
,Nc,qNc)
;
643 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),643,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
644 ierr = PetscQuadratureDestroy(&fem->quadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),644,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
645 fem->quadrature = q;
646 ierr = PetscObjectReference((PetscObject) q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),646,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
647 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)
;
648}
649
650/*@
651 PetscFEGetFaceQuadrature - Returns the PetscQuadrature used to calculate inner products on faces
652
653 Not collective
654
655 Input Parameter:
656. fem - The PetscFE object
657
658 Output Parameter:
659. q - The PetscQuadrature object
660
661 Level: intermediate
662
663.seealso: PetscFECreate()
664@*/
665PetscErrorCode PetscFEGetFaceQuadrature(PetscFE fem, PetscQuadrature *q)
666{
667 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 667; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
668 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),668,__func__
,"/sandbox/petsc/petsc.next/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),668,
__func__,"/sandbox/petsc/petsc.next/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),668,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),668,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
669 PetscValidPointer(q, 2)do { if (!q) return PetscError(((MPI_Comm)0x44000001),669,__func__
,"/sandbox/petsc/petsc.next/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),669,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
670 *q = fem->faceQuadrature;
671 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)
;
672}
673
674/*@
675 PetscFESetFaceQuadrature - Sets the PetscQuadrature used to calculate inner products on faces
676
677 Not collective
678
679 Input Parameters:
680+ fem - The PetscFE object
681- q - The PetscQuadrature object
682
683 Level: intermediate
684
685.seealso: PetscFECreate()
686@*/
687PetscErrorCode PetscFESetFaceQuadrature(PetscFE fem, PetscQuadrature q)
688{
689 PetscErrorCode ierr;
690
691 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 691; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
692 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),692,__func__
,"/sandbox/petsc/petsc.next/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),692,
__func__,"/sandbox/petsc/petsc.next/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),692,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),692,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
693 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),693,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
694 ierr = PetscQuadratureDestroy(&fem->faceQuadrature);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),694,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
695 fem->faceQuadrature = q;
696 ierr = PetscObjectReference((PetscObject) q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),696,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
697 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)
;
698}
699
700/*@C
701 PetscFEGetNumDof - Returns the number of dofs (dual basis vectors) associated to mesh points on the reference cell of a given dimension
702
703 Not collective
704
705 Input Parameter:
706. fem - The PetscFE object
707
708 Output Parameter:
709. numDof - Array with the number of dofs per dimension
710
711 Level: intermediate
712
713.seealso: PetscFECreate()
714@*/
715PetscErrorCode PetscFEGetNumDof(PetscFE fem, const PetscInt **numDof)
716{
717 PetscErrorCode ierr;
718
719 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 719; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
720 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),720,__func__
,"/sandbox/petsc/petsc.next/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),720,
__func__,"/sandbox/petsc/petsc.next/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),720,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),720,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
721 PetscValidPointer(numDof, 2)do { if (!numDof) return PetscError(((MPI_Comm)0x44000001),721
,__func__,"/sandbox/petsc/petsc.next/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),721,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
722 ierr = PetscDualSpaceGetNumDof(fem->dualSpace, numDof);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),722,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
723 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)
;
724}
725
726/*@C
727 PetscFEGetDefaultTabulation - Returns the tabulation of the basis functions at the quadrature points
728
729 Not collective
730
731 Input Parameter:
732. fem - The PetscFE object
733
734 Output Parameters:
735+ B - The basis function values at quadrature points
736. D - The basis function derivatives at quadrature points
737- H - The basis function second derivatives at quadrature points
738
739 Note:
740$ B[(p*pdim + i)*Nc + c] is the value at point p for basis function i and component c
741$ D[((p*pdim + i)*Nc + c)*dim + d] is the derivative value at point p for basis function i, component c, in direction d
742$ 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
743
744 Level: intermediate
745
746.seealso: PetscFEGetTabulation(), PetscFERestoreTabulation()
747@*/
748PetscErrorCode PetscFEGetDefaultTabulation(PetscFE fem, PetscReal **B, PetscReal **D, PetscReal **H)
749{
750 PetscInt npoints;
751 const PetscReal *points;
752 PetscErrorCode ierr;
753
754 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 754; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
755 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),755,__func__
,"/sandbox/petsc/petsc.next/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),755,
__func__,"/sandbox/petsc/petsc.next/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),755,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),755,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
756 if (B) PetscValidPointer(B, 2)do { if (!B) return PetscError(((MPI_Comm)0x44000001),756,__func__
,"/sandbox/petsc/petsc.next/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),756,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
757 if (D) PetscValidPointer(D, 3)do { if (!D) return PetscError(((MPI_Comm)0x44000001),757,__func__
,"/sandbox/petsc/petsc.next/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),757,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",3); } while (0)
;
758 if (H) PetscValidPointer(H, 4)do { if (!H) return PetscError(((MPI_Comm)0x44000001),758,__func__
,"/sandbox/petsc/petsc.next/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),758,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",4); } while (0)
;
759 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),759,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
760 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),760,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
761 if (B) *B = fem->B;
762 if (D) *D = fem->D;
763 if (H) *H = fem->H;
764 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)
;
765}
766
767PetscErrorCode PetscFEGetFaceTabulation(PetscFE fem, PetscReal **Bf, PetscReal **Df, PetscReal **Hf)
768{
769 PetscErrorCode ierr;
770
771 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 771; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
772 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),772,__func__
,"/sandbox/petsc/petsc.next/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),772,
__func__,"/sandbox/petsc/petsc.next/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),772,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),772,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
773 if (Bf) PetscValidPointer(Bf, 2)do { if (!Bf) return PetscError(((MPI_Comm)0x44000001),773,__func__
,"/sandbox/petsc/petsc.next/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),773,__func__
,"/sandbox/petsc/petsc.next/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
774 if (Df) PetscValidPointer(Df, 3)do { if (!Df) return PetscError(((MPI_Comm)0x44000001),774,__func__
,"/sandbox/petsc/petsc.next/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),774,__func__
,"/sandbox/petsc/petsc.next/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
775 if (Hf) PetscValidPointer(Hf, 4)do { if (!Hf) return PetscError(((MPI_Comm)0x44000001),775,__func__
,"/sandbox/petsc/petsc.next/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),775,__func__
,"/sandbox/petsc/petsc.next/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
776 if (!fem->Bf) {
7
Assuming the condition is true
8
Taking true branch
777 const PetscReal xi0[3] = {-1., -1., -1.};
778 PetscReal v0[3], J[9], detJ;
779 PetscQuadrature fq;
780 PetscDualSpace sp;
781 DM dm;
782 const PetscInt *faces;
783 PetscInt dim, numFaces, f, npoints, q;
784 const PetscReal *points;
785 PetscReal *facePoints;
786
787 ierr = PetscFEGetDualSpace(fem, &sp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),787,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
788 ierr = PetscDualSpaceGetDM(sp, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),788,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
789 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),789,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
790 ierr = DMPlexGetConeSize(dm, 0, &numFaces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),790,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
791 ierr = DMPlexGetCone(dm, 0, &faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),791,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
792 ierr = PetscFEGetFaceQuadrature(fem, &fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),792,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
793 if (fq) {
9
Assuming 'fq' is non-null
10
Taking true branch
794 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),794,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
795 ierr = PetscMalloc1(numFaces*npoints*dim, &facePoints)PetscMallocA(1,PETSC_FALSE,795,__func__,"/sandbox/petsc/petsc.next/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),795,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
796 for (f = 0; f < numFaces; ++f) {
11
Assuming 'f' is < 'numFaces'
12
Loop condition is true. Entering loop body
797 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),797,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
798 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'
799 }
800 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),800,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
801 ierr = PetscFree(facePoints)((*PetscTrFree)((void*)(facePoints),801,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((facePoints) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),801,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
802 }
803 }
804 if (Bf) *Bf = fem->Bf;
805 if (Df) *Df = fem->Df;
806 if (Hf) *Hf = fem->Hf;
807 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)
;
808}
809
810PetscErrorCode PetscFEGetFaceCentroidTabulation(PetscFE fem, PetscReal **F)
811{
812 PetscErrorCode ierr;
813
814 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 814; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
815 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),815,__func__
,"/sandbox/petsc/petsc.next/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),815,
__func__,"/sandbox/petsc/petsc.next/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),815,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),815,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
816 PetscValidPointer(F, 2)do { if (!F) return PetscError(((MPI_Comm)0x44000001),816,__func__
,"/sandbox/petsc/petsc.next/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),816,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",2); } while (0)
;
817 if (!fem->F) {
818 PetscDualSpace sp;
819 DM dm;
820 const PetscInt *cone;
821 PetscReal *centroids;
822 PetscInt dim, numFaces, f;
823
824 ierr = PetscFEGetDualSpace(fem, &sp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),824,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
825 ierr = PetscDualSpaceGetDM(sp, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),825,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
826 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),826,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
827 ierr = DMPlexGetConeSize(dm, 0, &numFaces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),827,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
828 ierr = DMPlexGetCone(dm, 0, &cone);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),828,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
829 ierr = PetscMalloc1(numFaces*dim, &centroids)PetscMallocA(1,PETSC_FALSE,829,__func__,"/sandbox/petsc/petsc.next/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),829,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
830 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),830,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
831 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),831,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
832 ierr = PetscFree(centroids)((*PetscTrFree)((void*)(centroids),832,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((centroids) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),832,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
833 }
834 *F = fem->F;
835 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)
;
836}
837
838/*@C
839 PetscFEGetTabulation - Tabulates the basis functions, and perhaps derivatives, at the points provided.
840
841 Not collective
842
843 Input Parameters:
844+ fem - The PetscFE object
845. npoints - The number of tabulation points
846- points - The tabulation point coordinates
847
848 Output Parameters:
849+ B - The basis function values at tabulation points
850. D - The basis function derivatives at tabulation points
851- H - The basis function second derivatives at tabulation points
852
853 Note:
854$ B[(p*pdim + i)*Nc + c] is the value at point p for basis function i and component c
855$ D[((p*pdim + i)*Nc + c)*dim + d] is the derivative value at point p for basis function i, component c, in direction d
856$ 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
857
858 Level: intermediate
859
860.seealso: PetscFERestoreTabulation(), PetscFEGetDefaultTabulation()
861@*/
862PetscErrorCode PetscFEGetTabulation(PetscFE fem, PetscInt npoints, const PetscReal points[], PetscReal **B, PetscReal **D, PetscReal **H)
863{
864 DM dm;
865 PetscInt pdim; /* Dimension of FE space P */
866 PetscInt dim; /* Spatial dimension */
867 PetscInt comp; /* Field components */
868 PetscErrorCode ierr;
869
870 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 870; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
871 if (!npoints) {
872 if (B) *B = NULL((void*)0);
873 if (D) *D = NULL((void*)0);
874 if (H) *H = NULL((void*)0);
875 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)
;
876 }
877 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),877,__func__
,"/sandbox/petsc/petsc.next/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),877,
__func__,"/sandbox/petsc/petsc.next/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),877,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),877,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
878 PetscValidPointer(points, 3)do { if (!points) return PetscError(((MPI_Comm)0x44000001),878
,__func__,"/sandbox/petsc/petsc.next/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),878,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
879 if (B) PetscValidPointer(B, 4)do { if (!B) return PetscError(((MPI_Comm)0x44000001),879,__func__
,"/sandbox/petsc/petsc.next/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),879,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",4); } while (0)
;
880 if (D) PetscValidPointer(D, 5)do { if (!D) return PetscError(((MPI_Comm)0x44000001),880,__func__
,"/sandbox/petsc/petsc.next/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),880,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",5); } while (0)
;
881 if (H) PetscValidPointer(H, 6)do { if (!H) return PetscError(((MPI_Comm)0x44000001),881,__func__
,"/sandbox/petsc/petsc.next/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),881,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",68,PETSC_ERROR_INITIAL
,"Invalid Pointer: Parameter # %d",6); } while (0)
;
882 ierr = PetscDualSpaceGetDM(fem->dualSpace, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),882,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
883 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),883,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
884 ierr = PetscDualSpaceGetDimension(fem->dualSpace, &pdim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),884,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
885 ierr = PetscFEGetNumComponents(fem, &comp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),885,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
886 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),886,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
887 if (!dim) {
888 if (D) *D = NULL((void*)0);
889 if (H) *H = NULL((void*)0);
890 } else {
891 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),891,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
892 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),892,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
893 }
894 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),894,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
895 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)
;
896}
897
898PetscErrorCode PetscFERestoreTabulation(PetscFE fem, PetscInt npoints, const PetscReal points[], PetscReal **B, PetscReal **D, PetscReal **H)
899{
900 DM dm;
901 PetscErrorCode ierr;
902
903 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 903; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
904 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),904,__func__
,"/sandbox/petsc/petsc.next/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),904,
__func__,"/sandbox/petsc/petsc.next/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),904,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),904,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
905 ierr = PetscDualSpaceGetDM(fem->dualSpace, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),905,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
906 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),906,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
907 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),907,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
908 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),908,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
909 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)
;
910}
911
912PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFECreatePointTrace(PetscFE fe, PetscInt refPoint, PetscFE *trFE)
913{
914 PetscSpace bsp, bsubsp;
915 PetscDualSpace dsp, dsubsp;
916 PetscInt dim, depth, numComp, i, j, coneSize, order;
917 PetscFEType type;
918 DM dm;
919 DMLabel label;
920 PetscReal *xi, *v, *J, detJ;
921 const char *name;
922 PetscQuadrature origin, fullQuad, subQuad;
923 PetscErrorCode ierr;
924
925 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 925; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
926 PetscValidHeaderSpecific(fe,PETSCFE_CLASSID,1)do { if (!fe) return PetscError(((MPI_Comm)0x44000001),926,__func__
,"/sandbox/petsc/petsc.next/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),926,__func__
,"/sandbox/petsc/petsc.next/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
),926,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),926,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
927 PetscValidPointer(trFE,3)do { if (!trFE) return PetscError(((MPI_Comm)0x44000001),927,
__func__,"/sandbox/petsc/petsc.next/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),927,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
928 ierr = PetscFEGetBasisSpace(fe,&bsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),928,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
929 ierr = PetscFEGetDualSpace(fe,&dsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),929,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
930 ierr = PetscDualSpaceGetDM(dsp,&dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),930,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
931 ierr = DMGetDimension(dm,&dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),931,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
932 ierr = DMPlexGetDepthLabel(dm,&label);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),932,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
933 ierr = DMLabelGetValue(label,refPoint,&depth);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),933,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
934 ierr = PetscCalloc1(depth,&xi)PetscMallocA(1,PETSC_TRUE,934,__func__,"/sandbox/petsc/petsc.next/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),934,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
935 ierr = PetscMalloc1(dim,&v)PetscMallocA(1,PETSC_FALSE,935,__func__,"/sandbox/petsc/petsc.next/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),935,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
936 ierr = PetscMalloc1(dim*dim,&J)PetscMallocA(1,PETSC_FALSE,936,__func__,"/sandbox/petsc/petsc.next/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),936,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
937 for (i = 0; i < depth; i++) xi[i] = 0.;
938 ierr = PetscQuadratureCreate(PETSC_COMM_SELF((MPI_Comm)0x44000001),&origin);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),938,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
939 ierr = PetscQuadratureSetData(origin,depth,0,1,xi,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),939,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
940 ierr = DMPlexComputeCellGeometryFEM(dm,refPoint,origin,v,J,NULL((void*)0),&detJ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),940,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
941 /* CellGeometryFEM computes the expanded Jacobian, we want the true jacobian */
942 for (i = 1; i < dim; i++) {
943 for (j = 0; j < depth; j++) {
944 J[i * depth + j] = J[i * dim + j];
945 }
946 }
947 ierr = PetscQuadratureDestroy(&origin);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),947,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
948 ierr = PetscDualSpaceGetPointSubspace(dsp,refPoint,&dsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),948,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
949 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),949,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
950 ierr = PetscSpaceSetUp(bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),950,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
951 ierr = PetscFECreate(PetscObjectComm((PetscObject)fe),trFE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),951,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
952 ierr = PetscFEGetType(fe,&type);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),952,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
953 ierr = PetscFESetType(*trFE,type);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),953,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
954 ierr = PetscFEGetNumComponents(fe,&numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),954,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
955 ierr = PetscFESetNumComponents(*trFE,numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),955,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
956 ierr = PetscFESetBasisSpace(*trFE,bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),956,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
957 ierr = PetscFESetDualSpace(*trFE,dsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),957,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
958 ierr = PetscObjectGetName((PetscObject) fe, &name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),958,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
959 if (name) {ierr = PetscFESetName(*trFE, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),959,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
960 ierr = PetscFEGetQuadrature(fe,&fullQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),960,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
961 ierr = PetscQuadratureGetOrder(fullQuad,&order);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),961,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
962 ierr = DMPlexGetConeSize(dm,refPoint,&coneSize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),962,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
963 if (coneSize == 2 * depth) {
964 ierr = PetscDTGaussTensorQuadrature(depth,1,(order + 1)/2,-1.,1.,&subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),964,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
965 } else {
966 ierr = PetscDTGaussJacobiQuadrature(depth,1,(order + 1)/2,-1.,1.,&subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),966,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
967 }
968 ierr = PetscFESetQuadrature(*trFE,subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),968,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
969 ierr = PetscFESetUp(*trFE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),969,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
970 ierr = PetscQuadratureDestroy(&subQuad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),970,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
971 ierr = PetscSpaceDestroy(&bsubsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),971,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
972 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)
;
973}
974
975PetscErrorCode PetscFECreateHeightTrace(PetscFE fe, PetscInt height, PetscFE *trFE)
976{
977 PetscInt hStart, hEnd;
978 PetscDualSpace dsp;
979 DM dm;
980 PetscErrorCode ierr;
981
982 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 982; petscstack->petscroutine
[petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize
++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE
|| petscstack->hotdepth); } ; } while (0); ; } while (0)
;
983 PetscValidHeaderSpecific(fe,PETSCFE_CLASSID,1)do { if (!fe) return PetscError(((MPI_Comm)0x44000001),983,__func__
,"/sandbox/petsc/petsc.next/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),983,__func__
,"/sandbox/petsc/petsc.next/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
),983,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),983,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
984 PetscValidPointer(trFE,3)do { if (!trFE) return PetscError(((MPI_Comm)0x44000001),984,
__func__,"/sandbox/petsc/petsc.next/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),984,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
985 *trFE = NULL((void*)0);
986 ierr = PetscFEGetDualSpace(fe,&dsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),986,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
987 ierr = PetscDualSpaceGetDM(dsp,&dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),987,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
988 ierr = DMPlexGetHeightStratum(dm,height,&hStart,&hEnd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),988,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
989 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)
;
990 ierr = PetscFECreatePointTrace(fe,hStart,trFE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),990,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
991 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)
;
992}
993
994
995/*@
996 PetscFEGetDimension - Get the dimension of the finite element space on a cell
997
998 Not collective
999
1000 Input Parameter:
1001. fe - The PetscFE
1002
1003 Output Parameter:
1004. dim - The dimension
1005
1006 Level: intermediate
1007
1008.seealso: PetscFECreate(), PetscSpaceGetDimension(), PetscDualSpaceGetDimension()
1009@*/
1010PetscErrorCode PetscFEGetDimension(PetscFE fem, PetscInt *dim)
1011{
1012 PetscErrorCode ierr;
1013
1014 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1014; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1015 PetscValidHeaderSpecific(fem, PETSCFE_CLASSID, 1)do { if (!fem) return PetscError(((MPI_Comm)0x44000001),1015,
__func__,"/sandbox/petsc/petsc.next/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),1015,__func__,"/sandbox/petsc/petsc.next/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),1015,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1015,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1016 PetscValidPointer(dim, 2)do { if (!dim) return PetscError(((MPI_Comm)0x44000001),1016,
__func__,"/sandbox/petsc/petsc.next/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),1016,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
1017 if (fem->ops->getdimension) {ierr = (*fem->ops->getdimension)(fem, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1017,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1018 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)
;
1019}
1020
1021/*@C
1022 PetscFEPushforward - Map the reference element function to real space
1023
1024 Input Parameters:
1025+ fe - The PetscFE
1026. fegeom - The cell geometry
1027. Nv - The number of function values
1028- vals - The function values
1029
1030 Output Parameter:
1031. vals - The transformed function values
1032
1033 Level: advanced
1034
1035 Note: This just forwards the call onto PetscDualSpacePushforward().
1036
1037.seealso: PetscDualSpacePushforward()
1038@*/
1039PetscErrorCode PetscFEPushforward(PetscFE fe, PetscFEGeom *fegeom, PetscInt Nv, PetscScalar vals[])
1040{
1041 PetscErrorCode ierr;
1042
1043 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1043; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
1044 ierr = PetscDualSpacePushforward(fe->dualSpace, fegeom, Nv, fe->numComponents, vals);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1044,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1045 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)
;
1046}
1047
1048/*@C
1049 PetscFEPushforwardGradient - Map the reference element function gradient to real space
1050
1051 Input Parameters:
1052+ fe - The PetscFE
1053. fegeom - The cell geometry
1054. Nv - The number of function gradient values
1055- vals - The function gradient values
1056
1057 Output Parameter:
1058. vals - The transformed function gradient values
1059
1060 Level: advanced
1061
1062 Note: This just forwards the call onto PetscDualSpacePushforwardGradient().
1063
1064.seealso: PetscFEPushforward(), PetscDualSpacePushforwardGradient(), PetscDualSpacePushforward()
1065@*/
1066PetscErrorCode PetscFEPushforwardGradient(PetscFE fe, PetscFEGeom *fegeom, PetscInt Nv, PetscScalar vals[])
1067{
1068 PetscErrorCode ierr;
1069
1070 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1070; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
1071 ierr = PetscDualSpacePushforwardGradient(fe->dualSpace, fegeom, Nv, fe->numComponents, vals);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1071,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1072 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)
;
1073}
1074
1075/*
1076Purpose: Compute element vector for chunk of elements
1077
1078Input:
1079 Sizes:
1080 Ne: number of elements
1081 Nf: number of fields
1082 PetscFE
1083 dim: spatial dimension
1084 Nb: number of basis functions
1085 Nc: number of field components
1086 PetscQuadrature
1087 Nq: number of quadrature points
1088
1089 Geometry:
1090 PetscFEGeom[Ne] possibly *Nq
1091 PetscReal v0s[dim]
1092 PetscReal n[dim]
1093 PetscReal jacobians[dim*dim]
1094 PetscReal jacobianInverses[dim*dim]
1095 PetscReal jacobianDeterminants
1096 FEM:
1097 PetscFE
1098 PetscQuadrature
1099 PetscReal quadPoints[Nq*dim]
1100 PetscReal quadWeights[Nq]
1101 PetscReal basis[Nq*Nb*Nc]
1102 PetscReal basisDer[Nq*Nb*Nc*dim]
1103 PetscScalar coefficients[Ne*Nb*Nc]
1104 PetscScalar elemVec[Ne*Nb*Nc]
1105
1106 Problem:
1107 PetscInt f: the active field
1108 f0, f1
1109
1110 Work Space:
1111 PetscFE
1112 PetscScalar f0[Nq*dim];
1113 PetscScalar f1[Nq*dim*dim];
1114 PetscScalar u[Nc];
1115 PetscScalar gradU[Nc*dim];
1116 PetscReal x[dim];
1117 PetscScalar realSpaceDer[dim];
1118
1119Purpose: Compute element vector for N_cb batches of elements
1120
1121Input:
1122 Sizes:
1123 N_cb: Number of serial cell batches
1124
1125 Geometry:
1126 PetscReal v0s[Ne*dim]
1127 PetscReal jacobians[Ne*dim*dim] possibly *Nq
1128 PetscReal jacobianInverses[Ne*dim*dim] possibly *Nq
1129 PetscReal jacobianDeterminants[Ne] possibly *Nq
1130 FEM:
1131 static PetscReal quadPoints[Nq*dim]
1132 static PetscReal quadWeights[Nq]
1133 static PetscReal basis[Nq*Nb*Nc]
1134 static PetscReal basisDer[Nq*Nb*Nc*dim]
1135 PetscScalar coefficients[Ne*Nb*Nc]
1136 PetscScalar elemVec[Ne*Nb*Nc]
1137
1138ex62.c:
1139 PetscErrorCode PetscFEIntegrateResidualBatch(PetscInt Ne, PetscInt numFields, PetscInt field, PetscQuadrature quad[], const PetscScalar coefficients[],
1140 const PetscReal v0s[], const PetscReal jacobians[], const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[],
1141 void (*f0_func)(const PetscScalar u[], const PetscScalar gradU[], const PetscReal x[], PetscScalar f0[]),
1142 void (*f1_func)(const PetscScalar u[], const PetscScalar gradU[], const PetscReal x[], PetscScalar f1[]), PetscScalar elemVec[])
1143
1144ex52.c:
1145 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)
1146 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)
1147
1148ex52_integrateElement.cu
1149__global__ void integrateElementQuadrature(int N_cb, realType *coefficients, realType *jacobianInverses, realType *jacobianDeterminants, realType *elemVec)
1150
1151PETSC_EXTERN PetscErrorCode IntegrateElementBatchGPU(PetscInt spatial_dim, PetscInt Ne, PetscInt Ncb, PetscInt Nbc, PetscInt Nbl, const PetscScalar coefficients[],
1152 const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[], PetscScalar elemVec[],
1153 PetscLogEvent event, PetscInt debug, PetscInt pde_op)
1154
1155ex52_integrateElementOpenCL.c:
1156PETSC_EXTERN PetscErrorCode IntegrateElementBatchGPU(PetscInt spatial_dim, PetscInt Ne, PetscInt Ncb, PetscInt Nbc, PetscInt N_bl, const PetscScalar coefficients[],
1157 const PetscReal jacobianInverses[], const PetscReal jacobianDeterminants[], PetscScalar elemVec[],
1158 PetscLogEvent event, PetscInt debug, PetscInt pde_op)
1159
1160__kernel void integrateElementQuadrature(int N_cb, __global float *coefficients, __global float *jacobianInverses, __global float *jacobianDeterminants, __global float *elemVec)
1161*/
1162
1163/*@C
1164 PetscFEIntegrate - Produce the integral for the given field for a chunk of elements by quadrature integration
1165
1166 Not collective
1167
1168 Input Parameters:
1169+ fem - The PetscFE object for the field being integrated
1170. prob - The PetscDS specifying the discretizations and continuum functions
1171. field - The field being integrated
1172. Ne - The number of elements in the chunk
1173. cgeom - The cell geometry for each cell in the chunk
1174. coefficients - The array of FEM basis coefficients for the elements
1175. probAux - The PetscDS specifying the auxiliary discretizations
1176- coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1177
1178 Output Parameter
1179. integral - the integral for this field
1180
1181 Level: developer
1182
1183.seealso: PetscFEIntegrateResidual()
1184@*/
1185PetscErrorCode PetscFEIntegrate(PetscDS prob, PetscInt field, PetscInt Ne, PetscFEGeom *cgeom,
1186 const PetscScalar coefficients[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscScalar integral[])
1187{
1188 PetscFE fe;
1189 PetscErrorCode ierr;
1190
1191 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1191; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1192 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1192
,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1192,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1192,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1192,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1193 ierr = PetscDSGetDiscretization(prob, field, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1193,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1194 if (fe->ops->integrate) {ierr = (*fe->ops->integrate)(prob, field, Ne, cgeom, coefficients, probAux, coefficientsAux, integral);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1194,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1195 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)
;
1196}
1197
1198/*@C
1199 PetscFEIntegrateBd - Produce the integral for the given field for a chunk of elements by quadrature integration
1200
1201 Not collective
1202
1203 Input Parameters:
1204+ fem - The PetscFE object for the field being integrated
1205. prob - The PetscDS specifying the discretizations and continuum functions
1206. field - The field being integrated
1207. obj_func - The function to be integrated
1208. Ne - The number of elements in the chunk
1209. fgeom - The face geometry for each face in the chunk
1210. coefficients - The array of FEM basis coefficients for the elements
1211. probAux - The PetscDS specifying the auxiliary discretizations
1212- coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1213
1214 Output Parameter
1215. integral - the integral for this field
1216
1217 Level: developer
1218
1219.seealso: PetscFEIntegrateResidual()
1220@*/
1221PetscErrorCode PetscFEIntegrateBd(PetscDS prob, PetscInt field,
1222 void (*obj_func)(PetscInt, PetscInt, PetscInt,
1223 const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[],
1224 const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[],
1225 PetscReal, const PetscReal[], const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]),
1226 PetscInt Ne, PetscFEGeom *geom, const PetscScalar coefficients[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscScalar integral[])
1227{
1228 PetscFE fe;
1229 PetscErrorCode ierr;
1230
1231 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1231; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1232 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1232
,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1232,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1232,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1232,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1233 ierr = PetscDSGetDiscretization(prob, field, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1233,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1234 if (fe->ops->integratebd) {ierr = (*fe->ops->integratebd)(prob, field, obj_func, Ne, geom, coefficients, probAux, coefficientsAux, integral);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1234,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1235 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)
;
1236}
1237
1238/*@C
1239 PetscFEIntegrateResidual - Produce the element residual vector for a chunk of elements by quadrature integration
1240
1241 Not collective
1242
1243 Input Parameters:
1244+ fem - The PetscFE object for the field being integrated
1245. prob - The PetscDS specifying the discretizations and continuum functions
1246. field - The field being integrated
1247. Ne - The number of elements in the chunk
1248. cgeom - The cell geometry for each cell in the chunk
1249. coefficients - The array of FEM basis coefficients for the elements
1250. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1251. probAux - The PetscDS specifying the auxiliary discretizations
1252. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1253- t - The time
1254
1255 Output Parameter
1256. elemVec - the element residual vectors from each element
1257
1258 Note:
1259$ Loop over batch of elements (e):
1260$ Loop over quadrature points (q):
1261$ Make u_q and gradU_q (loops over fields,Nb,Ncomp) and x_q
1262$ Call f_0 and f_1
1263$ Loop over element vector entries (f,fc --> i):
1264$ elemVec[i] += \psi^{fc}_f(q) f0_{fc}(u, \nabla u) + \nabla\psi^{fc}_f(q) \cdot f1_{fc,df}(u, \nabla u)
1265
1266 Level: developer
1267
1268.seealso: PetscFEIntegrateResidual()
1269@*/
1270PetscErrorCode PetscFEIntegrateResidual(PetscDS prob, PetscInt field, PetscInt Ne, PetscFEGeom *cgeom,
1271 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscScalar elemVec[])
1272{
1273 PetscFE fe;
1274 PetscErrorCode ierr;
1275
1276 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1276; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1277 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1277
,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1277,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1277,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1277,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1278 ierr = PetscDSGetDiscretization(prob, field, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1278,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1279 if (fe->ops->integrateresidual) {ierr = (*fe->ops->integrateresidual)(prob, field, Ne, cgeom, coefficients, coefficients_t, probAux, coefficientsAux, t, elemVec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1279,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1280 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)
;
1281}
1282
1283/*@C
1284 PetscFEIntegrateBdResidual - Produce the element residual vector for a chunk of elements by quadrature integration over a boundary
1285
1286 Not collective
1287
1288 Input Parameters:
1289+ fem - The PetscFE object for the field being integrated
1290. prob - The PetscDS specifying the discretizations and continuum functions
1291. field - The field being integrated
1292. Ne - The number of elements in the chunk
1293. fgeom - The face geometry for each cell in the chunk
1294. coefficients - The array of FEM basis coefficients for the elements
1295. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1296. probAux - The PetscDS specifying the auxiliary discretizations
1297. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1298- t - The time
1299
1300 Output Parameter
1301. elemVec - the element residual vectors from each element
1302
1303 Level: developer
1304
1305.seealso: PetscFEIntegrateResidual()
1306@*/
1307PetscErrorCode PetscFEIntegrateBdResidual(PetscDS prob, PetscInt field, PetscInt Ne, PetscFEGeom *fgeom,
1308 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscScalar elemVec[])
1309{
1310 PetscFE fe;
1311 PetscErrorCode ierr;
1312
1313 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1313; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1314 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1314
,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1314,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1314,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1314,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1315 ierr = PetscDSGetDiscretization(prob, field, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1315,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1316 if (fe->ops->integratebdresidual) {ierr = (*fe->ops->integratebdresidual)(prob, field, Ne, fgeom, coefficients, coefficients_t, probAux, coefficientsAux, t, elemVec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1316,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1317 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)
;
1318}
1319
1320/*@C
1321 PetscFEIntegrateJacobian - Produce the element Jacobian for a chunk of elements by quadrature integration
1322
1323 Not collective
1324
1325 Input Parameters:
1326+ fem - The PetscFE object for the field being integrated
1327. prob - The PetscDS specifying the discretizations and continuum functions
1328. jtype - The type of matrix pointwise functions that should be used
1329. fieldI - The test field being integrated
1330. fieldJ - The basis field being integrated
1331. Ne - The number of elements in the chunk
1332. cgeom - The cell geometry for each cell in the chunk
1333. coefficients - The array of FEM basis coefficients for the elements for the Jacobian evaluation point
1334. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1335. probAux - The PetscDS specifying the auxiliary discretizations
1336. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1337. t - The time
1338- u_tShift - A multiplier for the dF/du_t term (as opposed to the dF/du term)
1339
1340 Output Parameter
1341. elemMat - the element matrices for the Jacobian from each element
1342
1343 Note:
1344$ Loop over batch of elements (e):
1345$ Loop over element matrix entries (f,fc,g,gc --> i,j):
1346$ Loop over quadrature points (q):
1347$ Make u_q and gradU_q (loops over fields,Nb,Ncomp)
1348$ elemMat[i,j] += \psi^{fc}_f(q) g0_{fc,gc}(u, \nabla u) \phi^{gc}_g(q)
1349$ + \psi^{fc}_f(q) \cdot g1_{fc,gc,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1350$ + \nabla\psi^{fc}_f(q) \cdot g2_{fc,gc,df}(u, \nabla u) \phi^{gc}_g(q)
1351$ + \nabla\psi^{fc}_f(q) \cdot g3_{fc,gc,df,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1352 Level: developer
1353
1354.seealso: PetscFEIntegrateResidual()
1355@*/
1356PetscErrorCode PetscFEIntegrateJacobian(PetscDS prob, PetscFEJacobianType jtype, PetscInt fieldI, PetscInt fieldJ, PetscInt Ne, PetscFEGeom *cgeom,
1357 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscReal u_tshift, PetscScalar elemMat[])
1358{
1359 PetscFE fe;
1360 PetscErrorCode ierr;
1361
1362 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1362; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1363 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1363
,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1363,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1363,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1363,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1364 ierr = PetscDSGetDiscretization(prob, fieldI, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1364,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1365 if (fe->ops->integratejacobian) {ierr = (*fe->ops->integratejacobian)(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),1365,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1366 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)
;
1367}
1368
1369/*@C
1370 PetscFEIntegrateBdJacobian - Produce the boundary element Jacobian for a chunk of elements by quadrature integration
1371
1372 Not collective
1373
1374 Input Parameters:
1375. prob - The PetscDS specifying the discretizations and continuum functions
1376. fieldI - The test field being integrated
1377. fieldJ - The basis field being integrated
1378. Ne - The number of elements in the chunk
1379. fgeom - The face geometry for each cell in the chunk
1380. coefficients - The array of FEM basis coefficients for the elements for the Jacobian evaluation point
1381. coefficients_t - The array of FEM basis time derivative coefficients for the elements
1382. probAux - The PetscDS specifying the auxiliary discretizations
1383. coefficientsAux - The array of FEM auxiliary basis coefficients for the elements
1384. t - The time
1385- u_tShift - A multiplier for the dF/du_t term (as opposed to the dF/du term)
1386
1387 Output Parameter
1388. elemMat - the element matrices for the Jacobian from each element
1389
1390 Note:
1391$ Loop over batch of elements (e):
1392$ Loop over element matrix entries (f,fc,g,gc --> i,j):
1393$ Loop over quadrature points (q):
1394$ Make u_q and gradU_q (loops over fields,Nb,Ncomp)
1395$ elemMat[i,j] += \psi^{fc}_f(q) g0_{fc,gc}(u, \nabla u) \phi^{gc}_g(q)
1396$ + \psi^{fc}_f(q) \cdot g1_{fc,gc,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1397$ + \nabla\psi^{fc}_f(q) \cdot g2_{fc,gc,df}(u, \nabla u) \phi^{gc}_g(q)
1398$ + \nabla\psi^{fc}_f(q) \cdot g3_{fc,gc,df,dg}(u, \nabla u) \nabla\phi^{gc}_g(q)
1399 Level: developer
1400
1401.seealso: PetscFEIntegrateJacobian(), PetscFEIntegrateResidual()
1402@*/
1403PetscErrorCode PetscFEIntegrateBdJacobian(PetscDS prob, PetscInt fieldI, PetscInt fieldJ, PetscInt Ne, PetscFEGeom *fgeom,
1404 const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscDS probAux, const PetscScalar coefficientsAux[], PetscReal t, PetscReal u_tshift, PetscScalar elemMat[])
1405{
1406 PetscFE fe;
1407 PetscErrorCode ierr;
1408
1409 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1409; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1410 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1)do { if (!prob) return PetscError(((MPI_Comm)0x44000001),1410
,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(prob,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),1410,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(prob))->classid != PETSCDS_CLASSID
) { if (((PetscObject)(prob))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),1410,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1410,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1411 ierr = PetscDSGetDiscretization(prob, fieldI, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1411,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1412 if (fe->ops->integratebdjacobian) {ierr = (*fe->ops->integratebdjacobian)(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),1412,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1413 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)
;
1414}
1415
1416PetscErrorCode PetscFEGetHeightSubspace(PetscFE fe, PetscInt height, PetscFE *subfe)
1417{
1418 PetscSpace P, subP;
1419 PetscDualSpace Q, subQ;
1420 PetscQuadrature subq;
1421 PetscFEType fetype;
1422 PetscInt dim, Nc;
1423 PetscErrorCode ierr;
1424
1425 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1425; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1426 PetscValidHeaderSpecific(fe, PETSCFE_CLASSID, 1)do { if (!fe) return PetscError(((MPI_Comm)0x44000001),1426,__func__
,"/sandbox/petsc/petsc.next/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),1426,
__func__,"/sandbox/petsc/petsc.next/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),1426,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1426,__func__
,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c",62,PETSC_ERROR_INITIAL
,"Wrong type of object: Parameter # %d",1); } } while (0)
;
1427 PetscValidPointer(subfe, 3)do { if (!subfe) return PetscError(((MPI_Comm)0x44000001),1427
,__func__,"/sandbox/petsc/petsc.next/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),1427,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
1428 if (height == 0) {
1429 *subfe = fe;
1430 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)
;
1431 }
1432 ierr = PetscFEGetBasisSpace(fe, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1432,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1433 ierr = PetscFEGetDualSpace(fe, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1433,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1434 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1434,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1435 ierr = PetscFEGetFaceQuadrature(fe, &subq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1435,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1436 ierr = PetscDualSpaceGetDimension(Q, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1436,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1437 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),1437,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,63,PETSC_ERROR_INITIAL,"Asked for space at height %D for dimension %D space"
,height,dim)
;}
1438 if (!fe->subspaces) {ierr = PetscCalloc1(dim, &fe->subspaces)PetscMallocA(1,PETSC_TRUE,1438,__func__,"/sandbox/petsc/petsc.next/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),1438,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
1439 if (height <= dim) {
1440 if (!fe->subspaces[height-1]) {
1441 PetscFE sub;
1442 const char *name;
1443
1444 ierr = PetscSpaceGetHeightSubspace(P, height, &subP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1444,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1445 ierr = PetscDualSpaceGetHeightSubspace(Q, height, &subQ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1445,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1446 ierr = PetscFECreate(PetscObjectComm((PetscObject) fe), &sub);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1446,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1447 ierr = PetscObjectGetName((PetscObject) fe, &name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1447,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1448 ierr = PetscObjectSetName((PetscObject) sub, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1448,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1449 ierr = PetscFEGetType(fe, &fetype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1449,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1450 ierr = PetscFESetType(sub, fetype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1450,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1451 ierr = PetscFESetBasisSpace(sub, subP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1451,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1452 ierr = PetscFESetDualSpace(sub, subQ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1452,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1453 ierr = PetscFESetNumComponents(sub, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1453,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1454 ierr = PetscFESetUp(sub);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1454,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1455 ierr = PetscFESetQuadrature(sub, subq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1455,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1456 fe->subspaces[height-1] = sub;
1457 }
1458 *subfe = fe->subspaces[height-1];
1459 } else {
1460 *subfe = NULL((void*)0);
1461 }
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/*@
1466 PetscFERefine - Create a "refined" PetscFE object that refines the reference cell into smaller copies. This is typically used
1467 to precondition a higher order method with a lower order method on a refined mesh having the same number of dofs (but more
1468 sparsity). It is also used to create an interpolation between regularly refined meshes.
1469
1470 Collective on fem
1471
1472 Input Parameter:
1473. fe - The initial PetscFE
1474
1475 Output Parameter:
1476. feRef - The refined PetscFE
1477
1478 Level: developer
1479
1480.seealso: PetscFEType, PetscFECreate(), PetscFESetType()
1481@*/
1482PetscErrorCode PetscFERefine(PetscFE fe, PetscFE *feRef)
1483{
1484 PetscSpace P, Pref;
1485 PetscDualSpace Q, Qref;
1486 DM K, Kref;
1487 PetscQuadrature q, qref;
1488 const PetscReal *v0, *jac;
1489 PetscInt numComp, numSubelements;
1490 PetscErrorCode ierr;
1491
1492 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1492; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1493 ierr = PetscFEGetBasisSpace(fe, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1493,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1494 ierr = PetscFEGetDualSpace(fe, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1494,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1495 ierr = PetscFEGetQuadrature(fe, &q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1495,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1496 ierr = PetscDualSpaceGetDM(Q, &K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1496,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1497 /* Create space */
1498 ierr = PetscObjectReference((PetscObject) P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1498,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1499 Pref = P;
1500 /* Create dual space */
1501 ierr = PetscDualSpaceDuplicate(Q, &Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1501,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1502 ierr = DMRefine(K, PetscObjectComm((PetscObject) fe), &Kref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1502,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1503 ierr = PetscDualSpaceSetDM(Qref, Kref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1503,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1504 ierr = DMDestroy(&Kref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1504,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1505 ierr = PetscDualSpaceSetUp(Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1505,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1506 /* Create element */
1507 ierr = PetscFECreate(PetscObjectComm((PetscObject) fe), feRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1507,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1508 ierr = PetscFESetType(*feRef, PETSCFECOMPOSITE"composite");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1508,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1509 ierr = PetscFESetBasisSpace(*feRef, Pref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1509,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1510 ierr = PetscFESetDualSpace(*feRef, Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1510,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1511 ierr = PetscFEGetNumComponents(fe, &numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1511,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1512 ierr = PetscFESetNumComponents(*feRef, numComp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1512,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1513 ierr = PetscFESetUp(*feRef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1513,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1514 ierr = PetscSpaceDestroy(&Pref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1514,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1515 ierr = PetscDualSpaceDestroy(&Qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1515,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1516 /* Create quadrature */
1517 ierr = PetscFECompositeGetMapping(*feRef, &numSubelements, &v0, &jac, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1517,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1518 ierr = PetscQuadratureExpandComposite(q, numSubelements, v0, jac, &qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1518,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1519 ierr = PetscFESetQuadrature(*feRef, qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1519,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1520 ierr = PetscQuadratureDestroy(&qref);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1520,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1521 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)
;
1522}
1523
1524/*@C
1525 PetscFECreateDefault - Create a PetscFE for basic FEM computation
1526
1527 Collective
1528
1529 Input Parameters:
1530+ comm - The MPI comm
1531. dim - The spatial dimension
1532. Nc - The number of components
1533. isSimplex - Flag for simplex reference cell, otherwise its a tensor product
1534. prefix - The options prefix, or NULL
1535- qorder - The quadrature order
1536
1537 Output Parameter:
1538. fem - The PetscFE object
1539
1540 Level: beginner
1541
1542.seealso: PetscFECreate(), PetscSpaceCreate(), PetscDualSpaceCreate()
1543@*/
1544PetscErrorCode PetscFECreateDefault(MPI_Comm comm, PetscInt dim, PetscInt Nc, PetscBool isSimplex, const char prefix[], PetscInt qorder, PetscFE *fem)
1545{
1546 PetscQuadrature q, fq;
1547 DM K;
1548 PetscSpace P;
1549 PetscDualSpace Q;
1550 PetscInt order, quadPointsPerEdge;
1551 PetscBool tensor = isSimplex ? PETSC_FALSE : PETSC_TRUE;
1552 PetscErrorCode ierr;
1553
1554 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1554; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1555 /* Create space */
1556 ierr = PetscSpaceCreate(comm, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1556,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1557 ierr = PetscObjectSetOptionsPrefix((PetscObject) P, prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1557,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1558 ierr = PetscSpacePolynomialSetTensor(P, tensor);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1558,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1559 ierr = PetscSpaceSetNumComponents(P, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1559,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1560 ierr = PetscSpaceSetNumVariables(P, dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1560,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1561 ierr = PetscSpaceSetFromOptions(P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1561,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1562 ierr = PetscSpaceSetUp(P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1562,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1563 ierr = PetscSpaceGetDegree(P, &order, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1563,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1564 ierr = PetscSpacePolynomialGetTensor(P, &tensor);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1564,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1565 /* Create dual space */
1566 ierr = PetscDualSpaceCreate(comm, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1566,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1567 ierr = PetscDualSpaceSetType(Q,PETSCDUALSPACELAGRANGE"lagrange");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1567,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1568 ierr = PetscObjectSetOptionsPrefix((PetscObject) Q, prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1568,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1569 ierr = PetscDualSpaceCreateReferenceCell(Q, dim, isSimplex, &K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1569,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1570 ierr = PetscDualSpaceSetDM(Q, K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1570,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1571 ierr = DMDestroy(&K);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1571,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1572 ierr = PetscDualSpaceSetNumComponents(Q, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1572,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1573 ierr = PetscDualSpaceSetOrder(Q, order);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1573,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1574 ierr = PetscDualSpaceLagrangeSetTensor(Q, tensor);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1574,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1575 ierr = PetscDualSpaceSetFromOptions(Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1575,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1576 ierr = PetscDualSpaceSetUp(Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1576,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1577 /* Create element */
1578 ierr = PetscFECreate(comm, fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1578,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1579 ierr = PetscObjectSetOptionsPrefix((PetscObject) *fem, prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1579,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1580 ierr = PetscFESetBasisSpace(*fem, P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1580,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1581 ierr = PetscFESetDualSpace(*fem, Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1581,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1582 ierr = PetscFESetNumComponents(*fem, Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1582,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1583 ierr = PetscFESetFromOptions(*fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1583,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1584 ierr = PetscFESetUp(*fem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1584,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1585 ierr = PetscSpaceDestroy(&P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1585,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1586 ierr = PetscDualSpaceDestroy(&Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1586,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1587 /* Create quadrature (with specified order if given) */
1588 qorder = qorder >= 0 ? qorder : order;
1589 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),1589,__func__,"/sandbox/petsc/petsc.next/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),1589,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1590 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),1590,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1591 ierr = PetscOptionsEnd()_5_ierr = PetscOptionsEnd_Private(PetscOptionsObject);do {if (
__builtin_expect(!!(_5_ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1591,__func__,"/sandbox/petsc/petsc.next/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),1591,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1592 quadPointsPerEdge = PetscMax(qorder + 1,1)(((qorder + 1)<(1)) ? (1) : (qorder + 1));
1593 if (isSimplex) {
1594 ierr = PetscDTGaussJacobiQuadrature(dim, 1, quadPointsPerEdge, -1.0, 1.0, &q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1594,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1595 ierr = PetscDTGaussJacobiQuadrature(dim-1, 1, quadPointsPerEdge, -1.0, 1.0, &fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1595,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1596 } else {
1597 ierr = PetscDTGaussTensorQuadrature(dim, 1, quadPointsPerEdge, -1.0, 1.0, &q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1597,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1598 ierr = PetscDTGaussTensorQuadrature(dim-1, 1, quadPointsPerEdge, -1.0, 1.0, &fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1598,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1599 }
1600 ierr = PetscFESetQuadrature(*fem, q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1600,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1601 ierr = PetscFESetFaceQuadrature(*fem, fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1601,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1602 ierr = PetscQuadratureDestroy(&q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1602,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1603 ierr = PetscQuadratureDestroy(&fq);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1603,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1604 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)
;
1605}
1606
1607/*@C
1608 PetscFESetName - Names the FE and its subobjects
1609
1610 Not collective
1611
1612 Input Parameters:
1613+ fe - The PetscFE
1614- name - The name
1615
1616 Level: beginner
1617
1618.seealso: PetscFECreate(), PetscSpaceCreate(), PetscDualSpaceCreate()
1619@*/
1620PetscErrorCode PetscFESetName(PetscFE fe, const char name[])
1621{
1622 PetscSpace P;
1623 PetscDualSpace Q;
1624 PetscErrorCode ierr;
1625
1626 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1626; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1627 ierr = PetscFEGetBasisSpace(fe, &P);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1627,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1628 ierr = PetscFEGetDualSpace(fe, &Q);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1628,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1629 ierr = PetscObjectSetName((PetscObject) fe, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1629,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1630 ierr = PetscObjectSetName((PetscObject) P, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1630,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1631 ierr = PetscObjectSetName((PetscObject) Q, name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1631,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1632 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)
;
1633}
1634
1635PetscErrorCode PetscFEEvaluateFieldJets_Internal(PetscDS ds, PetscInt dim, PetscInt Nf, const PetscInt Nb[], const PetscInt Nc[], PetscInt q, PetscReal *basisField[], PetscReal *basisFieldDer[], PetscFEGeom *fegeom, const PetscScalar coefficients[], const PetscScalar coefficients_t[], PetscScalar u[], PetscScalar u_x[], PetscScalar u_t[])
1636{
1637 PetscInt dOffset = 0, fOffset = 0, f;
1638 PetscErrorCode ierr;
1639
1640 for (f = 0; f < Nf; ++f) {
1641 PetscFE fe;
1642 const PetscInt Nbf = Nb[f], Ncf = Nc[f];
1643 const PetscReal *Bq = &basisField[f][q*Nbf*Ncf];
1644 const PetscReal *Dq = &basisFieldDer[f][q*Nbf*Ncf*dim];
1645 PetscInt b, c, d;
1646
1647 ierr = PetscDSGetDiscretization(ds, f, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1647,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1648 for (c = 0; c < Ncf; ++c) u[fOffset+c] = 0.0;
1649 for (d = 0; d < dim*Ncf; ++d) u_x[fOffset*dim+d] = 0.0;
1650 for (b = 0; b < Nbf; ++b) {
1651 for (c = 0; c < Ncf; ++c) {
1652 const PetscInt cidx = b*Ncf+c;
1653
1654 u[fOffset+c] += Bq[cidx]*coefficients[dOffset+b];
1655 for (d = 0; d < dim; ++d) u_x[(fOffset+c)*dim+d] += Dq[cidx*dim+d]*coefficients[dOffset+b];
1656 }
1657 }
1658 ierr = PetscFEPushforward(fe, fegeom, 1, &u[fOffset]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1658,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1659 ierr = PetscFEPushforwardGradient(fe, fegeom, 1, &u_x[fOffset*dim]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1659,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1660 if (u_t) {
1661 for (c = 0; c < Ncf; ++c) u_t[fOffset+c] = 0.0;
1662 for (b = 0; b < Nbf; ++b) {
1663 for (c = 0; c < Ncf; ++c) {
1664 const PetscInt cidx = b*Ncf+c;
1665
1666 u_t[fOffset+c] += Bq[cidx]*coefficients_t[dOffset+b];
1667 }
1668 }
1669 ierr = PetscFEPushforward(fe, fegeom, 1, &u_t[fOffset]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1669,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1670 }
1671 fOffset += Ncf;
1672 dOffset += Nbf;
1673 }
1674 return 0;
1675}
1676
1677PetscErrorCode PetscFEEvaluateFaceFields_Internal(PetscDS prob, PetscInt field, PetscInt faceLoc, const PetscScalar coefficients[], PetscScalar u[])
1678{
1679 PetscFE fe;
1680 PetscReal *faceBasis;
1681 PetscInt Nb, Nc, b, c;
1682 PetscErrorCode ierr;
1683
1684 if (!prob) return 0;
1685 ierr = PetscDSGetDiscretization(prob, field, (PetscObject *) &fe);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1685,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1686 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1686,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1687 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1687,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1688 ierr = PetscFEGetFaceCentroidTabulation(fe, &faceBasis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1688,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1689 for (c = 0; c < Nc; ++c) {u[c] = 0.0;}
1690 for (b = 0; b < Nb; ++b) {
1691 for (c = 0; c < Nc; ++c) {
1692 const PetscInt cidx = b*Nc+c;
1693
1694 u[c] += coefficients[cidx]*faceBasis[faceLoc*Nb*Nc+cidx];
1695 }
1696 }
1697 return 0;
1698}
1699
1700PetscErrorCode PetscFEUpdateElementVec_Internal(PetscFE fe, PetscInt dim, PetscInt Nq, PetscInt Nb, PetscInt Nc, PetscReal basis[], PetscReal basisDer[], PetscScalar tmpBasis[], PetscScalar tmpBasisDer[], PetscFEGeom *fegeom, PetscScalar f0[], PetscScalar f1[], PetscScalar elemVec[])
1701{
1702 PetscInt q, b, c, d;
1703 PetscErrorCode ierr;
1704
1705 for (b = 0; b < Nb; ++b) elemVec[b] = 0.0;
1706 for (q = 0; q < Nq; ++q) {
1707 for (b = 0; b < Nb; ++b) {
1708 for (c = 0; c < Nc; ++c) {
1709 const PetscInt bcidx = b*Nc+c;
1710
1711 tmpBasis[bcidx] = basis[q*Nb*Nc+bcidx];
1712 for (d = 0; d < dim; ++d) tmpBasisDer[bcidx*dim+d] = basisDer[q*Nb*Nc*dim+bcidx*dim+d];
1713 }
1714 }
1715 ierr = PetscFEPushforward(fe, fegeom, Nb, tmpBasis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1715,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1716 ierr = PetscFEPushforwardGradient(fe, fegeom, Nb, tmpBasisDer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1716,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1717 for (b = 0; b < Nb; ++b) {
1718 for (c = 0; c < Nc; ++c) {
1719 const PetscInt bcidx = b*Nc+c;
1720 const PetscInt qcidx = q*Nc+c;
1721
1722 elemVec[b] += tmpBasis[bcidx]*f0[qcidx];
1723 for (d = 0; d < dim; ++d) elemVec[b] += tmpBasisDer[bcidx*dim+d]*f1[qcidx*dim+d];
1724 }
1725 }
1726 }
1727 return(0);
1728}
1729
1730PetscErrorCode PetscFEUpdateElementMat_Internal(PetscFE feI, PetscFE feJ, PetscInt dim, PetscInt NbI, PetscInt NcI, const PetscReal basisI[], const PetscReal basisDerI[], PetscScalar tmpBasisI[], PetscScalar tmpBasisDerI[], PetscInt NbJ, PetscInt NcJ, const PetscReal basisJ[], const PetscReal basisDerJ[], PetscScalar tmpBasisJ[], PetscScalar tmpBasisDerJ[], PetscFEGeom *fegeom, const PetscScalar g0[], const PetscScalar g1[], const PetscScalar g2[], const PetscScalar g3[], PetscInt eOffset, PetscInt totDim, PetscInt offsetI, PetscInt offsetJ, PetscScalar elemMat[])
1731{
1732 PetscInt f, fc, g, gc, df, dg;
1733 PetscErrorCode ierr;
1734
1735 for (f = 0; f < NbI; ++f) {
1736 for (fc = 0; fc < NcI; ++fc) {
1737 const PetscInt fidx = f*NcI+fc; /* Test function basis index */
1738
1739 tmpBasisI[fidx] = basisI[fidx];
1740 for (df = 0; df < dim; ++df) tmpBasisDerI[fidx*dim+df] = basisDerI[fidx*dim+df];
1741 }
1742 }
1743 ierr = PetscFEPushforward(feI, fegeom, NbI, tmpBasisI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1743,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1744 ierr = PetscFEPushforwardGradient(feI, fegeom, NbI, tmpBasisDerI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1744,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1745 for (g = 0; g < NbJ; ++g) {
1746 for (gc = 0; gc < NcJ; ++gc) {
1747 const PetscInt gidx = g*NcJ+gc; /* Trial function basis index */
1748
1749 tmpBasisJ[gidx] = basisJ[gidx];
1750 for (dg = 0; dg < dim; ++dg) tmpBasisDerJ[gidx*dim+dg] = basisDerJ[gidx*dim+dg];
1751 }
1752 }
1753 ierr = PetscFEPushforward(feJ, fegeom, NbJ, tmpBasisJ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1753,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1754 ierr = PetscFEPushforwardGradient(feJ, fegeom, NbJ, tmpBasisDerJ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1754,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1755 for (f = 0; f < NbI; ++f) {
1756 for (fc = 0; fc < NcI; ++fc) {
1757 const PetscInt fidx = f*NcI+fc; /* Test function basis index */
1758 const PetscInt i = offsetI+f; /* Element matrix row */
1759 for (g = 0; g < NbJ; ++g) {
1760 for (gc = 0; gc < NcJ; ++gc) {
1761 const PetscInt gidx = g*NcJ+gc; /* Trial function basis index */
1762 const PetscInt j = offsetJ+g; /* Element matrix column */
1763 const PetscInt fOff = eOffset+i*totDim+j;
1764
1765 elemMat[fOff] += tmpBasisI[fidx]*g0[fc*NcJ+gc]*tmpBasisJ[gidx];
1766 for (df = 0; df < dim; ++df) {
1767 elemMat[fOff] += tmpBasisI[fidx]*g1[(fc*NcJ+gc)*dim+df]*tmpBasisDerJ[gidx*dim+df];
1768 elemMat[fOff] += tmpBasisDerI[fidx*dim+df]*g2[(fc*NcJ+gc)*dim+df]*tmpBasisJ[gidx];
1769 for (dg = 0; dg < dim; ++dg) {
1770 elemMat[fOff] += tmpBasisDerI[fidx*dim+df]*g3[((fc*NcJ+gc)*dim+df)*dim+dg]*tmpBasisDerJ[gidx*dim+dg];
1771 }
1772 }
1773 }
1774 }
1775 }
1776 }
1777 return(0);
1778}
1779
1780PetscErrorCode PetscFECreateCellGeometry(PetscFE fe, PetscQuadrature quad, PetscFEGeom *cgeom)
1781{
1782 PetscDualSpace dsp;
1783 DM dm;
1784 PetscQuadrature quadDef;
1785 PetscInt dim, cdim, Nq;
1786 PetscErrorCode ierr;
1787
1788 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1788; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1789 ierr = PetscFEGetDualSpace(fe, &dsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1789,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1790 ierr = PetscDualSpaceGetDM(dsp, &dm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1790,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1791 ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1791,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1792 ierr = DMGetCoordinateDim(dm, &cdim);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1792,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1793 ierr = PetscFEGetQuadrature(fe, &quadDef);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1793,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1794 quad = quad ? quad : quadDef;
1795 ierr = PetscQuadratureGetData(quad, NULL((void*)0), NULL((void*)0), &Nq, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1795,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1796 ierr = PetscMalloc1(Nq*cdim, &cgeom->v)PetscMallocA(1,PETSC_FALSE,1796,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,(size_t)(Nq*cdim)*sizeof(**(&cgeom->v)),(&cgeom->
v))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1796,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1797 ierr = PetscMalloc1(Nq*cdim*cdim, &cgeom->J)PetscMallocA(1,PETSC_FALSE,1797,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,(size_t)(Nq*cdim*cdim)*sizeof(**(&cgeom->J)),(&cgeom
->J))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1797,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1798 ierr = PetscMalloc1(Nq*cdim*cdim, &cgeom->invJ)PetscMallocA(1,PETSC_FALSE,1798,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,(size_t)(Nq*cdim*cdim)*sizeof(**(&cgeom->invJ)),(&
cgeom->invJ))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1798,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1799 ierr = PetscMalloc1(Nq, &cgeom->detJ)PetscMallocA(1,PETSC_FALSE,1799,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,(size_t)(Nq)*sizeof(**(&cgeom->detJ)),(&cgeom->
detJ))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1799,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1800 cgeom->dim = dim;
1801 cgeom->dimEmbed = cdim;
1802 cgeom->numCells = 1;
1803 cgeom->numPoints = Nq;
1804 ierr = DMPlexComputeCellGeometryFEM(dm, 0, quad, cgeom->v, cgeom->J, cgeom->invJ, cgeom->detJ);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1804,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1805 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)
;
1806}
1807
1808PetscErrorCode PetscFEDestroyCellGeometry(PetscFE fe, PetscFEGeom *cgeom)
1809{
1810 PetscErrorCode ierr;
1811
1812 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"; petscstack
->line[petscstack->currentsize] = 1812; petscstack->
petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1813 ierr = PetscFree(cgeom->v)((*PetscTrFree)((void*)(cgeom->v),1813,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((cgeom->v) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1813,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1814 ierr = PetscFree(cgeom->J)((*PetscTrFree)((void*)(cgeom->J),1814,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((cgeom->J) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1814,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1815 ierr = PetscFree(cgeom->invJ)((*PetscTrFree)((void*)(cgeom->invJ),1815,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((cgeom->invJ) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1815,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1816 ierr = PetscFree(cgeom->detJ)((*PetscTrFree)((void*)(cgeom->detJ),1816,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
) || ((cgeom->detJ) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1816,__func__,"/sandbox/petsc/petsc.next/src/dm/dt/fe/interface/fe.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1817 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)
;
1818}

/sandbox/petsc/petsc.next/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 PetscSpacePolynomialType ptype; /* Allows us to make the Hdiv and Hcurl spaces */
47 PetscBool setupCalled;
48 PetscSpace *subspaces; /* Subspaces for each dimension */
49} PetscSpace_Poly;
50
51typedef struct {
52 PetscSpace *tensspaces;
53 PetscInt numTensSpaces;
54 PetscInt dim;
55 PetscBool uniform;
56 PetscBool setupCalled;
57 PetscSpace *heightsubspaces; /* Height subspaces */
58} PetscSpace_Tensor;
59
60typedef struct {
61 PetscQuadrature quad; /* The points defining the space */
62} PetscSpace_Point;
63
64typedef struct _PetscDualSpaceOps *PetscDualSpaceOps;
65struct _PetscDualSpaceOps {
66 PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscDualSpace);
67 PetscErrorCode (*setup)(PetscDualSpace);
68 PetscErrorCode (*view)(PetscDualSpace,PetscViewer);
69 PetscErrorCode (*destroy)(PetscDualSpace);
70
71 PetscErrorCode (*duplicate)(PetscDualSpace,PetscDualSpace*);
72 PetscErrorCode (*getdimension)(PetscDualSpace,PetscInt*);
73 PetscErrorCode (*getnumdof)(PetscDualSpace,const PetscInt**);
74 PetscErrorCode (*getheightsubspace)(PetscDualSpace,PetscInt,PetscDualSpace *);
75 PetscErrorCode (*getpointsubspace)(PetscDualSpace,PetscInt,PetscDualSpace *);
76 PetscErrorCode (*getsymmetries)(PetscDualSpace,const PetscInt****,const PetscScalar****);
77 PetscErrorCode (*apply)(PetscDualSpace, PetscInt, PetscReal, PetscFEGeom *, PetscInt, PetscErrorCode (*)(PetscInt, PetscReal, const PetscReal [], PetscInt, PetscScalar *, void *), void *, PetscScalar *);
78 PetscErrorCode (*applyall)(PetscDualSpace, const PetscScalar *, PetscScalar *);
79 PetscErrorCode (*createallpoints)(PetscDualSpace, PetscQuadrature *);
80};
81
82struct _p_PetscDualSpace {
83 PETSCHEADER(struct _PetscDualSpaceOps)_p_PetscObject hdr; struct _PetscDualSpaceOps ops[1];
84 void *data; /* Implementation object */
85 DM dm; /* The integration region K */
86 PetscInt order; /* The approximation order of the space */
87 PetscInt Nc; /* The number of components */
88 PetscQuadrature *functional; /* The basis of functionals for this space */
89 PetscQuadrature allPoints; /* Collects all quadrature points representing functionals in the basis */
90 PetscInt k; /* k-simplex corresponding to the dofs in this basis (we always use the 3D complex right now) */
91 PetscBool setupcalled;
92 PetscBool setfromoptionscalled;
93};
94
95typedef struct {
96 PetscInt *numDof; /* [d]: Number of dofs for d-dimensional point */
97 PetscBool simplexCell; /* Flag for simplices, as opposed to tensor cells */
98 PetscBool tensorSpace; /* Flag for tensor product space of polynomials, as opposed to a space of maximum degree */
99 PetscBool continuous; /* Flag for a continuous basis, as opposed to discontinuous across element boundaries */
100 PetscInt height; /* The number of subspaces stored */
101 PetscDualSpace *subspaces; /* [h]: The subspace for dimension dim-(h+1) */
102 PetscInt ***symmetries;
103 PetscInt numSelfSym;
104 PetscInt selfSymOff;
105} PetscDualSpace_Lag;
106
107typedef struct {
108 PetscInt *numDof; /* [d]: Number of dofs for d-dimensional point */
109 PetscBool simplexCell; /* Flag for simplices, as opposed to tensor cells */
110 PetscInt height; /* The number of subspaces stored */
111 PetscDualSpace *subspaces; /* [h]: The subspace for dimension dim-(h+1) */
112 PetscBool faceSpace; /* Flag indicating this is a subspace for a face (the only subspaces permitted) */
113 PetscInt ***symmetries;
114 PetscScalar ***flips;
115 PetscInt numSelfSym;
116 PetscInt selfSymOff;
117} PetscDualSpace_BDM;
118
119typedef struct {
120 PetscInt dim;
121 PetscInt *numDof;
122} PetscDualSpace_Simple;
123
124typedef struct _PetscFEOps *PetscFEOps;
125struct _PetscFEOps {
126 PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscFE);
127 PetscErrorCode (*setup)(PetscFE);
128 PetscErrorCode (*view)(PetscFE,PetscViewer);
129 PetscErrorCode (*destroy)(PetscFE);
130 PetscErrorCode (*getdimension)(PetscFE,PetscInt*);
131 PetscErrorCode (*gettabulation)(PetscFE,PetscInt,const PetscReal*,PetscReal*,PetscReal*,PetscReal*);
132 /* Element integration */
133 PetscErrorCode (*integrate)(PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
134 PetscErrorCode (*integratebd)(PetscDS, PetscInt, PetscBdPointFunc, PetscInt, PetscFEGeom *, const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
135 PetscErrorCode (*integrateresidual)(PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscScalar[]);
136 PetscErrorCode (*integratebdresidual)(PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscScalar[]);
137 PetscErrorCode (*integratejacobianaction)(PetscFE, PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscReal, PetscScalar[]);
138 PetscErrorCode (*integratejacobian)(PetscDS, PetscFEJacobianType, PetscInt, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscReal, PetscScalar[]);
139 PetscErrorCode (*integratebdjacobian)(PetscDS, PetscInt, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscReal, PetscReal, PetscScalar[]);
140};
141
142struct _p_PetscFE {
143 PETSCHEADER(struct _PetscFEOps)_p_PetscObject hdr; struct _PetscFEOps ops[1];
144 void *data; /* Implementation object */
145 PetscSpace basisSpace; /* The basis space P */
146 PetscDualSpace dualSpace; /* The dual space P' */
147 PetscInt numComponents; /* The number of field components */
148 PetscQuadrature quadrature; /* Suitable quadrature on K */
149 PetscQuadrature faceQuadrature; /* Suitable face quadrature on \partial K */
150 PetscFE *subspaces; /* Subspaces for each dimension */
151 PetscReal *invV; /* Change of basis matrix, from prime to nodal basis set */
152 PetscReal *B, *D, *H; /* Tabulation of basis and derivatives at quadrature points */
153 PetscReal *Bf, *Df, *Hf; /* Tabulation of basis and derivatives at quadrature points on each face */
154 PetscReal *F; /* Tabulation of basis at face centroids */
155 PetscInt blockSize, numBlocks; /* Blocks are processed concurrently */
156 PetscInt batchSize, numBatches; /* A batch is made up of blocks, Batches are processed in serial */
157 PetscBool setupcalled;
158};
159
160typedef struct {
161 PetscInt cellType;
162} PetscFE_Basic;
163
164#ifdef PETSC_HAVE_OPENCL
165
166#ifdef __APPLE__
167#include <OpenCL/cl.h>
168#else
169#include <CL/cl.h>
170#endif
171
172typedef struct {
173 cl_platform_id pf_id;
174 cl_device_id dev_id;
175 cl_context ctx_id;
176 cl_command_queue queue_id;
177 PetscDataType realType;
178 PetscLogEvent residualEvent;
179 PetscInt op; /* ANDY: Stand-in for real equation code generation */
180} PetscFE_OpenCL;
181#endif
182
183typedef struct {
184 CellRefiner cellRefiner; /* The cell refiner defining the cell division */
185 PetscInt numSubelements; /* The number of subelements */
186 PetscReal *v0; /* The affine transformation for each subelement */
187 PetscReal *jac, *invjac;
188 PetscInt *embedding; /* Map from subelements dofs to element dofs */
189} PetscFE_Composite;
190
191/* Utility functions */
192PETSC_STATIC_INLINEstatic inline void CoordinatesRefToReal(PetscInt dimReal, PetscInt dimRef, const PetscReal xi0[], const PetscReal v0[], const PetscReal J[], const PetscReal xi[], PetscReal x[])
193{
194 PetscInt d, e;
195
196 for (d = 0; d < dimReal; ++d) {
16
Assuming 'd' is < 'dimReal'
17
Loop condition is true. Entering loop body
197 x[d] = v0[d];
198 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
199 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
200 }
201 }
202}
203
204PETSC_STATIC_INLINEstatic inline void CoordinatesRealToRef(PetscInt dimReal, PetscInt dimRef, const PetscReal xi0[], const PetscReal v0[], const PetscReal invJ[], const PetscReal x[], PetscReal xi[])
205{
206 PetscInt d, e;
207
208 for (d = 0; d < dimRef; ++d) {
209 xi[d] = xi0[d];
210 for (e = 0; e < dimReal; ++e) {
211 xi[d] += invJ[d*dimReal+e]*(x[e] - v0[e]);
212 }
213 }
214}
215
216PETSC_STATIC_INLINEstatic inline PetscErrorCode PetscFEInterpolate_Static(PetscFE fe, const PetscScalar x[], PetscFEGeom *fegeom, PetscInt q, PetscScalar interpolant[])
217{
218 PetscReal *basis;
219 PetscInt Nb, Nc, fc, f;
220 PetscErrorCode ierr;
221
222 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
; petscstack->line[petscstack->currentsize] = 222; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
223 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),223,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
224 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),224,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
225 ierr = PetscFEGetDefaultTabulation(fe, &basis, NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),225,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
226 for (fc = 0; fc < Nc; ++fc) {
227 interpolant[fc] = 0.0;
228 for (f = 0; f < Nb; ++f) {
229 interpolant[fc] += x[f]*basis[(q*Nb + f)*Nc + fc];
230 }
231 }
232 ierr = PetscFEPushforward(fe, fegeom, 1, interpolant);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),232,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
233 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)
;
234}
235
236PETSC_STATIC_INLINEstatic inline PetscErrorCode PetscFEInterpolateGradient_Static(PetscFE fe, const PetscScalar x[], PetscFEGeom *fegeom, PetscInt q, PetscScalar interpolant[])
237{
238 PetscReal *basisDer;
239 PetscInt Nb, Nc, fc, f, d;
240 const PetscInt dim = fegeom->dimEmbed;
241 PetscErrorCode ierr;
242
243 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
; petscstack->line[petscstack->currentsize] = 243; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
244 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),244,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
245 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),245,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
246 ierr = PetscFEGetDefaultTabulation(fe, NULL((void*)0), &basisDer, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),246,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
247 for (fc = 0; fc < Nc; ++fc) {
248 for (d = 0; d < dim; ++d) interpolant[fc*dim+d] = 0.0;
249 for (f = 0; f < Nb; ++f) {
250 for (d = 0; d < dim; ++d) {
251 interpolant[fc*dim+d] += x[f]*basisDer[((q*Nb + f)*Nc + fc)*dim + d];
252 }
253 }
254 }
255 ierr = PetscFEPushforwardGradient(fe, fegeom, 1, interpolant);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),255,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
256 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)
;
257}
258
259PETSC_STATIC_INLINEstatic inline PetscErrorCode PetscFEInterpolateFieldAndGradient_Static(PetscFE fe, const PetscScalar x[], PetscFEGeom *fegeom, PetscInt q, PetscScalar interpolant[], PetscScalar interpolantGrad[])
260{
261 PetscReal *basis, *basisDer;
262 PetscInt Nb, Nc, fc, f, d;
263 const PetscInt dim = fegeom->dimEmbed;
264 PetscErrorCode ierr;
265
266 PetscFunctionBeginHotdo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
; petscstack->line[petscstack->currentsize] = 266; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_TRUE || petscstack->hotdepth); } ; } while (0);
; } while (0)
;
267 ierr = PetscFEGetDimension(fe, &Nb);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),267,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
268 ierr = PetscFEGetNumComponents(fe, &Nc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),268,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
269 ierr = PetscFEGetDefaultTabulation(fe, &basis, &basisDer, NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),269,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
270 for (fc = 0; fc < Nc; ++fc) {
271 interpolant[fc] = 0.0;
272 for (d = 0; d < dim; ++d) interpolantGrad[fc*dim+d] = 0.0;
273 for (f = 0; f < Nb; ++f) {
274 interpolant[fc] += x[f]*basis[(q*Nb + f)*Nc + fc];
275 for (d = 0; d < dim; ++d) interpolantGrad[fc*dim+d] += x[f]*basisDer[((q*Nb + f)*Nc + fc)*dim + d];
276 }
277 }
278 ierr = PetscFEPushforward(fe, fegeom, 1, interpolant);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),278,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
279 ierr = PetscFEPushforwardGradient(fe, fegeom, 1, interpolantGrad);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),279,__func__,"/sandbox/petsc/petsc.next/include/petsc/private/petscfeimpl.h"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
280 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)
;
281}
282
283PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscDualSpaceLatticePointLexicographic_Internal(PetscInt, PetscInt, PetscInt[]);
284PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscDualSpaceTensorPointLexicographic_Internal(PetscInt, PetscInt, PetscInt[]);
285
286PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscFEEvaluateFieldJets_Internal(PetscDS, PetscInt, PetscInt, const PetscInt[], const PetscInt[], PetscInt, PetscReal *[], PetscReal *[], PetscFEGeom *, const PetscScalar[], const PetscScalar[], PetscScalar[], PetscScalar[], PetscScalar[]);
287PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscFEEvaluateFaceFields_Internal(PetscDS, PetscInt, PetscInt, const PetscScalar[], PetscScalar[]);
288PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscFEUpdateElementVec_Internal(PetscFE, PetscInt, PetscInt, PetscInt, PetscInt, PetscReal[], PetscReal[], PetscScalar[], PetscScalar[], PetscFEGeom *, PetscScalar[], PetscScalar[], PetscScalar[]);
289PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscFEUpdateElementMat_Internal(PetscFE, PetscFE, PetscInt, PetscInt, PetscInt, const PetscReal[], const PetscReal[], PetscScalar[], PetscScalar[], PetscInt, PetscInt, const PetscReal[], const PetscReal[], PetscScalar[], PetscScalar[], PetscFEGeom *, const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscInt, PetscInt, PetscInt, PetscInt, PetscScalar[]);
290
291PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEGetDimension_Basic(PetscFE, PetscInt *);
292PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEIntegrateResidual_Basic(PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar [], const PetscScalar [], PetscDS, const PetscScalar [], PetscReal, PetscScalar []);
293PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEIntegrateBdResidual_Basic(PetscDS, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar [], const PetscScalar [], PetscDS, const PetscScalar [], PetscReal, PetscScalar[]);
294PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscFEIntegrateJacobian_Basic(PetscDS, PetscFEJacobianType, PetscInt, PetscInt, PetscInt, PetscFEGeom *, const PetscScalar [], const PetscScalar [], PetscDS, const PetscScalar [], PetscReal, PetscReal, PetscScalar []);
295#endif