bps.c (de1229c50b0fa287ef0d97965becc5ec55ca5a76) bps.c (345f5e33518f0ed733cc6f00a8d4b28ffbee7b10)
1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8// libCEED + PETSc Example: CEED BPs

--- 200 unchanged lines hidden (view full) ---

209 user_O->ceed = ceed;
210
211 ierr = KSPCreate(rp->comm, &ksp); CHKERRQ(ierr);
212 {
213 PC pc;
214 ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr);
215 if (rp->bp_choice == CEED_BP1 || rp->bp_choice == CEED_BP2) {
216 ierr = PCSetType(pc, PCJACOBI); CHKERRQ(ierr);
1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8// libCEED + PETSc Example: CEED BPs

--- 200 unchanged lines hidden (view full) ---

209 user_O->ceed = ceed;
210
211 ierr = KSPCreate(rp->comm, &ksp); CHKERRQ(ierr);
212 {
213 PC pc;
214 ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr);
215 if (rp->bp_choice == CEED_BP1 || rp->bp_choice == CEED_BP2) {
216 ierr = PCSetType(pc, PCJACOBI); CHKERRQ(ierr);
217 ierr = PCJacobiSetType(pc, PC_JACOBI_ROWSUM); CHKERRQ(ierr);
217 if (rp->simplex) {
218 ierr = PCJacobiSetType(pc, PC_JACOBI_DIAGONAL); CHKERRQ(ierr);
219 } else {
220 ierr = PCJacobiSetType(pc, PC_JACOBI_ROWSUM); CHKERRQ(ierr);
221 }
218 } else {
219 ierr = PCSetType(pc, PCNONE); CHKERRQ(ierr);
220 }
221 ierr = KSPSetType(ksp, KSPCG); CHKERRQ(ierr);
222 ierr = KSPSetNormType(ksp, KSP_NORM_NATURAL); CHKERRQ(ierr);
223 ierr = KSPSetTolerances(ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT,
224 PETSC_DEFAULT); CHKERRQ(ierr);
225 }

--- 309 unchanged lines hidden ---
222 } else {
223 ierr = PCSetType(pc, PCNONE); CHKERRQ(ierr);
224 }
225 ierr = KSPSetType(ksp, KSPCG); CHKERRQ(ierr);
226 ierr = KSPSetNormType(ksp, KSP_NORM_NATURAL); CHKERRQ(ierr);
227 ierr = KSPSetTolerances(ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT,
228 PETSC_DEFAULT); CHKERRQ(ierr);
229 }

--- 309 unchanged lines hidden ---