| /petsc/include/ |
| H A D | petsccxxcomplexfix.h | 64 …x_extended_type<Cmplex, Atype>::value, Cmplex>::type operator+(const Atype &lhs, const Cmplex &rhs) 66 return PetscReal(lhs) + rhs; 70 …x_extended_type<Cmplex, Atype>::value, Cmplex>::type operator+(const Cmplex &lhs, const Atype &rhs) 72 return lhs + PetscReal(rhs); 76 …x_extended_type<Cmplex, Atype>::value, Cmplex>::type operator-(const Atype &lhs, const Cmplex &rhs) 78 return PetscReal(lhs) - rhs; 82 …x_extended_type<Cmplex, Atype>::value, Cmplex>::type operator-(const Cmplex &lhs, const Atype &rhs) 84 return lhs - PetscReal(rhs); 88 …x_extended_type<Cmplex, Atype>::value, Cmplex>::type operator*(const Atype &lhs, const Cmplex &rhs) 90 return PetscReal(lhs) * rhs; [all …]
|
| /petsc/src/ksp/ksp/tests/ |
| H A D | ex80.c | 14 Vec sol, rhs, newsol, newrhs; in main() local 26 PetscCall(VecDuplicate(sol, &rhs)); in main() 31 PetscCall(VecSetValues(rhs, SIZE - 1, indices, values, INSERT_VALUES)); in main() 34 PetscCall(VecAssemblyBegin(rhs)); in main() 37 PetscCall(VecAssemblyEnd(rhs)); in main() 52 PetscCall(KSPGuessUpdate(guess, rhs, sol)); in main() 70 for (i = 0; i < 15; ++i) PetscCall(KSPGuessUpdate(guess, rhs, sol)); in main() 78 PetscCall(VecDestroy(&rhs)); in main() 97 Vec sol, rhs; in main() local 109 PetscCall(VecCreateSeq(PETSC_COMM_SELF, triangle_size, &rhs)); in main() [all …]
|
| H A D | ex83.c | 12 Vec sol, rhs, sol_nest, rhs_nest; in main() local 33 PetscCall(VecCreateSeq(PETSC_COMM_SELF, triangle_size, &rhs)); in main() 36 PetscCall(VecSetValue(rhs, j, (PetscScalar)j, INSERT_VALUES)); in main() 39 PetscCall(VecAssemblyBegin(rhs)); in main() 41 PetscCall(VecAssemblyEnd(rhs)); in main() 44 PetscCall(VecCreateNest(PETSC_COMM_SELF, 1, NULL, &rhs, &rhs_nest)); in main() 50 PetscCall(VecDestroy(&rhs)); in main() 55 PetscCall(VecCreateSeq(PETSC_COMM_SELF, triangle_size, &rhs)); in main() 56 PetscCall(VecSetValues(rhs, 5, indices, values, INSERT_VALUES)); in main() 57 PetscCall(VecAssemblyBegin(rhs)); in main() [all …]
|
| H A D | ex87.c | 25 Vec rhs, x, r; in main() local 109 PetscCall(MatCreateVecs(H, &x, &rhs)); in main() 111 PetscCall(VecSet(rhs, 1.0)); in main() 112 PetscCall(KSPSolve(ksp, rhs, x)); in main() 115 PetscCall(VecDuplicate(rhs, &r)); in main() 117 PetscCall(VecAXPY(r, -1.0, rhs)); in main() 119 PetscCall(VecNorm(rhs, NORM_2, norm + 1)); in main() 127 PetscCall(VecGetType(rhs, &type)); in main() 172 PetscCall(VecDestroy(&rhs)); in main()
|
| H A D | ex84.c | 6 PetscErrorCode LSCLoadOperators(Mat *A, Mat *Q, Mat *L, Vec *rhs, IS *velocity, IS *pressure) in LSCLoadOperators() argument 18 PetscCall(VecCreate(PETSC_COMM_WORLD, rhs)); in LSCLoadOperators() 24 PetscCall(VecLoad(*rhs, viewer)); in LSCLoadOperators()
|
| /petsc/src/mat/tests/ |
| H A D | ex18.c | 9 Vec x, rhs, y; in main() local 35 PetscCall(MatCreateVecs(A, NULL, &rhs)); in main() 36 PetscCall(VecSetFromOptions(rhs)); in main() 37 PetscCall(VecSetUp(rhs)); in main() 96 PetscCall(VecSetValue(rhs, Ii, rhsval, INSERT_VALUES)); in main() 112 PetscCall(VecAssemblyBegin(rhs)); in main() 113 PetscCall(VecAssemblyEnd(rhs)); in main() 115 if (zerorhs) PetscCall(VecZeroEntries(rhs)); in main() 150 PetscCall(VecDuplicate(rhs, &x)); in main() 171 PetscCall(VecAYPX(y, -1.0, rhs)); in main() [all …]
|
| H A D | ex78.c | 41 char Ain[PETSC_MAX_PATH_LEN], rhs[PETSC_MAX_PATH_LEN], solu[PETSC_MAX_PATH_LEN]; in main() local 92 PetscCall(PetscOptionsGetString(NULL, NULL, "-rhs", rhs, sizeof(rhs), &flg_b)); in main() 98 PetscCall(PetscFOpen(PETSC_COMM_SELF, rhs, "r", &bfile)); in main()
|
| /petsc/src/ksp/ksp/tutorials/ |
| H A D | ex89f.F90 | 22 Vec rhs, solution 32 PetscCallA(VecCreateSeq(PETSC_COMM_SELF, n, rhs, ierr)) 38 PetscCallA(VecGetArray(rhs, b, ierr)) 42 PetscCallA(VecRestoreArray(rhs, b, ierr)) 72 PetscCallA(KSPSolve(ksp, rhs, solution, ierr)) 80 PetscCallA(KSPSolve(ksp, rhs, solution, ierr)) 83 PetscCallA(VecDestroy(rhs, ierr))
|
| H A D | ex88f.F90 | 22 Vec rhs, solution 31 PetscCallA(VecCreateSeq(PETSC_COMM_SELF, n, rhs, ierr)) 35 PetscCallA(VecGetArray(rhs, b, ierr)) 39 PetscCallA(VecRestoreArray(rhs, b, ierr)) 65 PetscCallA(KSPSolve(ksp, rhs, solution, ierr)) 73 PetscCallA(KSPSolve(ksp, rhs, solution, ierr)) 76 PetscCallA(VecDestroy(rhs, ierr))
|
| H A D | ex83f.F90 | 28 Vec rhs, solution 87 PetscCallA(VecCreateSeqWithArray(PETSC_COMM_SELF, one, n, b, rhs, ierr)) 98 PetscCallA(KSPSolve(ksp, rhs, solution, ierr)) 110 PetscCallA(KSPSolve(ksp, rhs, solution, ierr)) 113 PetscCallA(VecDestroy(rhs, ierr))
|
| H A D | ex16.c | 29 PetscScalar v, one = 1.0, rhs; in main() local 157 rhs = one * (PetscReal)k; in main() 158 PetscCall(VecSet(u, rhs)); in main()
|
| /petsc/src/ksp/ksp/tutorials/amrex/ |
| H A D | MyEB.H | 28 FlowerIF (const FlowerIF& rhs) noexcept = default; 29 FlowerIF (FlowerIF&& rhs) noexcept = default; 30 FlowerIF& operator= (const FlowerIF& rhs) = delete; 31 FlowerIF& operator= (FlowerIF&& rhs) = delete;
|
| H A D | MyTest.cxx | 79 mlmg.solve(amrex::GetVecOfPtrs(phi), amrex::GetVecOfConstPtrs(rhs), tol_rel, tol_abs); in solve() 163 rhs.resize(nlevels); in initData() 175 rhs[ilev].define(grids[ilev], dmap[ilev], 1, 0, MFInfo(), *factory[ilev]); in initData() 184 rhs[ilev].setVal(0.0); in initData() 193 for (MFIter mfi(rhs[ilev]); mfi.isValid(); ++mfi) { in initData() 195 Array4<Real> const &fab = rhs[ilev].array(mfi); in initData()
|
| /petsc/src/dm/impls/stag/tests/ |
| H A D | ex18.c | 149 Vec tmp, rhs; in main() local 151 PetscCall(CreateSystem(dmSol, &A, &rhs)); in main() 156 PetscCall(VecGetSubVector(rhs, isuf, &tmp)); in main() 158 PetscCall(VecRestoreSubVector(rhs, isuf, &tmp)); in main() 160 PetscCall(VecDestroy(&rhs)); in main() 255 Vec rhs; in CreateSystem() local 273 rhs = *pRhs; in CreateSystem() 275 rhs = NULL; in CreateSystem() 304 if (rhs) { in CreateSystem() 306 PetscCall(DMStagVecSetValuesStencil(dm, rhs, 1, &row, &valRhs, INSERT_VALUES)); in CreateSystem() [all …]
|
| H A D | ex5.c | 20 Vec sol, solRef, solRefLocal, rhs, rhsLocal; in main() local 35 PetscCall(DMCreateGlobalVector(dmSol, &rhs)); in main() 58 PetscCall(DMLocalToGlobalBegin(dmSol, rhsLocal, INSERT_VALUES, rhs)); in main() 59 PetscCall(DMLocalToGlobalEnd(dmSol, rhsLocal, INSERT_VALUES, rhs)); in main() 78 PetscCall(KSPSolve(ksp, rhs, sol)); in main() 101 PetscCall(VecDestroy(&rhs)); in main()
|
| H A D | ex11.c | 16 Vec sol, solRef, solRefLocal, rhs, rhsLocal; in main() local 38 PetscCall(DMCreateGlobalVector(dmSol, &rhs)); in main() 64 PetscCall(DMLocalToGlobalBegin(dmSol, rhsLocal, INSERT_VALUES, rhs)); in main() 65 PetscCall(DMLocalToGlobalEnd(dmSol, rhsLocal, INSERT_VALUES, rhs)); in main() 84 PetscCall(KSPSolve(ksp, rhs, sol)); in main() 107 PetscCall(VecDestroy(&rhs)); in main()
|
| /petsc/src/dm/impls/swarm/tutorials/ |
| H A D | ex1f90.F90 | 15 Vec :: f, rho, rhs 75 PetscCallA(DMCreateGlobalVector(dm, rhs, ierr)) 77 PetscCallA(MatMult(M, rho, rhs, ierr)) ! this is what you would do for and FE solve 79 PetscCallA(VecCopy(rho, rhs, ierr)) ! Identity: M^1 M rho 85 PetscCallA(KSPSolveTranspose(ksp, rhs, f, ierr)) 87 PetscCallA(VecDestroy(rhs, ierr))
|
| /petsc/src/vec/vec/tests/ |
| H A D | ex63.c | 20 const PetscScalar rhs = arr[i]; in CheckExp() local 22 if (!PetscIsCloseAtTolScalar(lhs, rhs, rtol, atol)) { in CheckExp() 25 const PetscReal rhs_r = PetscRealPart(rhs); in CheckExp() 26 const PetscReal rhs_i = PetscImaginaryPart(rhs); in CheckExp()
|
| H A D | ex64.c | 20 const PetscScalar rhs = arr[i]; in CheckLog() local 22 if (!PetscIsCloseAtTolScalar(lhs, rhs, rtol, atol)) { in CheckLog() 25 const PetscReal rhs_r = PetscRealPart(rhs); in CheckLog() 26 const PetscReal rhs_i = PetscImaginaryPart(rhs); in CheckLog()
|
| /petsc/src/ksp/ksp/interface/ |
| H A D | iguess.c | 304 PetscErrorCode KSPGuessUpdate(KSPGuess guess, Vec rhs, Vec sol) in KSPGuessUpdate() argument 308 PetscValidHeaderSpecific(rhs, VEC_CLASSID, 2); in KSPGuessUpdate() 310 PetscTryTypeMethod(guess, update, rhs, sol); in KSPGuessUpdate() 328 PetscErrorCode KSPGuessFormGuess(KSPGuess guess, Vec rhs, Vec sol) in KSPGuessFormGuess() argument 332 PetscValidHeaderSpecific(rhs, VEC_CLASSID, 2); in KSPGuessFormGuess() 334 PetscTryTypeMethod(guess, formguess, rhs, sol); in KSPGuessFormGuess()
|
| /petsc/src/ksp/pc/impls/tfs/ |
| H A D | xxt.c | 54 static PetscErrorCode do_xxt_solve(xxt_ADT xxt_handle, PetscScalar *rhs); 471 PetscScalar *lhs, *rhs; in det_separators() local 494 rhs = (PetscScalar *)malloc(sizeof(PetscScalar) * m); in det_separators() 524 PetscCall((id < mask) ? PCTFS_rvec_set(rhs, 1.0, m) : PCTFS_rvec_zero(rhs, m)); in det_separators() 525 PetscCall(PCTFS_gs_gop_hc(PCTFS_gs_handle, rhs, "+\0", edge)); in det_separators() 532 if (rhs[i] != 0.0) rhs[i] = 1.0; in det_separators() 537 else PetscCall(PCTFS_gs_gop_hc(PCTFS_gs_handle, rhs, "+\0", edge - 1)); in det_separators() 555 if (rhs[i] != 0.0) { in det_separators() 557 rsum[1] += 1.0 / rhs[i]; in det_separators() 596 if ((!used[i]) && (rhs[i] != 0.0)) { in det_separators() [all …]
|
| /petsc/src/dm/impls/stag/tutorials/ |
| H A D | ex2.c | 79 Vec sol, solRef, rhs; in main() local 107 PetscCall(CreateSystem(dmSol, &A, &rhs, pinPressure)); in main() 124 PetscCall(KSPSolve(ksp, rhs, sol)); in main() 133 PetscCall(VecDestroy(&rhs)); in main() 151 Vec rhs; in CreateSystem() local 168 rhs = *pRhs; in CreateSystem() 193 PetscCall(DMStagVecSetValuesStencil(dmSol, rhs, 1, &row, &valRhs, INSERT_VALUES)); in CreateSystem() 206 PetscCall(DMStagVecSetValuesStencil(dmSol, rhs, 1, &row, &valRhs, INSERT_VALUES)); in CreateSystem() 220 PetscCall(DMStagVecSetValuesStencil(dmSol, rhs, 1, &row, &valRhs, INSERT_VALUES)); in CreateSystem() 338 PetscCall(DMStagVecSetValuesStencil(dmSol, rhs, 1, &row, &valRhs, INSERT_VALUES)); in CreateSystem() [all …]
|
| H A D | ex1.c | 86 Vec sol, solRef, solRefLocal, f, fLocal, rhs, coordSolLocal; in main() local 173 PetscCall(DMCreateGlobalVector(dmSol, &rhs)); in main() 226 PetscCall(DMStagVecSetValuesStencil(dmSol, rhs, idxLoc, pos, val, INSERT_VALUES)); in main() 229 PetscCall(VecAssemblyBegin(rhs)); in main() 230 PetscCall(VecAssemblyEnd(rhs)); in main() 333 PetscCall(KSPSolve(ksp, rhs, sol)); in main() 378 PetscCall(VecDestroy(&rhs)); in main()
|
| /petsc/src/ksp/ksp/utils/dm/ |
| H A D | dmproject.c | 429 Vec rhs; in DMSwarmProjectField_Conservative_PLEX() local 435 PetscCall(DMGetGlobalVector(dm, &rhs)); in DMSwarmProjectField_Conservative_PLEX() 436 PetscCall(MatMultTranspose(M_p, u_p, rhs)); in DMSwarmProjectField_Conservative_PLEX() 445 PetscCall(KSPSolve(ksp, rhs, u_f)); in DMSwarmProjectField_Conservative_PLEX() 447 PetscCall(DMRestoreGlobalVector(dm, &rhs)); in DMSwarmProjectField_Conservative_PLEX() 462 Vec rhs; in DMSwarmProjectParticles_Conservative_PLEX() local 469 PetscCall(DMGetGlobalVector(dm, &rhs)); in DMSwarmProjectParticles_Conservative_PLEX() 470 PetscCall(MatMult(M_f, u_f, rhs)); in DMSwarmProjectParticles_Conservative_PLEX() 487 PetscCall(KSPSolveTranspose(ksp, rhs, u_p)); in DMSwarmProjectParticles_Conservative_PLEX() 489 PetscCall(DMRestoreGlobalVector(dm, &rhs)); in DMSwarmProjectParticles_Conservative_PLEX() [all …]
|
| /petsc/src/ts/impls/rosw/ |
| H A D | rosw.c | 967 PetscScalar M[3][3], rhs[3]; in TSRosWRegisterRos4() local 985 rhs[0] = one - b3; in TSRosWRegisterRos4() 986 rhs[1] = one / three - a3 * a3 * b3; in TSRosWRegisterRos4() 987 rhs[2] = one / four - a3 * a3 * a3 * b3; in TSRosWRegisterRos4() 989 b1 = PetscRealPart(M[0][0] * rhs[0] + M[0][1] * rhs[1] + M[0][2] * rhs[2]); in TSRosWRegisterRos4() 990 b2 = PetscRealPart(M[1][0] * rhs[0] + M[1][1] * rhs[1] + M[1][2] * rhs[2]); in TSRosWRegisterRos4() 991 b4 = PetscRealPart(M[2][0] * rhs[0] + M[2][1] * rhs[1] + M[2][2] * rhs[2]); in TSRosWRegisterRos4() 1006 rhs[0] = one / two - gamma; in TSRosWRegisterRos4() 1007 rhs[1] = 0; in TSRosWRegisterRos4() 1008 rhs[2] = -a2 * a2 * p32; in TSRosWRegisterRos4() [all …]
|