Bug Summary

File:ksp/pc/impls/bddc/bddc.c
Warning:line 2849, column 18
2nd function call argument is an uninitialized value

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1/* TODOLIST
2
3 Solvers
4 - Add support for cholesky for coarse solver (similar to local solvers)
5 - Propagate ksp prefixes for solvers to mat objects?
6
7 User interface
8 - ** DM attached to pc?
9
10 Debugging output
11 - * Better management of verbosity levels of debugging output
12
13 Extra
14 - *** Is it possible to work with PCBDDCGraph on boundary indices only (less memory consumed)?
15 - BDDC with MG framework?
16
17 MATIS related operations contained in BDDC code
18 - Provide general case for subassembling
19
20*/
21
22#include <../src/ksp/pc/impls/bddc/bddc.h> /*I "petscpc.h" I*/ /* includes for fortran wrappers */
23#include <../src/ksp/pc/impls/bddc/bddcprivate.h>
24#include <petscblaslapack.h>
25
26static PetscBool PCBDDCPackageInitialized = PETSC_FALSE;
27
28static PetscBool cited = PETSC_FALSE;
29static const char citation[] =
30"@article{ZampiniPCBDDC,\n"
31"author = {Stefano Zampini},\n"
32"title = {{PCBDDC}: A Class of Robust Dual-Primal Methods in {PETS}c},\n"
33"journal = {SIAM Journal on Scientific Computing},\n"
34"volume = {38},\n"
35"number = {5},\n"
36"pages = {S282-S306},\n"
37"year = {2016},\n"
38"doi = {10.1137/15M1025785},\n"
39"URL = {http://dx.doi.org/10.1137/15M1025785},\n"
40"eprint = {http://dx.doi.org/10.1137/15M1025785}\n"
41"}\n";
42
43PetscLogEvent PC_BDDC_Topology[PETSC_PCBDDC_MAXLEVELS8];
44PetscLogEvent PC_BDDC_LocalSolvers[PETSC_PCBDDC_MAXLEVELS8];
45PetscLogEvent PC_BDDC_LocalWork[PETSC_PCBDDC_MAXLEVELS8];
46PetscLogEvent PC_BDDC_CorrectionSetUp[PETSC_PCBDDC_MAXLEVELS8];
47PetscLogEvent PC_BDDC_CoarseSetUp[PETSC_PCBDDC_MAXLEVELS8];
48PetscLogEvent PC_BDDC_CoarseSolver[PETSC_PCBDDC_MAXLEVELS8];
49PetscLogEvent PC_BDDC_AdaptiveSetUp[PETSC_PCBDDC_MAXLEVELS8];
50PetscLogEvent PC_BDDC_Scaling[PETSC_PCBDDC_MAXLEVELS8];
51PetscLogEvent PC_BDDC_Schurs[PETSC_PCBDDC_MAXLEVELS8];
52
53PetscErrorCode PCApply_BDDC(PC,Vec,Vec);
54
55PetscErrorCode PCSetFromOptions_BDDC(PetscOptionItems *PetscOptionsObject,PC pc)
56{
57 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
58 PetscInt nt,i;
59 PetscErrorCode ierr;
60
61 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 61; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
62 ierr = PetscOptionsHead(PetscOptionsObject,"BDDC options");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),62,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
63 /* Verbose debugging */
64 ierr = PetscOptionsInt("-pc_bddc_check_level","Verbose output for PCBDDC (intended for debug)","none",pcbddc->dbg_flag,&pcbddc->dbg_flag,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_check_level"
,"Verbose output for PCBDDC (intended for debug)","none",pcbddc
->dbg_flag,&pcbddc->dbg_flag,((void*)0),(-2147483647
- 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),64,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
65 /* Approximate solvers */
66 ierr = PetscOptionsBool("-pc_bddc_dirichlet_approximate","Inform PCBDDC that we are using approximate Dirichlet solvers","none",pcbddc->NullSpace_corr[0],&pcbddc->NullSpace_corr[0],NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_dirichlet_approximate"
,"Inform PCBDDC that we are using approximate Dirichlet solvers"
,"none",pcbddc->NullSpace_corr[0],&pcbddc->NullSpace_corr
[0],((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),66,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
67 ierr = PetscOptionsBool("-pc_bddc_dirichlet_approximate_scale","Inform PCBDDC that we need to scale the Dirichlet solve","none",pcbddc->NullSpace_corr[1],&pcbddc->NullSpace_corr[1],NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_dirichlet_approximate_scale"
,"Inform PCBDDC that we need to scale the Dirichlet solve","none"
,pcbddc->NullSpace_corr[1],&pcbddc->NullSpace_corr[
1],((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),67,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
68 ierr = PetscOptionsBool("-pc_bddc_neumann_approximate","Inform PCBDDC that we are using approximate Neumann solvers","none",pcbddc->NullSpace_corr[2],&pcbddc->NullSpace_corr[2],NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_neumann_approximate"
,"Inform PCBDDC that we are using approximate Neumann solvers"
,"none",pcbddc->NullSpace_corr[2],&pcbddc->NullSpace_corr
[2],((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),68,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
69 ierr = PetscOptionsBool("-pc_bddc_neumann_approximate_scale","Inform PCBDDC that we need to scale the Neumann solve","none",pcbddc->NullSpace_corr[3],&pcbddc->NullSpace_corr[3],NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_neumann_approximate_scale"
,"Inform PCBDDC that we need to scale the Neumann solve","none"
,pcbddc->NullSpace_corr[3],&pcbddc->NullSpace_corr[
3],((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),69,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
70 /* Primal space customization */
71 ierr = PetscOptionsBool("-pc_bddc_use_local_mat_graph","Use or not adjacency graph of local mat for interface analysis","none",pcbddc->use_local_adj,&pcbddc->use_local_adj,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_local_mat_graph"
,"Use or not adjacency graph of local mat for interface analysis"
,"none",pcbddc->use_local_adj,&pcbddc->use_local_adj
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),71,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
72 ierr = PetscOptionsInt("-pc_bddc_graph_maxcount","Maximum number of shared subdomains for a connected component","none",pcbddc->graphmaxcount,&pcbddc->graphmaxcount,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_graph_maxcount"
,"Maximum number of shared subdomains for a connected component"
,"none",pcbddc->graphmaxcount,&pcbddc->graphmaxcount
,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),72,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
73 ierr = PetscOptionsBool("-pc_bddc_corner_selection","Activates face-based corner selection","none",pcbddc->corner_selection,&pcbddc->corner_selection,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_corner_selection"
,"Activates face-based corner selection","none",pcbddc->corner_selection
,&pcbddc->corner_selection,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),73,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
74 ierr = PetscOptionsBool("-pc_bddc_use_vertices","Use or not corner dofs in coarse space","none",pcbddc->use_vertices,&pcbddc->use_vertices,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_vertices"
,"Use or not corner dofs in coarse space","none",pcbddc->use_vertices
,&pcbddc->use_vertices,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),74,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
75 ierr = PetscOptionsBool("-pc_bddc_use_edges","Use or not edge constraints in coarse space","none",pcbddc->use_edges,&pcbddc->use_edges,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_edges"
,"Use or not edge constraints in coarse space","none",pcbddc->
use_edges,&pcbddc->use_edges,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),75,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
76 ierr = PetscOptionsBool("-pc_bddc_use_faces","Use or not face constraints in coarse space","none",pcbddc->use_faces,&pcbddc->use_faces,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_faces"
,"Use or not face constraints in coarse space","none",pcbddc->
use_faces,&pcbddc->use_faces,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),76,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
77 ierr = PetscOptionsInt("-pc_bddc_vertex_size","Connected components smaller or equal to vertex size will be considered as primal vertices","none",pcbddc->vertex_size,&pcbddc->vertex_size,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_vertex_size"
,"Connected components smaller or equal to vertex size will be considered as primal vertices"
,"none",pcbddc->vertex_size,&pcbddc->vertex_size,((
void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),77,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
78 ierr = PetscOptionsBool("-pc_bddc_use_true_nnsp","Use near null space attached to the matrix without modifications","none",pcbddc->use_nnsp_true,&pcbddc->use_nnsp_true,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_true_nnsp"
,"Use near null space attached to the matrix without modifications"
,"none",pcbddc->use_nnsp_true,&pcbddc->use_nnsp_true
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),78,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
79 ierr = PetscOptionsBool("-pc_bddc_use_qr_single","Use QR factorization for single constraints on cc (QR is always used when multiple constraints are present)","none",pcbddc->use_qr_single,&pcbddc->use_qr_single,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_qr_single"
,"Use QR factorization for single constraints on cc (QR is always used when multiple constraints are present)"
,"none",pcbddc->use_qr_single,&pcbddc->use_qr_single
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),79,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
80 /* Change of basis */
81 ierr = PetscOptionsBool("-pc_bddc_use_change_of_basis","Use or not internal change of basis on local edge nodes","none",pcbddc->use_change_of_basis,&pcbddc->use_change_of_basis,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_change_of_basis"
,"Use or not internal change of basis on local edge nodes","none"
,pcbddc->use_change_of_basis,&pcbddc->use_change_of_basis
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),81,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
82 ierr = PetscOptionsBool("-pc_bddc_use_change_on_faces","Use or not internal change of basis on local face nodes","none",pcbddc->use_change_on_faces,&pcbddc->use_change_on_faces,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_change_on_faces"
,"Use or not internal change of basis on local face nodes","none"
,pcbddc->use_change_on_faces,&pcbddc->use_change_on_faces
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),82,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
83 if (!pcbddc->use_change_of_basis) {
84 pcbddc->use_change_on_faces = PETSC_FALSE;
85 }
86 /* Switch between M_2 (default) and M_3 preconditioners (as defined by C. Dohrmann in the ref. article) */
87 ierr = PetscOptionsBool("-pc_bddc_switch_static","Switch on static condensation ops around the interface preconditioner","none",pcbddc->switch_static,&pcbddc->switch_static,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_switch_static"
,"Switch on static condensation ops around the interface preconditioner"
,"none",pcbddc->switch_static,&pcbddc->switch_static
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),87,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
88 ierr = PetscOptionsInt("-pc_bddc_coarse_eqs_per_proc","Target number of equations per process for coarse problem redistribution (significant only at the coarsest level)","none",pcbddc->coarse_eqs_per_proc,&pcbddc->coarse_eqs_per_proc,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_coarse_eqs_per_proc"
,"Target number of equations per process for coarse problem redistribution (significant only at the coarsest level)"
,"none",pcbddc->coarse_eqs_per_proc,&pcbddc->coarse_eqs_per_proc
,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),88,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
89 i = pcbddc->coarsening_ratio;
90 ierr = PetscOptionsInt("-pc_bddc_coarsening_ratio","Set coarsening ratio used in multilevel coarsening","PCBDDCSetCoarseningRatio",i,&i,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_coarsening_ratio"
,"Set coarsening ratio used in multilevel coarsening","PCBDDCSetCoarseningRatio"
,i,&i,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),90,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
91 ierr = PCBDDCSetCoarseningRatio(pc,i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),91,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
92 i = pcbddc->max_levels;
93 ierr = PetscOptionsInt("-pc_bddc_levels","Set maximum number of levels for multilevel","PCBDDCSetLevels",i,&i,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_levels",
"Set maximum number of levels for multilevel","PCBDDCSetLevels"
,i,&i,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),93,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
94 ierr = PCBDDCSetLevels(pc,i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),94,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
95 ierr = PetscOptionsInt("-pc_bddc_coarse_eqs_limit","Set maximum number of equations on coarsest grid to aim for","none",pcbddc->coarse_eqs_limit,&pcbddc->coarse_eqs_limit,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_coarse_eqs_limit"
,"Set maximum number of equations on coarsest grid to aim for"
,"none",pcbddc->coarse_eqs_limit,&pcbddc->coarse_eqs_limit
,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),95,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
96 ierr = PetscOptionsBool("-pc_bddc_use_coarse_estimates","Use estimated eigenvalues for coarse problem","none",pcbddc->use_coarse_estimates,&pcbddc->use_coarse_estimates,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_coarse_estimates"
,"Use estimated eigenvalues for coarse problem","none",pcbddc
->use_coarse_estimates,&pcbddc->use_coarse_estimates
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),96,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
97 ierr = PetscOptionsBool("-pc_bddc_use_deluxe_scaling","Use deluxe scaling for BDDC","none",pcbddc->use_deluxe_scaling,&pcbddc->use_deluxe_scaling,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_use_deluxe_scaling"
,"Use deluxe scaling for BDDC","none",pcbddc->use_deluxe_scaling
,&pcbddc->use_deluxe_scaling,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),97,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
98 ierr = PetscOptionsBool("-pc_bddc_schur_rebuild","Whether or not the interface graph for Schur principal minors has to be rebuilt (i.e. define the interface without any adjacency)","none",pcbddc->sub_schurs_rebuild,&pcbddc->sub_schurs_rebuild,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_schur_rebuild"
,"Whether or not the interface graph for Schur principal minors has to be rebuilt (i.e. define the interface without any adjacency)"
,"none",pcbddc->sub_schurs_rebuild,&pcbddc->sub_schurs_rebuild
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),98,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
99 ierr = PetscOptionsInt("-pc_bddc_schur_layers","Number of dofs' layers for the computation of principal minors (i.e. -1 uses all dofs)","none",pcbddc->sub_schurs_layers,&pcbddc->sub_schurs_layers,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_schur_layers"
,"Number of dofs' layers for the computation of principal minors (i.e. -1 uses all dofs)"
,"none",pcbddc->sub_schurs_layers,&pcbddc->sub_schurs_layers
,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),99,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
100 ierr = PetscOptionsBool("-pc_bddc_schur_use_useradj","Whether or not the CSR graph specified by the user should be used for computing successive layers (default is to use adj of local mat)","none",pcbddc->sub_schurs_use_useradj,&pcbddc->sub_schurs_use_useradj,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_schur_use_useradj"
,"Whether or not the CSR graph specified by the user should be used for computing successive layers (default is to use adj of local mat)"
,"none",pcbddc->sub_schurs_use_useradj,&pcbddc->sub_schurs_use_useradj
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),100,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
101 ierr = PetscOptionsBool("-pc_bddc_schur_exact","Whether or not to use the exact Schur complement instead of the reduced one (which excludes size 1 cc)","none",pcbddc->sub_schurs_exact_schur,&pcbddc->sub_schurs_exact_schur,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_schur_exact"
,"Whether or not to use the exact Schur complement instead of the reduced one (which excludes size 1 cc)"
,"none",pcbddc->sub_schurs_exact_schur,&pcbddc->sub_schurs_exact_schur
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),101,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
102 ierr = PetscOptionsBool("-pc_bddc_deluxe_zerorows","Zero rows and columns of deluxe operators associated with primal dofs","none",pcbddc->deluxe_zerorows,&pcbddc->deluxe_zerorows,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_deluxe_zerorows"
,"Zero rows and columns of deluxe operators associated with primal dofs"
,"none",pcbddc->deluxe_zerorows,&pcbddc->deluxe_zerorows
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),102,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
103 ierr = PetscOptionsBool("-pc_bddc_deluxe_singlemat","Collapse deluxe operators","none",pcbddc->deluxe_singlemat,&pcbddc->deluxe_singlemat,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_deluxe_singlemat"
,"Collapse deluxe operators","none",pcbddc->deluxe_singlemat
,&pcbddc->deluxe_singlemat,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),103,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
104 ierr = PetscOptionsBool("-pc_bddc_adaptive_userdefined","Use user-defined constraints (should be attached via MatSetNearNullSpace to pmat) in addition to those adaptively generated","none",pcbddc->adaptive_userdefined,&pcbddc->adaptive_userdefined,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_adaptive_userdefined"
,"Use user-defined constraints (should be attached via MatSetNearNullSpace to pmat) in addition to those adaptively generated"
,"none",pcbddc->adaptive_userdefined,&pcbddc->adaptive_userdefined
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),104,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
105 nt = 2;
106 ierr = PetscOptionsRealArray("-pc_bddc_adaptive_threshold","Thresholds to be used for adaptive selection of constraints","none",pcbddc->adaptive_threshold,&nt,NULL)PetscOptionsRealArray_Private(PetscOptionsObject,"-pc_bddc_adaptive_threshold"
,"Thresholds to be used for adaptive selection of constraints"
,"none",pcbddc->adaptive_threshold,&nt,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),106,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
107 if (nt == 1) pcbddc->adaptive_threshold[1] = pcbddc->adaptive_threshold[0];
108 ierr = PetscOptionsInt("-pc_bddc_adaptive_nmin","Minimum number of constraints per connected components","none",pcbddc->adaptive_nmin,&pcbddc->adaptive_nmin,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_adaptive_nmin"
,"Minimum number of constraints per connected components","none"
,pcbddc->adaptive_nmin,&pcbddc->adaptive_nmin,((void
*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),108,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
109 ierr = PetscOptionsInt("-pc_bddc_adaptive_nmax","Maximum number of constraints per connected components","none",pcbddc->adaptive_nmax,&pcbddc->adaptive_nmax,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_adaptive_nmax"
,"Maximum number of constraints per connected components","none"
,pcbddc->adaptive_nmax,&pcbddc->adaptive_nmax,((void
*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),109,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
110 ierr = PetscOptionsBool("-pc_bddc_symmetric","Symmetric computation of primal basis functions","none",pcbddc->symmetric_primal,&pcbddc->symmetric_primal,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_symmetric"
,"Symmetric computation of primal basis functions","none",pcbddc
->symmetric_primal,&pcbddc->symmetric_primal,((void
*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),110,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
111 ierr = PetscOptionsInt("-pc_bddc_coarse_adj","Number of processors where to map the coarse adjacency list","none",pcbddc->coarse_adj_red,&pcbddc->coarse_adj_red,NULL)PetscOptionsInt_Private(PetscOptionsObject,"-pc_bddc_coarse_adj"
,"Number of processors where to map the coarse adjacency list"
,"none",pcbddc->coarse_adj_red,&pcbddc->coarse_adj_red
,((void*)0),(-2147483647 - 1),2147483647)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),111,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
112 ierr = PetscOptionsBool("-pc_bddc_benign_trick","Apply the benign subspace trick to saddle point problems with discontinuous pressures","none",pcbddc->benign_saddle_point,&pcbddc->benign_saddle_point,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_benign_trick"
,"Apply the benign subspace trick to saddle point problems with discontinuous pressures"
,"none",pcbddc->benign_saddle_point,&pcbddc->benign_saddle_point
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),112,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
113 ierr = PetscOptionsBool("-pc_bddc_benign_change","Compute the pressure change of basis explicitly","none",pcbddc->benign_change_explicit,&pcbddc->benign_change_explicit,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_benign_change"
,"Compute the pressure change of basis explicitly","none",pcbddc
->benign_change_explicit,&pcbddc->benign_change_explicit
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),113,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
114 ierr = PetscOptionsBool("-pc_bddc_benign_compute_correction","Compute the benign correction during PreSolve","none",pcbddc->benign_compute_correction,&pcbddc->benign_compute_correction,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_benign_compute_correction"
,"Compute the benign correction during PreSolve","none",pcbddc
->benign_compute_correction,&pcbddc->benign_compute_correction
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),114,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
115 ierr = PetscOptionsBool("-pc_bddc_nonetflux","Automatic computation of no-net-flux quadrature weights","none",pcbddc->compute_nonetflux,&pcbddc->compute_nonetflux,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_nonetflux"
,"Automatic computation of no-net-flux quadrature weights","none"
,pcbddc->compute_nonetflux,&pcbddc->compute_nonetflux
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),115,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
116 ierr = PetscOptionsBool("-pc_bddc_detect_disconnected","Detects disconnected subdomains","none",pcbddc->detect_disconnected,&pcbddc->detect_disconnected,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_detect_disconnected"
,"Detects disconnected subdomains","none",pcbddc->detect_disconnected
,&pcbddc->detect_disconnected,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),116,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
117 ierr = PetscOptionsBool("-pc_bddc_detect_disconnected_filter","Filters out small entries in the local matrix when detecting disconnected subdomains","none",pcbddc->detect_disconnected_filter,&pcbddc->detect_disconnected_filter,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_detect_disconnected_filter"
,"Filters out small entries in the local matrix when detecting disconnected subdomains"
,"none",pcbddc->detect_disconnected_filter,&pcbddc->
detect_disconnected_filter,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),117,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
118 ierr = PetscOptionsBool("-pc_bddc_eliminate_dirichlet","Whether or not we want to eliminate dirichlet dofs during presolve","none",pcbddc->eliminate_dirdofs,&pcbddc->eliminate_dirdofs,NULL)PetscOptionsBool_Private(PetscOptionsObject,"-pc_bddc_eliminate_dirichlet"
,"Whether or not we want to eliminate dirichlet dofs during presolve"
,"none",pcbddc->eliminate_dirdofs,&pcbddc->eliminate_dirdofs
,((void*)0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),118,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
119 ierr = PetscOptionsTail()0; do {if (PetscOptionsObject->count != 1) 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);} while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),119,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
120 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)
;
121}
122
123static PetscErrorCode PCView_BDDC(PC pc,PetscViewer viewer)
124{
125 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
126 PC_IS *pcis = (PC_IS*)pc->data;
127 PetscErrorCode ierr;
128 PetscBool isascii;
129 PetscSubcomm subcomm;
130 PetscViewer subviewer;
131
132 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 132; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
133 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII"ascii",&isascii);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),133,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
134 /* ASCII viewer */
135 if (isascii) {
136 PetscMPIInt color,rank,size;
137 PetscInt64 loc[7],gsum[6],gmax[6],gmin[6],totbenign;
138 PetscScalar interface_size;
139 PetscReal ratio1=0.,ratio2=0.;
140 Vec counter;
141
142 if (!pc->setupcalled) {
143 ierr = PetscViewerASCIIPrintf(viewer," Partial information available: preconditioner has not been setup yet\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),143,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
144 }
145 ierr = PetscViewerASCIIPrintf(viewer," Use verbose output: %D\n",pcbddc->dbg_flag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),145,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
146 ierr = PetscViewerASCIIPrintf(viewer," Use user-defined CSR: %d\n",!!pcbddc->mat_graph->nvtxs_csr);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),146,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
147 ierr = PetscViewerASCIIPrintf(viewer," Use local mat graph: %d\n",pcbddc->use_local_adj && !pcbddc->mat_graph->nvtxs_csr);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),147,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
148 if (pcbddc->mat_graph->twodim) {
149 ierr = PetscViewerASCIIPrintf(viewer," Connectivity graph topological dimension: 2\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),149,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
150 } else {
151 ierr = PetscViewerASCIIPrintf(viewer," Connectivity graph topological dimension: 3\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),151,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
152 }
153 if (pcbddc->graphmaxcount != PETSC_MAX_INT2147483647) {
154 ierr = PetscViewerASCIIPrintf(viewer," Graph max count: %D\n",pcbddc->graphmaxcount);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),154,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
155 }
156 ierr = PetscViewerASCIIPrintf(viewer," Use vertices: %d (vertex size %D)\n",pcbddc->use_vertices,pcbddc->vertex_size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),156,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
157 ierr = PetscViewerASCIIPrintf(viewer," Use edges: %d\n",pcbddc->use_edges);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),157,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
158 ierr = PetscViewerASCIIPrintf(viewer," Use faces: %d\n",pcbddc->use_faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),158,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
159 ierr = PetscViewerASCIIPrintf(viewer," Use true near null space: %d\n",pcbddc->use_nnsp_true);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),159,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
160 ierr = PetscViewerASCIIPrintf(viewer," Use QR for single constraints on cc: %d\n",pcbddc->use_qr_single);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),160,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
161 ierr = PetscViewerASCIIPrintf(viewer," Use change of basis on local edge nodes: %d\n",pcbddc->use_change_of_basis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),161,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
162 ierr = PetscViewerASCIIPrintf(viewer," Use change of basis on local face nodes: %d\n",pcbddc->use_change_on_faces);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),162,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
163 ierr = PetscViewerASCIIPrintf(viewer," User defined change of basis matrix: %d\n",!!pcbddc->user_ChangeOfBasisMatrix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),163,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
164 ierr = PetscViewerASCIIPrintf(viewer," Has change of basis matrix: %d\n",!!pcbddc->ChangeOfBasisMatrix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),164,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
165 ierr = PetscViewerASCIIPrintf(viewer," Eliminate dirichlet boundary dofs: %d\n",pcbddc->eliminate_dirdofs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),165,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
166 ierr = PetscViewerASCIIPrintf(viewer," Switch on static condensation ops around the interface preconditioner: %d\n",pcbddc->switch_static);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),166,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
167 ierr = PetscViewerASCIIPrintf(viewer," Use exact dirichlet trick: %d\n",pcbddc->use_exact_dirichlet_trick);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),167,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
168 ierr = PetscViewerASCIIPrintf(viewer," Multilevel max levels: %D\n",pcbddc->max_levels);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),168,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
169 ierr = PetscViewerASCIIPrintf(viewer," Multilevel coarsening ratio: %D\n",pcbddc->coarsening_ratio);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),169,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
170 ierr = PetscViewerASCIIPrintf(viewer," Use estimated eigs for coarse problem: %d\n",pcbddc->use_coarse_estimates);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),170,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
171 ierr = PetscViewerASCIIPrintf(viewer," Use deluxe scaling: %d\n",pcbddc->use_deluxe_scaling);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),171,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
172 ierr = PetscViewerASCIIPrintf(viewer," Use deluxe zerorows: %d\n",pcbddc->deluxe_zerorows);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),172,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
173 ierr = PetscViewerASCIIPrintf(viewer," Use deluxe singlemat: %d\n",pcbddc->deluxe_singlemat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),173,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
174 ierr = PetscViewerASCIIPrintf(viewer," Rebuild interface graph for Schur principal minors: %d\n",pcbddc->sub_schurs_rebuild);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),174,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
175 ierr = PetscViewerASCIIPrintf(viewer," Number of dofs' layers for the computation of principal minors: %D\n",pcbddc->sub_schurs_layers);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),175,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
176 ierr = PetscViewerASCIIPrintf(viewer," Use user CSR graph to compute successive layers: %d\n",pcbddc->sub_schurs_use_useradj);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),176,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
177 if (pcbddc->adaptive_threshold[1] != pcbddc->adaptive_threshold[0]) {
178 ierr = PetscViewerASCIIPrintf(viewer," Adaptive constraint selection thresholds (active %d, userdefined %d): %g,%g\n",pcbddc->adaptive_selection,pcbddc->adaptive_userdefined,pcbddc->adaptive_threshold[0],pcbddc->adaptive_threshold[1]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),178,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
179 } else {
180 ierr = PetscViewerASCIIPrintf(viewer," Adaptive constraint selection threshold (active %d, userdefined %d): %g\n",pcbddc->adaptive_selection,pcbddc->adaptive_userdefined,pcbddc->adaptive_threshold[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),180,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
181 }
182 ierr = PetscViewerASCIIPrintf(viewer," Min constraints / connected component: %D\n",pcbddc->adaptive_nmin);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),182,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
183 ierr = PetscViewerASCIIPrintf(viewer," Max constraints / connected component: %D\n",pcbddc->adaptive_nmax);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),183,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
184 ierr = PetscViewerASCIIPrintf(viewer," Invert exact Schur complement for adaptive selection: %d\n",pcbddc->sub_schurs_exact_schur);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),184,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
185 ierr = PetscViewerASCIIPrintf(viewer," Symmetric computation of primal basis functions: %d\n",pcbddc->symmetric_primal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),185,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
186 ierr = PetscViewerASCIIPrintf(viewer," Num. Procs. to map coarse adjacency list: %D\n",pcbddc->coarse_adj_red);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),186,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
187 ierr = PetscViewerASCIIPrintf(viewer," Coarse eqs per proc (significant at the coarsest level): %D\n",pcbddc->coarse_eqs_per_proc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),187,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
188 ierr = PetscViewerASCIIPrintf(viewer," Detect disconnected: %d (filter %d)\n",pcbddc->detect_disconnected,pcbddc->detect_disconnected_filter);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),188,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
189 ierr = PetscViewerASCIIPrintf(viewer," Benign subspace trick: %d (change explicit %d)\n",pcbddc->benign_saddle_point,pcbddc->benign_change_explicit);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),189,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
190 ierr = PetscViewerASCIIPrintf(viewer," Benign subspace trick is active: %d\n",pcbddc->benign_have_null);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),190,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
191 ierr = PetscViewerASCIIPrintf(viewer," Algebraic computation of no-net-flux: %d\n",pcbddc->compute_nonetflux);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),191,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
192 if (!pc->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)
;
193
194 /* compute interface size */
195 ierr = VecSet(pcis->vec1_B,1.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),195,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
196 ierr = MatCreateVecs(pc->pmat,&counter,0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),196,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
197 ierr = VecSet(counter,0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),197,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
198 ierr = VecScatterBegin(pcis->global_to_B,pcis->vec1_B,counter,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),198,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
199 ierr = VecScatterEnd(pcis->global_to_B,pcis->vec1_B,counter,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),199,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
200 ierr = VecSum(counter,&interface_size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),200,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
201 ierr = VecDestroy(&counter);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),201,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
202
203 /* compute some statistics on the domain decomposition */
204 gsum[0] = 1;
205 gsum[1] = gsum[2] = gsum[3] = gsum[4] = gsum[5] = 0;
206 loc[0] = !!pcis->n;
207 loc[1] = pcis->n - pcis->n_B;
208 loc[2] = pcis->n_B;
209 loc[3] = pcbddc->local_primal_size;
210 loc[4] = pcis->n;
211 loc[5] = pcbddc->n_local_subs > 0 ? pcbddc->n_local_subs : (pcis->n ? 1 : 0);
212 loc[6] = pcbddc->benign_n;
213 ierr = MPI_Reduce(loc,gsum,6,MPIU_INT64((MPI_Datatype)0x4c00083a),MPI_SUM(MPI_Op)(0x58000003),0,PetscObjectComm((PetscObject)pc));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),213,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
214 if (!loc[0]) loc[1] = loc[2] = loc[3] = loc[4] = loc[5] = -1;
215 ierr = MPI_Reduce(loc,gmax,6,MPIU_INT64((MPI_Datatype)0x4c00083a),MPI_MAX(MPI_Op)(0x58000001),0,PetscObjectComm((PetscObject)pc));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),215,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
216 if (!loc[0]) loc[1] = loc[2] = loc[3] = loc[4] = loc[5] = PETSC_MAX_INT2147483647;
217 ierr = MPI_Reduce(loc,gmin,6,MPIU_INT64((MPI_Datatype)0x4c00083a),MPI_MIN(MPI_Op)(0x58000002),0,PetscObjectComm((PetscObject)pc));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),217,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
218 ierr = MPI_Reduce(&loc[6],&totbenign,1,MPIU_INT64((MPI_Datatype)0x4c00083a),MPI_SUM(MPI_Op)(0x58000003),0,PetscObjectComm((PetscObject)pc));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),218,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
219 if (pcbddc->coarse_size) {
220 ratio1 = pc->pmat->rmap->N/(1.*pcbddc->coarse_size);
221 ratio2 = PetscRealPart(interface_size)(interface_size)/pcbddc->coarse_size;
222 }
223 ierr = PetscViewerASCIIPrintf(viewer,"********************************** STATISTICS AT LEVEL %d **********************************\n",pcbddc->current_level);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),223,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
224 ierr = PetscViewerASCIIPrintf(viewer," Global dofs sizes: all %D interface %D coarse %D\n",pc->pmat->rmap->N,(PetscInt)PetscRealPart(interface_size)(interface_size),pcbddc->coarse_size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),224,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
225 ierr = PetscViewerASCIIPrintf(viewer," Coarsening ratios: all/coarse %D interface/coarse %D\n",(PetscInt)ratio1,(PetscInt)ratio2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),225,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
226 ierr = PetscViewerASCIIPrintf(viewer," Active processes : %D\n",(PetscInt)gsum[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),226,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
227 ierr = PetscViewerASCIIPrintf(viewer," Total subdomains : %D\n",(PetscInt)gsum[5]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),227,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
228 if (pcbddc->benign_have_null) {
229 ierr = PetscViewerASCIIPrintf(viewer," Benign subs : %D\n",(PetscInt)totbenign);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),229,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
230 }
231 ierr = PetscViewerASCIIPrintf(viewer," Dofs type :\tMIN\tMAX\tMEAN\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),231,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
232 ierr = PetscViewerASCIIPrintf(viewer," Interior dofs :\t%D\t%D\t%D\n",(PetscInt)gmin[1],(PetscInt)gmax[1],(PetscInt)(gsum[1]/gsum[0]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),232,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
233 ierr = PetscViewerASCIIPrintf(viewer," Interface dofs :\t%D\t%D\t%D\n",(PetscInt)gmin[2],(PetscInt)gmax[2],(PetscInt)(gsum[2]/gsum[0]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),233,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
234 ierr = PetscViewerASCIIPrintf(viewer," Primal dofs :\t%D\t%D\t%D\n",(PetscInt)gmin[3],(PetscInt)gmax[3],(PetscInt)(gsum[3]/gsum[0]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),234,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
235 ierr = PetscViewerASCIIPrintf(viewer," Local dofs :\t%D\t%D\t%D\n",(PetscInt)gmin[4],(PetscInt)gmax[4],(PetscInt)(gsum[4]/gsum[0]));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),235,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
236 ierr = PetscViewerASCIIPrintf(viewer," Local subs :\t%D\t%D\n" ,(PetscInt)gmin[5],(PetscInt)gmax[5]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),236,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
237 ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),237,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
238
239 ierr = MPI_Comm_rank(PetscObjectComm((PetscObject)pc),&rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),239,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
240
241 /* local solvers */
242 ierr = PetscViewerGetSubViewer(viewer,PetscObjectComm((PetscObject)pcbddc->ksp_D),&subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),242,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
243 if (!rank) {
244 ierr = PetscViewerASCIIPrintf(subviewer,"--- Interior solver (rank 0)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),244,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
245 ierr = PetscViewerASCIIPushTab(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),245,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
246 ierr = KSPView(pcbddc->ksp_D,subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),246,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
247 ierr = PetscViewerASCIIPopTab(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),247,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
248 ierr = PetscViewerASCIIPrintf(subviewer,"--- Correction solver (rank 0)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),248,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
249 ierr = PetscViewerASCIIPushTab(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),249,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
250 ierr = KSPView(pcbddc->ksp_R,subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),250,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
251 ierr = PetscViewerASCIIPopTab(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),251,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
252 ierr = PetscViewerFlush(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),252,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
253 }
254 ierr = PetscViewerRestoreSubViewer(viewer,PetscObjectComm((PetscObject)pcbddc->ksp_D),&subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),254,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
255 ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),255,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
256
257 /* the coarse problem can be handled by a different communicator */
258 if (pcbddc->coarse_ksp) color = 1;
259 else color = 0;
260 ierr = MPI_Comm_size(PetscObjectComm((PetscObject)pc),&size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),260,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
261 ierr = PetscSubcommCreate(PetscObjectComm((PetscObject)pc),&subcomm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),261,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
262 ierr = PetscSubcommSetNumber(subcomm,PetscMin(size,2)(((size)<(2)) ? (size) : (2)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),262,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
263 ierr = PetscSubcommSetTypeGeneral(subcomm,color,rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),263,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
264 ierr = PetscViewerGetSubViewer(viewer,PetscSubcommChild(subcomm),&subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),264,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
265 if (color == 1) {
266 ierr = PetscViewerASCIIPrintf(subviewer,"--- Coarse solver\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),266,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
267 ierr = PetscViewerASCIIPushTab(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),267,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
268 ierr = KSPView(pcbddc->coarse_ksp,subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),268,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
269 ierr = PetscViewerASCIIPopTab(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),269,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
270 ierr = PetscViewerFlush(subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),270,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
271 }
272 ierr = PetscViewerRestoreSubViewer(viewer,PetscSubcommChild(subcomm),&subviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),272,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
273 ierr = PetscSubcommDestroy(&subcomm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),273,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
274 ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),274,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
275 }
276 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)
;
277}
278
279static PetscErrorCode PCBDDCSetDiscreteGradient_BDDC(PC pc, Mat G, PetscInt order, PetscInt field, PetscBool global, PetscBool conforming)
280{
281 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
282 PetscErrorCode ierr;
283
284 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 284; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
285 ierr = PetscObjectReference((PetscObject)G);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),285,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
286 ierr = MatDestroy(&pcbddc->discretegradient);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),286,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
287 pcbddc->discretegradient = G;
288 pcbddc->nedorder = order > 0 ? order : -order;
289 pcbddc->nedfield = field;
290 pcbddc->nedglobal = global;
291 pcbddc->conforming = conforming;
292 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
293}
294
295/*@
296 PCBDDCSetDiscreteGradient - Sets the discrete gradient
297
298 Collective on PC
299
300 Input Parameters:
301+ pc - the preconditioning context
302. G - the discrete gradient matrix (should be in AIJ format)
303. order - the order of the Nedelec space (1 for the lowest order)
304. field - the field id of the Nedelec dofs (not used if the fields have not been specified)
305. global - the type of global ordering for the rows of G
306- conforming - whether the mesh is conforming or not
307
308 Level: advanced
309
310 Notes:
311 The discrete gradient matrix G is used to analyze the subdomain edges, and it should not contain any zero entry.
312 For variable order spaces, the order should be set to zero.
313 If global is true, the rows of G should be given in global ordering for the whole dofs;
314 if false, the ordering should be global for the Nedelec field.
315 In the latter case, it should hold gid[i] < gid[j] iff geid[i] < geid[j], with gid the global orderding for all the dofs
316 and geid the one for the Nedelec field.
317
318.seealso: PCBDDC,PCBDDCSetDofsSplitting(),PCBDDCSetDofsSplittingLocal()
319@*/
320PetscErrorCode PCBDDCSetDiscreteGradient(PC pc, Mat G, PetscInt order, PetscInt field, PetscBool global, PetscBool conforming)
321{
322 PetscErrorCode ierr;
323
324 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 324; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
325 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),325,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),325
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),325,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),325,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
326 PetscValidHeaderSpecific(G,MAT_CLASSID,2)do { if (!G) return PetscError(((MPI_Comm)0x44000001),326,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (!PetscCheckPointer
(G,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),326
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(G))->classid != MAT_CLASSID) { if (
((PetscObject)(G))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),326,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),326,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
327 PetscValidLogicalCollectiveInt(pc,order,3)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -order
; b1[1] = order; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,327,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),327,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),327,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,3); } while (0)
;
328 PetscValidLogicalCollectiveInt(pc,field,4)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -field
; b1[1] = field; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,328,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),328,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),328,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,4); } while (0)
;
329 PetscValidLogicalCollectiveBool(pc,global,5)do { PetscErrorCode _7_ierr; PetscMPIInt b1[2],b2[2]; b1[0] =
-(PetscMPIInt)global; b1[1] = (PetscMPIInt)global; _7_ierr =
(PetscAllreduceBarrierCheck(PetscObjectComm((PetscObject)pc)
,2,329,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),329,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),329,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Bool value must be same on all processes, argument # %d"
,5); } while (0)
;
330 PetscValidLogicalCollectiveBool(pc,conforming,6)do { PetscErrorCode _7_ierr; PetscMPIInt b1[2],b2[2]; b1[0] =
-(PetscMPIInt)conforming; b1[1] = (PetscMPIInt)conforming; _7_ierr
= (PetscAllreduceBarrierCheck(PetscObjectComm((PetscObject)pc
),2,330,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),330,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),330,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Bool value must be same on all processes, argument # %d"
,6); } while (0)
;
331 PetscCheckSameComm(pc,1,G,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)G),&_7_flag);do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),331,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),331,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
332 ierr = PetscTryMethod(pc,"PCBDDCSetDiscreteGradient_C",(PC,Mat,PetscInt,PetscInt,PetscBool,PetscBool),(pc,G,order,field,global,conforming))0; do { PetscErrorCode (*_7_f)(PC,Mat,PetscInt,PetscInt,PetscBool
,PetscBool), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetDiscreteGradient_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),332,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,G,order,field,global,conforming);do {if (__builtin_expect
(!!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),332
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),332,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
333 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)
;
334}
335
336static PetscErrorCode PCBDDCSetDivergenceMat_BDDC(PC pc, Mat divudotp, PetscBool trans, IS vl2l)
337{
338 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
339 PetscErrorCode ierr;
340
341 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 341; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
342 ierr = PetscObjectReference((PetscObject)divudotp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),342,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
343 ierr = MatDestroy(&pcbddc->divudotp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),343,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
344 pcbddc->divudotp = divudotp;
345 pcbddc->divudotp_trans = trans;
346 pcbddc->compute_nonetflux = PETSC_TRUE;
347 if (vl2l) {
348 ierr = PetscObjectReference((PetscObject)vl2l);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),348,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
349 ierr = ISDestroy(&pcbddc->divudotp_vl2l);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),349,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
350 pcbddc->divudotp_vl2l = vl2l;
351 }
352 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)
;
353}
354
355/*@
356 PCBDDCSetDivergenceMat - Sets the linear operator representing \int_\Omega \div {\bf u} \cdot p dx
357
358 Collective on PC
359
360 Input Parameters:
361+ pc - the preconditioning context
362. divudotp - the matrix (must be of type MATIS)
363. trans - if trans if false (resp. true), then pressures are in the test (trial) space and velocities are in the trial (test) space.
364- vl2l - optional index set describing the local (wrt the local matrix in divudotp) to local (wrt the local matrix in the preconditioning matrix) map for the velocities
365
366 Level: advanced
367
368 Notes:
369 This auxiliary matrix is used to compute quadrature weights representing the net-flux across subdomain boundaries
370 If vl2l is NULL, the local ordering for velocities in divudotp should match that of the preconditioning matrix
371
372.seealso: PCBDDC
373@*/
374PetscErrorCode PCBDDCSetDivergenceMat(PC pc, Mat divudotp, PetscBool trans, IS vl2l)
375{
376 PetscBool ismatis;
377 PetscErrorCode ierr;
378
379 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 379; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
380 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),380,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),380
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),380,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),380,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
381 PetscValidHeaderSpecific(divudotp,MAT_CLASSID,2)do { if (!divudotp) return PetscError(((MPI_Comm)0x44000001),
381,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(divudotp,PETSC_OBJECT)) return PetscError(
((MPI_Comm)0x44000001),381,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(divudotp))->classid != MAT_CLASSID
) { if (((PetscObject)(divudotp))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),381,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),381,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
382 PetscCheckSameComm(pc,1,divudotp,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)divudotp),&_7_flag);do {if (__builtin_expect(!!(_7_ierr)
,0)) return PetscError(((MPI_Comm)0x44000001),382,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),382,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
383 PetscValidLogicalCollectiveBool(pc,trans,3)do { PetscErrorCode _7_ierr; PetscMPIInt b1[2],b2[2]; b1[0] =
-(PetscMPIInt)trans; b1[1] = (PetscMPIInt)trans; _7_ierr = (
PetscAllreduceBarrierCheck(PetscObjectComm((PetscObject)pc),2
,383,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),383,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),383,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Bool value must be same on all processes, argument # %d"
,3); } while (0)
;
384 if (vl2l) PetscValidHeaderSpecific(vl2l,IS_CLASSID,4)do { if (!vl2l) return PetscError(((MPI_Comm)0x44000001),384,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",4); if (
!PetscCheckPointer(vl2l,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),384,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,4); if (((PetscObject)(vl2l))->classid != IS_CLASSID) { if
(((PetscObject)(vl2l))->classid == -1) return PetscError(
((MPI_Comm)0x44000001),384,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,4); else return PetscError(((MPI_Comm)0x44000001),384,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",4
); } } while (0)
;
385 ierr = PetscObjectTypeCompare((PetscObject)divudotp,MATIS"is",&ismatis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),385,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
386 if (!ismatis) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_WRONG,"Divergence matrix needs to be of type MATIS")return PetscError(PetscObjectComm((PetscObject)pc),386,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Divergence matrix needs to be of type MATIS"
)
;
387 ierr = PetscTryMethod(pc,"PCBDDCSetDivergenceMat_C",(PC,Mat,PetscBool,IS),(pc,divudotp,trans,vl2l))0; do { PetscErrorCode (*_7_f)(PC,Mat,PetscBool,IS), _7_ierr;
_7_ierr = PetscObjectQueryFunction_Private(((PetscObject)(pc
)),("PCBDDCSetDivergenceMat_C"),(PetscVoidFunction*)(&_7_f
));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),387,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,divudotp,trans,vl2l);do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),387,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),387,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.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
391static PetscErrorCode PCBDDCSetChangeOfBasisMat_BDDC(PC pc, Mat change, PetscBool interior)
392{
393 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
394 PetscErrorCode ierr;
395
396 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 396; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
397 ierr = PetscObjectReference((PetscObject)change);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),397,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
398 ierr = MatDestroy(&pcbddc->user_ChangeOfBasisMatrix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),398,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
399 pcbddc->user_ChangeOfBasisMatrix = change;
400 pcbddc->change_interior = interior;
401 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)
;
402}
403/*@
404 PCBDDCSetChangeOfBasisMat - Set user defined change of basis for dofs
405
406 Collective on PC
407
408 Input Parameters:
409+ pc - the preconditioning context
410. change - the change of basis matrix
411- interior - whether or not the change of basis modifies interior dofs
412
413 Level: intermediate
414
415 Notes:
416
417.seealso: PCBDDC
418@*/
419PetscErrorCode PCBDDCSetChangeOfBasisMat(PC pc, Mat change, PetscBool interior)
420{
421 PetscErrorCode ierr;
422
423 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 423; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
424 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),424,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),424
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),424,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),424,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
425 PetscValidHeaderSpecific(change,MAT_CLASSID,2)do { if (!change) return PetscError(((MPI_Comm)0x44000001),425
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(change,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),425,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(change))->classid != MAT_CLASSID) {
if (((PetscObject)(change))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),425,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),425,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
426 PetscCheckSameComm(pc,1,change,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)change),&_7_flag);do {if (__builtin_expect(!!(_7_ierr),0
)) return PetscError(((MPI_Comm)0x44000001),426,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),426,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
427 if (pc->mat) {
428 PetscInt rows_c,cols_c,rows,cols;
429 ierr = MatGetSize(pc->mat,&rows,&cols);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),429,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
430 ierr = MatGetSize(change,&rows_c,&cols_c);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),430,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
431 if (rows_c != rows) SETERRQ2(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Invalid number of rows for change of basis matrix! %D != %D",rows_c,rows)return PetscError(PetscObjectComm((PetscObject)pc),431,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Invalid number of rows for change of basis matrix! %D != %D"
,rows_c,rows)
;
432 if (cols_c != cols) SETERRQ2(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Invalid number of columns for change of basis matrix! %D != %D",cols_c,cols)return PetscError(PetscObjectComm((PetscObject)pc),432,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Invalid number of columns for change of basis matrix! %D != %D"
,cols_c,cols)
;
433 ierr = MatGetLocalSize(pc->mat,&rows,&cols);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),433,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
434 ierr = MatGetLocalSize(change,&rows_c,&cols_c);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),434,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
435 if (rows_c != rows) SETERRQ2(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Invalid number of local rows for change of basis matrix! %D != %D",rows_c,rows)return PetscError(PetscObjectComm((PetscObject)pc),435,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Invalid number of local rows for change of basis matrix! %D != %D"
,rows_c,rows)
;
436 if (cols_c != cols) SETERRQ2(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Invalid number of local columns for change of basis matrix! %D != %D",cols_c,cols)return PetscError(PetscObjectComm((PetscObject)pc),436,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Invalid number of local columns for change of basis matrix! %D != %D"
,cols_c,cols)
;
437 }
438 ierr = PetscTryMethod(pc,"PCBDDCSetChangeOfBasisMat_C",(PC,Mat,PetscBool),(pc,change,interior))0; do { PetscErrorCode (*_7_f)(PC,Mat,PetscBool), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetChangeOfBasisMat_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),438,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,change,interior);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),438,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),438,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
439 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)
;
440}
441
442static PetscErrorCode PCBDDCSetPrimalVerticesIS_BDDC(PC pc, IS PrimalVertices)
443{
444 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
445 PetscBool isequal = PETSC_FALSE;
446 PetscErrorCode ierr;
447
448 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 448; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
449 ierr = PetscObjectReference((PetscObject)PrimalVertices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),449,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
450 if (pcbddc->user_primal_vertices) {
451 ierr = ISEqual(PrimalVertices,pcbddc->user_primal_vertices,&isequal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),451,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
452 }
453 ierr = ISDestroy(&pcbddc->user_primal_vertices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),453,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
454 ierr = ISDestroy(&pcbddc->user_primal_vertices_local);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),454,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
455 pcbddc->user_primal_vertices = PrimalVertices;
456 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
457 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)
;
458}
459
460/*@
461 PCBDDCSetPrimalVerticesIS - Set additional user defined primal vertices in PCBDDC
462
463 Collective
464
465 Input Parameters:
466+ pc - the preconditioning context
467- PrimalVertices - index set of primal vertices in global numbering (can be empty)
468
469 Level: intermediate
470
471 Notes:
472 Any process can list any global node
473
474.seealso: PCBDDC, PCBDDCGetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS(), PCBDDCGetPrimalVerticesLocalIS()
475@*/
476PetscErrorCode PCBDDCSetPrimalVerticesIS(PC pc, IS PrimalVertices)
477{
478 PetscErrorCode ierr;
479
480 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 480; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
481 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),481,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),481
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),481,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),481,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
482 PetscValidHeaderSpecific(PrimalVertices,IS_CLASSID,2)do { if (!PrimalVertices) return PetscError(((MPI_Comm)0x44000001
),482,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(PrimalVertices,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),482,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(PrimalVertices))->classid != IS_CLASSID
) { if (((PetscObject)(PrimalVertices))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),482,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),482,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
483 PetscCheckSameComm(pc,1,PrimalVertices,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)PrimalVertices),&_7_flag);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),483,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),483,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
484 ierr = PetscTryMethod(pc,"PCBDDCSetPrimalVerticesIS_C",(PC,IS),(pc,PrimalVertices))0; do { PetscErrorCode (*_7_f)(PC,IS), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetPrimalVerticesIS_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),484,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,PrimalVertices);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),484,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),484,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
485 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)
;
486}
487
488static PetscErrorCode PCBDDCGetPrimalVerticesIS_BDDC(PC pc, IS *is)
489{
490 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
491
492 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 492; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
493 *is = pcbddc->user_primal_vertices;
494 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)
;
495}
496
497/*@
498 PCBDDCGetPrimalVerticesIS - Get user defined primal vertices set with PCBDDCSetPrimalVerticesIS()
499
500 Collective
501
502 Input Parameters:
503. pc - the preconditioning context
504
505 Output Parameters:
506. is - index set of primal vertices in global numbering (NULL if not set)
507
508 Level: intermediate
509
510 Notes:
511
512.seealso: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS(), PCBDDCGetPrimalVerticesLocalIS()
513@*/
514PetscErrorCode PCBDDCGetPrimalVerticesIS(PC pc, IS *is)
515{
516 PetscErrorCode ierr;
517
518 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 518; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
519 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),519,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),519
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),519,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),519,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
520 PetscValidPointer(is,2)do { if (!is) return PetscError(((MPI_Comm)0x44000001),520,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (!
PetscCheckPointer(is,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),520,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
521 ierr = PetscUseMethod(pc,"PCBDDCGetPrimalVerticesIS_C",(PC,IS*),(pc,is))0; do { PetscErrorCode (*_7_f)(PC,IS*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCGetPrimalVerticesIS_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),521,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,is);do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),521,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),521,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCGetPrimalVerticesIS_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),521,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
522 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)
;
523}
524
525static PetscErrorCode PCBDDCSetPrimalVerticesLocalIS_BDDC(PC pc, IS PrimalVertices)
526{
527 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
528 PetscBool isequal = PETSC_FALSE;
529 PetscErrorCode ierr;
530
531 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 531; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
532 ierr = PetscObjectReference((PetscObject)PrimalVertices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),532,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
533 if (pcbddc->user_primal_vertices_local) {
534 ierr = ISEqual(PrimalVertices,pcbddc->user_primal_vertices_local,&isequal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),534,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
535 }
536 ierr = ISDestroy(&pcbddc->user_primal_vertices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),536,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
537 ierr = ISDestroy(&pcbddc->user_primal_vertices_local);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),537,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
538 pcbddc->user_primal_vertices_local = PrimalVertices;
539 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
540 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)
;
541}
542
543/*@
544 PCBDDCSetPrimalVerticesLocalIS - Set additional user defined primal vertices in PCBDDC
545
546 Collective
547
548 Input Parameters:
549+ pc - the preconditioning context
550- PrimalVertices - index set of primal vertices in local numbering (can be empty)
551
552 Level: intermediate
553
554 Notes:
555
556.seealso: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCGetPrimalVerticesIS(), PCBDDCGetPrimalVerticesLocalIS()
557@*/
558PetscErrorCode PCBDDCSetPrimalVerticesLocalIS(PC pc, IS PrimalVertices)
559{
560 PetscErrorCode ierr;
561
562 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 562; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
563 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),563,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),563
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),563,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),563,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
564 PetscValidHeaderSpecific(PrimalVertices,IS_CLASSID,2)do { if (!PrimalVertices) return PetscError(((MPI_Comm)0x44000001
),564,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(PrimalVertices,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),564,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(PrimalVertices))->classid != IS_CLASSID
) { if (((PetscObject)(PrimalVertices))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),564,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),564,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
565 PetscCheckSameComm(pc,1,PrimalVertices,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)PrimalVertices),&_7_flag);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),565,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),565,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
566 ierr = PetscTryMethod(pc,"PCBDDCSetPrimalVerticesLocalIS_C",(PC,IS),(pc,PrimalVertices))0; do { PetscErrorCode (*_7_f)(PC,IS), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetPrimalVerticesLocalIS_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),566,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,PrimalVertices);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),566,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),566,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
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
570static PetscErrorCode PCBDDCGetPrimalVerticesLocalIS_BDDC(PC pc, IS *is)
571{
572 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
573
574 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 574; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
575 *is = pcbddc->user_primal_vertices_local;
576 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)
;
577}
578
579/*@
580 PCBDDCGetPrimalVerticesLocalIS - Get user defined primal vertices set with PCBDDCSetPrimalVerticesLocalIS()
581
582 Collective
583
584 Input Parameters:
585. pc - the preconditioning context
586
587 Output Parameters:
588. is - index set of primal vertices in local numbering (NULL if not set)
589
590 Level: intermediate
591
592 Notes:
593
594.seealso: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCGetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS()
595@*/
596PetscErrorCode PCBDDCGetPrimalVerticesLocalIS(PC pc, IS *is)
597{
598 PetscErrorCode ierr;
599
600 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 600; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
601 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),601,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),601
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),601,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),601,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
602 PetscValidPointer(is,2)do { if (!is) return PetscError(((MPI_Comm)0x44000001),602,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",2); if (!
PetscCheckPointer(is,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),602,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",2);
} while (0)
;
603 ierr = PetscUseMethod(pc,"PCBDDCGetPrimalVerticesLocalIS_C",(PC,IS*),(pc,is))0; do { PetscErrorCode (*_7_f)(PC,IS*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCGetPrimalVerticesLocalIS_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),603,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,is);do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),603,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),603,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCGetPrimalVerticesLocalIS_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),603,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
604 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)
;
605}
606
607static PetscErrorCode PCBDDCSetCoarseningRatio_BDDC(PC pc,PetscInt k)
608{
609 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
610
611 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 611; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
612 pcbddc->coarsening_ratio = k;
613 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)
;
614}
615
616/*@
617 PCBDDCSetCoarseningRatio - Set coarsening ratio used in multilevel
618
619 Logically collective on PC
620
621 Input Parameters:
622+ pc - the preconditioning context
623- k - coarsening ratio (H/h at the coarser level)
624
625 Options Database Keys:
626. -pc_bddc_coarsening_ratio
627
628 Level: intermediate
629
630 Notes:
631 Approximatively k subdomains at the finer level will be aggregated into a single subdomain at the coarser level
632
633.seealso: PCBDDC, PCBDDCSetLevels()
634@*/
635PetscErrorCode PCBDDCSetCoarseningRatio(PC pc,PetscInt k)
636{
637 PetscErrorCode ierr;
638
639 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 639; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
640 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),640,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),640
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),640,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),640,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
641 PetscValidLogicalCollectiveInt(pc,k,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -k
; b1[1] = k; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,641,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),641,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),641,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
642 ierr = PetscTryMethod(pc,"PCBDDCSetCoarseningRatio_C",(PC,PetscInt),(pc,k))0; do { PetscErrorCode (*_7_f)(PC,PetscInt), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetCoarseningRatio_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),642,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,k);do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),642,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),642,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
643 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)
;
644}
645
646/* The following functions (PCBDDCSetUseExactDirichlet PCBDDCSetLevel) are not public */
647static PetscErrorCode PCBDDCSetUseExactDirichlet_BDDC(PC pc,PetscBool flg)
648{
649 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
650
651 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 651; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
652 pcbddc->use_exact_dirichlet_trick = flg;
653 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)
;
654}
655
656PetscErrorCode PCBDDCSetUseExactDirichlet(PC pc,PetscBool flg)
657{
658 PetscErrorCode ierr;
659
660 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 660; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
661 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),661,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),661
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),661,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),661,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
662 PetscValidLogicalCollectiveBool(pc,flg,2)do { PetscErrorCode _7_ierr; PetscMPIInt b1[2],b2[2]; b1[0] =
-(PetscMPIInt)flg; b1[1] = (PetscMPIInt)flg; _7_ierr = (PetscAllreduceBarrierCheck
(PetscObjectComm((PetscObject)pc),2,662,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),662,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),662,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Bool value must be same on all processes, argument # %d"
,2); } while (0)
;
663 ierr = PetscTryMethod(pc,"PCBDDCSetUseExactDirichlet_C",(PC,PetscBool),(pc,flg))0; do { PetscErrorCode (*_7_f)(PC,PetscBool), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetUseExactDirichlet_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),663,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,flg);do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),663,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),663,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
664 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)
;
665}
666
667static PetscErrorCode PCBDDCSetLevel_BDDC(PC pc,PetscInt level)
668{
669 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
670
671 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 671; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
672 pcbddc->current_level = level;
673 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)
;
674}
675
676PetscErrorCode PCBDDCSetLevel(PC pc,PetscInt level)
677{
678 PetscErrorCode ierr;
679
680 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 680; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
681 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),681,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),681
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),681,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),681,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
682 PetscValidLogicalCollectiveInt(pc,level,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -level
; b1[1] = level; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,682,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),682,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),682,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
683 ierr = PetscTryMethod(pc,"PCBDDCSetLevel_C",(PC,PetscInt),(pc,level))0; do { PetscErrorCode (*_7_f)(PC,PetscInt), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetLevel_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),683,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,level);do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),683,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),683,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
684 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)
;
685}
686
687static PetscErrorCode PCBDDCSetLevels_BDDC(PC pc,PetscInt levels)
688{
689 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
690
691 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.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 if (levels > PETSC_PCBDDC_MAXLEVELS8-1) SETERRQ1(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Maximum number of additional levels for BDDC is %d",PETSC_PCBDDC_MAXLEVELS-1)return PetscError(PetscObjectComm((PetscObject)pc),692,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Maximum number of additional levels for BDDC is %d"
,8 -1)
;
693 pcbddc->max_levels = levels;
694 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)
;
695}
696
697/*@
698 PCBDDCSetLevels - Sets the maximum number of additional levels allowed for multilevel BDDC
699
700 Logically collective on PC
701
702 Input Parameters:
703+ pc - the preconditioning context
704- levels - the maximum number of levels
705
706 Options Database Keys:
707. -pc_bddc_levels
708
709 Level: intermediate
710
711 Notes:
712 The default value is 0, that gives the classical two-levels BDDC
713
714.seealso: PCBDDC, PCBDDCSetCoarseningRatio()
715@*/
716PetscErrorCode PCBDDCSetLevels(PC pc,PetscInt levels)
717{
718 PetscErrorCode ierr;
719
720 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 720; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
721 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),721,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),721
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),721,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),721,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
722 PetscValidLogicalCollectiveInt(pc,levels,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -levels
; b1[1] = levels; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,722,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),722,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),722,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
723 ierr = PetscTryMethod(pc,"PCBDDCSetLevels_C",(PC,PetscInt),(pc,levels))0; do { PetscErrorCode (*_7_f)(PC,PetscInt), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetLevels_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),723,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,levels);do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),723,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),723,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
724 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)
;
725}
726
727static PetscErrorCode PCBDDCSetDirichletBoundaries_BDDC(PC pc,IS DirichletBoundaries)
728{
729 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
730 PetscBool isequal = PETSC_FALSE;
731 PetscErrorCode ierr;
732
733 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 733; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
734 ierr = PetscObjectReference((PetscObject)DirichletBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),734,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
735 if (pcbddc->DirichletBoundaries) {
736 ierr = ISEqual(DirichletBoundaries,pcbddc->DirichletBoundaries,&isequal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),736,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
737 }
738 /* last user setting takes precendence -> destroy any other customization */
739 ierr = ISDestroy(&pcbddc->DirichletBoundariesLocal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),739,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
740 ierr = ISDestroy(&pcbddc->DirichletBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),740,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
741 pcbddc->DirichletBoundaries = DirichletBoundaries;
742 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
743 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)
;
744}
745
746/*@
747 PCBDDCSetDirichletBoundaries - Set IS defining Dirichlet boundaries for the global problem.
748
749 Collective
750
751 Input Parameters:
752+ pc - the preconditioning context
753- DirichletBoundaries - parallel IS defining the Dirichlet boundaries
754
755 Level: intermediate
756
757 Notes:
758 Provide the information if you used MatZeroRows/Columns routines. Any process can list any global node
759
760.seealso: PCBDDC, PCBDDCSetDirichletBoundariesLocal(), MatZeroRows(), MatZeroRowsColumns()
761@*/
762PetscErrorCode PCBDDCSetDirichletBoundaries(PC pc,IS DirichletBoundaries)
763{
764 PetscErrorCode ierr;
765
766 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 766; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
767 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),767,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),767
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),767,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),767,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
768 PetscValidHeaderSpecific(DirichletBoundaries,IS_CLASSID,2)do { if (!DirichletBoundaries) return PetscError(((MPI_Comm)0x44000001
),768,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(DirichletBoundaries,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),768,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(DirichletBoundaries))->classid != IS_CLASSID
) { if (((PetscObject)(DirichletBoundaries))->classid == -
1) return PetscError(((MPI_Comm)0x44000001),768,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),768,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
769 PetscCheckSameComm(pc,1,DirichletBoundaries,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)DirichletBoundaries),&_7_flag);do {if (__builtin_expect(
!!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),769,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),769,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
770 ierr = PetscTryMethod(pc,"PCBDDCSetDirichletBoundaries_C",(PC,IS),(pc,DirichletBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetDirichletBoundaries_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),770,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,DirichletBoundaries);do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),770,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),770,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
771 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)
;
772}
773
774static PetscErrorCode PCBDDCSetDirichletBoundariesLocal_BDDC(PC pc,IS DirichletBoundaries)
775{
776 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
777 PetscBool isequal = PETSC_FALSE;
778 PetscErrorCode ierr;
779
780 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 780; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
781 ierr = PetscObjectReference((PetscObject)DirichletBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),781,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
782 if (pcbddc->DirichletBoundariesLocal) {
783 ierr = ISEqual(DirichletBoundaries,pcbddc->DirichletBoundariesLocal,&isequal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),783,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
784 }
785 /* last user setting takes precendence -> destroy any other customization */
786 ierr = ISDestroy(&pcbddc->DirichletBoundariesLocal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),786,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
787 ierr = ISDestroy(&pcbddc->DirichletBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),787,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
788 pcbddc->DirichletBoundariesLocal = DirichletBoundaries;
789 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
790 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)
;
791}
792
793/*@
794 PCBDDCSetDirichletBoundariesLocal - Set IS defining Dirichlet boundaries for the global problem in local ordering.
795
796 Collective
797
798 Input Parameters:
799+ pc - the preconditioning context
800- DirichletBoundaries - parallel IS defining the Dirichlet boundaries (in local ordering)
801
802 Level: intermediate
803
804 Notes:
805
806.seealso: PCBDDC, PCBDDCSetDirichletBoundaries(), MatZeroRows(), MatZeroRowsColumns()
807@*/
808PetscErrorCode PCBDDCSetDirichletBoundariesLocal(PC pc,IS DirichletBoundaries)
809{
810 PetscErrorCode ierr;
811
812 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 812; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
813 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),813,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),813
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),813,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),813,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
814 PetscValidHeaderSpecific(DirichletBoundaries,IS_CLASSID,2)do { if (!DirichletBoundaries) return PetscError(((MPI_Comm)0x44000001
),814,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(DirichletBoundaries,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),814,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(DirichletBoundaries))->classid != IS_CLASSID
) { if (((PetscObject)(DirichletBoundaries))->classid == -
1) return PetscError(((MPI_Comm)0x44000001),814,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),814,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
815 PetscCheckSameComm(pc,1,DirichletBoundaries,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)DirichletBoundaries),&_7_flag);do {if (__builtin_expect(
!!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),815,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1
&& _7_flag != 0) return PetscError(((MPI_Comm)0x44000001
),815,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
816 ierr = PetscTryMethod(pc,"PCBDDCSetDirichletBoundariesLocal_C",(PC,IS),(pc,DirichletBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetDirichletBoundariesLocal_C"),
(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!!(
_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),816,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,DirichletBoundaries);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),816,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),816,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
817 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)
;
818}
819
820static PetscErrorCode PCBDDCSetNeumannBoundaries_BDDC(PC pc,IS NeumannBoundaries)
821{
822 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
823 PetscBool isequal = PETSC_FALSE;
824 PetscErrorCode ierr;
825
826 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 826; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
827 ierr = PetscObjectReference((PetscObject)NeumannBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),827,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
828 if (pcbddc->NeumannBoundaries) {
829 ierr = ISEqual(NeumannBoundaries,pcbddc->NeumannBoundaries,&isequal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),829,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
830 }
831 /* last user setting takes precendence -> destroy any other customization */
832 ierr = ISDestroy(&pcbddc->NeumannBoundariesLocal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),832,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
833 ierr = ISDestroy(&pcbddc->NeumannBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),833,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
834 pcbddc->NeumannBoundaries = NeumannBoundaries;
835 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
836 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)
;
837}
838
839/*@
840 PCBDDCSetNeumannBoundaries - Set IS defining Neumann boundaries for the global problem.
841
842 Collective
843
844 Input Parameters:
845+ pc - the preconditioning context
846- NeumannBoundaries - parallel IS defining the Neumann boundaries
847
848 Level: intermediate
849
850 Notes:
851 Any process can list any global node
852
853.seealso: PCBDDC, PCBDDCSetNeumannBoundariesLocal()
854@*/
855PetscErrorCode PCBDDCSetNeumannBoundaries(PC pc,IS NeumannBoundaries)
856{
857 PetscErrorCode ierr;
858
859 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 859; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
860 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),860,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),860
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),860,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),860,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
861 PetscValidHeaderSpecific(NeumannBoundaries,IS_CLASSID,2)do { if (!NeumannBoundaries) return PetscError(((MPI_Comm)0x44000001
),861,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(NeumannBoundaries,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),861,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(NeumannBoundaries))->classid != IS_CLASSID
) { if (((PetscObject)(NeumannBoundaries))->classid == -1)
return PetscError(((MPI_Comm)0x44000001),861,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),861,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
862 PetscCheckSameComm(pc,1,NeumannBoundaries,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)NeumannBoundaries),&_7_flag);do {if (__builtin_expect(!!
(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),862,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1 &&
_7_flag != 0) return PetscError(((MPI_Comm)0x44000001),862,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",80
,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
863 ierr = PetscTryMethod(pc,"PCBDDCSetNeumannBoundaries_C",(PC,IS),(pc,NeumannBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetNeumannBoundaries_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),863,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,NeumannBoundaries);do {if (__builtin_expect(!!(
_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),863,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),863,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
864 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)
;
865}
866
867static PetscErrorCode PCBDDCSetNeumannBoundariesLocal_BDDC(PC pc,IS NeumannBoundaries)
868{
869 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
870 PetscBool isequal = PETSC_FALSE;
871 PetscErrorCode ierr;
872
873 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 873; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
874 ierr = PetscObjectReference((PetscObject)NeumannBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),874,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
875 if (pcbddc->NeumannBoundariesLocal) {
876 ierr = ISEqual(NeumannBoundaries,pcbddc->NeumannBoundariesLocal,&isequal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),876,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
877 }
878 /* last user setting takes precendence -> destroy any other customization */
879 ierr = ISDestroy(&pcbddc->NeumannBoundariesLocal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),879,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
880 ierr = ISDestroy(&pcbddc->NeumannBoundaries);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),880,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
881 pcbddc->NeumannBoundariesLocal = NeumannBoundaries;
882 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
883 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)
;
884}
885
886/*@
887 PCBDDCSetNeumannBoundariesLocal - Set IS defining Neumann boundaries for the global problem in local ordering.
888
889 Collective
890
891 Input Parameters:
892+ pc - the preconditioning context
893- NeumannBoundaries - parallel IS defining the subdomain part of Neumann boundaries (in local ordering)
894
895 Level: intermediate
896
897 Notes:
898
899.seealso: PCBDDC, PCBDDCSetNeumannBoundaries()
900@*/
901PetscErrorCode PCBDDCSetNeumannBoundariesLocal(PC pc,IS NeumannBoundaries)
902{
903 PetscErrorCode ierr;
904
905 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 905; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
906 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),906,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),906
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),906,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),906,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
907 PetscValidHeaderSpecific(NeumannBoundaries,IS_CLASSID,2)do { if (!NeumannBoundaries) return PetscError(((MPI_Comm)0x44000001
),907,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(NeumannBoundaries,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),907,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(NeumannBoundaries))->classid != IS_CLASSID
) { if (((PetscObject)(NeumannBoundaries))->classid == -1)
return PetscError(((MPI_Comm)0x44000001),907,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),907,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
908 PetscCheckSameComm(pc,1,NeumannBoundaries,2)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)NeumannBoundaries),&_7_flag);do {if (__builtin_expect(!!
(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),908,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1 &&
_7_flag != 0) return PetscError(((MPI_Comm)0x44000001),908,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",80
,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,2,_7_flag); } while (0)
;
909 ierr = PetscTryMethod(pc,"PCBDDCSetNeumannBoundariesLocal_C",(PC,IS),(pc,NeumannBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetNeumannBoundariesLocal_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),909,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,NeumannBoundaries);do {if (__builtin_expect(!!(
_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),909,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),909,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
910 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)
;
911}
912
913static PetscErrorCode PCBDDCGetDirichletBoundaries_BDDC(PC pc,IS *DirichletBoundaries)
914{
915 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
916
917 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 917; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
918 *DirichletBoundaries = pcbddc->DirichletBoundaries;
919 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)
;
920}
921
922/*@
923 PCBDDCGetDirichletBoundaries - Get parallel IS for Dirichlet boundaries
924
925 Collective
926
927 Input Parameters:
928. pc - the preconditioning context
929
930 Output Parameters:
931. DirichletBoundaries - index set defining the Dirichlet boundaries
932
933 Level: intermediate
934
935 Notes:
936 The IS returned (if any) is the same passed in earlier by the user with PCBDDCSetDirichletBoundaries
937
938.seealso: PCBDDC
939@*/
940PetscErrorCode PCBDDCGetDirichletBoundaries(PC pc,IS *DirichletBoundaries)
941{
942 PetscErrorCode ierr;
943
944 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 944; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
945 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),945,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),945
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),945,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),945,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
946 ierr = PetscUseMethod(pc,"PCBDDCGetDirichletBoundaries_C",(PC,IS*),(pc,DirichletBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCGetDirichletBoundaries_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),946,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,DirichletBoundaries);do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),946,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),946,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCGetDirichletBoundaries_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),946,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
947 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)
;
948}
949
950static PetscErrorCode PCBDDCGetDirichletBoundariesLocal_BDDC(PC pc,IS *DirichletBoundaries)
951{
952 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
953
954 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 954; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
955 *DirichletBoundaries = pcbddc->DirichletBoundariesLocal;
956 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)
;
957}
958
959/*@
960 PCBDDCGetDirichletBoundariesLocal - Get parallel IS for Dirichlet boundaries (in local ordering)
961
962 Collective
963
964 Input Parameters:
965. pc - the preconditioning context
966
967 Output Parameters:
968. DirichletBoundaries - index set defining the subdomain part of Dirichlet boundaries
969
970 Level: intermediate
971
972 Notes:
973 The IS returned could be the same passed in earlier by the user (if provided with PCBDDCSetDirichletBoundariesLocal) or a global-to-local map of the global IS (if provided with PCBDDCSetDirichletBoundaries).
974 In the latter case, the IS will be available after PCSetUp.
975
976.seealso: PCBDDC
977@*/
978PetscErrorCode PCBDDCGetDirichletBoundariesLocal(PC pc,IS *DirichletBoundaries)
979{
980 PetscErrorCode ierr;
981
982 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.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(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),983,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),983
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),983,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),983,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
984 ierr = PetscUseMethod(pc,"PCBDDCGetDirichletBoundariesLocal_C",(PC,IS*),(pc,DirichletBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCGetDirichletBoundariesLocal_C"),
(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!!(
_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),984,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr = (*
_7_f)(pc,DirichletBoundaries);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),984,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),984,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCGetDirichletBoundariesLocal_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),984,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
985 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)
;
986}
987
988static PetscErrorCode PCBDDCGetNeumannBoundaries_BDDC(PC pc,IS *NeumannBoundaries)
989{
990 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
991
992 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 992; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
993 *NeumannBoundaries = pcbddc->NeumannBoundaries;
994 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
995}
996
997/*@
998 PCBDDCGetNeumannBoundaries - Get parallel IS for Neumann boundaries
999
1000 Collective
1001
1002 Input Parameters:
1003. pc - the preconditioning context
1004
1005 Output Parameters:
1006. NeumannBoundaries - index set defining the Neumann boundaries
1007
1008 Level: intermediate
1009
1010 Notes:
1011 The IS returned (if any) is the same passed in earlier by the user with PCBDDCSetNeumannBoundaries
1012
1013.seealso: PCBDDC
1014@*/
1015PetscErrorCode PCBDDCGetNeumannBoundaries(PC pc,IS *NeumannBoundaries)
1016{
1017 PetscErrorCode ierr;
1018
1019 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1019; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1020 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),1020,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),1020
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),1020,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1020,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
1021 ierr = PetscUseMethod(pc,"PCBDDCGetNeumannBoundaries_C",(PC,IS*),(pc,NeumannBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCGetNeumannBoundaries_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),1021,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,NeumannBoundaries);do {if (__builtin_expect(!!(
_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),1021,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),1021,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCGetNeumannBoundaries_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1021,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1022 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)
;
1023}
1024
1025static PetscErrorCode PCBDDCGetNeumannBoundariesLocal_BDDC(PC pc,IS *NeumannBoundaries)
1026{
1027 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
1028
1029 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1029; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1030 *NeumannBoundaries = pcbddc->NeumannBoundariesLocal;
1031 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)
;
1032}
1033
1034/*@
1035 PCBDDCGetNeumannBoundariesLocal - Get parallel IS for Neumann boundaries (in local ordering)
1036
1037 Collective
1038
1039 Input Parameters:
1040. pc - the preconditioning context
1041
1042 Output Parameters:
1043. NeumannBoundaries - index set defining the subdomain part of Neumann boundaries
1044
1045 Level: intermediate
1046
1047 Notes:
1048 The IS returned could be the same passed in earlier by the user (if provided with PCBDDCSetNeumannBoundariesLocal) or a global-to-local map of the global IS (if provided with PCBDDCSetNeumannBoundaries).
1049 In the latter case, the IS will be available after PCSetUp.
1050
1051.seealso: PCBDDC
1052@*/
1053PetscErrorCode PCBDDCGetNeumannBoundariesLocal(PC pc,IS *NeumannBoundaries)
1054{
1055 PetscErrorCode ierr;
1056
1057 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1057; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1058 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),1058,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),1058
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),1058,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1058,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
1059 ierr = PetscUseMethod(pc,"PCBDDCGetNeumannBoundariesLocal_C",(PC,IS*),(pc,NeumannBoundaries))0; do { PetscErrorCode (*_7_f)(PC,IS*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCGetNeumannBoundariesLocal_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),1059,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,NeumannBoundaries);do {if (__builtin_expect(!!(
_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),1059,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),1059,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCGetNeumannBoundariesLocal_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1059,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1060 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)
;
1061}
1062
1063static PetscErrorCode PCBDDCSetLocalAdjacencyGraph_BDDC(PC pc, PetscInt nvtxs,const PetscInt xadj[],const PetscInt adjncy[], PetscCopyMode copymode)
1064{
1065 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
1066 PCBDDCGraph mat_graph = pcbddc->mat_graph;
1067 PetscBool same_data = PETSC_FALSE;
1068 PetscErrorCode ierr;
1069
1070 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1070; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1071 if (!nvtxs) {
1072 if (copymode == PETSC_OWN_POINTER) {
1073 ierr = PetscFree(xadj)((*PetscTrFree)((void*)(xadj),1073,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((xadj) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1073,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1074 ierr = PetscFree(adjncy)((*PetscTrFree)((void*)(adjncy),1074,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((adjncy) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1074,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1075 }
1076 ierr = PCBDDCGraphResetCSR(mat_graph);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1076,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1077 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)
;
1078 }
1079 if (mat_graph->nvtxs == nvtxs && mat_graph->freecsr) { /* we own the data */
1080 if (mat_graph->xadj == xadj && mat_graph->adjncy == adjncy) same_data = PETSC_TRUE;
1081 if (!same_data && mat_graph->xadj[nvtxs] == xadj[nvtxs]) {
1082 ierr = PetscArraycmp(xadj,mat_graph->xadj,nvtxs+1,&same_data)((sizeof(*(xadj)) != sizeof(*(mat_graph->xadj))) || PetscMemcmp
(xadj,mat_graph->xadj,(nvtxs+1)*sizeof(*(xadj)),&same_data
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1082,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1083 if (same_data) {
1084 ierr = PetscArraycmp(adjncy,mat_graph->adjncy,xadj[nvtxs],&same_data)((sizeof(*(adjncy)) != sizeof(*(mat_graph->adjncy))) || PetscMemcmp
(adjncy,mat_graph->adjncy,(xadj[nvtxs])*sizeof(*(adjncy)),
&same_data))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1084,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1085 }
1086 }
1087 }
1088 if (!same_data) {
1089 /* free old CSR */
1090 ierr = PCBDDCGraphResetCSR(mat_graph);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1090,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1091 /* get CSR into graph structure */
1092 if (copymode == PETSC_COPY_VALUES) {
1093 ierr = PetscMalloc1(nvtxs+1,&mat_graph->xadj)PetscMallocA(1,PETSC_FALSE,1093,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(nvtxs+1)*sizeof(**(&mat_graph->xadj)),(&
mat_graph->xadj))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1093,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1094 ierr = PetscMalloc1(xadj[nvtxs],&mat_graph->adjncy)PetscMallocA(1,PETSC_FALSE,1094,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(xadj[nvtxs])*sizeof(**(&mat_graph->adjncy)),
(&mat_graph->adjncy))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1094,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1095 ierr = PetscArraycpy(mat_graph->xadj,xadj,nvtxs+1)((sizeof(*(mat_graph->xadj)) != sizeof(*(xadj))) || PetscMemcpy
(mat_graph->xadj,xadj,(nvtxs+1)*sizeof(*(mat_graph->xadj
))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1095,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1096 ierr = PetscArraycpy(mat_graph->adjncy,adjncy,xadj[nvtxs])((sizeof(*(mat_graph->adjncy)) != sizeof(*(adjncy))) || PetscMemcpy
(mat_graph->adjncy,adjncy,(xadj[nvtxs])*sizeof(*(mat_graph
->adjncy))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1096,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1097 mat_graph->freecsr = PETSC_TRUE;
1098 } else if (copymode == PETSC_OWN_POINTER) {
1099 mat_graph->xadj = (PetscInt*)xadj;
1100 mat_graph->adjncy = (PetscInt*)adjncy;
1101 mat_graph->freecsr = PETSC_TRUE;
1102 } else if (copymode == PETSC_USE_POINTER) {
1103 mat_graph->xadj = (PetscInt*)xadj;
1104 mat_graph->adjncy = (PetscInt*)adjncy;
1105 mat_graph->freecsr = PETSC_FALSE;
1106 } else SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"Unsupported copy mode %D",copymode)return PetscError(((MPI_Comm)0x44000001),1106,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Unsupported copy mode %D",copymode)
;
1107 mat_graph->nvtxs_csr = nvtxs;
1108 pcbddc->recompute_topography = PETSC_TRUE;
1109 }
1110 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)
;
1111}
1112
1113/*@
1114 PCBDDCSetLocalAdjacencyGraph - Set adjacency structure (CSR graph) of the local degrees of freedom.
1115
1116 Not collective
1117
1118 Input Parameters:
1119+ pc - the preconditioning context.
1120. nvtxs - number of local vertices of the graph (i.e., the number of local dofs).
1121. xadj, adjncy - the connectivity of the dofs in CSR format.
1122- copymode - supported modes are PETSC_COPY_VALUES, PETSC_USE_POINTER or PETSC_OWN_POINTER.
1123
1124 Level: intermediate
1125
1126 Notes:
1127 A dof is considered connected with all local dofs if xadj[dof+1]-xadj[dof] == 1 and adjncy[xadj[dof]] is negative.
1128
1129.seealso: PCBDDC,PetscCopyMode
1130@*/
1131PetscErrorCode PCBDDCSetLocalAdjacencyGraph(PC pc,PetscInt nvtxs,const PetscInt xadj[],const PetscInt adjncy[], PetscCopyMode copymode)
1132{
1133 void (*f)(void) = 0;
1134 PetscErrorCode ierr;
1135
1136 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1136; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1137 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),1137,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),1137
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),1137,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1137,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
1138 if (nvtxs) {
1139 PetscValidIntPointer(xadj,3)do { if (!xadj) return PetscError(((MPI_Comm)0x44000001),1139
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,68,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(xadj,PETSC_INT)) return PetscError(((MPI_Comm
)0x44000001),1139,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer to PetscInt: Parameter # %d"
,3); } while (0)
;
1140 if (xadj[nvtxs]) PetscValidIntPointer(adjncy,4)do { if (!adjncy) return PetscError(((MPI_Comm)0x44000001),1140
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,68,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",4); if
(!PetscCheckPointer(adjncy,PETSC_INT)) return PetscError(((MPI_Comm
)0x44000001),1140,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer to PetscInt: Parameter # %d"
,4); } while (0)
;
1141 }
1142 ierr = PetscTryMethod(pc,"PCBDDCSetLocalAdjacencyGraph_C",(PC,PetscInt,const PetscInt[],const PetscInt[],PetscCopyMode),(pc,nvtxs,xadj,adjncy,copymode))0; do { PetscErrorCode (*_7_f)(PC,PetscInt,const PetscInt[],const
PetscInt[],PetscCopyMode), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private
(((PetscObject)(pc)),("PCBDDCSetLocalAdjacencyGraph_C"),(PetscVoidFunction
*)(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return
PetscError(((MPI_Comm)0x44000001),1142,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,nvtxs,xadj,adjncy,copymode);do {if (__builtin_expect
(!!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),1142
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1142,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1143 /* free arrays if PCBDDC is not the PC type */
1144 ierr = PetscObjectQueryFunction((PetscObject)pc,"PCBDDCSetLocalAdjacencyGraph_C",&f)PetscObjectQueryFunction_Private(((PetscObject)pc),("PCBDDCSetLocalAdjacencyGraph_C"
),(PetscVoidFunction*)(&f))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1144,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1145 if (!f && copymode == PETSC_OWN_POINTER) {
1146 ierr = PetscFree(xadj)((*PetscTrFree)((void*)(xadj),1146,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((xadj) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1146,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1147 ierr = PetscFree(adjncy)((*PetscTrFree)((void*)(adjncy),1147,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((adjncy) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1147,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1148 }
1149 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)
;
1150}
1151
1152static PetscErrorCode PCBDDCSetDofsSplittingLocal_BDDC(PC pc,PetscInt n_is, IS ISForDofs[])
1153{
1154 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
1155 PetscInt i;
1156 PetscBool isequal = PETSC_FALSE;
1157 PetscErrorCode ierr;
1158
1159 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1159; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1160 if (pcbddc->n_ISForDofsLocal == n_is) {
1161 for (i=0;i<n_is;i++) {
1162 PetscBool isequalt;
1163 ierr = ISEqual(ISForDofs[i],pcbddc->ISForDofsLocal[i],&isequalt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1163,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1164 if (!isequalt) break;
1165 }
1166 if (i == n_is) isequal = PETSC_TRUE;
1167 }
1168 for (i=0;i<n_is;i++) {
1169 ierr = PetscObjectReference((PetscObject)ISForDofs[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1169,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1170 }
1171 /* Destroy ISes if they were already set */
1172 for (i=0;i<pcbddc->n_ISForDofsLocal;i++) {
1173 ierr = ISDestroy(&pcbddc->ISForDofsLocal[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1173,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1174 }
1175 ierr = PetscFree(pcbddc->ISForDofsLocal)((*PetscTrFree)((void*)(pcbddc->ISForDofsLocal),1175,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c") ||
((pcbddc->ISForDofsLocal) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1175,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1176 /* last user setting takes precendence -> destroy any other customization */
1177 for (i=0;i<pcbddc->n_ISForDofs;i++) {
1178 ierr = ISDestroy(&pcbddc->ISForDofs[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1178,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1179 }
1180 ierr = PetscFree(pcbddc->ISForDofs)((*PetscTrFree)((void*)(pcbddc->ISForDofs),1180,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((pcbddc->ISForDofs) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1180,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1181 pcbddc->n_ISForDofs = 0;
1182 /* allocate space then set */
1183 if (n_is) {
1184 ierr = PetscMalloc1(n_is,&pcbddc->ISForDofsLocal)PetscMallocA(1,PETSC_FALSE,1184,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(n_is)*sizeof(**(&pcbddc->ISForDofsLocal)),(&
pcbddc->ISForDofsLocal))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1184,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1185 }
1186 for (i=0;i<n_is;i++) {
1187 pcbddc->ISForDofsLocal[i] = ISForDofs[i];
1188 }
1189 pcbddc->n_ISForDofsLocal = n_is;
1190 if (n_is) pcbddc->user_provided_isfordofs = PETSC_TRUE;
1191 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
1192 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)
;
1193}
1194
1195/*@
1196 PCBDDCSetDofsSplittingLocal - Set index sets defining fields of the local subdomain matrix
1197
1198 Collective
1199
1200 Input Parameters:
1201+ pc - the preconditioning context
1202. n_is - number of index sets defining the fields
1203- ISForDofs - array of IS describing the fields in local ordering
1204
1205 Level: intermediate
1206
1207 Notes:
1208 n_is should be the same among processes. Not all nodes need to be listed: unlisted nodes will belong to the complement field.
1209
1210.seealso: PCBDDC
1211@*/
1212PetscErrorCode PCBDDCSetDofsSplittingLocal(PC pc,PetscInt n_is, IS ISForDofs[])
1213{
1214 PetscInt i;
1215 PetscErrorCode ierr;
1216
1217 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1217; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1218 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),1218,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),1218
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),1218,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1218,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
1219 PetscValidLogicalCollectiveInt(pc,n_is,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -n_is
; b1[1] = n_is; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,1219,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),1219,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),1219,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
1220 for (i=0;i<n_is;i++) {
1221 PetscCheckSameComm(pc,1,ISForDofs[i],3)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)ISForDofs[i]),&_7_flag);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),1221,__func__,
"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1 &&
_7_flag != 0) return PetscError(((MPI_Comm)0x44000001),1221,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,3,_7_flag); } while (0)
;
1222 PetscValidHeaderSpecific(ISForDofs[i],IS_CLASSID,3)do { if (!ISForDofs[i]) return PetscError(((MPI_Comm)0x44000001
),1222,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",3); if (
!PetscCheckPointer(ISForDofs[i],PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),1222,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,3); if (((PetscObject)(ISForDofs[i]))->classid != IS_CLASSID
) { if (((PetscObject)(ISForDofs[i]))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),1222,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,3); else return PetscError(((MPI_Comm)0x44000001),1222,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",3
); } } while (0)
;
1223 }
1224 ierr = PetscTryMethod(pc,"PCBDDCSetDofsSplittingLocal_C",(PC,PetscInt,IS[]),(pc,n_is,ISForDofs))0; do { PetscErrorCode (*_7_f)(PC,PetscInt,IS[]), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetDofsSplittingLocal_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),1224,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,n_is,ISForDofs);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),1224,__func__,
"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1224,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1225 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)
;
1226}
1227
1228static PetscErrorCode PCBDDCSetDofsSplitting_BDDC(PC pc,PetscInt n_is, IS ISForDofs[])
1229{
1230 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
1231 PetscInt i;
1232 PetscBool isequal = PETSC_FALSE;
1233 PetscErrorCode ierr;
1234
1235 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1235; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1236 if (pcbddc->n_ISForDofs == n_is) {
1237 for (i=0;i<n_is;i++) {
1238 PetscBool isequalt;
1239 ierr = ISEqual(ISForDofs[i],pcbddc->ISForDofs[i],&isequalt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1239,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1240 if (!isequalt) break;
1241 }
1242 if (i == n_is) isequal = PETSC_TRUE;
1243 }
1244 for (i=0;i<n_is;i++) {
1245 ierr = PetscObjectReference((PetscObject)ISForDofs[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1245,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1246 }
1247 /* Destroy ISes if they were already set */
1248 for (i=0;i<pcbddc->n_ISForDofs;i++) {
1249 ierr = ISDestroy(&pcbddc->ISForDofs[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1249,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1250 }
1251 ierr = PetscFree(pcbddc->ISForDofs)((*PetscTrFree)((void*)(pcbddc->ISForDofs),1251,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((pcbddc->ISForDofs) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1251,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1252 /* last user setting takes precendence -> destroy any other customization */
1253 for (i=0;i<pcbddc->n_ISForDofsLocal;i++) {
1254 ierr = ISDestroy(&pcbddc->ISForDofsLocal[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1254,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1255 }
1256 ierr = PetscFree(pcbddc->ISForDofsLocal)((*PetscTrFree)((void*)(pcbddc->ISForDofsLocal),1256,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c") ||
((pcbddc->ISForDofsLocal) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1256,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1257 pcbddc->n_ISForDofsLocal = 0;
1258 /* allocate space then set */
1259 if (n_is) {
1260 ierr = PetscMalloc1(n_is,&pcbddc->ISForDofs)PetscMallocA(1,PETSC_FALSE,1260,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(n_is)*sizeof(**(&pcbddc->ISForDofs)),(&pcbddc
->ISForDofs))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1260,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1261 }
1262 for (i=0;i<n_is;i++) {
1263 pcbddc->ISForDofs[i] = ISForDofs[i];
1264 }
1265 pcbddc->n_ISForDofs = n_is;
1266 if (n_is) pcbddc->user_provided_isfordofs = PETSC_TRUE;
1267 if (!isequal) pcbddc->recompute_topography = PETSC_TRUE;
1268 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)
;
1269}
1270
1271/*@
1272 PCBDDCSetDofsSplitting - Set index sets defining fields of the global matrix
1273
1274 Collective
1275
1276 Input Parameters:
1277+ pc - the preconditioning context
1278. n_is - number of index sets defining the fields
1279- ISForDofs - array of IS describing the fields in global ordering
1280
1281 Level: intermediate
1282
1283 Notes:
1284 Any process can list any global node. Not all nodes need to be listed: unlisted nodes will belong to the complement field.
1285
1286.seealso: PCBDDC
1287@*/
1288PetscErrorCode PCBDDCSetDofsSplitting(PC pc,PetscInt n_is, IS ISForDofs[])
1289{
1290 PetscInt i;
1291 PetscErrorCode ierr;
1292
1293 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1293; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1294 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),1294,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),1294
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),1294,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),1294,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
1295 PetscValidLogicalCollectiveInt(pc,n_is,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -n_is
; b1[1] = n_is; _7_ierr = (PetscAllreduceBarrierCheck(PetscObjectComm
((PetscObject)pc),2,1295,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((b1),(b2),(2),(((MPI_Datatype
)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm((PetscObject
)pc)))));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),1295,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)pc),1295,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
1296 for (i=0;i<n_is;i++) {
1297 PetscValidHeaderSpecific(ISForDofs[i],IS_CLASSID,3)do { if (!ISForDofs[i]) return PetscError(((MPI_Comm)0x44000001
),1297,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",3); if (
!PetscCheckPointer(ISForDofs[i],PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),1297,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,3); if (((PetscObject)(ISForDofs[i]))->classid != IS_CLASSID
) { if (((PetscObject)(ISForDofs[i]))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),1297,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,3); else return PetscError(((MPI_Comm)0x44000001),1297,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",3
); } } while (0)
;
1298 PetscCheckSameComm(pc,1,ISForDofs[i],3)do { PetscErrorCode _7_ierr; PetscMPIInt _7_flag; _7_ierr = MPI_Comm_compare
(PetscObjectComm((PetscObject)pc),PetscObjectComm((PetscObject
)ISForDofs[i]),&_7_flag);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),1298,__func__,
"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0); if (_7_flag != 1 &&
_7_flag != 0) return PetscError(((MPI_Comm)0x44000001),1298,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,80,PETSC_ERROR_INITIAL,"Different communicators in the two objects: Argument # %d and %d flag %d"
,1,3,_7_flag); } while (0)
;
1299 }
1300 ierr = PetscTryMethod(pc,"PCBDDCSetDofsSplitting_C",(PC,PetscInt,IS[]),(pc,n_is,ISForDofs))0; do { PetscErrorCode (*_7_f)(PC,PetscInt,IS[]), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(pc)),("PCBDDCSetDofsSplitting_C"
),(PetscVoidFunction*)(&_7_f));do {if (__builtin_expect(!
!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),1300,
__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,n_is,ISForDofs);do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),1300,__func__,
"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",_7_ierr
,PETSC_ERROR_REPEAT," ");} while (0);} } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1300,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1301 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)
;
1302}
1303
1304/*
1305 PCPreSolve_BDDC - Changes the right hand side and (if necessary) the initial
1306 guess if a transformation of basis approach has been selected.
1307
1308 Input Parameter:
1309+ pc - the preconditioner contex
1310
1311 Application Interface Routine: PCPreSolve()
1312
1313 Notes:
1314 The interface routine PCPreSolve() is not usually called directly by
1315 the user, but instead is called by KSPSolve().
1316*/
1317static PetscErrorCode PCPreSolve_BDDC(PC pc, KSP ksp, Vec rhs, Vec x)
1318{
1319 PetscErrorCode ierr;
1320 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
1321 PC_IS *pcis = (PC_IS*)(pc->data);
1322 Vec used_vec;
1323 PetscBool iscg = PETSC_FALSE, save_rhs = PETSC_TRUE, benign_correction_computed;
1324
1325 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1325; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1326 /* if we are working with CG, one dirichlet solve can be avoided during Krylov iterations */
1327 if (ksp) {
1328 PetscBool isgroppcg, ispipecg, ispipelcg, ispipecgrr;
1329
1330 ierr = PetscObjectTypeCompare((PetscObject)ksp,KSPCG"cg",&iscg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1330,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1331 ierr = PetscObjectTypeCompare((PetscObject)ksp,KSPGROPPCG"groppcg",&isgroppcg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1331,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1332 ierr = PetscObjectTypeCompare((PetscObject)ksp,KSPPIPECG"pipecg",&ispipecg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1332,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1333 ierr = PetscObjectTypeCompare((PetscObject)ksp,KSPPIPECG"pipecg",&ispipelcg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1333,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1334 ierr = PetscObjectTypeCompare((PetscObject)ksp,KSPPIPECGRR"pipecgrr",&ispipecgrr);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1334,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1335 iscg = (PetscBool)(iscg || isgroppcg || ispipecg || ispipelcg || ispipecgrr);
1336 if (pcbddc->benign_apply_coarse_only || pcbddc->switch_static || !iscg || pc->mat != pc->pmat) {
1337 ierr = PCBDDCSetUseExactDirichlet(pc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1337,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1338 }
1339 }
1340 if (pcbddc->benign_apply_coarse_only || pcbddc->switch_static || pc->mat != pc->pmat) {
1341 ierr = PCBDDCSetUseExactDirichlet(pc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1341,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1342 }
1343
1344 /* Creates parallel work vectors used in presolve */
1345 if (!pcbddc->original_rhs) {
1346 ierr = VecDuplicate(pcis->vec1_global,&pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1346,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1347 }
1348 if (!pcbddc->temp_solution) {
1349 ierr = VecDuplicate(pcis->vec1_global,&pcbddc->temp_solution);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1349,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1350 }
1351
1352 pcbddc->temp_solution_used = PETSC_FALSE;
1353 if (x) {
1354 ierr = PetscObjectReference((PetscObject)x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1354,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1355 used_vec = x;
1356 } else { /* it can only happen when calling PCBDDCMatFETIDPGetRHS */
1357 ierr = PetscObjectReference((PetscObject)pcbddc->temp_solution);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1357,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1358 used_vec = pcbddc->temp_solution;
1359 ierr = VecSet(used_vec,0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1359,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1360 pcbddc->temp_solution_used = PETSC_TRUE;
1361 ierr = VecCopy(rhs,pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1361,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1362 save_rhs = PETSC_FALSE;
1363 pcbddc->eliminate_dirdofs = PETSC_TRUE;
1364 }
1365
1366 /* hack into ksp data structure since PCPreSolve comes earlier than setting to zero the guess in src/ksp/ksp/interface/itfunc.c */
1367 if (ksp) {
1368 /* store the flag for the initial guess since it will be restored back during PCPostSolve_BDDC */
1369 ierr = KSPGetInitialGuessNonzero(ksp,&pcbddc->ksp_guess_nonzero);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1369,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1370 if (!pcbddc->ksp_guess_nonzero) {
1371 ierr = VecSet(used_vec,0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1371,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1372 }
1373 }
1374
1375 pcbddc->rhs_change = PETSC_FALSE;
1376 /* Take into account zeroed rows -> change rhs and store solution removed */
1377 if (rhs && pcbddc->eliminate_dirdofs) {
1378 IS dirIS = NULL((void*)0);
1379
1380 /* DirichletBoundariesLocal may not be consistent among neighbours; gets a dirichlet dofs IS from graph (may be cached) */
1381 ierr = PCBDDCGraphGetDirichletDofs(pcbddc->mat_graph,&dirIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1381,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1382 if (dirIS) {
1383 Mat_IS *matis = (Mat_IS*)pc->pmat->data;
1384 PetscInt dirsize,i,*is_indices;
1385 PetscScalar *array_x;
1386 const PetscScalar *array_diagonal;
1387
1388 ierr = MatGetDiagonal(pc->pmat,pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1388,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1389 ierr = VecPointwiseDivide(pcis->vec1_global,rhs,pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1389,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1390 ierr = VecScatterBegin(matis->rctx,pcis->vec1_global,pcis->vec2_N,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1390,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1391 ierr = VecScatterEnd(matis->rctx,pcis->vec1_global,pcis->vec2_N,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1391,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1392 ierr = VecScatterBegin(matis->rctx,used_vec,pcis->vec1_N,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1392,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1393 ierr = VecScatterEnd(matis->rctx,used_vec,pcis->vec1_N,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1393,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1394 ierr = ISGetLocalSize(dirIS,&dirsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1394,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1395 ierr = VecGetArray(pcis->vec1_N,&array_x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1395,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1396 ierr = VecGetArrayRead(pcis->vec2_N,&array_diagonal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1396,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1397 ierr = ISGetIndices(dirIS,(const PetscInt**)&is_indices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1397,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1398 for (i=0; i<dirsize; i++) array_x[is_indices[i]] = array_diagonal[is_indices[i]];
1399 ierr = ISRestoreIndices(dirIS,(const PetscInt**)&is_indices);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1399,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1400 ierr = VecRestoreArrayRead(pcis->vec2_N,&array_diagonal);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1400,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1401 ierr = VecRestoreArray(pcis->vec1_N,&array_x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1401,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1402 ierr = VecScatterBegin(matis->rctx,pcis->vec1_N,used_vec,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1402,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1403 ierr = VecScatterEnd(matis->rctx,pcis->vec1_N,used_vec,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1403,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1404 pcbddc->rhs_change = PETSC_TRUE;
1405 ierr = ISDestroy(&dirIS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1405,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1406 }
1407 }
1408
1409 /* remove the computed solution or the initial guess from the rhs */
1410 if (pcbddc->rhs_change || (ksp && pcbddc->ksp_guess_nonzero) ) {
1411 /* save the original rhs */
1412 if (save_rhs) {
1413 ierr = VecSwap(rhs,pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1413,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1414 save_rhs = PETSC_FALSE;
1415 }
1416 pcbddc->rhs_change = PETSC_TRUE;
1417 ierr = VecScale(used_vec,-1.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1417,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1418 ierr = MatMultAdd(pc->mat,used_vec,pcbddc->original_rhs,rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1418,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1419 ierr = VecScale(used_vec,-1.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1419,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1420 ierr = VecCopy(used_vec,pcbddc->temp_solution);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1420,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1421 pcbddc->temp_solution_used = PETSC_TRUE;
1422 if (ksp) {
1423 ierr = KSPSetInitialGuessNonzero(ksp,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1423,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1424 }
1425 }
1426 ierr = VecDestroy(&used_vec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1426,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1427
1428 /* compute initial vector in benign space if needed
1429 and remove non-benign solution from the rhs */
1430 benign_correction_computed = PETSC_FALSE;
1431 if (rhs && pcbddc->benign_compute_correction && (pcbddc->benign_have_null || pcbddc->benign_apply_coarse_only)) {
1432 /* compute u^*_h using ideas similar to those in Xuemin Tu's PhD thesis (see Section 4.8.1)
1433 Recursively apply BDDC in the multilevel case */
1434 if (!pcbddc->benign_vec) {
1435 ierr = VecDuplicate(rhs,&pcbddc->benign_vec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1435,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1436 }
1437 /* keep applying coarse solver unless we no longer have benign subdomains */
1438 pcbddc->benign_apply_coarse_only = pcbddc->benign_have_null ? PETSC_TRUE : PETSC_FALSE;
1439 if (!pcbddc->benign_skip_correction) {
1440 ierr = PCApply_BDDC(pc,rhs,pcbddc->benign_vec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1440,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1441 benign_correction_computed = PETSC_TRUE;
1442 if (pcbddc->temp_solution_used) {
1443 ierr = VecAXPY(pcbddc->temp_solution,1.0,pcbddc->benign_vec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1443,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1444 }
1445 ierr = VecScale(pcbddc->benign_vec,-1.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1445,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1446 /* store the original rhs if not done earlier */
1447 if (save_rhs) {
1448 ierr = VecSwap(rhs,pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1448,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1449 }
1450 if (pcbddc->rhs_change) {
1451 ierr = MatMultAdd(pc->mat,pcbddc->benign_vec,rhs,rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1451,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1452 } else {
1453 ierr = MatMultAdd(pc->mat,pcbddc->benign_vec,pcbddc->original_rhs,rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1453,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1454 }
1455 pcbddc->rhs_change = PETSC_TRUE;
1456 }
1457 pcbddc->benign_apply_coarse_only = PETSC_FALSE;
1458 } else {
1459 ierr = VecDestroy(&pcbddc->benign_vec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1459,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1460 }
1461
1462 /* dbg output */
1463 if (pcbddc->dbg_flag && benign_correction_computed) {
1464 Vec v;
1465
1466 ierr = VecDuplicate(pcis->vec1_global,&v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1466,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1467 if (pcbddc->ChangeOfBasisMatrix) {
1468 ierr = MatMultTranspose(pcbddc->ChangeOfBasisMatrix,rhs,v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1468,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1469 } else {
1470 ierr = VecCopy(rhs,v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1470,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1471 }
1472 ierr = PCBDDCBenignGetOrSetP0(pc,v,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1472,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1473 ierr = PetscViewerASCIIPrintf(pcbddc->dbg_viewer,"LEVEL %D: is the correction benign?\n",pcbddc->current_level);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1473,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1474 ierr = PetscScalarView(pcbddc->benign_n,pcbddc->benign_p0,pcbddc->dbg_viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1474,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1475 ierr = PetscViewerFlush(pcbddc->dbg_viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1475,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1476 ierr = VecDestroy(&v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1476,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1477 }
1478
1479 /* set initial guess if using PCG */
1480 pcbddc->exact_dirichlet_trick_app = PETSC_FALSE;
1481 if (x && pcbddc->use_exact_dirichlet_trick) {
1482 ierr = VecSet(x,0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1482,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1483 if (pcbddc->ChangeOfBasisMatrix && pcbddc->change_interior) {
1484 if (benign_correction_computed) { /* we have already saved the changed rhs */
1485 ierr = VecLockReadPop(pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1485,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1486 } else {
1487 ierr = MatMultTranspose(pcbddc->ChangeOfBasisMatrix,rhs,pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1487,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1488 }
1489 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec1_global,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1489,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1490 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec1_global,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1490,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1491 } else {
1492 ierr = VecScatterBegin(pcis->global_to_D,rhs,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1492,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1493 ierr = VecScatterEnd(pcis->global_to_D,rhs,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1493,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1494 }
1495 ierr = KSPSolve(pcbddc->ksp_D,pcis->vec1_D,pcis->vec2_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1495,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1496 ierr = KSPCheckSolve(pcbddc->ksp_D,pc,pcis->vec2_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1496,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1497 if (pcbddc->ChangeOfBasisMatrix && pcbddc->change_interior) {
1498 ierr = VecSet(pcis->vec1_global,0.);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1498,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1499 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec2_D,pcis->vec1_global,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1499,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1500 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec2_D,pcis->vec1_global,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1500,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1501 ierr = MatMult(pcbddc->ChangeOfBasisMatrix,pcis->vec1_global,x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1501,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1502 } else {
1503 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec2_D,x,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1503,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1504 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec2_D,x,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1504,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1505 }
1506 if (ksp) {
1507 ierr = KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1507,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1508 }
1509 pcbddc->exact_dirichlet_trick_app = PETSC_TRUE;
1510 } else if (pcbddc->ChangeOfBasisMatrix && pcbddc->change_interior && benign_correction_computed && pcbddc->use_exact_dirichlet_trick) {
1511 ierr = VecLockReadPop(pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1511,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1512 }
1513 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)
;
1514}
1515
1516/*
1517 PCPostSolve_BDDC - Changes the computed solution if a transformation of basis
1518 approach has been selected. Also, restores rhs to its original state.
1519
1520 Input Parameter:
1521+ pc - the preconditioner contex
1522
1523 Application Interface Routine: PCPostSolve()
1524
1525 Notes:
1526 The interface routine PCPostSolve() is not usually called directly by
1527 the user, but instead is called by KSPSolve().
1528*/
1529static PetscErrorCode PCPostSolve_BDDC(PC pc, KSP ksp, Vec rhs, Vec x)
1530{
1531 PetscErrorCode ierr;
1532 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
1533
1534 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1534; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1535 /* add solution removed in presolve */
1536 if (x && pcbddc->rhs_change) {
1537 if (pcbddc->temp_solution_used) {
1538 ierr = VecAXPY(x,1.0,pcbddc->temp_solution);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1538,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1539 } else if (pcbddc->benign_compute_correction && pcbddc->benign_vec) {
1540 ierr = VecAXPY(x,-1.0,pcbddc->benign_vec);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1540,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1541 }
1542 /* restore to original state (not for FETI-DP) */
1543 if (ksp) pcbddc->temp_solution_used = PETSC_FALSE;
1544 }
1545
1546 /* restore rhs to its original state (not needed for FETI-DP) */
1547 if (rhs && pcbddc->rhs_change) {
1548 ierr = VecSwap(rhs,pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1548,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1549 pcbddc->rhs_change = PETSC_FALSE;
1550 }
1551 /* restore ksp guess state */
1552 if (ksp) {
1553 ierr = KSPSetInitialGuessNonzero(ksp,pcbddc->ksp_guess_nonzero);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1553,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1554 /* reset flag for exact dirichlet trick */
1555 pcbddc->exact_dirichlet_trick_app = PETSC_FALSE;
1556 }
1557 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)
;
1558}
1559
1560/*
1561 PCSetUp_BDDC - Prepares for the use of the BDDC preconditioner
1562 by setting data structures and options.
1563
1564 Input Parameter:
1565+ pc - the preconditioner context
1566
1567 Application Interface Routine: PCSetUp()
1568
1569 Notes:
1570 The interface routine PCSetUp() is not usually called directly by
1571 the user, but instead is called by PCApply() if necessary.
1572*/
1573PetscErrorCode PCSetUp_BDDC(PC pc)
1574{
1575 PC_BDDC* pcbddc = (PC_BDDC*)pc->data;
1576 PCBDDCSubSchurs sub_schurs;
1577 Mat_IS* matis;
1578 MatNullSpace nearnullspace;
1579 Mat lA;
1580 IS lP,zerodiag = NULL((void*)0);
1581 PetscInt nrows,ncols;
1582 PetscMPIInt size;
1583 PetscBool computesubschurs;
1584 PetscBool computeconstraintsmatrix;
1585 PetscBool new_nearnullspace_provided,ismatis,rl;
1586 PetscErrorCode ierr;
1587
1588 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1588; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1589 ierr = PetscObjectTypeCompare((PetscObject)pc->pmat,MATIS"is",&ismatis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1589,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1590 if (!ismatis) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_ARG_WRONG,"PCBDDC preconditioner requires matrix of type MATIS")return PetscError(PetscObjectComm((PetscObject)pc),1590,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"PCBDDC preconditioner requires matrix of type MATIS"
)
;
1591 ierr = MatGetSize(pc->pmat,&nrows,&ncols);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1591,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1592 if (nrows != ncols) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"PCBDDC preconditioner requires a square preconditioning matrix")return PetscError(PetscObjectComm((PetscObject)pc),1592,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"PCBDDC preconditioner requires a square preconditioning matrix"
)
;
1593 ierr = MPI_Comm_size(PetscObjectComm((PetscObject)pc),&size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1593,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1594
1595 matis = (Mat_IS*)pc->pmat->data;
1596 /* the following lines of code should be replaced by a better logic between PCIS, PCNN, PCBDDC and other future nonoverlapping preconditioners */
1597 /* For BDDC we need to define a local "Neumann" problem different to that defined in PCISSetup
1598 Also, BDDC builds its own KSP for the Dirichlet problem */
1599 rl = pcbddc->recompute_topography;
1600 if (!pc->setupcalled || pc->flag == DIFFERENT_NONZERO_PATTERN) rl = PETSC_TRUE;
1601 ierr = MPIU_Allreduce(&rl,&pcbddc->recompute_topography,1,MPIU_BOOL,MPI_LOR,PetscObjectComm((PetscObject)pc))(PetscAllreduceBarrierCheck(PetscObjectComm((PetscObject)pc),
1,1601,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)pc))),0) || MPI_Allreduce((&rl),(&pcbddc
->recompute_topography),(1),(MPIU_BOOL),((MPI_Op)(0x58000007
)),(PetscObjectComm((PetscObject)pc)))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1601,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1602 if (pcbddc->recompute_topography) {
1603 pcbddc->graphanalyzed = PETSC_FALSE;
1604 computeconstraintsmatrix = PETSC_TRUE;
1605 } else {
1606 computeconstraintsmatrix = PETSC_FALSE;
1607 }
1608
1609 /* check parameters' compatibility */
1610 if (!pcbddc->use_deluxe_scaling) pcbddc->deluxe_zerorows = PETSC_FALSE;
1611 pcbddc->adaptive_selection = (PetscBool)(pcbddc->adaptive_threshold[0] != 0.0 || pcbddc->adaptive_threshold[1] != 0.0);
1612 pcbddc->use_deluxe_scaling = (PetscBool)(pcbddc->use_deluxe_scaling && size > 1);
1613 pcbddc->adaptive_selection = (PetscBool)(pcbddc->adaptive_selection && size > 1);
1614 pcbddc->adaptive_userdefined = (PetscBool)(pcbddc->adaptive_selection && pcbddc->adaptive_userdefined);
1615 if (pcbddc->adaptive_selection) pcbddc->use_faces = PETSC_TRUE;
1616
1617 computesubschurs = (PetscBool)(pcbddc->adaptive_selection || pcbddc->use_deluxe_scaling);
1618
1619 /* activate all connected components if the netflux has been requested */
1620 if (pcbddc->compute_nonetflux) {
1621 pcbddc->use_vertices = PETSC_TRUE;
1622 pcbddc->use_edges = PETSC_TRUE;
1623 pcbddc->use_faces = PETSC_TRUE;
1624 }
1625
1626 /* Get stdout for dbg */
1627 if (pcbddc->dbg_flag) {
1628 if (!pcbddc->dbg_viewer) {
1629 pcbddc->dbg_viewer = PETSC_VIEWER_STDOUT_(PetscObjectComm((PetscObject)pc));
1630 }
1631 ierr = PetscViewerASCIIPushSynchronized(pcbddc->dbg_viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1631,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1632 ierr = PetscViewerASCIIAddTab(pcbddc->dbg_viewer,2*pcbddc->current_level);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1632,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1633 }
1634
1635 /* process topology information */
1636 ierr = PetscLogEventBegin(PC_BDDC_Topology[pcbddc->current_level],pc,0,0,0)(((PetscLogPLB && petsc_stageLog->stageInfo[petsc_stageLog
->curStage].perfInfo.active && petsc_stageLog->
stageInfo[petsc_stageLog->curStage].eventLog->eventInfo
[PC_BDDC_Topology[pcbddc->current_level]].active) ? (*PetscLogPLB
)((PC_BDDC_Topology[pcbddc->current_level]),0,(PetscObject
)(pc),(PetscObject)(0),(PetscObject)(0),(PetscObject)(0)) : 0
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1636,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1637 if (pcbddc->recompute_topography) {
1638 ierr = PCBDDCComputeLocalTopologyInfo(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1638,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1639 if (pcbddc->discretegradient) {
1640 ierr = PCBDDCNedelecSupport(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1640,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1641 }
1642 }
1643 if (pcbddc->corner_selected) pcbddc->use_vertices = PETSC_TRUE;
1644
1645 /* change basis if requested by the user */
1646 if (pcbddc->user_ChangeOfBasisMatrix) {
1647 /* use_change_of_basis flag is used to automatically compute a change of basis from constraints */
1648 pcbddc->use_change_of_basis = PETSC_FALSE;
1649 ierr = PCBDDCComputeLocalMatrix(pc,pcbddc->user_ChangeOfBasisMatrix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1649,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1650 } else {
1651 ierr = MatDestroy(&pcbddc->local_mat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1651,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1652 ierr = PetscObjectReference((PetscObject)matis->A);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1652,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1653 pcbddc->local_mat = matis->A;
1654 }
1655
1656 /*
1657 Compute change of basis on local pressures (aka zerodiag dofs) with the benign trick
1658 This should come earlier then PCISSetUp for extracting the correct subdomain matrices
1659 */
1660 ierr = PCBDDCBenignShellMat(pc,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1660,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1661 if (pcbddc->benign_saddle_point) {
1662 PC_IS* pcis = (PC_IS*)pc->data;
1663
1664 if (pcbddc->user_ChangeOfBasisMatrix || pcbddc->use_change_of_basis || !computesubschurs) pcbddc->benign_change_explicit = PETSC_TRUE;
1665 /* detect local saddle point and change the basis in pcbddc->local_mat */
1666 ierr = PCBDDCBenignDetectSaddlePoint(pc,(PetscBool)(!pcbddc->recompute_topography),&zerodiag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1666,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1667 /* pop B0 mat from local mat */
1668 ierr = PCBDDCBenignPopOrPushB0(pc,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1668,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1669 /* give pcis a hint to not reuse submatrices during PCISCreate */
1670 if (pc->flag == SAME_NONZERO_PATTERN && pcis->reusesubmatrices == PETSC_TRUE) {
1671 if (pcbddc->benign_n && (pcbddc->benign_change_explicit || pcbddc->dbg_flag)) {
1672 pcis->reusesubmatrices = PETSC_FALSE;
1673 } else {
1674 pcis->reusesubmatrices = PETSC_TRUE;
1675 }
1676 } else {
1677 pcis->reusesubmatrices = PETSC_FALSE;
1678 }
1679 }
1680
1681 /* propagate relevant information */
1682 if (matis->A->symmetric_set) {
1683 ierr = MatSetOption(pcbddc->local_mat,MAT_SYMMETRIC,matis->A->symmetric);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1683,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1684 }
1685 if (matis->A->spd_set) {
1686 ierr = MatSetOption(pcbddc->local_mat,MAT_SPD,matis->A->spd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1686,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1687 }
1688
1689 /* Set up all the "iterative substructuring" common block without computing solvers */
1690 {
1691 Mat temp_mat;
1692
1693 temp_mat = matis->A;
1694 matis->A = pcbddc->local_mat;
1695 ierr = PCISSetUp(pc,PETSC_TRUE,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1695,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1696 pcbddc->local_mat = matis->A;
1697 matis->A = temp_mat;
1698 }
1699
1700 /* Analyze interface */
1701 if (!pcbddc->graphanalyzed) {
1702 ierr = PCBDDCAnalyzeInterface(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1702,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1703 computeconstraintsmatrix = PETSC_TRUE;
1704 if (pcbddc->adaptive_selection && !pcbddc->use_deluxe_scaling && !pcbddc->mat_graph->twodim) {
1705 SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Cannot compute the adaptive primal space for a problem with 3D edges without deluxe scaling")return PetscError(PetscObjectComm((PetscObject)pc),1705,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Cannot compute the adaptive primal space for a problem with 3D edges without deluxe scaling"
)
;
1706 }
1707 if (pcbddc->compute_nonetflux) {
1708 MatNullSpace nnfnnsp;
1709
1710 if (!pcbddc->divudotp) SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Missing divudotp operator")return PetscError(PetscObjectComm((PetscObject)pc),1710,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Missing divudotp operator")
;
1711 ierr = PCBDDCComputeNoNetFlux(pc->pmat,pcbddc->divudotp,pcbddc->divudotp_trans,pcbddc->divudotp_vl2l,pcbddc->mat_graph,&nnfnnsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1711,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1712 /* TODO what if a nearnullspace is already attached? */
1713 if (nnfnnsp) {
1714 ierr = MatSetNearNullSpace(pc->pmat,nnfnnsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1714,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1715 ierr = MatNullSpaceDestroy(&nnfnnsp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1715,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1716 }
1717 }
1718 }
1719 ierr = PetscLogEventEnd(PC_BDDC_Topology[pcbddc->current_level],pc,0,0,0)(((PetscLogPLE && petsc_stageLog->stageInfo[petsc_stageLog
->curStage].perfInfo.active && petsc_stageLog->
stageInfo[petsc_stageLog->curStage].eventLog->eventInfo
[PC_BDDC_Topology[pcbddc->current_level]].active) ? (*PetscLogPLE
)((PC_BDDC_Topology[pcbddc->current_level]),0,(PetscObject
)(pc),(PetscObject)(0),(PetscObject)(0),(PetscObject)(0)) : 0
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1719,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1720
1721 /* check existence of a divergence free extension, i.e.
1722 b(v_I,p_0) = 0 for all v_I (raise error if not).
1723 Also, check that PCBDDCBenignGetOrSetP0 works */
1724 if (pcbddc->benign_saddle_point && pcbddc->dbg_flag > 1) {
1725 ierr = PCBDDCBenignCheck(pc,zerodiag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1725,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1726 }
1727 ierr = ISDestroy(&zerodiag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1727,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1728
1729 /* Setup local dirichlet solver ksp_D and sub_schurs solvers */
1730 if (computesubschurs && pcbddc->recompute_topography) {
1731 ierr = PCBDDCInitSubSchurs(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1731,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1732 }
1733 /* SetUp Scaling operator (scaling matrices could be needed in SubSchursSetUp)*/
1734 if (!pcbddc->use_deluxe_scaling) {
1735 ierr = PCBDDCScalingSetUp(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1735,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1736 }
1737
1738 /* finish setup solvers and do adaptive selection of constraints */
1739 sub_schurs = pcbddc->sub_schurs;
1740 if (sub_schurs && sub_schurs->schur_explicit) {
1741 if (computesubschurs) {
1742 ierr = PCBDDCSetUpSubSchurs(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1742,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1743 }
1744 ierr = PCBDDCSetUpLocalSolvers(pc,PETSC_TRUE,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1744,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1745 } else {
1746 ierr = PCBDDCSetUpLocalSolvers(pc,PETSC_TRUE,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1746,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1747 if (computesubschurs) {
1748 ierr = PCBDDCSetUpSubSchurs(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1748,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1749 }
1750 }
1751 if (pcbddc->adaptive_selection) {
1752 ierr = PCBDDCAdaptiveSelection(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1752,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1753 computeconstraintsmatrix = PETSC_TRUE;
1754 }
1755
1756 /* infer if NullSpace object attached to Mat via MatSetNearNullSpace has changed */
1757 new_nearnullspace_provided = PETSC_FALSE;
1758 ierr = MatGetNearNullSpace(pc->pmat,&nearnullspace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1758,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1759 if (pcbddc->onearnullspace) { /* already used nearnullspace */
1760 if (!nearnullspace) { /* near null space attached to mat has been destroyed */
1761 new_nearnullspace_provided = PETSC_TRUE;
1762 } else {
1763 /* determine if the two nullspaces are different (should be lightweight) */
1764 if (nearnullspace != pcbddc->onearnullspace) {
1765 new_nearnullspace_provided = PETSC_TRUE;
1766 } else { /* maybe the user has changed the content of the nearnullspace so check vectors ObjectStateId */
1767 PetscInt i;
1768 const Vec *nearnullvecs;
1769 PetscObjectState state;
1770 PetscInt nnsp_size;
1771 ierr = MatNullSpaceGetVecs(nearnullspace,NULL((void*)0),&nnsp_size,&nearnullvecs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1771,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1772 for (i=0;i<nnsp_size;i++) {
1773 ierr = PetscObjectStateGet((PetscObject)nearnullvecs[i],&state);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1773,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1774 if (pcbddc->onearnullvecs_state[i] != state) {
1775 new_nearnullspace_provided = PETSC_TRUE;
1776 break;
1777 }
1778 }
1779 }
1780 }
1781 } else {
1782 if (!nearnullspace) { /* both nearnullspaces are null */
1783 new_nearnullspace_provided = PETSC_FALSE;
1784 } else { /* nearnullspace attached later */
1785 new_nearnullspace_provided = PETSC_TRUE;
1786 }
1787 }
1788
1789 /* Setup constraints and related work vectors */
1790 /* reset primal space flags */
1791 ierr = PetscLogEventBegin(PC_BDDC_LocalWork[pcbddc->current_level],pc,0,0,0)(((PetscLogPLB && petsc_stageLog->stageInfo[petsc_stageLog
->curStage].perfInfo.active && petsc_stageLog->
stageInfo[petsc_stageLog->curStage].eventLog->eventInfo
[PC_BDDC_LocalWork[pcbddc->current_level]].active) ? (*PetscLogPLB
)((PC_BDDC_LocalWork[pcbddc->current_level]),0,(PetscObject
)(pc),(PetscObject)(0),(PetscObject)(0),(PetscObject)(0)) : 0
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1791,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1792 pcbddc->new_primal_space = PETSC_FALSE;
1793 pcbddc->new_primal_space_local = PETSC_FALSE;
1794 if (computeconstraintsmatrix || new_nearnullspace_provided) {
1795 /* It also sets the primal space flags */
1796 ierr = PCBDDCConstraintsSetUp(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1796,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1797 }
1798 /* Allocate needed local vectors (which depends on quantities defined during ConstraintsSetUp) */
1799 ierr = PCBDDCSetUpLocalWorkVectors(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1799,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1800
1801 if (pcbddc->use_change_of_basis) {
1802 PC_IS *pcis = (PC_IS*)(pc->data);
1803
1804 ierr = PCBDDCComputeLocalMatrix(pc,pcbddc->ChangeOfBasisMatrix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1804,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1805 if (pcbddc->benign_change) {
1806 ierr = MatDestroy(&pcbddc->benign_B0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1806,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1807 /* pop B0 from pcbddc->local_mat */
1808 ierr = PCBDDCBenignPopOrPushB0(pc,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1808,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1809 }
1810 /* get submatrices */
1811 ierr = MatDestroy(&pcis->A_IB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1811,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1812 ierr = MatDestroy(&pcis->A_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1812,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1813 ierr = MatDestroy(&pcis->A_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1813,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1814 ierr = MatCreateSubMatrix(pcbddc->local_mat,pcis->is_B_local,pcis->is_B_local,MAT_INITIAL_MATRIX,&pcis->A_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1814,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1815 ierr = MatCreateSubMatrix(pcbddc->local_mat,pcis->is_I_local,pcis->is_B_local,MAT_INITIAL_MATRIX,&pcis->A_IB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1815,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1816 ierr = MatCreateSubMatrix(pcbddc->local_mat,pcis->is_B_local,pcis->is_I_local,MAT_INITIAL_MATRIX,&pcis->A_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1816,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1817 /* set flag in pcis to not reuse submatrices during PCISCreate */
1818 pcis->reusesubmatrices = PETSC_FALSE;
1819 } else if (!pcbddc->user_ChangeOfBasisMatrix && !pcbddc->benign_change) {
1820 ierr = MatDestroy(&pcbddc->local_mat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1820,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1821 ierr = PetscObjectReference((PetscObject)matis->A);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1821,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1822 pcbddc->local_mat = matis->A;
1823 }
1824
1825 /* interface pressure block row for B_C */
1826 ierr = PetscObjectQuery((PetscObject)pc,"__KSPFETIDP_lP" ,(PetscObject*)&lP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1826,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1827 ierr = PetscObjectQuery((PetscObject)pc,"__KSPFETIDP_lA" ,(PetscObject*)&lA);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1827,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1828 if (lA && lP) {
1829 PC_IS* pcis = (PC_IS*)pc->data;
1830 Mat B_BI,B_BB,Bt_BI,Bt_BB;
1831 PetscBool issym;
1832 ierr = MatIsSymmetric(lA,PETSC_SMALL1.e-10,&issym);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1832,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1833 if (issym) {
1834 ierr = MatCreateSubMatrix(lA,lP,pcis->is_I_local,MAT_INITIAL_MATRIX,&B_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1834,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1835 ierr = MatCreateSubMatrix(lA,lP,pcis->is_B_local,MAT_INITIAL_MATRIX,&B_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1835,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1836 ierr = MatCreateTranspose(B_BI,&Bt_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1836,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1837 ierr = MatCreateTranspose(B_BB,&Bt_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1837,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1838 } else {
1839 ierr = MatCreateSubMatrix(lA,lP,pcis->is_I_local,MAT_INITIAL_MATRIX,&B_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1839,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1840 ierr = MatCreateSubMatrix(lA,lP,pcis->is_B_local,MAT_INITIAL_MATRIX,&B_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1840,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1841 ierr = MatCreateSubMatrix(lA,pcis->is_I_local,lP,MAT_INITIAL_MATRIX,&Bt_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1841,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1842 ierr = MatCreateSubMatrix(lA,pcis->is_B_local,lP,MAT_INITIAL_MATRIX,&Bt_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1842,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1843 }
1844 ierr = PetscObjectCompose((PetscObject)pc,"__KSPFETIDP_B_BI",(PetscObject)B_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1844,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1845 ierr = PetscObjectCompose((PetscObject)pc,"__KSPFETIDP_B_BB",(PetscObject)B_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1845,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1846 ierr = PetscObjectCompose((PetscObject)pc,"__KSPFETIDP_Bt_BI",(PetscObject)Bt_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1846,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1847 ierr = PetscObjectCompose((PetscObject)pc,"__KSPFETIDP_Bt_BB",(PetscObject)Bt_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1847,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1848 ierr = MatDestroy(&B_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1848,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1849 ierr = MatDestroy(&B_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1849,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1850 ierr = MatDestroy(&Bt_BI);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1850,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1851 ierr = MatDestroy(&Bt_BB);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1851,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1852 }
1853 ierr = PetscLogEventEnd(PC_BDDC_LocalWork[pcbddc->current_level],pc,0,0,0)(((PetscLogPLE && petsc_stageLog->stageInfo[petsc_stageLog
->curStage].perfInfo.active && petsc_stageLog->
stageInfo[petsc_stageLog->curStage].eventLog->eventInfo
[PC_BDDC_LocalWork[pcbddc->current_level]].active) ? (*PetscLogPLE
)((PC_BDDC_LocalWork[pcbddc->current_level]),0,(PetscObject
)(pc),(PetscObject)(0),(PetscObject)(0),(PetscObject)(0)) : 0
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1853,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1854
1855 /* SetUp coarse and local Neumann solvers */
1856 ierr = PCBDDCSetUpSolvers(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1856,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1857 /* SetUp Scaling operator */
1858 if (pcbddc->use_deluxe_scaling) {
1859 ierr = PCBDDCScalingSetUp(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1859,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1860 }
1861
1862 /* mark topography as done */
1863 pcbddc->recompute_topography = PETSC_FALSE;
1864
1865 /* wrap pcis->A_IB and pcis->A_BI if we did not change explicitly the variables on the pressures */
1866 ierr = PCBDDCBenignShellMat(pc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1866,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1867
1868 if (pcbddc->dbg_flag) {
1869 ierr = PetscViewerASCIISubtractTab(pcbddc->dbg_viewer,2*pcbddc->current_level);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1869,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1870 ierr = PetscViewerASCIIPopSynchronized(pcbddc->dbg_viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1870,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1871 }
1872 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)
;
1873}
1874
1875/*
1876 PCApply_BDDC - Applies the BDDC operator to a vector.
1877
1878 Input Parameters:
1879+ pc - the preconditioner context
1880- r - input vector (global)
1881
1882 Output Parameter:
1883. z - output vector (global)
1884
1885 Application Interface Routine: PCApply()
1886 */
1887PetscErrorCode PCApply_BDDC(PC pc,Vec r,Vec z)
1888{
1889 PC_IS *pcis = (PC_IS*)(pc->data);
1890 PC_BDDC *pcbddc = (PC_BDDC*)(pc->data);
1891 Mat lA = NULL((void*)0);
1892 PetscInt n_B = pcis->n_B, n_D = pcis->n - n_B;
1893 PetscErrorCode ierr;
1894 const PetscScalar one = 1.0;
1895 const PetscScalar m_one = -1.0;
1896 const PetscScalar zero = 0.0;
1897/* This code is similar to that provided in nn.c for PCNN
1898 NN interface preconditioner changed to BDDC
1899 Added support for M_3 preconditioner in the reference article (code is active if pcbddc->switch_static == PETSC_TRUE) */
1900
1901 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 1901; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
1902 ierr = PetscCitationsRegister(citation,&cited);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1902,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1903 if (pcbddc->switch_static) {
1904 ierr = MatISGetLocalMat(pc->useAmat ? pc->mat : pc->pmat,&lA);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1904,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1905 }
1906
1907 if (pcbddc->ChangeOfBasisMatrix) {
1908 Vec swap;
1909
1910 ierr = MatMultTranspose(pcbddc->ChangeOfBasisMatrix,r,pcbddc->work_change);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1910,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1911 swap = pcbddc->work_change;
1912 pcbddc->work_change = r;
1913 r = swap;
1914 /* save rhs so that we don't need to apply the change of basis for the exact dirichlet trick in PreSolve */
1915 if (pcbddc->benign_apply_coarse_only && pcbddc->use_exact_dirichlet_trick && pcbddc->change_interior) {
1916 ierr = VecCopy(r,pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1916,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1917 ierr = VecLockReadPush(pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1917,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1918 }
1919 }
1920 if (pcbddc->benign_have_null) { /* get p0 from r */
1921 ierr = PCBDDCBenignGetOrSetP0(pc,r,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1921,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1922 }
1923 if (!pcbddc->exact_dirichlet_trick_app && !pcbddc->benign_apply_coarse_only) {
1924 ierr = VecCopy(r,z);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1924,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1925 /* First Dirichlet solve */
1926 ierr = VecScatterBegin(pcis->global_to_D,r,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1926,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1927 ierr = VecScatterEnd(pcis->global_to_D,r,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1927,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1928 /*
1929 Assembling right hand side for BDDC operator
1930 - pcis->vec1_D for the Dirichlet part (if needed, i.e. pcbddc->switch_static == PETSC_TRUE)
1931 - pcis->vec1_B the interface part of the global vector z
1932 */
1933 if (n_D) {
1934 ierr = KSPSolve(pcbddc->ksp_D,pcis->vec1_D,pcis->vec2_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1934,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1935 ierr = KSPCheckSolve(pcbddc->ksp_D,pc,pcis->vec2_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1935,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1936 ierr = VecScale(pcis->vec2_D,m_one);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1936,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1937 if (pcbddc->switch_static) {
1938 ierr = VecSet(pcis->vec1_N,0.);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1938,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1939 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec2_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1939,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1940 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec2_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1940,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1941 if (!pcbddc->switch_static_change) {
1942 ierr = MatMult(lA,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1942,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1943 } else {
1944 ierr = MatMult(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1944,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1945 ierr = MatMult(lA,pcis->vec2_N,pcis->vec1_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1945,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1946 ierr = MatMultTranspose(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1946,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1947 }
1948 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec2_N,pcis->vec1_D,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1948,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1949 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec2_N,pcis->vec1_D,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1949,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1950 ierr = VecScatterBegin(pcis->N_to_B,pcis->vec2_N,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1950,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1951 ierr = VecScatterEnd(pcis->N_to_B,pcis->vec2_N,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1951,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1952 } else {
1953 ierr = MatMult(pcis->A_BI,pcis->vec2_D,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1953,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1954 }
1955 } else {
1956 ierr = VecSet(pcis->vec1_B,zero);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1956,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1957 }
1958 ierr = VecScatterBegin(pcis->global_to_B,pcis->vec1_B,z,ADD_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1958,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1959 ierr = VecScatterEnd(pcis->global_to_B,pcis->vec1_B,z,ADD_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1959,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1960 ierr = PCBDDCScalingRestriction(pc,z,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1960,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1961 } else {
1962 if (!pcbddc->benign_apply_coarse_only) {
1963 ierr = PCBDDCScalingRestriction(pc,r,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1963,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1964 }
1965 }
1966
1967 /* Apply interface preconditioner
1968 input/output vecs: pcis->vec1_B and pcis->vec1_D */
1969 ierr = PCBDDCApplyInterfacePreconditioner(pc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1969,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1970
1971 /* Apply transpose of partition of unity operator */
1972 ierr = PCBDDCScalingExtension(pc,pcis->vec1_B,z);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1972,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1973
1974 /* Second Dirichlet solve and assembling of output */
1975 ierr = VecScatterBegin(pcis->global_to_B,z,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1975,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1976 ierr = VecScatterEnd(pcis->global_to_B,z,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1976,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1977 if (n_B) {
1978 if (pcbddc->switch_static) {
1979 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec1_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1979,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1980 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec1_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1980,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1981 ierr = VecScatterBegin(pcis->N_to_B,pcis->vec1_B,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1981,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1982 ierr = VecScatterEnd(pcis->N_to_B,pcis->vec1_B,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1982,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1983 if (!pcbddc->switch_static_change) {
1984 ierr = MatMult(lA,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1984,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1985 } else {
1986 ierr = MatMult(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1986,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1987 ierr = MatMult(lA,pcis->vec2_N,pcis->vec1_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1987,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1988 ierr = MatMultTranspose(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1988,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1989 }
1990 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec2_N,pcis->vec3_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1990,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1991 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec2_N,pcis->vec3_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1991,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1992 } else {
1993 ierr = MatMult(pcis->A_IB,pcis->vec1_B,pcis->vec3_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1993,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1994 }
1995 } else if (pcbddc->switch_static) { /* n_B is zero */
1996 if (!pcbddc->switch_static_change) {
1997 ierr = MatMult(lA,pcis->vec1_D,pcis->vec3_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1997,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1998 } else {
1999 ierr = MatMult(pcbddc->switch_static_change,pcis->vec1_D,pcis->vec1_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),1999,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2000 ierr = MatMult(lA,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2000,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2001 ierr = MatMultTranspose(pcbddc->switch_static_change,pcis->vec2_N,pcis->vec3_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2001,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2002 }
2003 }
2004 ierr = KSPSolve(pcbddc->ksp_D,pcis->vec3_D,pcis->vec4_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2004,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2005 ierr = KSPCheckSolve(pcbddc->ksp_D,pc,pcis->vec4_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2005,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2006
2007 if (!pcbddc->exact_dirichlet_trick_app && !pcbddc->benign_apply_coarse_only) {
2008 if (pcbddc->switch_static) {
2009 ierr = VecAXPBYPCZ(pcis->vec2_D,m_one,one,m_one,pcis->vec4_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2009,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2010 } else {
2011 ierr = VecAXPBY(pcis->vec2_D,m_one,m_one,pcis->vec4_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2011,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2012 }
2013 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec2_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2013,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2014 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec2_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2014,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2015 } else {
2016 if (pcbddc->switch_static) {
2017 ierr = VecAXPBY(pcis->vec4_D,one,m_one,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2017,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2018 } else {
2019 ierr = VecScale(pcis->vec4_D,m_one);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2019,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2020 }
2021 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec4_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2021,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2022 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec4_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2022,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2023 }
2024 if (pcbddc->benign_have_null) { /* set p0 (computed in PCBDDCApplyInterface) */
2025 if (pcbddc->benign_apply_coarse_only) {
2026 ierr = PetscArrayzero(pcbddc->benign_p0,pcbddc->benign_n)PetscMemzero(pcbddc->benign_p0,(pcbddc->benign_n)*sizeof
(*(pcbddc->benign_p0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2026,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2027 }
2028 ierr = PCBDDCBenignGetOrSetP0(pc,z,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2028,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2029 }
2030
2031 if (pcbddc->ChangeOfBasisMatrix) {
2032 pcbddc->work_change = r;
2033 ierr = VecCopy(z,pcbddc->work_change);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2033,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2034 ierr = MatMult(pcbddc->ChangeOfBasisMatrix,pcbddc->work_change,z);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2034,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2035 }
2036 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)
;
2037}
2038
2039/*
2040 PCApplyTranspose_BDDC - Applies the transpose of the BDDC operator to a vector.
2041
2042 Input Parameters:
2043+ pc - the preconditioner context
2044- r - input vector (global)
2045
2046 Output Parameter:
2047. z - output vector (global)
2048
2049 Application Interface Routine: PCApplyTranspose()
2050 */
2051PetscErrorCode PCApplyTranspose_BDDC(PC pc,Vec r,Vec z)
2052{
2053 PC_IS *pcis = (PC_IS*)(pc->data);
2054 PC_BDDC *pcbddc = (PC_BDDC*)(pc->data);
2055 Mat lA = NULL((void*)0);
2056 PetscInt n_B = pcis->n_B, n_D = pcis->n - n_B;
2057 PetscErrorCode ierr;
2058 const PetscScalar one = 1.0;
2059 const PetscScalar m_one = -1.0;
2060 const PetscScalar zero = 0.0;
2061
2062 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2062; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2063 ierr = PetscCitationsRegister(citation,&cited);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2063,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2064 if (pcbddc->switch_static) {
2065 ierr = MatISGetLocalMat(pc->useAmat ? pc->mat : pc->pmat,&lA);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2065,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2066 }
2067 if (pcbddc->ChangeOfBasisMatrix) {
2068 Vec swap;
2069
2070 ierr = MatMultTranspose(pcbddc->ChangeOfBasisMatrix,r,pcbddc->work_change);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2070,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2071 swap = pcbddc->work_change;
2072 pcbddc->work_change = r;
2073 r = swap;
2074 /* save rhs so that we don't need to apply the change of basis for the exact dirichlet trick in PreSolve */
2075 if (pcbddc->benign_apply_coarse_only && pcbddc->exact_dirichlet_trick_app && pcbddc->change_interior) {
2076 ierr = VecCopy(r,pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2076,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2077 ierr = VecLockReadPush(pcis->vec1_global);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2077,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2078 }
2079 }
2080 if (pcbddc->benign_have_null) { /* get p0 from r */
2081 ierr = PCBDDCBenignGetOrSetP0(pc,r,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2081,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2082 }
2083 if (!pcbddc->exact_dirichlet_trick_app && !pcbddc->benign_apply_coarse_only) {
2084 ierr = VecCopy(r,z);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2084,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2085 /* First Dirichlet solve */
2086 ierr = VecScatterBegin(pcis->global_to_D,r,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2086,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2087 ierr = VecScatterEnd(pcis->global_to_D,r,pcis->vec1_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2087,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2088 /*
2089 Assembling right hand side for BDDC operator
2090 - pcis->vec1_D for the Dirichlet part (if needed, i.e. pcbddc->switch_static == PETSC_TRUE)
2091 - pcis->vec1_B the interface part of the global vector z
2092 */
2093 if (n_D) {
2094 ierr = KSPSolveTranspose(pcbddc->ksp_D,pcis->vec1_D,pcis->vec2_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2094,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2095 ierr = KSPCheckSolve(pcbddc->ksp_D,pc,pcis->vec2_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2095,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2096 ierr = VecScale(pcis->vec2_D,m_one);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2096,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2097 if (pcbddc->switch_static) {
2098 ierr = VecSet(pcis->vec1_N,0.);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2098,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2099 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec2_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2099,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2100 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec2_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2100,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2101 if (!pcbddc->switch_static_change) {
2102 ierr = MatMultTranspose(lA,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2102,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2103 } else {
2104 ierr = MatMult(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2104,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2105 ierr = MatMultTranspose(lA,pcis->vec2_N,pcis->vec1_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2105,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2106 ierr = MatMultTranspose(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2106,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2107 }
2108 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec2_N,pcis->vec1_D,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2108,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2109 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec2_N,pcis->vec1_D,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2109,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2110 ierr = VecScatterBegin(pcis->N_to_B,pcis->vec2_N,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2110,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2111 ierr = VecScatterEnd(pcis->N_to_B,pcis->vec2_N,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2111,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2112 } else {
2113 ierr = MatMultTranspose(pcis->A_IB,pcis->vec2_D,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2113,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2114 }
2115 } else {
2116 ierr = VecSet(pcis->vec1_B,zero);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2116,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2117 }
2118 ierr = VecScatterBegin(pcis->global_to_B,pcis->vec1_B,z,ADD_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2118,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2119 ierr = VecScatterEnd(pcis->global_to_B,pcis->vec1_B,z,ADD_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2119,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2120 ierr = PCBDDCScalingRestriction(pc,z,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2120,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2121 } else {
2122 ierr = PCBDDCScalingRestriction(pc,r,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2122,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2123 }
2124
2125 /* Apply interface preconditioner
2126 input/output vecs: pcis->vec1_B and pcis->vec1_D */
2127 ierr = PCBDDCApplyInterfacePreconditioner(pc,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2127,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2128
2129 /* Apply transpose of partition of unity operator */
2130 ierr = PCBDDCScalingExtension(pc,pcis->vec1_B,z);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2130,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2131
2132 /* Second Dirichlet solve and assembling of output */
2133 ierr = VecScatterBegin(pcis->global_to_B,z,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2133,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2134 ierr = VecScatterEnd(pcis->global_to_B,z,pcis->vec1_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2134,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2135 if (n_B) {
2136 if (pcbddc->switch_static) {
2137 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec1_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2137,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2138 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec1_D,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2138,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2139 ierr = VecScatterBegin(pcis->N_to_B,pcis->vec1_B,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2139,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2140 ierr = VecScatterEnd(pcis->N_to_B,pcis->vec1_B,pcis->vec1_N,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2140,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2141 if (!pcbddc->switch_static_change) {
2142 ierr = MatMultTranspose(lA,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2142,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2143 } else {
2144 ierr = MatMult(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2144,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2145 ierr = MatMultTranspose(lA,pcis->vec2_N,pcis->vec1_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2145,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2146 ierr = MatMultTranspose(pcbddc->switch_static_change,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2146,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2147 }
2148 ierr = VecScatterBegin(pcis->N_to_D,pcis->vec2_N,pcis->vec3_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2148,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2149 ierr = VecScatterEnd(pcis->N_to_D,pcis->vec2_N,pcis->vec3_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2149,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2150 } else {
2151 ierr = MatMultTranspose(pcis->A_BI,pcis->vec1_B,pcis->vec3_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2151,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2152 }
2153 } else if (pcbddc->switch_static) { /* n_B is zero */
2154 if (!pcbddc->switch_static_change) {
2155 ierr = MatMultTranspose(lA,pcis->vec1_D,pcis->vec3_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2155,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2156 } else {
2157 ierr = MatMult(pcbddc->switch_static_change,pcis->vec1_D,pcis->vec1_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2157,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2158 ierr = MatMultTranspose(lA,pcis->vec1_N,pcis->vec2_N);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2158,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2159 ierr = MatMultTranspose(pcbddc->switch_static_change,pcis->vec2_N,pcis->vec3_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2159,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2160 }
2161 }
2162 ierr = KSPSolveTranspose(pcbddc->ksp_D,pcis->vec3_D,pcis->vec4_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2162,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2163 ierr = KSPCheckSolve(pcbddc->ksp_D,pc,pcis->vec4_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2163,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2164 if (!pcbddc->exact_dirichlet_trick_app && !pcbddc->benign_apply_coarse_only) {
2165 if (pcbddc->switch_static) {
2166 ierr = VecAXPBYPCZ(pcis->vec2_D,m_one,one,m_one,pcis->vec4_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2166,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2167 } else {
2168 ierr = VecAXPBY(pcis->vec2_D,m_one,m_one,pcis->vec4_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2168,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2169 }
2170 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec2_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2170,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2171 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec2_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2171,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2172 } else {
2173 if (pcbddc->switch_static) {
2174 ierr = VecAXPBY(pcis->vec4_D,one,m_one,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2174,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2175 } else {
2176 ierr = VecScale(pcis->vec4_D,m_one);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2176,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2177 }
2178 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec4_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2178,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2179 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec4_D,z,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2179,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2180 }
2181 if (pcbddc->benign_have_null) { /* set p0 (computed in PCBDDCApplyInterface) */
2182 ierr = PCBDDCBenignGetOrSetP0(pc,z,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2182,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2183 }
2184 if (pcbddc->ChangeOfBasisMatrix) {
2185 pcbddc->work_change = r;
2186 ierr = VecCopy(z,pcbddc->work_change);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2186,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2187 ierr = MatMult(pcbddc->ChangeOfBasisMatrix,pcbddc->work_change,z);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2187,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2188 }
2189 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)
;
2190}
2191
2192PetscErrorCode PCReset_BDDC(PC pc)
2193{
2194 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
2195 PC_IS *pcis = (PC_IS*)pc->data;
2196 KSP kspD,kspR,kspC;
2197 PetscErrorCode ierr;
2198
2199 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2199; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2200 /* free BDDC custom data */
2201 ierr = PCBDDCResetCustomization(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2201,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2202 /* destroy objects related to topography */
2203 ierr = PCBDDCResetTopography(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2203,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2204 /* destroy objects for scaling operator */
2205 ierr = PCBDDCScalingDestroy(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2205,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2206 /* free solvers stuff */
2207 ierr = PCBDDCResetSolvers(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2207,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2208 /* free global vectors needed in presolve */
2209 ierr = VecDestroy(&pcbddc->temp_solution);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2209,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2210 ierr = VecDestroy(&pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2210,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2211 /* free data created by PCIS */
2212 ierr = PCISDestroy(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2212,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2213
2214 /* restore defaults */
2215 kspD = pcbddc->ksp_D;
2216 kspR = pcbddc->ksp_R;
2217 kspC = pcbddc->coarse_ksp;
2218 ierr = PetscMemzero(pc->data,sizeof(*pcbddc));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2218,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2219 pcis->n_neigh = -1;
2220 pcis->scaling_factor = 1.0;
2221 pcis->reusesubmatrices = PETSC_TRUE;
2222 pcbddc->use_local_adj = PETSC_TRUE;
2223 pcbddc->use_vertices = PETSC_TRUE;
2224 pcbddc->use_edges = PETSC_TRUE;
2225 pcbddc->symmetric_primal = PETSC_TRUE;
2226 pcbddc->vertex_size = 1;
2227 pcbddc->recompute_topography = PETSC_TRUE;
2228 pcbddc->coarse_size = -1;
2229 pcbddc->use_exact_dirichlet_trick = PETSC_TRUE;
2230 pcbddc->coarsening_ratio = 8;
2231 pcbddc->coarse_eqs_per_proc = 1;
2232 pcbddc->benign_compute_correction = PETSC_TRUE;
2233 pcbddc->nedfield = -1;
2234 pcbddc->nedglobal = PETSC_TRUE;
2235 pcbddc->graphmaxcount = PETSC_MAX_INT2147483647;
2236 pcbddc->sub_schurs_layers = -1;
2237 pcbddc->ksp_D = kspD;
2238 pcbddc->ksp_R = kspR;
2239 pcbddc->coarse_ksp = kspC;
2240 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)
;
2241}
2242
2243PetscErrorCode PCDestroy_BDDC(PC pc)
2244{
2245 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
2246 PetscErrorCode ierr;
2247
2248 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2248; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2249 ierr = PCReset_BDDC(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2249,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2250 ierr = KSPDestroy(&pcbddc->ksp_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2250,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2251 ierr = KSPDestroy(&pcbddc->ksp_R);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2251,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2252 ierr = KSPDestroy(&pcbddc->coarse_ksp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2252,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2253 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDiscreteGradient_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDiscreteGradient_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2253,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2254 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDivergenceMat_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDivergenceMat_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2254,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2255 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetChangeOfBasisMat_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetChangeOfBasisMat_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2255,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2256 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetPrimalVerticesLocalIS_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetPrimalVerticesLocalIS_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2256,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2257 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetPrimalVerticesIS_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetPrimalVerticesIS_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2257,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2258 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetCoarseningRatio_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetCoarseningRatio_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2258,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2259 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetLevel_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetLevel_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2259,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2260 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetUseExactDirichlet_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetUseExactDirichlet_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2260,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2261 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetLevels_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetLevels_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2261,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2262 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDirichletBoundaries_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDirichletBoundaries_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2262,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2263 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDirichletBoundariesLocal_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDirichletBoundariesLocal_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2263,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2264 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetNeumannBoundaries_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetNeumannBoundaries_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2264,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2265 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetNeumannBoundariesLocal_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetNeumannBoundariesLocal_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2265,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2266 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetDirichletBoundaries_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetDirichletBoundaries_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2266,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2267 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetDirichletBoundariesLocal_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetDirichletBoundariesLocal_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2267,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2268 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetNeumannBoundaries_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetNeumannBoundaries_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2268,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2269 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetNeumannBoundariesLocal_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetNeumannBoundariesLocal_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2269,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2270 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDofsSplitting_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDofsSplitting_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2270,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2271 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDofsSplittingLocal_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDofsSplittingLocal_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2271,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2272 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetLocalAdjacencyGraph_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetLocalAdjacencyGraph_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2272,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2273 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCCreateFETIDPOperators_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCCreateFETIDPOperators_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2273,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2274 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCMatFETIDPGetRHS_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCMatFETIDPGetRHS_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2274,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2275 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCMatFETIDPGetSolution_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCMatFETIDPGetSolution_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2275,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2276 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCPreSolveChangeRHS_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCPreSolveChangeRHS_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2276,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2277 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCSetCoordinates_C",NULL)PetscObjectComposeFunction_Private((PetscObject)pc,"PCSetCoordinates_C"
,(PetscVoidFunction)(((void*)0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2277,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2278 ierr = PetscFree(pc->data)((*PetscTrFree)((void*)(pc->data),2278,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((pc->data) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2278,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2279 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)
;
2280}
2281
2282static PetscErrorCode PCSetCoordinates_BDDC(PC pc, PetscInt dim, PetscInt nloc, PetscReal *coords)
2283{
2284 PC_BDDC *pcbddc = (PC_BDDC*)pc->data;
2285 PCBDDCGraph mat_graph = pcbddc->mat_graph;
2286 PetscErrorCode ierr;
2287
2288 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2288; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2289 ierr = PetscFree(mat_graph->coords)((*PetscTrFree)((void*)(mat_graph->coords),2289,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((mat_graph->coords) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2289,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2290 ierr = PetscMalloc1(nloc*dim,&mat_graph->coords)PetscMallocA(1,PETSC_FALSE,2290,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(nloc*dim)*sizeof(**(&mat_graph->coords)),(&
mat_graph->coords))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2290,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2291 ierr = PetscArraycpy(mat_graph->coords,coords,nloc*dim)((sizeof(*(mat_graph->coords)) != sizeof(*(coords))) || PetscMemcpy
(mat_graph->coords,coords,(nloc*dim)*sizeof(*(mat_graph->
coords))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2291,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2292 mat_graph->cnloc = nloc;
2293 mat_graph->cdim = dim;
2294 mat_graph->cloc = PETSC_FALSE;
2295 /* flg setup */
2296 pcbddc->recompute_topography = PETSC_TRUE;
2297 pcbddc->corner_selected = PETSC_FALSE;
2298 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)
;
2299}
2300
2301static PetscErrorCode PCPreSolveChangeRHS_BDDC(PC pc, PetscBool* change)
2302{
2303 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2303; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2304 *change = PETSC_TRUE;
2305 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)
;
2306}
2307
2308static PetscErrorCode PCBDDCMatFETIDPGetRHS_BDDC(Mat fetidp_mat, Vec standard_rhs, Vec fetidp_flux_rhs)
2309{
2310 FETIDPMat_ctx mat_ctx;
2311 Vec work;
2312 PC_IS* pcis;
2313 PC_BDDC* pcbddc;
2314 PetscErrorCode ierr;
2315
2316 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2316; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2317 ierr = MatShellGetContext(fetidp_mat,&mat_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2317,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2318 pcis = (PC_IS*)mat_ctx->pc->data;
2319 pcbddc = (PC_BDDC*)mat_ctx->pc->data;
2320
2321 ierr = VecSet(fetidp_flux_rhs,0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2321,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2322 /* copy rhs since we may change it during PCPreSolve_BDDC */
2323 if (!pcbddc->original_rhs) {
2324 ierr = VecDuplicate(pcis->vec1_global,&pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2324,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2325 }
2326 if (mat_ctx->rhs_flip) {
2327 ierr = VecPointwiseMult(pcbddc->original_rhs,standard_rhs,mat_ctx->rhs_flip);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2327,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2328 } else {
2329 ierr = VecCopy(standard_rhs,pcbddc->original_rhs);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2329,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2330 }
2331 if (mat_ctx->g2g_p) {
2332 /* interface pressure rhs */
2333 ierr = VecScatterBegin(mat_ctx->g2g_p,fetidp_flux_rhs,pcbddc->original_rhs,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2333,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2334 ierr = VecScatterEnd(mat_ctx->g2g_p,fetidp_flux_rhs,pcbddc->original_rhs,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2334,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2335 ierr = VecScatterBegin(mat_ctx->g2g_p,standard_rhs,fetidp_flux_rhs,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2335,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2336 ierr = VecScatterEnd(mat_ctx->g2g_p,standard_rhs,fetidp_flux_rhs,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2336,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2337 if (!mat_ctx->rhs_flip) {
2338 ierr = VecScale(fetidp_flux_rhs,-1.);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2338,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2339 }
2340 }
2341 /*
2342 change of basis for physical rhs if needed
2343 It also changes the rhs in case of dirichlet boundaries
2344 */
2345 ierr = PCPreSolve_BDDC(mat_ctx->pc,NULL((void*)0),pcbddc->original_rhs,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2345,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2346 if (pcbddc->ChangeOfBasisMatrix) {
2347 ierr = MatMultTranspose(pcbddc->ChangeOfBasisMatrix,pcbddc->original_rhs,pcbddc->work_change);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2347,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2348 work = pcbddc->work_change;
2349 } else {
2350 work = pcbddc->original_rhs;
2351 }
2352 /* store vectors for computation of fetidp final solution */
2353 ierr = VecScatterBegin(pcis->global_to_D,work,mat_ctx->temp_solution_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2353,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2354 ierr = VecScatterEnd(pcis->global_to_D,work,mat_ctx->temp_solution_D,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2354,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2355 /* scale rhs since it should be unassembled */
2356 /* TODO use counter scaling? (also below) */
2357 ierr = VecScatterBegin(pcis->global_to_B,work,mat_ctx->temp_solution_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2357,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2358 ierr = VecScatterEnd(pcis->global_to_B,work,mat_ctx->temp_solution_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2358,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2359 /* Apply partition of unity */
2360 ierr = VecPointwiseMult(mat_ctx->temp_solution_B,pcis->D,mat_ctx->temp_solution_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2360,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2361 /* ierr = PCBDDCScalingRestriction(mat_ctx->pc,work,mat_ctx->temp_solution_B);CHKERRQ(ierr); */
2362 if (!pcbddc->switch_static) {
2363 /* compute partially subassembled Schur complement right-hand side */
2364 ierr = KSPSolve(pcbddc->ksp_D,mat_ctx->temp_solution_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2364,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2365 /* Cannot propagate up error in KSPSolve() because there is no access to the PC */
2366 ierr = MatMult(pcis->A_BI,pcis->vec1_D,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2366,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2367 ierr = VecAXPY(mat_ctx->temp_solution_B,-1.0,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2367,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2368 ierr = VecSet(work,0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2368,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2369 ierr = VecScatterBegin(pcis->global_to_B,mat_ctx->temp_solution_B,work,ADD_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2369,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2370 ierr = VecScatterEnd(pcis->global_to_B,mat_ctx->temp_solution_B,work,ADD_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2370,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2371 /* ierr = PCBDDCScalingRestriction(mat_ctx->pc,work,mat_ctx->temp_solution_B);CHKERRQ(ierr); */
2372 ierr = VecScatterBegin(pcis->global_to_B,work,mat_ctx->temp_solution_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2372,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2373 ierr = VecScatterEnd(pcis->global_to_B,work,mat_ctx->temp_solution_B,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2373,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2374 ierr = VecPointwiseMult(mat_ctx->temp_solution_B,pcis->D,mat_ctx->temp_solution_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2374,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2375 }
2376 /* BDDC rhs */
2377 ierr = VecCopy(mat_ctx->temp_solution_B,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2377,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2378 if (pcbddc->switch_static) {
2379 ierr = VecCopy(mat_ctx->temp_solution_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2379,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2380 }
2381 /* apply BDDC */
2382 ierr = PetscArrayzero(pcbddc->benign_p0,pcbddc->benign_n)PetscMemzero(pcbddc->benign_p0,(pcbddc->benign_n)*sizeof
(*(pcbddc->benign_p0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2382,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2383 ierr = PCBDDCApplyInterfacePreconditioner(mat_ctx->pc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2383,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2384 ierr = PetscArrayzero(pcbddc->benign_p0,pcbddc->benign_n)PetscMemzero(pcbddc->benign_p0,(pcbddc->benign_n)*sizeof
(*(pcbddc->benign_p0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2384,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2385
2386 /* Application of B_delta and assembling of rhs for fetidp fluxes */
2387 ierr = MatMult(mat_ctx->B_delta,pcis->vec1_B,mat_ctx->lambda_local);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2387,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2388 ierr = VecScatterBegin(mat_ctx->l2g_lambda,mat_ctx->lambda_local,fetidp_flux_rhs,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2388,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2389 ierr = VecScatterEnd(mat_ctx->l2g_lambda,mat_ctx->lambda_local,fetidp_flux_rhs,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2389,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2390 /* Add contribution to interface pressures */
2391 if (mat_ctx->l2g_p) {
2392 ierr = MatMult(mat_ctx->B_BB,pcis->vec1_B,mat_ctx->vP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2392,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2393 if (pcbddc->switch_static) {
2394 ierr = MatMultAdd(mat_ctx->B_BI,pcis->vec1_D,mat_ctx->vP,mat_ctx->vP);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2394,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2395 }
2396 ierr = VecScatterBegin(mat_ctx->l2g_p,mat_ctx->vP,fetidp_flux_rhs,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2396,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2397 ierr = VecScatterEnd(mat_ctx->l2g_p,mat_ctx->vP,fetidp_flux_rhs,ADD_VALUES,SCATTER_FORWARD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2397,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2398 }
2399 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)
;
2400}
2401
2402/*@
2403 PCBDDCMatFETIDPGetRHS - Compute the right-hand side for FETI-DP linear system using the physical right-hand side
2404
2405 Collective
2406
2407 Input Parameters:
2408+ fetidp_mat - the FETI-DP matrix object obtained by a call to PCBDDCCreateFETIDPOperators
2409- standard_rhs - the right-hand side of the original linear system
2410
2411 Output Parameters:
2412. fetidp_flux_rhs - the right-hand side for the FETI-DP linear system
2413
2414 Level: developer
2415
2416 Notes:
2417
2418.seealso: PCBDDC, PCBDDCCreateFETIDPOperators, PCBDDCMatFETIDPGetSolution
2419@*/
2420PetscErrorCode PCBDDCMatFETIDPGetRHS(Mat fetidp_mat, Vec standard_rhs, Vec fetidp_flux_rhs)
2421{
2422 FETIDPMat_ctx mat_ctx;
2423 PetscErrorCode ierr;
2424
2425 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2425; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2426 PetscValidHeaderSpecific(fetidp_mat,MAT_CLASSID,1)do { if (!fetidp_mat) return PetscError(((MPI_Comm)0x44000001
),2426,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fetidp_mat,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),2426,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fetidp_mat))->classid != MAT_CLASSID
) { if (((PetscObject)(fetidp_mat))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),2426,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),2426,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
2427 PetscValidHeaderSpecific(standard_rhs,VEC_CLASSID,2)do { if (!standard_rhs) return PetscError(((MPI_Comm)0x44000001
),2427,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(standard_rhs,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),2427,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(standard_rhs))->classid != VEC_CLASSID
) { if (((PetscObject)(standard_rhs))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),2427,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),2427,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
2428 PetscValidHeaderSpecific(fetidp_flux_rhs,VEC_CLASSID,3)do { if (!fetidp_flux_rhs) return PetscError(((MPI_Comm)0x44000001
),2428,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",3); if (
!PetscCheckPointer(fetidp_flux_rhs,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),2428,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,3); if (((PetscObject)(fetidp_flux_rhs))->classid != VEC_CLASSID
) { if (((PetscObject)(fetidp_flux_rhs))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),2428,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,3); else return PetscError(((MPI_Comm)0x44000001),2428,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",3
); } } while (0)
;
2429 ierr = MatShellGetContext(fetidp_mat,&mat_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2429,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2430 ierr = PetscUseMethod(mat_ctx->pc,"PCBDDCMatFETIDPGetRHS_C",(Mat,Vec,Vec),(fetidp_mat,standard_rhs,fetidp_flux_rhs))0; do { PetscErrorCode (*_7_f)(Mat,Vec,Vec), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(mat_ctx->
pc)),("PCBDDCMatFETIDPGetRHS_C"),(PetscVoidFunction*)(&_7_f
));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),2430,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(fetidp_mat,standard_rhs,fetidp_flux_rhs);do {if (__builtin_expect
(!!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),2430
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(mat_ctx->pc)),2430,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Cannot locate function %s in object","PCBDDCMatFETIDPGetRHS_C"
); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2430,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2431 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)
;
2432}
2433
2434static PetscErrorCode PCBDDCMatFETIDPGetSolution_BDDC(Mat fetidp_mat, Vec fetidp_flux_sol, Vec standard_sol)
2435{
2436 FETIDPMat_ctx mat_ctx;
2437 PC_IS* pcis;
2438 PC_BDDC* pcbddc;
2439 PetscErrorCode ierr;
2440 Vec work;
2441
2442 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2442; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2443 ierr = MatShellGetContext(fetidp_mat,&mat_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2443,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2444 pcis = (PC_IS*)mat_ctx->pc->data;
2445 pcbddc = (PC_BDDC*)mat_ctx->pc->data;
2446
2447 /* apply B_delta^T */
2448 ierr = VecSet(pcis->vec1_B,0.);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2448,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2449 ierr = VecScatterBegin(mat_ctx->l2g_lambda,fetidp_flux_sol,mat_ctx->lambda_local,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2449,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2450 ierr = VecScatterEnd(mat_ctx->l2g_lambda,fetidp_flux_sol,mat_ctx->lambda_local,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2450,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2451 ierr = MatMultTranspose(mat_ctx->B_delta,mat_ctx->lambda_local,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2451,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2452 if (mat_ctx->l2g_p) {
2453 ierr = VecScatterBegin(mat_ctx->l2g_p,fetidp_flux_sol,mat_ctx->vP,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2453,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2454 ierr = VecScatterEnd(mat_ctx->l2g_p,fetidp_flux_sol,mat_ctx->vP,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2454,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2455 ierr = MatMultAdd(mat_ctx->Bt_BB,mat_ctx->vP,pcis->vec1_B,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2455,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2456 }
2457
2458 /* compute rhs for BDDC application */
2459 ierr = VecAYPX(pcis->vec1_B,-1.0,mat_ctx->temp_solution_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2459,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2460 if (pcbddc->switch_static) {
2461 ierr = VecCopy(mat_ctx->temp_solution_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2461,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2462 if (mat_ctx->l2g_p) {
2463 ierr = VecScale(mat_ctx->vP,-1.);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2463,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2464 ierr = MatMultAdd(mat_ctx->Bt_BI,mat_ctx->vP,pcis->vec1_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2464,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2465 }
2466 }
2467
2468 /* apply BDDC */
2469 ierr = PetscArrayzero(pcbddc->benign_p0,pcbddc->benign_n)PetscMemzero(pcbddc->benign_p0,(pcbddc->benign_n)*sizeof
(*(pcbddc->benign_p0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2469,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2470 ierr = PCBDDCApplyInterfacePreconditioner(mat_ctx->pc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2470,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2471
2472 /* put values into global vector */
2473 if (pcbddc->ChangeOfBasisMatrix) work = pcbddc->work_change;
2474 else work = standard_sol;
2475 ierr = VecScatterBegin(pcis->global_to_B,pcis->vec1_B,work,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2475,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2476 ierr = VecScatterEnd(pcis->global_to_B,pcis->vec1_B,work,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2476,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2477 if (!pcbddc->switch_static) {
2478 /* compute values into the interior if solved for the partially subassembled Schur complement */
2479 ierr = MatMult(pcis->A_IB,pcis->vec1_B,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2479,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2480 ierr = VecAYPX(pcis->vec1_D,-1.0,mat_ctx->temp_solution_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2480,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2481 ierr = KSPSolve(pcbddc->ksp_D,pcis->vec1_D,pcis->vec1_D);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2481,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2482 /* Cannot propagate up error in KSPSolve() because there is no access to the PC */
2483 }
2484
2485 ierr = VecScatterBegin(pcis->global_to_D,pcis->vec1_D,work,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2485,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2486 ierr = VecScatterEnd(pcis->global_to_D,pcis->vec1_D,work,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2486,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2487 /* add p0 solution to final solution */
2488 ierr = PCBDDCBenignGetOrSetP0(mat_ctx->pc,work,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2488,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2489 if (pcbddc->ChangeOfBasisMatrix) {
2490 ierr = MatMult(pcbddc->ChangeOfBasisMatrix,work,standard_sol);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2490,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2491 }
2492 ierr = PCPostSolve_BDDC(mat_ctx->pc,NULL((void*)0),NULL((void*)0),standard_sol);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2492,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2493 if (mat_ctx->g2g_p) {
2494 ierr = VecScatterBegin(mat_ctx->g2g_p,fetidp_flux_sol,standard_sol,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2494,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2495 ierr = VecScatterEnd(mat_ctx->g2g_p,fetidp_flux_sol,standard_sol,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2495,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2496 }
2497 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)
;
2498}
2499
2500static PetscErrorCode PCView_BDDCIPC(PC pc, PetscViewer viewer)
2501{
2502 PetscErrorCode ierr;
2503 BDDCIPC_ctx bddcipc_ctx;
2504 PetscBool isascii;
2505
2506 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2506; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2507 ierr = PCShellGetContext(pc,(void **)&bddcipc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2507,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2508 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII"ascii",&isascii);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2508,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2509 if (isascii) {
2510 ierr = PetscViewerASCIIPrintf(viewer,"BDDC interface preconditioner\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2510,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2511 }
2512 ierr = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2512,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2513 ierr = PCView(bddcipc_ctx->bddc,viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2513,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2514 ierr = PetscViewerASCIIPopTab(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2514,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2515 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)
;
2516}
2517
2518static PetscErrorCode PCSetUp_BDDCIPC(PC pc)
2519{
2520 PetscErrorCode ierr;
2521 BDDCIPC_ctx bddcipc_ctx;
2522 PetscBool isbddc;
2523 Vec vv;
2524 IS is;
2525 PC_IS *pcis;
2526
2527 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2527; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2528 ierr = PCShellGetContext(pc,(void **)&bddcipc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2528,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2529 ierr = PetscObjectTypeCompare((PetscObject)bddcipc_ctx->bddc,PCBDDC"bddc",&isbddc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2529,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2530 if (!isbddc) SETERRQ1(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"Invalid type %s. Must be of type bddc",((PetscObject)bddcipc_ctx->bddc)->type_name)return PetscError(PetscObjectComm((PetscObject)pc),2530,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Invalid type %s. Must be of type bddc",
((PetscObject)bddcipc_ctx->bddc)->type_name)
;
2531 ierr = PCSetUp(bddcipc_ctx->bddc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2531,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2532
2533 /* create interface scatter */
2534 pcis = (PC_IS*)(bddcipc_ctx->bddc->data);
2535 ierr = VecScatterDestroy(&bddcipc_ctx->g2l);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2535,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2536 ierr = MatCreateVecs(pc->pmat,&vv,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2536,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2537 ierr = ISRenumber(pcis->is_B_global,NULL((void*)0),NULL((void*)0),&is);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2537,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2538 ierr = VecScatterCreate(vv,is,pcis->vec1_B,NULL((void*)0),&bddcipc_ctx->g2l);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2538,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2539 ierr = ISDestroy(&is);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2539,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2540 ierr = VecDestroy(&vv);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2540,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2541 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)
;
2542}
2543
2544static PetscErrorCode PCApply_BDDCIPC(PC pc, Vec r, Vec x)
2545{
2546 PetscErrorCode ierr;
2547 BDDCIPC_ctx bddcipc_ctx;
2548 PC_IS *pcis;
2549 VecScatter tmps;
2550
2551 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2551; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2552 ierr = PCShellGetContext(pc,(void **)&bddcipc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2552,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2553 pcis = (PC_IS*)(bddcipc_ctx->bddc->data);
2554 tmps = pcis->global_to_B;
2555 pcis->global_to_B = bddcipc_ctx->g2l;
2556 ierr = PCBDDCScalingRestriction(bddcipc_ctx->bddc,r,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2556,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2557 ierr = PCBDDCApplyInterfacePreconditioner(bddcipc_ctx->bddc,PETSC_FALSE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2557,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2558 ierr = PCBDDCScalingExtension(bddcipc_ctx->bddc,pcis->vec1_B,x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2558,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2559 pcis->global_to_B = tmps;
2560 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)
;
2561}
2562
2563static PetscErrorCode PCApplyTranspose_BDDCIPC(PC pc, Vec r, Vec x)
2564{
2565 PetscErrorCode ierr;
2566 BDDCIPC_ctx bddcipc_ctx;
2567 PC_IS *pcis;
2568 VecScatter tmps;
2569
2570 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2570; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2571 ierr = PCShellGetContext(pc,(void **)&bddcipc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2571,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2572 pcis = (PC_IS*)(bddcipc_ctx->bddc->data);
2573 tmps = pcis->global_to_B;
2574 pcis->global_to_B = bddcipc_ctx->g2l;
2575 ierr = PCBDDCScalingRestriction(bddcipc_ctx->bddc,r,pcis->vec1_B);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2575,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2576 ierr = PCBDDCApplyInterfacePreconditioner(bddcipc_ctx->bddc,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2576,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2577 ierr = PCBDDCScalingExtension(bddcipc_ctx->bddc,pcis->vec1_B,x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2577,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2578 pcis->global_to_B = tmps;
2579 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)
;
2580}
2581
2582static PetscErrorCode PCDestroy_BDDCIPC(PC pc)
2583{
2584 PetscErrorCode ierr;
2585 BDDCIPC_ctx bddcipc_ctx;
2586
2587 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2587; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2588 ierr = PCShellGetContext(pc,(void **)&bddcipc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2588,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2589 ierr = PCDestroy(&bddcipc_ctx->bddc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2589,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2590 ierr = VecScatterDestroy(&bddcipc_ctx->g2l);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2590,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2591 ierr = PetscFree(bddcipc_ctx)((*PetscTrFree)((void*)(bddcipc_ctx),2591,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((bddcipc_ctx) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2591,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2592 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)
;
2593}
2594
2595/*@
2596 PCBDDCMatFETIDPGetSolution - Compute the physical solution using the solution of the FETI-DP linear system
2597
2598 Collective
2599
2600 Input Parameters:
2601+ fetidp_mat - the FETI-DP matrix obtained by a call to PCBDDCCreateFETIDPOperators
2602- fetidp_flux_sol - the solution of the FETI-DP linear system
2603
2604 Output Parameters:
2605. standard_sol - the solution defined on the physical domain
2606
2607 Level: developer
2608
2609 Notes:
2610
2611.seealso: PCBDDC, PCBDDCCreateFETIDPOperators, PCBDDCMatFETIDPGetRHS
2612@*/
2613PetscErrorCode PCBDDCMatFETIDPGetSolution(Mat fetidp_mat, Vec fetidp_flux_sol, Vec standard_sol)
2614{
2615 FETIDPMat_ctx mat_ctx;
2616 PetscErrorCode ierr;
2617
2618 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2618; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2619 PetscValidHeaderSpecific(fetidp_mat,MAT_CLASSID,1)do { if (!fetidp_mat) return PetscError(((MPI_Comm)0x44000001
),2619,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(fetidp_mat,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),2619,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(fetidp_mat))->classid != MAT_CLASSID
) { if (((PetscObject)(fetidp_mat))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),2619,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),2619,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
2620 PetscValidHeaderSpecific(fetidp_flux_sol,VEC_CLASSID,2)do { if (!fetidp_flux_sol) return PetscError(((MPI_Comm)0x44000001
),2620,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",2); if (
!PetscCheckPointer(fetidp_flux_sol,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),2620,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,2); if (((PetscObject)(fetidp_flux_sol))->classid != VEC_CLASSID
) { if (((PetscObject)(fetidp_flux_sol))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),2620,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,2); else return PetscError(((MPI_Comm)0x44000001),2620,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",2
); } } while (0)
;
2621 PetscValidHeaderSpecific(standard_sol,VEC_CLASSID,3)do { if (!standard_sol) return PetscError(((MPI_Comm)0x44000001
),2621,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",3); if (
!PetscCheckPointer(standard_sol,PETSC_OBJECT)) return PetscError
(((MPI_Comm)0x44000001),2621,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,3); if (((PetscObject)(standard_sol))->classid != VEC_CLASSID
) { if (((PetscObject)(standard_sol))->classid == -1) return
PetscError(((MPI_Comm)0x44000001),2621,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,3); else return PetscError(((MPI_Comm)0x44000001),2621,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",3
); } } while (0)
;
2622 ierr = MatShellGetContext(fetidp_mat,&mat_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2622,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2623 ierr = PetscUseMethod(mat_ctx->pc,"PCBDDCMatFETIDPGetSolution_C",(Mat,Vec,Vec),(fetidp_mat,fetidp_flux_sol,standard_sol))0; do { PetscErrorCode (*_7_f)(Mat,Vec,Vec), _7_ierr; _7_ierr
= PetscObjectQueryFunction_Private(((PetscObject)(mat_ctx->
pc)),("PCBDDCMatFETIDPGetSolution_C"),(PetscVoidFunction*)(&
_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),2623,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(fetidp_mat,fetidp_flux_sol,standard_sol);do {if (__builtin_expect
(!!(_7_ierr),0)) return PetscError(((MPI_Comm)0x44000001),2623
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(mat_ctx->pc)),2623,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"Cannot locate function %s in object","PCBDDCMatFETIDPGetSolution_C"
); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2623,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2624 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)
;
2625}
2626
2627static PetscErrorCode PCBDDCCreateFETIDPOperators_BDDC(PC pc, PetscBool fully_redundant, const char* prefix, Mat *fetidp_mat, PC *fetidp_pc)
2628{
2629
2630 FETIDPMat_ctx fetidpmat_ctx;
2631 Mat newmat;
2632 FETIDPPC_ctx fetidppc_ctx;
2633 PC newpc;
2634 MPI_Comm comm;
2635 PetscErrorCode ierr;
2636
2637 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2637; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2638 ierr = PetscObjectGetComm((PetscObject)pc,&comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2638,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2639 /* FETI-DP matrix */
2640 ierr = PCBDDCCreateFETIDPMatContext(pc,&fetidpmat_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2640,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2641 fetidpmat_ctx->fully_redundant = fully_redundant;
2642 ierr = PCBDDCSetupFETIDPMatContext(fetidpmat_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2642,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2643 ierr = MatCreateShell(comm,fetidpmat_ctx->n,fetidpmat_ctx->n,fetidpmat_ctx->N,fetidpmat_ctx->N,fetidpmat_ctx,&newmat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2643,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2644 ierr = PetscObjectSetName((PetscObject)newmat,!fetidpmat_ctx->l2g_lambda_only ? "F" : "G");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2644,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
1
Assuming the condition is false
2
'?' condition is false
2645 ierr = MatShellSetOperation(newmat,MATOP_MULT,(void (*)(void))FETIDPMatMult);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2645,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2646 ierr = MatShellSetOperation(newmat,MATOP_MULT_TRANSPOSE,(void (*)(void))FETIDPMatMultTranspose);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2646,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2647 ierr = MatShellSetOperation(newmat,MATOP_DESTROY,(void (*)(void))PCBDDCDestroyFETIDPMat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2647,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2648 /* propagate MatOptions */
2649 {
2650 PC_BDDC *pcbddc = (PC_BDDC*)fetidpmat_ctx->pc->data;
2651 PetscBool issym;
2652
2653 ierr = MatGetOption(pc->mat,MAT_SYMMETRIC,&issym);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2653,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2654 if (issym || pcbddc->symmetric_primal) {
3
Assuming 'issym' is 0
4
Assuming the condition is false
5
Taking false branch
2655 ierr = MatSetOption(newmat,MAT_SYMMETRIC,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2655,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2656 }
2657 }
2658 ierr = MatSetOptionsPrefix(newmat,prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2658,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2659 ierr = MatAppendOptionsPrefix(newmat,"fetidp_");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2659,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2660 ierr = MatSetUp(newmat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2660,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2661 /* FETI-DP preconditioner */
2662 ierr = PCBDDCCreateFETIDPPCContext(pc,&fetidppc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2662,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2663 ierr = PCBDDCSetupFETIDPPCContext(newmat,fetidppc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2663,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2664 ierr = PCCreate(comm,&newpc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2664,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2665 ierr = PCSetOperators(newpc,newmat,newmat);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2665,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2666 ierr = PCSetOptionsPrefix(newpc,prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2666,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2667 ierr = PCAppendOptionsPrefix(newpc,"fetidp_");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2667,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2668 ierr = PCSetErrorIfFailure(newpc,pc->erroriffailure);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2668,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2669 if (!fetidpmat_ctx->l2g_lambda_only) { /* standard FETI-DP */
6
Taking false branch
2670 ierr = PCSetType(newpc,PCSHELL"shell");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2670,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2671 ierr = PCShellSetName(newpc,"FETI-DP multipliers");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2671,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2672 ierr = PCShellSetContext(newpc,fetidppc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2672,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2673 ierr = PCShellSetApply(newpc,FETIDPPCApply);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2673,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2674 ierr = PCShellSetApplyTranspose(newpc,FETIDPPCApplyTranspose);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2674,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2675 ierr = PCShellSetView(newpc,FETIDPPCView);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2675,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2676 ierr = PCShellSetDestroy(newpc,PCBDDCDestroyFETIDPPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2676,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2677 } else { /* saddle-point FETI-DP */
2678 Mat M;
2679 PetscInt psize;
2680 PetscBool fake = PETSC_FALSE, isfieldsplit;
2681
2682 ierr = ISViewFromOptions(fetidpmat_ctx->lagrange,NULL((void*)0),"-lag_view");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2682,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2683 ierr = ISViewFromOptions(fetidpmat_ctx->pressure,NULL((void*)0),"-press_view");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2683,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2684 ierr = PetscObjectQuery((PetscObject)pc,"__KSPFETIDP_PPmat",(PetscObject*)&M);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2684,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2685 ierr = PCSetType(newpc,PCFIELDSPLIT"fieldsplit");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2685,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2686 ierr = PCFieldSplitSetIS(newpc,"lag",fetidpmat_ctx->lagrange);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2686,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2687 ierr = PCFieldSplitSetIS(newpc,"p",fetidpmat_ctx->pressure);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2687,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2688 ierr = PCFieldSplitSetType(newpc,PC_COMPOSITE_SCHUR);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2688,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2689 ierr = PCFieldSplitSetSchurFactType(newpc,PC_FIELDSPLIT_SCHUR_FACT_DIAG);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2689,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2690 ierr = ISGetSize(fetidpmat_ctx->pressure,&psize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2690,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2691 if (psize != M->rmap->N) {
7
Taking false branch
2692 Mat M2;
2693 PetscInt lpsize;
2694
2695 fake = PETSC_TRUE;
2696 ierr = ISGetLocalSize(fetidpmat_ctx->pressure,&lpsize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2696,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2697 ierr = MatCreate(comm,&M2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2697,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2698 ierr = MatSetType(M2,MATAIJ"aij");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2698,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2699 ierr = MatSetSizes(M2,lpsize,lpsize,psize,psize);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2699,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2700 ierr = MatSetUp(M2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2700,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2701 ierr = MatAssemblyBegin(M2,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2701,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2702 ierr = MatAssemblyEnd(M2,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2702,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2703 ierr = PCFieldSplitSetSchurPre(newpc,PC_FIELDSPLIT_SCHUR_PRE_USER,M2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2703,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2704 ierr = MatDestroy(&M2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2704,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2705 } else {
2706 ierr = PCFieldSplitSetSchurPre(newpc,PC_FIELDSPLIT_SCHUR_PRE_USER,M);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2706,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2707 }
2708 ierr = PCFieldSplitSetSchurScale(newpc,1.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2708,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2709
2710 /* we need to setfromoptions and setup here to access the blocks */
2711 ierr = PCSetFromOptions(newpc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2711,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2712 ierr = PCSetUp(newpc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2712,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2713
2714 /* user may have changed the type (e.g. -fetidp_pc_type none) */
2715 ierr = PetscObjectTypeCompare((PetscObject)newpc,PCFIELDSPLIT"fieldsplit",&isfieldsplit);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2715,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2716 if (isfieldsplit) {
8
Assuming 'isfieldsplit' is not equal to 0
9
Taking true branch
2717 KSP *ksps;
2718 PC ppc,lagpc;
2719 PetscInt nn;
2720 PetscBool ismatis,matisok = PETSC_FALSE,check = PETSC_FALSE;
2721
2722 /* set the solver for the (0,0) block */
2723 ierr = PCFieldSplitSchurGetSubKSP(newpc,&nn,&ksps);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2723,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2724 if (!nn) { /* not of type PC_COMPOSITE_SCHUR */
10
Assuming 'nn' is not equal to 0
11
Taking false branch
2725 ierr = PCFieldSplitGetSubKSP(newpc,&nn,&ksps);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2725,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2726 if (!fake) { /* pass pmat to the pressure solver */
2727 Mat F;
2728
2729 ierr = KSPGetOperators(ksps[1],&F,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2729,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2730 ierr = KSPSetOperators(ksps[1],F,M);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2730,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2731 }
2732 } else {
2733 PetscBool issym;
2734 Mat S;
2735
2736 ierr = PCFieldSplitSchurGetS(newpc,&S);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2736,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2737
2738 ierr = MatGetOption(newmat,MAT_SYMMETRIC,&issym);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2738,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2739 if (issym) {
12
Assuming 'issym' is 0
13
Taking false branch
2740 ierr = MatSetOption(S,MAT_SYMMETRIC,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2740,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2741 }
2742 }
2743 ierr = KSPGetPC(ksps[0],&lagpc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2743,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2744 ierr = PCSetType(lagpc,PCSHELL"shell");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2744,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2745 ierr = PCShellSetName(lagpc,"FETI-DP multipliers");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2745,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2746 ierr = PCShellSetContext(lagpc,fetidppc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2746,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2747 ierr = PCShellSetApply(lagpc,FETIDPPCApply);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2747,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2748 ierr = PCShellSetApplyTranspose(lagpc,FETIDPPCApplyTranspose);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2748,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2749 ierr = PCShellSetView(lagpc,FETIDPPCView);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2749,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2750 ierr = PCShellSetDestroy(lagpc,PCBDDCDestroyFETIDPPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2750,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2751
2752 /* Olof's idea: interface Schur complement preconditioner for the mass matrix */
2753 ierr = KSPGetPC(ksps[1],&ppc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2753,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2754 if (fake) {
14
Taking false branch
2755 BDDCIPC_ctx bddcipc_ctx;
2756 PetscContainer c;
2757
2758 matisok = PETSC_TRUE;
2759
2760 /* create inner BDDC solver */
2761 ierr = PetscNew(&bddcipc_ctx)PetscMallocA(1,PETSC_TRUE,2761,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(1)*sizeof(**((&bddcipc_ctx))),((&bddcipc_ctx
)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2761,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2762 ierr = PCCreate(comm,&bddcipc_ctx->bddc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2762,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2763 ierr = PCSetType(bddcipc_ctx->bddc,PCBDDC"bddc");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2763,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2764 ierr = PCSetOperators(bddcipc_ctx->bddc,M,M);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2764,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2765 ierr = PetscObjectQuery((PetscObject)pc,"__KSPFETIDP_pCSR",(PetscObject*)&c);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2765,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2766 ierr = PetscObjectTypeCompare((PetscObject)M,MATIS"is",&ismatis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2766,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2767 if (c && ismatis) {
2768 Mat lM;
2769 PetscInt *csr,n;
2770
2771 ierr = MatISGetLocalMat(M,&lM);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2771,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2772 ierr = MatGetSize(lM,&n,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2772,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2773 ierr = PetscContainerGetPointer(c,(void**)&csr);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2773,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2774 ierr = PCBDDCSetLocalAdjacencyGraph(bddcipc_ctx->bddc,n,csr,csr + (n + 1),PETSC_COPY_VALUES);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2774,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2775 ierr = MatISRestoreLocalMat(M,&lM);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2775,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2776 }
2777 ierr = PCSetOptionsPrefix(bddcipc_ctx->bddc,((PetscObject)ksps[1])->prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2777,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2778 ierr = PCSetErrorIfFailure(bddcipc_ctx->bddc,pc->erroriffailure);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2778,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2779 ierr = PCSetFromOptions(bddcipc_ctx->bddc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2779,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2780
2781 /* wrap the interface application */
2782 ierr = PCSetType(ppc,PCSHELL"shell");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2782,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2783 ierr = PCShellSetName(ppc,"FETI-DP pressure");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2783,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2784 ierr = PCShellSetContext(ppc,bddcipc_ctx);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2784,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2785 ierr = PCShellSetSetUp(ppc,PCSetUp_BDDCIPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2785,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2786 ierr = PCShellSetApply(ppc,PCApply_BDDCIPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2786,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2787 ierr = PCShellSetApplyTranspose(ppc,PCApplyTranspose_BDDCIPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2787,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2788 ierr = PCShellSetView(ppc,PCView_BDDCIPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2788,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2789 ierr = PCShellSetDestroy(ppc,PCDestroy_BDDCIPC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2789,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2790 }
2791
2792 /* determine if we need to assemble M to construct a preconditioner */
2793 if (!matisok) {
15
Taking true branch
2794 ierr = PetscObjectTypeCompare((PetscObject)M,MATIS"is",&ismatis);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2794,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2795 ierr = PetscObjectTypeCompareAny((PetscObject)ppc,&matisok,PCBDDC"bddc",PCJACOBI"jacobi",PCNONE"none",PCMG"mg","");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2795,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2796 if (ismatis && !matisok) {
16
Assuming 'ismatis' is 0
2797 ierr = MatConvert(M,MATAIJ"aij",MAT_INPLACE_MATRIX,&M);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2797,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2798 }
2799 }
2800
2801 /* run the subproblems to check convergence */
2802 ierr = PetscOptionsGetBool(NULL((void*)0),((PetscObject)newmat)->prefix,"-check_saddlepoint",&check,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2802,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2803 if (check) {
17
Assuming 'check' is not equal to 0
18
Taking true branch
2804 PetscInt i;
2805
2806 for (i=0;i<nn;i++) {
19
Assuming 'i' is < 'nn'
20
Loop condition is true. Entering loop body
2807 KSP kspC;
2808 PC pc;
21
'pc' declared without an initial value
2809 Mat F,pF;
2810 Vec x,y;
2811 PetscBool isschur,prec = PETSC_TRUE;
2812
2813 ierr = KSPCreate(PetscObjectComm((PetscObject)ksps[i]),&kspC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2813,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2814 ierr = KSPSetOptionsPrefix(kspC,((PetscObject)ksps[i])->prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2814,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2815 ierr = KSPAppendOptionsPrefix(kspC,"check_");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2815,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2816 ierr = KSPGetOperators(ksps[i],&F,&pF);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2816,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2817 ierr = PetscObjectTypeCompare((PetscObject)F,MATSCHURCOMPLEMENT"schurcomplement",&isschur);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2817,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2818 if (isschur) {
22
Assuming 'isschur' is 0
23
Taking false branch
2819 KSP kspS,kspS2;
2820 Mat A00,pA00,A10,A01,A11;
2821 char prefix[256];
2822
2823 ierr = MatSchurComplementGetKSP(F,&kspS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2823,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2824 ierr = MatSchurComplementGetSubMatrices(F,&A00,&pA00,&A01,&A10,&A11);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2824,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2825 ierr = MatCreateSchurComplement(A00,pA00,A01,A10,A11,&F);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2825,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2826 ierr = MatSchurComplementGetKSP(F,&kspS2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2826,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2827 ierr = PetscSNPrintf(prefix,sizeof(prefix),"%sschur_",((PetscObject)kspC)->prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2827,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2828 ierr = KSPSetOptionsPrefix(kspS2,prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2828,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2829 ierr = KSPGetPC(kspS2,&pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2829,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2830 ierr = PCSetType(pc,PCKSP"ksp");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2830,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2831 ierr = PCKSPSetKSP(pc,kspS);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2831,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2832 ierr = KSPSetFromOptions(kspS2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2832,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2833 ierr = KSPGetPC(kspS2,&pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2833,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2834 ierr = PCSetUseAmat(pc,PETSC_TRUE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2834,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2835 } else {
2836 ierr = PetscObjectReference((PetscObject)F);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2836,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2837 }
2838 ierr = KSPSetFromOptions(kspC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2838,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2839 ierr = PetscOptionsGetBool(NULL((void*)0),((PetscObject)kspC)->prefix,"-preconditioned",&prec,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2839,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2840 if (prec) {
24
Assuming 'prec' is 0
25
Taking false branch
2841 ierr = KSPGetPC(ksps[i],&pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2841,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2842 ierr = KSPSetPC(kspC,pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2842,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2843 }
2844 ierr = KSPSetOperators(kspC,F,pF);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2844,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2845 ierr = MatCreateVecs(F,&x,&y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2845,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2846 ierr = VecSetRandom(x,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2846,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2847 ierr = MatMult(F,x,y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2847,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2848 ierr = KSPSolve(kspC,y,x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2848,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2849 ierr = KSPCheckSolve(kspC,pc,x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2849,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
26
2nd function call argument is an uninitialized value
2850 ierr = KSPDestroy(&kspC);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2850,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2851 ierr = MatDestroy(&F);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2851,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2852 ierr = VecDestroy(&x);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2852,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2853 ierr = VecDestroy(&y);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2853,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2854 }
2855 }
2856 ierr = PetscFree(ksps)((*PetscTrFree)((void*)(ksps),2856,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
) || ((ksps) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2856,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2857 }
2858 }
2859 /* return pointers for objects created */
2860 *fetidp_mat = newmat;
2861 *fetidp_pc = newpc;
2862 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)
;
2863}
2864
2865/*@C
2866 PCBDDCCreateFETIDPOperators - Create FETI-DP operators
2867
2868 Collective
2869
2870 Input Parameters:
2871+ pc - the BDDC preconditioning context (setup should have been called before)
2872. fully_redundant - true for a fully redundant set of Lagrange multipliers
2873- prefix - optional options database prefix for the objects to be created (can be NULL)
2874
2875 Output Parameters:
2876+ fetidp_mat - shell FETI-DP matrix object
2877- fetidp_pc - shell Dirichlet preconditioner for FETI-DP matrix
2878
2879 Level: developer
2880
2881 Notes:
2882 Currently the only operations provided for FETI-DP matrix are MatMult and MatMultTranspose
2883
2884.seealso: PCBDDC, PCBDDCMatFETIDPGetRHS, PCBDDCMatFETIDPGetSolution
2885@*/
2886PetscErrorCode PCBDDCCreateFETIDPOperators(PC pc, PetscBool fully_redundant, const char *prefix, Mat *fetidp_mat, PC *fetidp_pc)
2887{
2888 PetscErrorCode ierr;
2889
2890 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2890; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2891 PetscValidHeaderSpecific(pc,PC_CLASSID,1)do { if (!pc) return PetscError(((MPI_Comm)0x44000001),2891,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",85
,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (!PetscCheckPointer
(pc,PETSC_OBJECT)) return PetscError(((MPI_Comm)0x44000001),2891
,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(pc))->classid != PC_CLASSID) { if (
((PetscObject)(pc))->classid == -1) return PetscError(((MPI_Comm
)0x44000001),2891,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),2891,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",62
,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d",1
); } } while (0)
;
2892 if (pc->setupcalled) {
2893 ierr = PetscUseMethod(pc,"PCBDDCCreateFETIDPOperators_C",(PC,PetscBool,const char*,Mat*,PC*),(pc,fully_redundant,prefix,fetidp_mat,fetidp_pc))0; do { PetscErrorCode (*_7_f)(PC,PetscBool,const char*,Mat*,
PC*), _7_ierr; _7_ierr = PetscObjectQueryFunction_Private(((PetscObject
)(pc)),("PCBDDCCreateFETIDPOperators_C"),(PetscVoidFunction*)
(&_7_f));do {if (__builtin_expect(!!(_7_ierr),0)) return PetscError
(((MPI_Comm)0x44000001),2893,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (_7_f) {_7_ierr
= (*_7_f)(pc,fully_redundant,prefix,fetidp_mat,fetidp_pc);do
{if (__builtin_expect(!!(_7_ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2893,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0);} else return PetscError
(PetscObjectComm((PetscObject)(pc)),2893,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,56,PETSC_ERROR_INITIAL,"Cannot locate function %s in object"
,"PCBDDCCreateFETIDPOperators_C"); } while(0)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2893,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2894 } else SETERRQ(PetscObjectComm((PetscObject)pc),PETSC_ERR_SUP,"You must call PCSetup_BDDC() first")return PetscError(PetscObjectComm((PetscObject)pc),2894,__func__
,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c",56
,PETSC_ERROR_INITIAL,"You must call PCSetup_BDDC() first")
;
2895 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)
;
2896}
2897/* -------------------------------------------------------------------------- */
2898/*MC
2899 PCBDDC - Balancing Domain Decomposition by Constraints.
2900
2901 An implementation of the BDDC preconditioner based on
2902
2903.vb
2904 [1] C. R. Dohrmann. "An approximate BDDC preconditioner", Numerical Linear Algebra with Applications Volume 14, Issue 2, pages 149-168, March 2007
2905 [2] A. Klawonn and O. B. Widlund. "Dual-Primal FETI Methods for Linear Elasticity", https://cs.nyu.edu/dynamic/reports/?year=all
2906 [3] J. Mandel, B. Sousedik, C. R. Dohrmann. "Multispace and Multilevel BDDC", https://arxiv.org/abs/0712.3977
2907 [4] C. Pechstein and C. R. Dohrmann. "Modern domain decomposition methods BDDC, deluxe scaling, and an algebraic approach", Seminar talk, Linz, December 2013, http://people.ricam.oeaw.ac.at/c.pechstein/pechstein-bddc2013.pdf
2908.ve
2909
2910 The matrix to be preconditioned (Pmat) must be of type MATIS.
2911
2912 Currently works with MATIS matrices with local matrices of type MATSEQAIJ, MATSEQBAIJ or MATSEQSBAIJ, either with real or complex numbers.
2913
2914 It also works with unsymmetric and indefinite problems.
2915
2916 Unlike 'conventional' interface preconditioners, PCBDDC iterates over all degrees of freedom, not just those on the interface. This allows the use of approximate solvers on the subdomains.
2917
2918 Approximate local solvers are automatically adapted (see [1]) if the user has attached a nullspace object to the subdomain matrices, and informed BDDC of using approximate solvers (via the command line).
2919
2920 Boundary nodes are split in vertices, edges and faces classes using information from the local to global mapping of dofs and the local connectivity graph of nodes. The latter can be customized by using PCBDDCSetLocalAdjacencyGraph()
2921 Additional information on dofs can be provided by using PCBDDCSetDofsSplitting(), PCBDDCSetDirichletBoundaries(), PCBDDCSetNeumannBoundaries(), and PCBDDCSetPrimalVerticesIS() and their local counterparts.
2922
2923 Constraints can be customized by attaching a MatNullSpace object to the MATIS matrix via MatSetNearNullSpace(). Non-singular modes are retained via SVD.
2924
2925 Change of basis is performed similarly to [2] when requested. When more than one constraint is present on a single connected component (i.e. an edge or a face), a robust method based on local QR factorizations is used.
2926 User defined change of basis can be passed to PCBDDC by using PCBDDCSetChangeOfBasisMat()
2927
2928 The PETSc implementation also supports multilevel BDDC [3]. Coarse grids are partitioned using a MatPartitioning object.
2929
2930 Adaptive selection of primal constraints [4] is supported for SPD systems with high-contrast in the coefficients if MUMPS or MKL_PARDISO are present. Future versions of the code will also consider using PASTIX.
2931
2932 An experimental interface to the FETI-DP method is available. FETI-DP operators could be created using PCBDDCCreateFETIDPOperators(). A stand-alone class for the FETI-DP method will be provided in the next releases.
2933 Deluxe scaling is not supported yet for FETI-DP.
2934
2935 Options Database Keys (some of them, run with -h for a complete list):
2936
2937+ -pc_bddc_use_vertices <true> - use or not vertices in primal space
2938. -pc_bddc_use_edges <true> - use or not edges in primal space
2939. -pc_bddc_use_faces <false> - use or not faces in primal space
2940. -pc_bddc_symmetric <true> - symmetric computation of primal basis functions. Specify false for unsymmetric problems
2941. -pc_bddc_use_change_of_basis <false> - use change of basis approach (on edges only)
2942. -pc_bddc_use_change_on_faces <false> - use change of basis approach on faces if change of basis has been requested
2943. -pc_bddc_switch_static <false> - switches from M_2 (default) to M_3 operator (see reference article [1])
2944. -pc_bddc_levels <0> - maximum number of levels for multilevel
2945. -pc_bddc_coarsening_ratio <8> - number of subdomains which will be aggregated together at the coarser level (e.g. H/h ratio at the coarser level, significative only in the multilevel case)
2946. -pc_bddc_coarse_redistribute <0> - size of a subset of processors where the coarse problem will be remapped (the value is ignored if not at the coarsest level)
2947. -pc_bddc_use_deluxe_scaling <false> - use deluxe scaling
2948. -pc_bddc_schur_layers <-1> - select the economic version of deluxe scaling by specifying the number of layers (-1 corresponds to the original deluxe scaling)
2949. -pc_bddc_adaptive_threshold <0.0> - when a value different than zero is specified, adaptive selection of constraints is performed on edges and faces (requires deluxe scaling and MUMPS or MKL_PARDISO installed)
2950- -pc_bddc_check_level <0> - set verbosity level of debugging output
2951
2952 Options for Dirichlet, Neumann or coarse solver can be set with
2953.vb
2954 -pc_bddc_dirichlet_
2955 -pc_bddc_neumann_
2956 -pc_bddc_coarse_
2957.ve
2958 e.g -pc_bddc_dirichlet_ksp_type richardson -pc_bddc_dirichlet_pc_type gamg. PCBDDC uses by default KPSPREONLY and PCLU.
2959
2960 When using a multilevel approach, solvers' options at the N-th level (N > 1) can be specified as
2961.vb
2962 -pc_bddc_dirichlet_lN_
2963 -pc_bddc_neumann_lN_
2964 -pc_bddc_coarse_lN_
2965.ve
2966 Note that level number ranges from the finest (0) to the coarsest (N).
2967 In order to specify options for the BDDC operators at the coarser levels (and not for the solvers), prepend -pc_bddc_coarse_ or -pc_bddc_coarse_l to the option, e.g.
2968.vb
2969 -pc_bddc_coarse_pc_bddc_adaptive_threshold 5 -pc_bddc_coarse_l1_pc_bddc_redistribute 3
2970.ve
2971 will use a threshold of 5 for constraints' selection at the first coarse level and will redistribute the coarse problem of the first coarse level on 3 processors
2972
2973 Level: intermediate
2974
2975 Developer Notes:
2976
2977 Contributed by Stefano Zampini
2978
2979.seealso: PCCreate(), PCSetType(), PCType (for list of available types), PC, MATIS
2980M*/
2981
2982PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PCCreate_BDDC(PC pc)
2983{
2984 PetscErrorCode ierr;
2985 PC_BDDC *pcbddc;
2986
2987 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 2987; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
2988 ierr = PetscNewLog(pc,&pcbddc)(PetscMallocA(1,PETSC_TRUE,2988,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,(size_t)(1)*sizeof(**(((&pcbddc)))),(((&pcbddc)))) ||
PetscLogObjectMemory((PetscObject)pc,sizeof(**(&pcbddc))
))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2988,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2989 pc->data = (void*)pcbddc;
2990
2991 /* create PCIS data structure */
2992 ierr = PCISCreate(pc);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2992,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2993
2994 /* create local graph structure */
2995 ierr = PCBDDCGraphCreate(&pcbddc->mat_graph);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),2995,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
2996
2997 /* BDDC nonzero defaults */
2998 pcbddc->use_local_adj = PETSC_TRUE;
2999 pcbddc->use_vertices = PETSC_TRUE;
3000 pcbddc->use_edges = PETSC_TRUE;
3001 pcbddc->symmetric_primal = PETSC_TRUE;
3002 pcbddc->vertex_size = 1;
3003 pcbddc->recompute_topography = PETSC_TRUE;
3004 pcbddc->coarse_size = -1;
3005 pcbddc->use_exact_dirichlet_trick = PETSC_TRUE;
3006 pcbddc->coarsening_ratio = 8;
3007 pcbddc->coarse_eqs_per_proc = 1;
3008 pcbddc->benign_compute_correction = PETSC_TRUE;
3009 pcbddc->nedfield = -1;
3010 pcbddc->nedglobal = PETSC_TRUE;
3011 pcbddc->graphmaxcount = PETSC_MAX_INT2147483647;
3012 pcbddc->sub_schurs_layers = -1;
3013 pcbddc->adaptive_threshold[0] = 0.0;
3014 pcbddc->adaptive_threshold[1] = 0.0;
3015
3016 /* function pointers */
3017 pc->ops->apply = PCApply_BDDC;
3018 pc->ops->applytranspose = PCApplyTranspose_BDDC;
3019 pc->ops->setup = PCSetUp_BDDC;
3020 pc->ops->destroy = PCDestroy_BDDC;
3021 pc->ops->setfromoptions = PCSetFromOptions_BDDC;
3022 pc->ops->view = PCView_BDDC;
3023 pc->ops->applyrichardson = 0;
3024 pc->ops->applysymmetricleft = 0;
3025 pc->ops->applysymmetricright = 0;
3026 pc->ops->presolve = PCPreSolve_BDDC;
3027 pc->ops->postsolve = PCPostSolve_BDDC;
3028 pc->ops->reset = PCReset_BDDC;
3029
3030 /* composing function */
3031 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDiscreteGradient_C",PCBDDCSetDiscreteGradient_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDiscreteGradient_C"
,(PetscVoidFunction)(PCBDDCSetDiscreteGradient_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3031,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3032 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDivergenceMat_C",PCBDDCSetDivergenceMat_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDivergenceMat_C"
,(PetscVoidFunction)(PCBDDCSetDivergenceMat_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3032,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3033 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetChangeOfBasisMat_C",PCBDDCSetChangeOfBasisMat_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetChangeOfBasisMat_C"
,(PetscVoidFunction)(PCBDDCSetChangeOfBasisMat_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3033,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3034 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetPrimalVerticesLocalIS_C",PCBDDCSetPrimalVerticesLocalIS_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetPrimalVerticesLocalIS_C"
,(PetscVoidFunction)(PCBDDCSetPrimalVerticesLocalIS_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3034,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3035 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetPrimalVerticesIS_C",PCBDDCSetPrimalVerticesIS_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetPrimalVerticesIS_C"
,(PetscVoidFunction)(PCBDDCSetPrimalVerticesIS_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3035,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3036 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetPrimalVerticesLocalIS_C",PCBDDCGetPrimalVerticesLocalIS_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetPrimalVerticesLocalIS_C"
,(PetscVoidFunction)(PCBDDCGetPrimalVerticesLocalIS_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3036,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3037 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetPrimalVerticesIS_C",PCBDDCGetPrimalVerticesIS_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetPrimalVerticesIS_C"
,(PetscVoidFunction)(PCBDDCGetPrimalVerticesIS_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3037,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3038 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetCoarseningRatio_C",PCBDDCSetCoarseningRatio_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetCoarseningRatio_C"
,(PetscVoidFunction)(PCBDDCSetCoarseningRatio_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3038,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3039 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetLevel_C",PCBDDCSetLevel_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetLevel_C"
,(PetscVoidFunction)(PCBDDCSetLevel_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3039,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3040 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetUseExactDirichlet_C",PCBDDCSetUseExactDirichlet_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetUseExactDirichlet_C"
,(PetscVoidFunction)(PCBDDCSetUseExactDirichlet_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3040,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3041 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetLevels_C",PCBDDCSetLevels_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetLevels_C"
,(PetscVoidFunction)(PCBDDCSetLevels_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3041,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3042 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDirichletBoundaries_C",PCBDDCSetDirichletBoundaries_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDirichletBoundaries_C"
,(PetscVoidFunction)(PCBDDCSetDirichletBoundaries_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3042,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3043 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDirichletBoundariesLocal_C",PCBDDCSetDirichletBoundariesLocal_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDirichletBoundariesLocal_C"
,(PetscVoidFunction)(PCBDDCSetDirichletBoundariesLocal_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3043,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3044 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetNeumannBoundaries_C",PCBDDCSetNeumannBoundaries_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetNeumannBoundaries_C"
,(PetscVoidFunction)(PCBDDCSetNeumannBoundaries_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3044,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3045 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetNeumannBoundariesLocal_C",PCBDDCSetNeumannBoundariesLocal_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetNeumannBoundariesLocal_C"
,(PetscVoidFunction)(PCBDDCSetNeumannBoundariesLocal_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3045,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3046 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetDirichletBoundaries_C",PCBDDCGetDirichletBoundaries_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetDirichletBoundaries_C"
,(PetscVoidFunction)(PCBDDCGetDirichletBoundaries_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3046,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3047 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetDirichletBoundariesLocal_C",PCBDDCGetDirichletBoundariesLocal_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetDirichletBoundariesLocal_C"
,(PetscVoidFunction)(PCBDDCGetDirichletBoundariesLocal_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3047,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3048 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetNeumannBoundaries_C",PCBDDCGetNeumannBoundaries_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetNeumannBoundaries_C"
,(PetscVoidFunction)(PCBDDCGetNeumannBoundaries_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3048,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3049 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCGetNeumannBoundariesLocal_C",PCBDDCGetNeumannBoundariesLocal_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCGetNeumannBoundariesLocal_C"
,(PetscVoidFunction)(PCBDDCGetNeumannBoundariesLocal_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3049,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3050 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDofsSplitting_C",PCBDDCSetDofsSplitting_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDofsSplitting_C"
,(PetscVoidFunction)(PCBDDCSetDofsSplitting_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3050,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3051 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetDofsSplittingLocal_C",PCBDDCSetDofsSplittingLocal_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetDofsSplittingLocal_C"
,(PetscVoidFunction)(PCBDDCSetDofsSplittingLocal_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3051,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3052 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCSetLocalAdjacencyGraph_C",PCBDDCSetLocalAdjacencyGraph_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCSetLocalAdjacencyGraph_C"
,(PetscVoidFunction)(PCBDDCSetLocalAdjacencyGraph_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3052,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3053 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCCreateFETIDPOperators_C",PCBDDCCreateFETIDPOperators_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCCreateFETIDPOperators_C"
,(PetscVoidFunction)(PCBDDCCreateFETIDPOperators_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3053,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3054 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCMatFETIDPGetRHS_C",PCBDDCMatFETIDPGetRHS_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCMatFETIDPGetRHS_C"
,(PetscVoidFunction)(PCBDDCMatFETIDPGetRHS_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3054,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3055 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCBDDCMatFETIDPGetSolution_C",PCBDDCMatFETIDPGetSolution_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCBDDCMatFETIDPGetSolution_C"
,(PetscVoidFunction)(PCBDDCMatFETIDPGetSolution_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3055,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3056 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCPreSolveChangeRHS_C",PCPreSolveChangeRHS_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCPreSolveChangeRHS_C"
,(PetscVoidFunction)(PCPreSolveChangeRHS_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3056,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3057 ierr = PetscObjectComposeFunction((PetscObject)pc,"PCSetCoordinates_C",PCSetCoordinates_BDDC)PetscObjectComposeFunction_Private((PetscObject)pc,"PCSetCoordinates_C"
,(PetscVoidFunction)(PCSetCoordinates_BDDC))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3057,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3058 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)
;
3059}
3060
3061/*@C
3062 PCBDDCInitializePackage - This function initializes everything in the PCBDDC package. It is called
3063 from PCInitializePackage().
3064
3065 Level: developer
3066
3067 .seealso: PetscInitialize()
3068@*/
3069PetscErrorCode PCBDDCInitializePackage(void)
3070{
3071 PetscErrorCode ierr;
3072 int i;
3073
3074 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 3074; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
3075 if (PCBDDCPackageInitialized) 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)
;
3076 PCBDDCPackageInitialized = PETSC_TRUE;
3077 ierr = PetscRegisterFinalize(PCBDDCFinalizePackage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3077,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3078
3079 /* general events */
3080 ierr = PetscLogEventRegister("PCBDDCTopo",PC_CLASSID,&PC_BDDC_Topology[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3080,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3081 ierr = PetscLogEventRegister("PCBDDCLKSP",PC_CLASSID,&PC_BDDC_LocalSolvers[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3081,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3082 ierr = PetscLogEventRegister("PCBDDCLWor",PC_CLASSID,&PC_BDDC_LocalWork[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3082,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3083 ierr = PetscLogEventRegister("PCBDDCCorr",PC_CLASSID,&PC_BDDC_CorrectionSetUp[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3083,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3084 ierr = PetscLogEventRegister("PCBDDCCSet",PC_CLASSID,&PC_BDDC_CoarseSetUp[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3084,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3085 ierr = PetscLogEventRegister("PCBDDCCKSP",PC_CLASSID,&PC_BDDC_CoarseSolver[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3085,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3086 ierr = PetscLogEventRegister("PCBDDCAdap",PC_CLASSID,&PC_BDDC_AdaptiveSetUp[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3086,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3087 ierr = PetscLogEventRegister("PCBDDCScal",PC_CLASSID,&PC_BDDC_Scaling[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3087,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3088 ierr = PetscLogEventRegister("PCBDDCSchr",PC_CLASSID,&PC_BDDC_Schurs[0]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3088,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3089 for (i=1;i<PETSC_PCBDDC_MAXLEVELS8;i++) {
3090 char ename[32];
3091
3092 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCTopo l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3092,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3093 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_Topology[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3093,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3094 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCLKSP l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3094,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3095 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_LocalSolvers[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3095,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3096 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCLWor l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3096,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3097 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_LocalWork[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3097,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3098 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCCorr l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3098,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3099 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_CorrectionSetUp[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3099,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3100 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCCSet l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3100,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3101 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_CoarseSetUp[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3101,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3102 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCCKSP l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3102,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3103 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_CoarseSolver[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3103,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3104 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCAdap l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3104,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3105 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_AdaptiveSetUp[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3105,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3106 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCScal l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3106,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3107 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_Scaling[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3107,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3108 ierr = PetscSNPrintf(ename,sizeof(ename),"PCBDDCSchr l%02d",i);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3108,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3109 ierr = PetscLogEventRegister(ename,PC_CLASSID,&PC_BDDC_Schurs[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),3109,__func__,"/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
3110 }
3111 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)
;
3112}
3113
3114/*@C
3115 PCBDDCFinalizePackage - This function frees everything from the PCBDDC package. It is
3116 called from PetscFinalize() automatically.
3117
3118 Level: developer
3119
3120 .seealso: PetscFinalize()
3121@*/
3122PetscErrorCode PCBDDCFinalizePackage(void)
3123{
3124 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.master/src/ksp/pc/impls/bddc/bddc.c"
; petscstack->line[petscstack->currentsize] = 3124; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
3125 PCBDDCPackageInitialized = PETSC_FALSE;
3126 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)
;
3127}