| /petsc/src/sys/utils/ |
| H A D | psplit.c | 8 Collective (if `N` is `PETSC_DECIDE`) 13 . n - local length (or `PETSC_DECIDE` to have it set) 14 - N - global length (or `PETSC_DECIDE`) 19 `n` and `N` cannot be both `PETSC_DECIDE` 21 If one processor calls this with `N` of `PETSC_DECIDE` then all processors 26 PetscErrorCode PetscSplitOwnershipBlock(MPI_Comm comm, PetscInt bs, PetscInt *n, PetscInt *N) in PetscSplitOwnershipBlock() argument 31 …PetscCheck(*N != PETSC_DECIDE || *n != PETSC_DECIDE, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Both … in PetscSplitOwnershipBlock() 33 if (*N == PETSC_DECIDE) { in PetscSplitOwnershipBlock() 34 …PetscCheck(*n % bs == 0, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "local size %" PetscInt_FMT " not … in PetscSplitOwnershipBlock() 35 PetscCallMPI(MPIU_Allreduce(n, N, 1, MPIU_INT, MPI_SUM, comm)); in PetscSplitOwnershipBlock() [all …]
|
| /petsc/src/binding/petsc4py/docs/ipynb/ |
| H A D | dmplex.ipynb | 7 "Decoding the DMPlex\n", 8 "===================\n", 9 "\n", 19 "from __future__ import print_function\n", 20 "import sys,petsc4py\n", 21 "petsc4py.init(sys.argv)\n", 22 "from petsc4py import PETSc\n", 39 "dim = 2\n", 40 "coords = np.asarray([[0.0, 0.0],\n", 41 " [0.5, 0.0],\n", [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/poisson3d/ |
| H A D | del2lib.f90 | 6 subroutine del2apply (n, F, x, y) argument 8 !f2py intent(hide) :: n=shape(F,0)-2 9 integer , intent(in) :: n local 10 real(kind=8) , intent(inout) :: F(0:n+1,0:n+1,0:n+1) 11 real(kind=8) , intent(in) :: x(n,n,n) 12 real(kind=8) , intent(inout) :: y(n,n,n) 14 F(1:n,1:n,1:n) = x 16 y(:,:,:) = 6.0 * F(1:n,1:n,1:n) & 17 - F(0:n-1,1:n,1:n) & 18 - F(2:n+1,1:n,1:n) & [all …]
|
| H A D | poisson3d.c | 12 PetscInt n; in main() local 24 PetscPrintf(PETSC_COMM_WORLD, "This a sequential example\n"); in main() 30 n = 32; in main() 31 h = 1.0/(n+1); /* grid spacing */ in main() 34 MatSetSizes(A, n*n*n, n*n*n, n*n*n, n*n*n); in main() 36 shell.N = n; in main() 37 PetscMalloc((n+2)*(n+2)*(n+2)*sizeof(PetscScalar),&shell.F); in main() 38 PetscMemzero(shell.F, (n+2)*(n+2)*(n+2)*sizeof(PetscScalar)); in main()
|
| /petsc/doc/manualpages/doctext/ |
| H A D | myst.def | 10 key %n`%1` 11 synopsis %n%1 12 definition %n**%1**%n 15 #section %n%n#### %1%n 22 section %n%n## %1%n 23 s_synopsis %n%n## Synopsis%n```%n 24 e_synopsis %n```%n 31 s_arg_list %n%n 35 e_defn_inlist %n 36 e_arg_list %n%n [all …]
|
| H A D | html.def | 13 end_par %n<P>%n 16 s_verbatim <PRE>%n 17 e_verbatim </PRE>%n 19 key %n%p<CODE>%1</CODE> 20 synopsis %n<PRE>%1</PRE> 21 definition %n<B>%1</B>%n 22 section %n<H3><FONT COLOR="#CC3333">%1</FONT></H3>%n 23 s_synopsis %n<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>%n<PRE>%n 24 e_synopsis %n</PRE>%n 26 eop %n</BODY></HTML>%n [all …]
|
| H A D | latex.def | 6 postamble %n 7 key %n\k{%1} 8 definition \DeFn{%1}}%n 9 synopsis {\CoDe{%N="\\"%1%N} 12 section %n\subhead{%1}%n 13 s_synopsis %n\subhead{Synopsis}%n\startvb\begin{verbatim}%n%m="verbatim" 14 e_synopsis %n\end{verbatim}%n\endvb%n%m="" 16 eop \endmanpage%n 17 bop \startmanpage%n 18 linebreak \nextline%n [all …]
|
| H A D | nroff.def | 5 key %n%p<CODE>%1</CODE> 6 definition %n.B %1%n 25 s_synopsis %n.SH SYNOPSIS%n.nf%n 26 e_synopsis %n.fi%n 30 em %n.B 31 s_arg %n.PD 0%n.TP%n.B 32 s_defn %n- 33 e_defn %n.PD 1%n 34 e_arg %n 35 mantitle %n.TH %1 %2 "%3" " " "%4"%n.SH NAME%n%1 [all …]
|
| /petsc/src/vec/vec/tests/ |
| H A D | ex32.c | 1 …(), PetscSortIntWithArrayPair(), PetscIntSortSemiOrderedWithArray(), and PetscSortIntWithArray()\n\ 2 …ndom numbers, but one can control average duplicates for each unique integer with the -d option.\n\ 3 Usage:\n\ 4 mpiexec -n 1 ./ex32 -n <length of the array to sort>, default=100 \n\ 5 -r <repeat times for each sort>, default=10 \n\ 6 … -d <average duplicates for each unique integer>, default=1, i.e., no duplicates \n\n"; 14 PetscInt i, l, n = 100, r = 10, d = 1, vsize = 1; in main() local 30 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main() 36 …n >= 1 && r >= 1 && d >= 1 && d <= n, PETSC_COMM_WORLD, PETSC_ERR_SUP, "Wrong input n=%" PetscInt_… in main() 38 PetscCall(PetscCalloc6(n, &X, n, &X1, n, &XR, n, &XSO, n, &Y, n, &Z)); in main() [all …]
|
| H A D | ex44.c | 3 static char help[] = "Tests vecScatter Sequential to Sequential for (CUDA) vectors\n\ 4 -m # : the size of the vectors\n \ 5 -n # : the number of indices (with n<=m)\n \ 6 -toFirst # : the starting index of the output vector for strided scatters\n \ 7 -toStep # : the step size into the output vector for strided scatters\n \ 8 -fromFirst # : the starting index of the input vector for strided scatters\n\ 9 -fromStep # : the step size into the input vector for strided scatters\n\n"; 14 PetscInt m, n, i, n1, n2; in main() local 28 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, &flg)); in main() 29 if (!flg) n = 30; in main() [all …]
|
| /petsc/include/petsc/private/valgrind/ |
| H A D | valgrind.h | 276 "roll $3, %%edi ; roll $13, %%edi\n\t" \ 277 "roll $29, %%edi ; roll $19, %%edi\n\t" 317 "xchgl %%edx,%%edx\n\t" 322 "xchgl %%edi,%%edi\n\t" \ 417 "rolq $3, %%rdi ; rolq $13, %%rdi\n\t" \ 418 "rolq $61, %%rdi ; rolq $51, %%rdi\n\t" 458 "xchgq %%rdx,%%rdx\n\t" 463 "xchgq %%rdi,%%rdi\n\t" \ 489 "rlwinm 0,0,3,0,31 ; rlwinm 0,0,13,0,31\n\t" \ 490 "rlwinm 0,0,29,0,31 ; rlwinm 0,0,19,0,31\n\t" [all …]
|
| /petsc/src/dm/dt/fe/impls/opencl/ |
| H A D | feopencl.c | 77 "#if defined(cl_khr_fp64)\n" in PetscFEOpenCLGenerateIntegrationCode() 78 "# pragma OPENCL EXTENSION cl_khr_fp64: enable\n" in PetscFEOpenCLGenerateIntegrationCode() 79 "#elif defined(cl_amd_fp64)\n" in PetscFEOpenCLGenerateIntegrationCode() 80 "# pragma OPENCL EXTENSION cl_amd_fp64: enable\n" in PetscFEOpenCLGenerateIntegrationCode() 81 "#endif\n", in PetscFEOpenCLGenerateIntegrationCode() 87 "\n" in PetscFEOpenCLGenerateIntegrationCode() 88 …entsAux, __global %s *jacobianInverses, __global %s *jacobianDeterminants, __global %s *elemVec)\n" in PetscFEOpenCLGenerateIntegrationCode() 89 "{\n", in PetscFEOpenCLGenerateIntegrationCode() 93 " /* Quadrature points\n" in PetscFEOpenCLGenerateIntegrationCode() 94 " - (x1,y1,x2,y2,...) */\n" in PetscFEOpenCLGenerateIntegrationCode() [all …]
|
| /petsc/src/dm/impls/plex/ftn-custom/ |
| H A D | zplexf90.c | 51 PetscInt n; in dmplexgetcone_() local 53 *ierr = DMPlexGetConeSize(*dm, *p, &n); in dmplexgetcone_() 57 *ierr = F90Array1dCreate((void *)v, MPIU_INT, 1, n, ptr PETSC_F90_2PTR_PARAM(ptrd)); in dmplexgetcone_() 69 PetscInt n; in dmplexgetconeorientation_() local 71 *ierr = DMPlexGetConeSize(*dm, *p, &n); in dmplexgetconeorientation_() 75 *ierr = F90Array1dCreate((void *)v, MPIU_INT, 1, n, ptr PETSC_F90_2PTR_PARAM(ptrd)); in dmplexgetconeorientation_() 87 PetscInt n; in dmplexgetsupport_() local 89 *ierr = DMPlexGetSupportSize(*dm, *p, &n); in dmplexgetsupport_() 93 *ierr = F90Array1dCreate((void *)v, MPIU_INT, 1, n, ptr PETSC_F90_2PTR_PARAM(ptrd)); in dmplexgetsupport_() 102 PETSC_EXTERN void dmplexgettransitiveclosure_(DM *dm, PetscInt *p, PetscBool *useCone, PetscInt *N,… in dmplexgettransitiveclosure_() argument [all …]
|
| /petsc/config/BuildSystem/config/packages/ |
| H A D | Chombo.py | 32 … raise RuntimeError('Cannot build Chombo. It requires /bin/csh. Please install csh and retry.\n') 40 g.write('\n#begin\n') 41 g.write('#DIM='+str(dim)+'\n') 42 g.write('#DEBUG='+'\n') 43 g.write('#OPT='+'\n') 44 g.write('#PRECISION='+'\n') 45 g.write('#PROFILE='+'\n') 47 g.write('CXX='+self.getCompiler()+'\n') 48 g.write('MPICXX='+self.getCompiler()+'\n') 51 g.write('FC='+self.getCompiler()+'\n') [all …]
|
| /petsc/src/sys/tests/ |
| H A D | ex41.c | 1 static char help[] = "Test PETSc integer hash set.\n\n"; 11 PetscInt n, off, array[4], na, nb, i, *marray, size; in main() local 19 PetscCall(PetscHSetIGetSize(ht, &n)); in main() 20 PetscTestCheck(n == 0); in main() 23 PetscCall(PetscHSetIGetSize(ht, &n)); in main() 24 PetscTestCheck(n == 0); in main() 30 PetscCall(PetscHSetIGetSize(ht, &n)); in main() 31 PetscTestCheck(n == 1); in main() 36 PetscCall(PetscHSetIGetSize(ht, &n)); in main() 37 PetscTestCheck(n == 0); in main() [all …]
|
| /petsc/src/mat/tests/ |
| H A D | ex226.c | 1 … = "Benchmark for MatMatMult() of AIJ matrices using different 2d finite-difference stencils.\n\n"; 5 /* Converts 3d grid coordinates (i,j,k) for a grid of size m \times n to global indexing. Pass k = … 6 PetscInt global_index(PetscInt i, PetscInt j, PetscInt k, PetscInt m, PetscInt n) in global_index() argument 8 return i + j * m + k * m * n; in global_index() 14 PetscInt i, M, N, Istart, Iend, n = 7, j, J, Ii, m = 8, k, o = 1; in main() local 23 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main() 29 M = N = m * n * o; in main() 31 PetscCall(MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, M, N)); in main() 36 …PetscCheck(o >= 1 && m > 1 && n >= 1, PETSC_COMM_WORLD, PETSC_ERR_USER, "Dimensions need to be lar… in main() 46 k = Ii / (m * n); in main() [all …]
|
| /petsc/src/mat/impls/transpose/ |
| H A D | transm.c | 3 static PetscErrorCode MatMult_Transpose(Mat N, Vec x, Vec y) in MatMult_Transpose() argument 8 PetscCall(MatShellGetContext(N, &A)); in MatMult_Transpose() 13 static PetscErrorCode MatMultTranspose_Transpose(Mat N, Vec x, Vec y) in MatMultTranspose_Transpose() argument 18 PetscCall(MatShellGetContext(N, &A)); in MatMultTranspose_Transpose() 23 static PetscErrorCode MatSolve_Transpose_LU(Mat N, Vec b, Vec x) in MatSolve_Transpose_LU() argument 28 PetscCall(MatShellGetContext(N, &A)); in MatSolve_Transpose_LU() 33 static PetscErrorCode MatSolveAdd_Transpose_LU(Mat N, Vec b, Vec y, Vec x) in MatSolveAdd_Transpose_LU() argument 38 PetscCall(MatShellGetContext(N, &A)); in MatSolveAdd_Transpose_LU() 43 static PetscErrorCode MatSolveTranspose_Transpose_LU(Mat N, Vec b, Vec x) in MatSolveTranspose_Transpose_LU() argument 48 PetscCall(MatShellGetContext(N, &A)); in MatSolveTranspose_Transpose_LU() [all …]
|
| /petsc/src/ts/interface/ |
| H A D | tshistory.c | 7 PetscCount n; /* current number of steps registered */ member 13 PetscErrorCode TSHistoryGetNumSteps(TSHistory tsh, PetscInt *n) in TSHistoryGetNumSteps() argument 16 PetscAssertPointer(n, 2); in TSHistoryGetNumSteps() 17 PetscCall(PetscIntCast(tsh->n, n)); in TSHistoryGetNumSteps() 24 if (tsh->n == tsh->c) { /* reallocation */ in TSHistoryUpdate() 29 …tsh->sorted = (PetscBool)(tsh->sorted && (tsh->n ? (PetscBool)(time >= tsh->hist[tsh->n - 1]) : PE… in TSHistoryUpdate() 31 if (tsh->n) { /* id should be unique */ in TSHistoryUpdate() 34 PetscCall(PetscMalloc1(tsh->n, &ids)); in TSHistoryUpdate() 35 PetscCall(PetscArraycpy(ids, tsh->hist_id, tsh->n)); in TSHistoryUpdate() 36 PetscCall(PetscSortInt(tsh->n, ids)); in TSHistoryUpdate() [all …]
|
| /petsc/src/ksp/ksp/impls/hpddm/cuda/ |
| H A D | hpddm.cu | 7 …PDDM_CUDA_Private(KSP_HPDDM *data, const PetscScalar *b, PetscScalar *x, PetscInt n, MPI_Comm comm) in KSPSolve_HPDDM_CUDA_Private() argument 9 const PetscInt N = data->op->getDof() * n; in KSPSolve_HPDDM_CUDA_Private() local 24 PetscCall(PetscMalloc1(2 * N, &host_ptr)); in KSPSolve_HPDDM_CUDA_Private() 25 PetscCallCUDA(cudaMalloc((void **)&ptr, 2 * N * sizeof(K))); in KSPSolve_HPDDM_CUDA_Private() 27 dptr[1] = thrust::device_pointer_cast(ptr + N); in KSPSolve_HPDDM_CUDA_Private() 28 thrust::copy_n(thrust::cuda::par.on(PetscDefaultCudaStream), db, N, dptr[0]); in KSPSolve_HPDDM_CUDA_Private() 29 thrust::copy_n(thrust::cuda::par.on(PetscDefaultCudaStream), dx, N, dptr[1]); in KSPSolve_HPDDM_CUDA_Private() 30 PetscCallCUDA(cudaMemcpy(host_ptr, ptr, 2 * N * sizeof(K), cudaMemcpyDeviceToHost)); in KSPSolve_HPDDM_CUDA_Private() 31 PetscCall(HPDDM::IterativeMethod::solve(*data->op, host_ptr, host_ptr + N, n, comm)); in KSPSolve_HPDDM_CUDA_Private() 32 PetscCallCUDA(cudaMemcpy(ptr + N, host_ptr + N, N * sizeof(K), cudaMemcpyHostToDevice)); in KSPSolve_HPDDM_CUDA_Private() [all …]
|
| /petsc/include/petsc/private/kernels/ |
| H A D | petscaxpy.h | 7 - n - length of arrays 32 #define PetscKernelAXPY(U, a1, p1, n) \ argument 35 PetscBLASInt nn = (PetscBLASInt)n; \ 38 #define PetscKernelAXPY2(U, a1, a2, p1, p2, n) \ argument 40 fortranmaxpy2_(U, &a1, &a2, p1, p2, &n); \ 42 #define PetscKernelAXPY3(U, a1, a2, a3, p1, p2, p3, n) \ argument 44 fortranmaxpy3_(U, &a1, &a2, &a3, p1, p2, p3, &n); \ 46 #define PetscKernelAXPY4(U, a1, a2, a3, a4, p1, p2, p3, p4, n) \ argument 48 fortranmaxpy4_(U, &a1, &a2, &a3, &a4, p1, p2, p3, p4, &n); \ 53 #define PetscKernelAXPY(U, Alpha, P, n) \ argument [all …]
|
| /petsc/include/ |
| H A D | petscdt.h | 186 PetscDTFactorial - Approximate n! as a real number 189 . n - a non-negative integer 192 . factorial - n! 198 static inline PetscErrorCode PetscDTFactorial(PetscInt n, PetscReal *factorial) in PetscDTFactorial() argument 204 …PetscCheck(n >= 0, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Factorial called with negative numb… in PetscDTFactorial() 205 for (PetscInt i = 1; i < n + 1; ++i) f *= (PetscReal)i; in PetscDTFactorial() 211 PetscDTFactorialInt - Compute n! as an integer 214 . n - a non-negative integer 217 . factorial - n! 222 …This is limited to `n` such that n! can be represented by `PetscInt`, which is 12 if `PetscInt` is… [all …]
|
| /petsc/src/dm/dt/tests/ |
| H A D | ex7.c | 1 static char help[] = "Test the PetscDTAltV interface for k-forms (alternating k-linear maps).\n\n"; 6 static PetscErrorCode CheckPullback(PetscInt N, PetscInt M, const PetscReal *L, PetscInt k, const P… in CheckPullback() argument 17 PetscCall(PetscDTBinomialInt(N, k, &Nk)); in CheckPullback() 28 PetscCall(PetscDTAltVPullback(N, M, L, negative ? -k : k, w, Lstarw)); in CheckPullback() 29 PetscCall(PetscDTAltVPullbackMatrix(N, M, L, negative ? -k : k, Lstar)); in CheckPullback() 34 PetscCall(PetscDTAltVStar(N, N - k, 1, Lstarw, sLsw)); in CheckPullback() 35 PetscCall(PetscDTAltVApply(N, k, sLsw, x, &Lstarwx)); in CheckPullback() 38 PetscCall(PetscDTAltVApply(N, k, Lstarw, x, &Lstarwx)); in CheckPullback() 44 for (j = 0; j < N; j++) sum += L[i * N + j] * x[l * N + j]; in CheckPullback() 60 PetscCall(PetscViewerASCIIPrintf(viewer, "L:\n")); in CheckPullback() [all …]
|
| H A D | ex6.c | 1 static char help[] = "Tests 1D Gauss-Lobatto-Legendre discretization on [-1, 1].\n\n"; 8 PetscInt n = 3, i; in main() local 13 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main() 15 PetscCall(PetscMalloc1(n, &la_nodes)); in main() 16 PetscCall(PetscMalloc1(n, &la_weights)); in main() 17 PetscCall(PetscMalloc1(n, &n_nodes)); in main() 18 PetscCall(PetscMalloc1(n, &n_weights)); in main() 19 …PetscCall(PetscDTGaussLobattoLegendreQuadrature(n, PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRA, l… in main() 21 …C_VIEWER_STDOUT_SELF, "Gauss-Lobatto-Legendre nodes and weights computed via linear algebra: \n")); in main() 22 PetscCall(PetscRealView(n, la_nodes, PETSC_VIEWER_STDOUT_SELF)); in main() [all …]
|
| /petsc/src/ksp/ksp/tests/ |
| H A D | ex17.c | 1 static char help[] = "Solves a linear system with KSP. This problem is\n\ 2 intended to test the complex numbers version of various solvers.\n\n"; 20 PetscInt n = 10, its, dim, p = 1, use_random; in main() local 29 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main() 34 dim = n; in main() 38 dim = n; in main() 42 dim = n; in main() 46 dim = n * n; in main() 50 dim = n * n; in main() 54 dim = n; in main() [all …]
|
| /petsc/src/dm/dt/interface/ |
| H A D | dtaltv.c | 17 …ctor space themselves, Alt^k V. The dimension of Alt^k V, if V is N dimensional, is N choose k. … 18 shows that for an N dimensional space, only 0 <= k <= N are valid form degrees.) 19 …scDTAltV, has one basis k-form for each ordered subset of k coordinates of the N dimensional space: 27 …If j + k <= N, then a j-form f and a k-form g can be multiplied to create a (j+k)-form using the w… 43 …When there is a linear map L: V -> W from an N dimensional vector space to an M dimensional vector… 47 …Alt^k V and Alt^(N-k) V have the same dimension, and the Hodge star operator maps between them. W… 58 …PetscDTAltVApply - Apply an a k-form (an alternating k-linear map) to a set of k N-dimensional vec… 61 + N - the dimension of the vector space, N >= 0 62 . k - the degree k of the k-form w, 0 <= k <= N 63 . w - a k-form, size [N choose k] (each degree of freedom of a k-form is associated with a subset o… [all …]
|