| /petsc/src/mat/impls/baij/seq/ |
| H A D | baij.h | 43 PETSC_INTERN PetscErrorCode MatSeqBAIJSetPreallocation_SeqBAIJ(Mat B, PetscInt bs, PetscInt nz, con… 276 static inline PetscErrorCode PetscKernel_A_gets_A_times_B_2(PetscScalar *A, const PetscScalar *B, P… in PetscKernel_A_gets_A_times_B_2() argument 279 A[0] = W[0] * B[0] + W[2] * B[1]; in PetscKernel_A_gets_A_times_B_2() 280 A[1] = W[1] * B[0] + W[3] * B[1]; in PetscKernel_A_gets_A_times_B_2() 281 A[2] = W[0] * B[2] + W[2] * B[3]; in PetscKernel_A_gets_A_times_B_2() 282 A[3] = W[1] * B[2] + W[3] * B[3]; in PetscKernel_A_gets_A_times_B_2() 296 …e PetscKernel_A_gets_A_minus_B_times_C_2(PetscScalar *A, const PetscScalar *B, const PetscScalar *… in PetscKernel_A_gets_A_minus_B_times_C_2() argument 298 A[0] -= B[0] * C[0] + B[2] * C[1]; in PetscKernel_A_gets_A_minus_B_times_C_2() 299 A[1] -= B[1] * C[0] + B[3] * C[1]; in PetscKernel_A_gets_A_minus_B_times_C_2() 300 A[2] -= B[0] * C[2] + B[2] * C[3]; in PetscKernel_A_gets_A_minus_B_times_C_2() [all …]
|
| /petsc/src/dm/dt/fe/tests/output/ |
| H A D | ex2_2.out | 2 B[0]: 1. 0. 0. 3 B[1]: -1. 0. 0. 4 B[2]: -1. 0. 0. 5 B[3]: -1. 0. 0. 6 B[4]: 0. 1. 0. 7 B[5]: 0. -1. 0. 8 B[6]: 0. -1. 0. 9 B[7]: 0. -1. 0. 10 B[8]: 0. 0. 1. 11 B[9]: 0. 0. -1. [all …]
|
| H A D | ex2_1.out | 2 B[0]: 1. 0. 0. 3 B[1]: -1. 0. 0. 4 B[2]: -1. 0. 0. 5 B[3]: -1. 0. 0. 6 B[4]: 0. 1. 0. 7 B[5]: 0. -1. 0. 8 B[6]: 0. -1. 0. 9 B[7]: 0. -1. 0. 10 B[8]: 0. 0. 1. 11 B[9]: 0. 0. -1. [all …]
|
| H A D | ex2_0.out | 2 B[0]: 0.353553 0. 0. 3 B[1]: 0. 0.353553 0. 4 B[2]: 0. 0. 0.353553 6 B[0]: 0.353553 0. 0. 7 B[1]: 0. 0.353553 0. 8 B[2]: 0. 0. 0.353553 10 B[0]: 0.353553 0. 0. 11 B[1]: 0. 0.353553 0. 12 B[2]: 0. 0. 0.353553 14 B[0]: 0.353553 0. 0. [all …]
|
| /petsc/src/dm/dt/tests/output/ |
| H A D | ex1_1.out | 2 degree 1 at 0: B= 0 D= 1 D2= 0 3 degree 2 at 0: B= -0.5 D= 0 D2= 3 4 degree 3 at 0: B= 0 D= -1.5 D2= 0 5 degree 4 at 0: B= 0.375 D= 0 D2= -7.5 6 degree 5 at 0: B= 0 D= 1.875 D2= 0 7 degree 1 at 0.2: B= 0.2 D= 1 D2= 0 8 degree 2 at 0.2: B= -0.44 D= 0.6 D2= 3 9 degree 3 at 0.2: B= -0.28 D= -1.2 D2= 3 10 degree 4 at 0.2: B= 0.232 D= -1.36 D2= -5.4 11 degree 5 at 0.2: B= 0.3075 D= 0.888 D2= -9.24 [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/diagbrdn/ |
| H A D | diagbrdn.c | 4 static PetscErrorCode MatSolve_DiagBrdn(Mat B, Vec F, Vec dX) in MatSolve_DiagBrdn() argument 6 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatSolve_DiagBrdn() 13 static PetscErrorCode MatMult_DiagBrdn(Mat B, Vec X, Vec Z) in MatMult_DiagBrdn() argument 15 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatMult_DiagBrdn() 22 static PetscErrorCode MatUpdate_DiagBrdn(Mat B, Vec X, Vec F) in MatUpdate_DiagBrdn() argument 24 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatUpdate_DiagBrdn() 34 PetscCall(MatLMVMGetRange(B, &oldest, &next)); in MatUpdate_DiagBrdn() 47 PetscCall(MatUpdateKernel_LMVM(B, lmvm->Xprev, lmvm->Fprev)); in MatUpdate_DiagBrdn() 48 …PetscCall(MatLMVMProductsInsertDiagonalValue(B, LMBASIS_Y, LMBASIS_S, next, PetscRealPart(curvatur… in MatUpdate_DiagBrdn() 49 PetscCall(MatLMVMProductsInsertDiagonalValue(B, LMBASIS_S, LMBASIS_S, next, ststmp)); in MatUpdate_DiagBrdn() [all …]
|
| /petsc/share/petsc/datafiles/meshes/ |
| H A D | cube.stl | 1 …B�A�?� B�A\�pB�A\� B�A��� B\� B�…
|
| /petsc/src/ksp/ksp/utils/lmvm/ |
| H A D | lmvmimpl.c | 53 PETSC_INTERN PetscErrorCode MatReset_LMVM(Mat B, MatLMVMResetMode mode) in MatReset_LMVM() argument 55 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatReset_LMVM() 68 … B->preallocated = PETSC_FALSE; // MatSetUp() needs to be run to create at least the S and Y bases in MatReset_LMVM() 77 if (MatLMVMResetClearsJ0(mode)) PetscCall(MatLMVMClearJ0(B)); in MatReset_LMVM() 81 B->preallocated = PETSC_FALSE; // MatSetUp() needs to be run to create these vecs in MatReset_LMVM() 90 PETSC_INTERN PetscErrorCode MatLMVMAllocateBases(Mat B) in MatLMVMAllocateBases() argument 92 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMAllocateBases() 95 …PetscCheck(lmvm->Xprev != NULL && lmvm->Fprev != NULL, PetscObjectComm((PetscObject)B), PETSC_ERR_… in MatLMVMAllocateBases() 101 PETSC_INTERN PetscErrorCode MatLMVMAllocateVecs(Mat B) in MatLMVMAllocateVecs() argument 103 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatLMVMAllocateVecs() [all …]
|
| H A D | lmvmutils.c | 30 PetscErrorCode MatLMVMUpdate(Mat B, Vec X, Vec F) in MatLMVMUpdate() argument 36 PetscValidHeaderSpecific(B, MAT_CLASSID, 1); in MatLMVMUpdate() 39 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in MatLMVMUpdate() 49 PetscCall(MatLMVMUseVecLayoutsIfCompatible(B, X, F)); in MatLMVMUpdate() 50 MatCheckPreallocated(B, 1); in MatLMVMUpdate() 52 lmvm = (Mat_LMVM *)B->data; in MatLMVMUpdate() 54 PetscCall((*lmvm->ops->update)(B, X, F)); in MatLMVMUpdate() 59 static PetscErrorCode MatLMVMCreateJ0(Mat B, Mat *J0) in MatLMVMCreateJ0() argument 66 PetscCall(MatCreate(PetscObjectComm((PetscObject)B), J0)); in MatLMVMCreateJ0() 67 PetscCall(MatGetLayouts(B, &rmap, &cmap)); in MatLMVMCreateJ0() [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/symbrdn/ |
| H A D | symbadbrdn.c | 3 static PetscErrorCode MatMult_LMVMSymBadBrdn_Recursive(Mat B, Vec X, Vec Y) in MatMult_LMVMSymBadBrdn_Recursive() argument 5 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatMult_LMVMSymBadBrdn_Recursive() 9 …PetscCheck(lsb->psi_scalar != PETSC_DETERMINE, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRON… in MatMult_LMVMSymBadBrdn_Recursive() 11 PetscCall(DFPKernel_Recursive(B, MATLMVM_MODE_PRIMAL, X, Y)); in MatMult_LMVMSymBadBrdn_Recursive() 13 PetscCall(BFGSKernel_Recursive(B, MATLMVM_MODE_PRIMAL, X, Y)); in MatMult_LMVMSymBadBrdn_Recursive() 15 PetscCall(SymBroydenKernel_Recursive(B, MATLMVM_MODE_PRIMAL, X, Y, PETSC_TRUE)); in MatMult_LMVMSymBadBrdn_Recursive() 20 static PetscErrorCode MatSolve_LMVMSymBadBrdn_Recursive(Mat B, Vec X, Vec Y) in MatSolve_LMVMSymBadBrdn_Recursive() argument 22 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in MatSolve_LMVMSymBadBrdn_Recursive() 26 …PetscCheck(lsb->psi_scalar != PETSC_DETERMINE, PetscObjectComm((PetscObject)B), PETSC_ERR_ARG_WRON… in MatSolve_LMVMSymBadBrdn_Recursive() 28 PetscCall(BFGSKernel_Recursive(B, MATLMVM_MODE_DUAL, X, Y)); in MatSolve_LMVMSymBadBrdn_Recursive() [all …]
|
| H A D | symbrdn.c | 28 static PetscErrorCode SymBroydenKernel_Recursive_Inner(Mat B, MatLMVMMode mode, PetscInt oldest, Pe… in SymBroydenKernel_Recursive_Inner() argument 30 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in SymBroydenKernel_Recursive_Inner() 41 PetscCall(MatLMVMGetUpdatedBasis(B, Y_t, &Y, NULL, NULL)); in SymBroydenKernel_Recursive_Inner() 42 PetscCall(MatLMVMGetWorkRow(B, &StBkX)); in SymBroydenKernel_Recursive_Inner() 43 PetscCall(MatLMVMGetWorkRow(B, &YtX)); in SymBroydenKernel_Recursive_Inner() 44 PetscCall(MatLMVMGetWorkRow(B, &U)); in SymBroydenKernel_Recursive_Inner() 45 PetscCall(MatLMVMGetWorkRow(B, &V)); in SymBroydenKernel_Recursive_Inner() 54 PetscCall(MatLMVMRestoreWorkRow(B, &V)); in SymBroydenKernel_Recursive_Inner() 55 PetscCall(MatLMVMRestoreWorkRow(B, &U)); in SymBroydenKernel_Recursive_Inner() 56 PetscCall(MatLMVMRestoreWorkRow(B, &YtX)); in SymBroydenKernel_Recursive_Inner() [all …]
|
| /petsc/src/benchmarks/ |
| H A D | PetscMemcmp.c | 7 PetscScalar A[10000], B[10000]; in main() local 14 B[i] = i % 61897; in main() 17 PetscMemcmp(A, B, sizeof(PetscScalar) * 0, &flg); in main() 21 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() 22 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() 23 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() 24 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() 25 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() 26 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() 27 PetscMemcmp(A, B, sizeof(PetscScalar) * 10000, &flg); in main() [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/dfp/ |
| H A D | dfp.c | 13 PETSC_INTERN PetscErrorCode DFPKernel_Recursive(Mat B, MatLMVMMode mode, Vec X, Vec BX) in DFPKernel_Recursive() argument 24 PetscCall(MatLMVMGetRange(B, &oldest, &next)); in DFPKernel_Recursive() 25 PetscCall(MatLMVMGetUpdatedBasis(B, S_t, &S, NULL, NULL)); in DFPKernel_Recursive() 26 PetscCall(MatLMVMGetUpdatedBasis(B, Y_t, &Y, NULL, NULL)); in DFPKernel_Recursive() 27 PetscCall(MatLMVMGetUpdatedProducts(B, Y_t, S_t, LMBLOCK_DIAGONAL, &YtS)); in DFPKernel_Recursive() 46 PetscCall(MatLMVMApplyJ0Mode(mode)(B, G, BX)); in DFPKernel_Recursive() 68 PETSC_INTERN PetscErrorCode DFPKernel_CompactDense(Mat B, MatLMVMMode mode, Vec X, Vec BX) in DFPKernel_CompactDense() argument 73 PetscCall(MatLMVMApplyJ0Mode(mode)(B, X, BX)); in DFPKernel_CompactDense() 74 PetscCall(MatLMVMGetRange(B, &oldest, &next)); in DFPKernel_CompactDense() 84 PetscCall(MatLMVMGetUpdatedBasis(B, S_t, &S, NULL, NULL)); in DFPKernel_CompactDense() [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/brdn/ |
| H A D | badbrdn.c | 5 static PetscErrorCode MatSolve_LMVMBadBrdn_Recursive(Mat B, Vec F, Vec dX) in MatSolve_LMVMBadBrdn_Recursive() argument 8 PetscCall(BroydenKernel_Recursive(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolve_LMVMBadBrdn_Recursive() 12 static PetscErrorCode MatSolve_LMVMBadBrdn_CompactDense(Mat B, Vec F, Vec dX) in MatSolve_LMVMBadBrdn_CompactDense() argument 15 PetscCall(BroydenKernel_CompactDense(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolve_LMVMBadBrdn_CompactDense() 19 PETSC_UNUSED static PetscErrorCode MatSolve_LMVMBadBrdn_Dense(Mat B, Vec F, Vec dX) in MatSolve_LMVMBadBrdn_Dense() argument 22 PetscCall(BroydenKernel_Dense(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolve_LMVMBadBrdn_Dense() 26 static PetscErrorCode MatSolveHermitianTranspose_LMVMBadBrdn_Recursive(Mat B, Vec F, Vec dX) in MatSolveHermitianTranspose_LMVMBadBrdn_Recursive() argument 29 PetscCall(BroydenKernelHermitianTranspose_Recursive(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolveHermitianTranspose_LMVMBadBrdn_Recursive() 33 static PetscErrorCode MatSolveHermitianTranspose_LMVMBadBrdn_CompactDense(Mat B, Vec F, Vec dX) in MatSolveHermitianTranspose_LMVMBadBrdn_CompactDense() argument 36 PetscCall(BroydenKernelHermitianTranspose_CompactDense(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolveHermitianTranspose_LMVMBadBrdn_CompactDense() [all …]
|
| H A D | brdn.c | 6 static PetscErrorCode MatSolve_LMVMBrdn_Recursive(Mat B, Vec F, Vec dX) in MatSolve_LMVMBrdn_Recursive() argument 9 PetscCall(BadBroydenKernel_Recursive(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolve_LMVMBrdn_Recursive() 13 static PetscErrorCode MatSolveHermitianTranspose_LMVMBrdn_Recursive(Mat B, Vec F, Vec dX) in MatSolveHermitianTranspose_LMVMBrdn_Recursive() argument 16 PetscCall(BadBroydenKernelHermitianTranspose_Recursive(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolveHermitianTranspose_LMVMBrdn_Recursive() 20 static PetscErrorCode MatSolve_LMVMBrdn_CompactDense(Mat B, Vec F, Vec dX) in MatSolve_LMVMBrdn_CompactDense() argument 23 PetscCall(BadBroydenKernel_CompactDense(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolve_LMVMBrdn_CompactDense() 27 static PetscErrorCode MatSolveHermitianTranspose_LMVMBrdn_CompactDense(Mat B, Vec F, Vec dX) in MatSolveHermitianTranspose_LMVMBrdn_CompactDense() argument 30 PetscCall(BadBroydenKernelHermitianTranspose_CompactDense(B, MATLMVM_MODE_DUAL, F, dX)); in MatSolveHermitianTranspose_LMVMBrdn_CompactDense() 47 PETSC_INTERN PetscErrorCode BroydenKernel_Recursive(Mat B, MatLMVMMode mode, Vec X, Vec BX) in BroydenKernel_Recursive() argument 57 PetscCall(MatLMVMGetRange(B, &oldest, &next)); in BroydenKernel_Recursive() [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/bfgs/ |
| H A D | bfgs.c | 15 static PetscErrorCode BFGSKernel_Recursive_Inner(Mat B, MatLMVMMode mode, PetscInt oldest, PetscInt… in BFGSKernel_Recursive_Inner() argument 17 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in BFGSKernel_Recursive_Inner() 27 PetscCall(MatLMVMGetUpdatedBasis(B, Y_t, &Y, NULL, NULL)); in BFGSKernel_Recursive_Inner() 28 PetscCall(MatLMVMGetUpdatedProducts(B, LMBASIS_Y, LMBASIS_S, LMBLOCK_DIAGONAL, &YtS)); in BFGSKernel_Recursive_Inner() 29 PetscCall(MatLMVMGetWorkRow(B, &StBkX)); in BFGSKernel_Recursive_Inner() 30 PetscCall(MatLMVMGetWorkRow(B, &YtX)); in BFGSKernel_Recursive_Inner() 37 PetscCall(MatLMVMRestoreWorkRow(B, &YtX)); in BFGSKernel_Recursive_Inner() 38 PetscCall(MatLMVMRestoreWorkRow(B, &StBkX)); in BFGSKernel_Recursive_Inner() 45 static PetscErrorCode BFGSRecursiveBasisUpdate(Mat B, MatLMVMMode mode) in BFGSRecursiveBasisUpdate() argument 47 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in BFGSRecursiveBasisUpdate() [all …]
|
| /petsc/src/mat/impls/sell/mpi/mpihip/ |
| H A D | mpisellhip.hip.cxx | 5 static PetscErrorCode MatMPISELLSetPreallocation_MPISELLHIP(Mat B, PetscInt d_rlenmax, const PetscI… in MatMPISELLSetPreallocation_MPISELLHIP() argument 7 Mat_MPISELL *b = (Mat_MPISELL *)B->data; in MatMPISELLSetPreallocation_MPISELLHIP() 10 PetscCall(PetscLayoutSetUp(B->rmap)); in MatMPISELLSetPreallocation_MPISELLHIP() 11 PetscCall(PetscLayoutSetUp(B->cmap)); in MatMPISELLSetPreallocation_MPISELLHIP() 13 if (!B->preallocated) { in MatMPISELLSetPreallocation_MPISELLHIP() 16 PetscCall(MatBindToCPU(b->A, B->boundtocpu)); in MatMPISELLSetPreallocation_MPISELLHIP() 17 PetscCall(MatSetSizes(b->A, B->rmap->n, B->cmap->n, B->rmap->n, B->cmap->n)); in MatMPISELLSetPreallocation_MPISELLHIP() 19 PetscCall(MatCreate(PETSC_COMM_SELF, &b->B)); in MatMPISELLSetPreallocation_MPISELLHIP() 20 PetscCall(MatBindToCPU(b->B, B->boundtocpu)); in MatMPISELLSetPreallocation_MPISELLHIP() 21 PetscCall(MatSetSizes(b->B, B->rmap->n, B->cmap->N, B->rmap->n, B->cmap->N)); in MatMPISELLSetPreallocation_MPISELLHIP() [all …]
|
| /petsc/src/mat/impls/sell/mpi/mpicuda/ |
| H A D | mpisellcuda.cu | 5 static PetscErrorCode MatMPISELLSetPreallocation_MPISELLCUDA(Mat B, PetscInt d_rlenmax, const Petsc… in MatMPISELLSetPreallocation_MPISELLCUDA() argument 7 Mat_MPISELL *b = (Mat_MPISELL *)B->data; in MatMPISELLSetPreallocation_MPISELLCUDA() 10 PetscCall(PetscLayoutSetUp(B->rmap)); in MatMPISELLSetPreallocation_MPISELLCUDA() 11 PetscCall(PetscLayoutSetUp(B->cmap)); in MatMPISELLSetPreallocation_MPISELLCUDA() 13 if (!B->preallocated) { in MatMPISELLSetPreallocation_MPISELLCUDA() 16 PetscCall(MatBindToCPU(b->A, B->boundtocpu)); in MatMPISELLSetPreallocation_MPISELLCUDA() 17 PetscCall(MatSetSizes(b->A, B->rmap->n, B->cmap->n, B->rmap->n, B->cmap->n)); in MatMPISELLSetPreallocation_MPISELLCUDA() 19 PetscCall(MatCreate(PETSC_COMM_SELF, &b->B)); in MatMPISELLSetPreallocation_MPISELLCUDA() 20 PetscCall(MatBindToCPU(b->B, B->boundtocpu)); in MatMPISELLSetPreallocation_MPISELLCUDA() 21 PetscCall(MatSetSizes(b->B, B->rmap->n, B->cmap->N, B->rmap->n, B->cmap->N)); in MatMPISELLSetPreallocation_MPISELLCUDA() [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/sr1/ |
| H A D | sr1.c | 45 static PetscErrorCode SR1Kernel_Recursive_Inner(Mat B, MatLMVMMode mode, PetscInt oldest, PetscInt … in SR1Kernel_Recursive_Inner() argument 47 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in SR1Kernel_Recursive_Inner() 56 PetscCall(MatLMVMGetWorkRow(B, &YmBkStX)); in SR1Kernel_Recursive_Inner() 60 PetscCall(MatLMVMRestoreWorkRow(B, &YmBkStX)); in SR1Kernel_Recursive_Inner() 66 static PetscErrorCode SR1RecursiveBasisUpdate(Mat B, MatLMVMMode mode) in SR1RecursiveBasisUpdate() argument 68 Mat_LMVM *lmvm = (Mat_LMVM *)B->data; in SR1RecursiveBasisUpdate() 85 …if (!lsr1->products[YtS_minus_StBkS_t]) PetscCall(MatLMVMCreateProducts(B, LMBLOCK_DIAGONAL, &lsr1… in SR1RecursiveBasisUpdate() 87 PetscCall(MatLMVMGetUpdatedBasis(B, S_t, &S, NULL, NULL)); in SR1RecursiveBasisUpdate() 88 PetscCall(MatLMVMGetUpdatedBasis(B, Y_t, &Y, NULL, NULL)); in SR1RecursiveBasisUpdate() 89 PetscCall(MatLMVMGetRange(B, &oldest, &next)); in SR1RecursiveBasisUpdate() [all …]
|
| /petsc/src/ksp/ksp/utils/lmvm/tests/ |
| H A D | ex1.c | 5 static PetscErrorCode MatSolveHermitianTranspose(Mat B, Vec x, Vec y) in MatSolveHermitianTranspose() argument 15 PetscCall(MatSolveTranspose(B, x_conj, y)); in MatSolveHermitianTranspose() 23 static PetscErrorCode HermitianTransposeTest(Mat B, PetscRandom rand, PetscBool inverse) in HermitianTransposeTest() argument 32 PetscCall(MatCreateVecs(B, &x, &f)); in HermitianTransposeTest() 35 PetscCall(MatCreateVecs(B, &Bhf, &Bx)); in HermitianTransposeTest() 36 PetscCall((inverse ? MatSolve : MatMult)(B, x, Bx)); in HermitianTransposeTest() 37 PetscCall((inverse ? MatSolveHermitianTranspose : MatMultHermitianTranspose)(B, f, Bhf)); in HermitianTransposeTest() 46 …PetscCall(PetscInfo((PetscObject)B, "Hermitian transpose error %g, relative error %g \n", (double)… in HermitianTransposeTest() 47 …PetscCheck(err <= PETSC_SMALL * scale, PetscObjectComm((PetscObject)B), PETSC_ERR_PLIB, "Hermitian… in HermitianTransposeTest() 55 static PetscErrorCode InverseTest(Mat B, PetscRandom rand) in InverseTest() argument [all …]
|
| /petsc/src/mat/impls/sell/mpi/ |
| H A D | mmsell.c | 19 Mat B = sell->B, Bnew; in MatDisAssemble_MPISELL() local 20 Mat_SeqSELL *Bsell = (Mat_SeqSELL *)B->data; in MatDisAssemble_MPISELL() 37 PetscCall(MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY)); in MatDisAssemble_MPISELL() 38 PetscCall(MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY)); in MatDisAssemble_MPISELL() 42 PetscCall(MatSetSizes(Bnew, B->rmap->n, N, B->rmap->n, N)); in MatDisAssemble_MPISELL() 44 PetscCall(MatSetType(Bnew, ((PetscObject)B)->type_name)); in MatDisAssemble_MPISELL() 54 Bnew->nonzerostate = B->nonzerostate; in MatDisAssemble_MPISELL() 56 totalslices = PetscCeilInt(B->rmap->n, Bsell->sliceheight); in MatDisAssemble_MPISELL() 60 …Bnew, Bsell->sliceheight * i + row, sell->garray[Bsell->colidx[j]], Bsell->val[j], B->insertmode)); in MatDisAssemble_MPISELL() 65 PetscCall(MatDestroy(&B)); in MatDisAssemble_MPISELL() [all …]
|
| /petsc/src/mat/tutorials/ |
| H A D | ex9.c | 14 Mat *A, B; /* matrix */ in main() local 58 PetscCall(MatCreateComposite(PETSC_COMM_WORLD, nmat, A + 1, &B)); in main() 59 PetscCall(MatSetFromOptions(B)); in main() 60 PetscCall(MatCompositeSetScalings(B, &scalings[1])); in main() 61 PetscCall(MatMultAdd(B, x, y, y)); in main() 69 PetscCall(MatCompositeSetMatStructure(B, DIFFERENT_NONZERO_PATTERN)); /* default */ in main() 70 PetscCall(MatCompositeMerge(B)); in main() 71 PetscCall(MatMult(B, x, y)); in main() 72 PetscCall(MatDestroy(&B)); in main() 92 PetscCall(MatCreateComposite(PETSC_COMM_WORLD, nmat, A, &B)); in main() [all …]
|
| /petsc/src/mat/interface/ |
| H A D | matproduct.c | 49 Mat P = product->B, AP = product->Dwork; in MatProductNumeric_PtAP_Unsafe() 64 Mat A = product->A, P = product->B, AP; in MatProductSymbolic_PtAP_Unsafe() 68 … %s, P %s is used\n", ((PetscObject)product->A)->type_name, ((PetscObject)product->B)->type_name)); in MatProductSymbolic_PtAP_Unsafe() 81 product->B = AP; in MatProductSymbolic_PtAP_Unsafe() 88 product->B = P; in MatProductSymbolic_PtAP_Unsafe() 98 Mat R = product->B, RA = product->Dwork; in MatProductNumeric_RARt_Unsafe() 113 Mat A = product->A, R = product->B, RA; in MatProductSymbolic_RARt_Unsafe() 117 … %s, R %s is used\n", ((PetscObject)product->A)->type_name, ((PetscObject)product->B)->type_name)); in MatProductSymbolic_RARt_Unsafe() 159 Mat B = product->B, C = product->C, BC; in MatProductSymbolic_ABC_Unsafe() local 163 …%s is used\n", ((PetscObject)product->A)->type_name, ((PetscObject)product->B)->type_name, ((Petsc… in MatProductSymbolic_ABC_Unsafe() [all …]
|
| /petsc/src/mat/tests/ |
| H A D | ex115.c | 7 Mat A, B, C, D; in main() local 46 PetscCall(MatCreate(PETSC_COMM_WORLD, &B)); in main() 47 PetscCall(MatSetSizes(B, PETSC_DECIDE, PETSC_DECIDE, M, N)); in main() 49 PetscCall(MatSetType(B, mtype)); in main() 51 PetscCall(MatSetType(B, MATHYPRE)); in main() 53 PetscCall(MatSeqAIJSetPreallocation(B, 9, NULL)); in main() 54 PetscCall(MatMPIAIJSetPreallocation(B, 9, NULL, 9, NULL)); in main() 56 PetscCall(MatHYPRESetPreallocation(B, 9, NULL, 9, NULL)); in main() 58 PetscCall(MatHYPRESetPreallocation(B, 6, NULL, 6, NULL)); in main() 67 PetscCall(MatSetValue(B, i, N - 1, (1. * j * N + i) / (3. * N * size), ADD_VALUES)); in main() [all …]
|
| /petsc/src/ksp/pc/impls/lmvm/ |
| H A D | lmvmpc.c | 12 Mat B; member 63 PetscErrorCode PCLMVMSetMatLMVM(PC pc, Mat B) in PCLMVMSetMatLMVM() argument 70 PetscValidHeaderSpecific(B, MAT_CLASSID, 2); in PCLMVMSetMatLMVM() 73 PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATLMVM, &same)); in PCLMVMSetMatLMVM() 76 PetscCall(PetscObjectReference((PetscObject)B)); in PCLMVMSetMatLMVM() 77 PetscCall(MatDestroy(&ctx->B)); in PCLMVMSetMatLMVM() 78 ctx->B = B; in PCLMVMSetMatLMVM() 95 PetscErrorCode PCLMVMGetMatLMVM(PC pc, Mat *B) in PCLMVMGetMatLMVM() argument 105 if (!ctx->B) { in PCLMVMGetMatLMVM() 111 if (same) *B = J; in PCLMVMGetMatLMVM() [all …]
|