Home
last modified time | relevance | path

Searched +full:- +full:j (Results 1 – 25 of 1211) sorted by relevance

12345678910>>...49

/petsc/src/ksp/ksp/impls/cg/pipecg2/
H A Dpipecg2.c4 the data multiple times by performing vector operations element-wise. These functions
12 PetscInt j, n; in VecMergedDot_Private() local
22 for (j = 0; j < n; j++) { in VecMergedDot_Private()
23 sumwu += PW[j] * PetscConj(PU[j]); in VecMergedDot_Private()
24 sumru += PR[j] * PetscConj(PU[j]); in VecMergedDot_Private()
25 sumuu += PU[j] * PetscConj(PU[j]); in VecMergedDot_Private()
29 for (j = 0; j < n; j++) { in VecMergedDot_Private()
30 sumwu += PW[j] * PetscConj(PU[j]); in VecMergedDot_Private()
31 sumru += PR[j] * PetscConj(PU[j]); in VecMergedDot_Private()
32 sumuu += PR[j] * PetscConj(PR[j]); in VecMergedDot_Private()
[all …]
/petsc/src/mat/tests/
H A Dex226.c1 static char help[] = "Benchmark for MatMatMult() of AIJ matrices using different 2d finite-differen…
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
22 PetscCall(PetscOptionsGetInt(NULL, NULL, "-m", &m, NULL)); in main()
23 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main()
24 PetscCall(PetscOptionsGetInt(NULL, NULL, "-o", &o, NULL)); in main()
25 PetscCall(PetscOptionsHasName(NULL, NULL, "-result_view", &mat_view)); in main()
26 PetscCall(PetscOptionsGetString(NULL, NULL, "-stencil", stencil, sizeof(stencil), NULL)); in main()
[all …]
/petsc/src/ts/tutorials/multirate/
H A Dex8.c1 static const char help[] = "1D periodic Finite Volume solver in slope-limiter form with semidiscret…
2 " advection - Constant coefficient scalar advection\n"
4 …oy problem, we choose different meshsizes for different sub-domains (slow-medium-fast-medium-slow)…
5 … " the meshsize ratio between two adjacient sub-domains is controlled with -hratio,\n"
6 …" exact - Exact Riemann solver which usually needs to perform a Newton iteration to connect…
8 …" simulation - use reference solution which is generated by smaller time step size to be true so…
10 … " characteristic - Limit the characteristic variables, this is usually preferred (default)\n"
11 "Several initial conditions can be chosen with -initial N\n\n"
12 "The problem size should be set with -da_grid_x M\n\n";
22 PetscReal range = xmax - xmin; in RangeMod()
[all …]
H A Dex7.c2 " advection - Constant coefficient scalar advection\n"
4 … " for this toy problem, we choose different meshsizes for different sub-domains, say\n"
5 " hxs = (xmax - xmin)/2.0*(hratio+1.0)/Mx, \n"
6 " hxf = (xmax - xmin)/2.0*(1.0+1.0/hratio)/Mx, \n"
9 …" exact - Exact Riemann solver which usually needs to perform a Newton iteration to connect…
11 …" simulation - use reference solution which is generated by smaller time step size to be true so…
13 … " characteristic - Limit the characteristic variables, this is usually preferred (default)\n"
14 "Several initial conditions can be chosen with -initial N\n\n"
15 "The problem size should be set with -da_grid_x M\n\n"
16 …"This script choose the slope limiter by biased second-order upwind procedure which is proposed by…
[all …]
H A Dex6.c3 -hratio is the ratio between mesh size of coarse grids and fine grids
4 -ts_rk_dtratio is the ratio between the large stepsize and the small stepsize
7 static const char help[] = "1D periodic Finite Volume solver in slope-limiter form with semidiscret…
8 " advection - Constant coefficient scalar advection\n"
10 … this toy problem, we choose different meshsizes for different sub-domains (slow-fast-slow), say\n"
13 …" exact - Exact Riemann solver which usually needs to perform a Newton iteration to connect…
15 …" simulation - use reference solution which is generated by smaller time step size to be true so…
17 … " characteristic - Limit the characteristic variables, this is usually preferred (default)\n"
18 "Several initial conditions can be chosen with -initial N\n\n"
19 "The problem size should be set with -da_grid_x M\n\n";
[all …]
H A Dex4.c3 -hratio is the ratio between mesh size of coarse grids and fine grids
6 static const char help[] = "1D periodic Finite Volume solver in slope-limiter form with semidiscret…
7 " advect - Constant coefficient scalar advection\n"
9 " shallow - 1D Shallow water equations (Saint Venant System)\n"
13 … this toy problem, we choose different meshsizes for different sub-domains (slow-fast-slow), say\n"
16 …" exact - Exact Riemann solver which usually needs to perform a Newton iteration to connect…
18 …" simulation - use reference solution which is generated by smaller time step size to be true so…
20 … " characteristic - Limit the characteristic variables, this is usually preferred (default)\n"
21 … " bc_type - Boundary condition for the problem, options are: periodic, outflow, inflow "
22 …iptions (initial data, physics specific features, boundary data) can be chosen with -initial N\n\n"
[all …]
H A Dex5.c3 …mall stepsize and stored into a binary file, e.g. -ts_type ssp -ts_time_step 1e-5 -ts_max_steps 30…
4 Errors can be computed in the following runs with -simulation -f reference.bin
7 -ts_rk_dtratio is the ratio between larger time step size and small time step size
8 -ts_rk_multirate_type has three choices: none (for single step RK)
13 static const char help[] = "1D periodic Finite Volume solver in slope-limiter form with semidiscret…
14 " advection - Variable coefficient scalar advection\n"
20 " you should type -simulation -f file.bin.\n"
21 " you can choose the number of grids by -da_grid_x.\n"
22 … " you can choose the value of a by -physics_advect_a1 and -physics_advect_a2.\n";
36 PetscReal range = xmax - xmin; in RangeMod()
[all …]
/petsc/src/benchmarks/streams/
H A DSSEVersion.c16 …rror SSE2 instruction set is not enabled, try adding -march=native to CFLAGS or disable by adding
18 #if !defined(PREFETCH_NTA) /* Use software prefetch and set non-temporal policy so that lines evict…
34 * Revision: 4.0-BETA, October 24, 1995
40 * the cost of floating-point operations relative to memory accesses.
46 * at least 20 clock-ticks. This will provide rate estimates
54 #define HLINE "-------------------------------------------------------------\n"
76 int BytesPerWord, j, k, size; in main() local
77 PetscInt node = -1; in main()
85 PetscCall(PetscOptionsGetInt(NULL, NULL, "-node", &node, NULL)); in main()
86 /* --- SETUP --- determine precision and check timing --- */ in main()
[all …]
H A DBasicVersion.c17 return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6); in second()
28 Revision: 4.0-BETA, October 24, 1995
34 the cost of floating-point operations relative to memory accesses.
40 at least 20 clock-ticks. This will provide rate estimates
55 cc -O stream_d.c second.c -o stream_d -lm
68 #define HLINE "-------------------------------------------------------------\n"
91 register int j, k; in main() local
94 /* --- SETUP --- determine precision and check timing --- */ in main()
96 for (j = 0; j < N; j++) { in main()
97 a[j] = 1.0; in main()
[all …]
/petsc/src/ts/tutorials/autodiff/adolc-utils/
H A Ddrivers.cxx8 REQUIRES configuration of PETSc with option --download-adolc.
10 For documentation on ADOL-C, see
11 $PETSC_ARCH/externalpackages/ADOL-C-2.6.0/ADOL-C/doc/adolc-manual.pdf
14 /* --------------------------------------------------------------------------------
16 ----------------------------------------------------------------------------- */
21 assembled (not recommended for non-toy problems!).
24 tag - tape identifier
25 u_vec - vector at which to evaluate Jacobian
26 ctx - ADOL-C context, as defined above
29 A - Mat object corresponding to Jacobian
[all …]
/petsc/src/ts/tutorials/power_grid/
H A Dex6.c1 static char help[] = "Time-dependent PDE in 2d for calculating joint PDF. \n";
3 p_t = -x_t*p_x -y_t*p_y + f(t)*p_yy
5 x_t = (y - ws) y_t = (ws/2H)*(Pm - Pmax*sin(x))
7 Boundary conditions: -bc_type 0 => Zero dirichlet boundary
8 -bc_type 1 => Steady state boundary condition
17 User-defined data structures and routines
31 PetscScalar rho; /* Cross-correlation coefficient */
54 TS ts; /* Time-stepping context */ in main()
56 Mat J; in main() local
80 PetscCall(DMCreateMatrix(user.da, &J)); in main()
[all …]
/petsc/src/snes/tests/
H A Dex20.c2 Uses 3-dimensional distributed arrays.\n\
3 A 3-dim simplified Radiative Transport test problem is used, with analytic Jacobian. \n\
9 -tleft <tl>, where <tl> indicates the left Diriclet BC \n\
10 -tright <tr>, where <tr> indicates the right Diriclet BC \n\
11 -beta <beta>, where <beta> indicates the exponent in T \n\n";
17 - Div(alpha* T^beta (GRAD T)) = 0.
26 A finite volume approximation with the usual 7-point stencil
38 /* User-defined application context */
68 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tleft", &user.tleft, NULL)); in main()
69 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tright", &user.tright, NULL)); in main()
[all …]
H A Dex69.c12 User-defined routines and data structures
22 PetscBool draw_contours; /* flag - 1 indicates drawing contours */
40 AppCtx user; /* user-defined work context */ in main()
45 Mat J = NULL, Jmf = NULL; in main() local
54 PetscCall(PetscOptionsGetBool(NULL, NULL, "-error_in_matmult", &errorinmatmult, NULL)); in main()
55 PetscCall(PetscOptionsGetBool(NULL, NULL, "-error_in_pcapply", &errorinpcapply, NULL)); in main()
56 PetscCall(PetscOptionsGetBool(NULL, NULL, "-error_in_pcsetup", &errorinpcsetup, NULL)); in main()
58 PetscCall(PetscOptionsGetBool(NULL, NULL, "-error_in_domain", &user.errorindomain, NULL)); in main()
60 PetscCall(PetscOptionsGetBool(NULL, NULL, "-error_in_domainmf", &user.errorindomainmf, NULL)); in main()
82 PetscCall(PetscOptionsGetReal(NULL, NULL, "-lidvelocity", &user.lidvelocity, NULL)); in main()
[all …]
/petsc/src/dm/impls/plex/
H A Dgmshlex.h7 i,j,k: coordinate indices
14 #define SI2(p, i, j) ((i) + (SN2(p) - SN2((p) - (j)))) argument
15 #define SI3(p, i, j, k) (SI2((p) - (k), i, j) + (SN3(p) - SN3((p) - (k)))) argument
17 #define SL2(p, i, j) SL1((p) - 1, i) SL1((p) - (i), j) argument
18 #define SL3(p, i, j, k) SL1((p) - 2, i) SL1((p) - (i), j) SL1((p) - (i) - (j), k) argument
24 #define BI2(p, i, j) ((i) + (j) * BN1(p)) argument
25 #define BI3(p, i, j, k) ((i) + BI2(p, j, k) * BN1(p)) argument
27 #define BL2(p, i, j) BL1(p, i) BL1(p, j) argument
28 #define BL3(p, i, j, k) BL1(p, i) BL1(p, j) BL1(p, k) argument
70 #define loop2(i, j) SL2(p, i, j) in GmshLexOrder_TRI() argument
[all …]
/petsc/src/snes/tutorials/
H A Dex30.c1 static const char help[] = "Steady-state 2D subduction flow, pressure and temperature solver.\n\
3 ---------------------------------ex30 help---------------------------------\n\
4 -OPTION <DEFAULT> = (UNITS) DESCRIPTION.\n\n\
5 -width <320> = (km) width of domain.\n\
6 -depth <300> = (km) depth of domain.\n\
7 -slab_dip <45> = (degrees) dip angle of the slab (determines the grid aspect ratio).\n\
8 -lid_depth <35> = (km) depth of the static conductive lid.\n\
9 -fault_depth <35> = (km) depth of slab-wedge mechanical coupling\n\
12 -ni <82> = grid cells in x-direction. (nj adjusts to accommodate\n\
13 the slab dip & depth). DO NOT USE -da_grid_x option!!!\n\
[all …]
H A Dex18.c2 Uses 2-dimensional distributed arrays.\n\
3 A 2-dim simplified Radiative Transport test problem is used, with analytic Jacobian. \n\
9 -tleft <tl>, where <tl> indicates the left Diriclet BC \n\
10 -tright <tr>, where <tr> indicates the right Diriclet BC \n\
11 -beta <beta>, where <beta> indicates the exponent in T \n\n";
17 - Div(alpha* T^beta (GRAD T)) = 0.
26 A finite volume approximation with the usual 5-point stencil
38 /* User-defined application context */
66 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tleft", &user.tleft, NULL)); in main()
67 PetscCall(PetscOptionsGetReal(NULL, NULL, "-tright", &user.tright, NULL)); in main()
[all …]
H A Dex19.c6 The 2D driven cavity problem is solved in a velocity-vorticity formulation.\n\
8 -lidvelocity &ltlid&gt, where &ltlid&gt = dimensionless velocity of lid\n\
9 -grashof &ltgr&gt, where &ltgr&gt = dimensionless temperature gradent\n\
10 -prandtl &ltpr&gt, where &ltpr&gt = dimensionless thermal/momentum diffusity ratio\n\
11 -contours : draw contour plots of solution\n\n";
18 /*F-----------------------------------------------------------------------
25 - \triangle U - \nabla_y \Omega & = & 0 \\
26 - \triangle V + \nabla_x\Omega & = & 0 \\
27 - \triangle \Omega + \nabla \cdot ([U*\Omega,V*\Omega]) - GR* \nabla_x T & = & 0 \\
28 - \triangle T + PR* \nabla \cdot ([U*T,V*T]) & = & 0
[all …]
/petsc/src/ts/tutorials/
H A Dex15.c1 static char help[] = "Time-dependent PDE in 2d. Modified from ex13.c for illustrating how to solve …
5 At t=0: u(x,y) = exp(c*r*r*r), if r=PetscSqrtReal((x-.5)*(x-.5) + (y-.5)*(y-.5)) < .125
16 mpiexec -n 2 ./ex15 -da_grid_x 40 -da_grid_y 40 -ts_max_steps 2 -snes_monitor -ksp_monitor
17 ./ex15 -da_grid_x 40 -da_grid_y 40 -draw_pause .1 -boundary 1 -ts_monitor_draw_solution
18 ./ex15 -da_grid_x 40 -da_grid_y 40 -draw_pause .1 -boundary 1 -Jtype 2 -nstencilpts 9
27 User-defined data structures and routines
47 Mat J, Jmf = NULL; /* Jacobian matrices */ in main() local
50 AppCtx user; /* user-defined work context */ in main()
62 user.c = -30.0; in main()
66 PetscCall(PetscOptionsGetInt(NULL, NULL, "-nstencilpts", &user.nstencilpts, NULL)); in main()
[all …]
H A Dex26.c3 The 2D driven cavity problem is solved in a velocity-vorticity formulation.\n\
5 -lidvelocity <lid>, where <lid> = dimensionless velocity of lid\n\
6 -grashof <gr>, where <gr> = dimensionless temperature gradent\n\
7 -prandtl <pr>, where <pr> = dimensionless thermal/momentum diffusity ratio\n\
8 -contours : draw contour plots of solution\n\n";
10 See src/snes/tutorials/ex19.c for the steady-state version.
17 Continuation and Differential-Algebraic Equations, 2003.
27 nonlinear solve (e.g., -snes_type newtonls). The DAE versus ODE variants
28 are controlled using the -parabolic option.
37 a relative tolerance of 1.e-3. On the example problem, setting
[all …]
/petsc/src/ksp/pc/impls/cp/
H A Dcp.c11 PetscScalar *a; /* non-zeros by column */
12 PetscInt *i, *j; /* offsets of nonzeros by column, non-zero indices by column */ member
17 PC_CP *cp = (PC_CP *)pc->data; in PCSetUp_CP()
18 PetscInt i, j, *colcnt; in PCSetUp_CP() local
20 Mat_SeqAIJ *aij = (Mat_SeqAIJ *)pc->pmat->data; in PCSetUp_CP()
23 PetscCall(PetscObjectTypeCompare((PetscObject)pc->pmat, MATSEQAIJ, &flg)); in PCSetUp_CP()
26 PetscCall(MatGetLocalSize(pc->pmat, &cp->m, &cp->n)); in PCSetUp_CP()
27 PetscCheck(cp->m == cp->n, PETSC_COMM_SELF, PETSC_ERR_SUP, "Currently only for square matrices"); in PCSetUp_CP()
29 if (!cp->work) PetscCall(MatCreateVecs(pc->pmat, &cp->work, NULL)); in PCSetUp_CP()
30 if (!cp->d) PetscCall(PetscMalloc1(cp->n, &cp->d)); in PCSetUp_CP()
[all …]
/petsc/src/ksp/ksp/tests/
H A Dex10.c4 -m : problem size\n\n";
25 PetscScalar v, neg1 = -1.0; in main()
32 PetscCall(PetscOptionsGetInt(NULL, NULL, "-m", &m, NULL)); in main()
48 v = (PetscScalar)(i - rstart + 100 * rank); in main()
54 /* Compute right-hand side */ in main()
79 /* -------------------------------------------------------------------- */
81 GetElasticityMatrix - Forms 3D linear elasticity matrix.
85 PetscInt i, j, k, i1, i2, j_1, j2, k1, k2, h1, h2, shiftx, shifty, shiftz; in GetElasticityMatrix() local
107 for (j = 0; j < m; j++) { in GetElasticityMatrix()
110 base = 2 * k * shiftz + 2 * j * shifty + 2 * i * shiftx; in GetElasticityMatrix()
[all …]
/petsc/src/ksp/ksp/impls/gmres/
H A Dborthog2.c11 KSPGMRESClassicalGramSchmidtOrthogonalization - This is the basic orthogonalization routine
12 using classical Gram-Schmidt with possible iterative refinement to improve the stability
17 + ksp - `KSP` object, must be associated with `KSPGMRES`, `KSPFGMRES`, or `KSPLGMRES` Krylov method
18 - it - one less than the current GMRES restart iteration, i.e. the size of the Krylov space
21 + -ksp_gmres_classicalgramschmidt - Activates `KSPGMRES…
22 - -ksp_gmres_cgs_refinement_type <refine_never,refine_ifneeded,refine_always> - determine if iterat…
23 … used to increase the stability of the classical Gram-Schmidt orthogonalization.
37 KSP_GMRES *gmres = (KSP_GMRES *)ksp->data; in KSPGMRESClassicalGramSchmidtOrthogonalization()
38 PetscInt j; in KSPGMRESClassicalGramSchmidtOrthogonalization() local
41 PetscBool refine = (PetscBool)(gmres->cgstype == KSP_GMRES_CGS_REFINE_ALWAYS); in KSPGMRESClassicalGramSchmidtOrthogonalization()
[all …]
/petsc/src/ts/tutorials/advection-diffusion-reaction/
H A Dreaction_diffusion.c6 …This example is taken from the book, Numerical Solution of Time-Dependent Advection-Diffusion-Reac…
7 W. Hundsdorf and J.G. Verwer, Page 21, Pattern Formation with Reaction-Diffusion Equations
9 u_t = D_1 (u_{xx} + u_{yy}) - u*v^2 + \gamma(1 -u) \\
10 v_t = D_2 (v_{xx} + v_{yy}) + u*v^2 - (\gamma + \kappa)v
17 RHSFunction - Evaluates nonlinear function, F(x).
20 . ts - the TS context
21 . X - input vector
22 . ptr - optional user-defined context, as set by TSSetRHSFunction()
25 . F - function vector
31 PetscInt i, j, Mx, My, xs, ys, xm, ym; in RHSFunction() local
[all …]
/petsc/src/vec/is/is/tests/
H A Dex13.c13 PetscInt *idx, i, j; in CreateIS() local
22 for (i = 0, j = first; i < n; i++, j += step) idx[i] = j; in CreateIS()
30 for (i = 0, j = first; i < n; i++, j += step) idx[i] = j; in CreateIS()
42 PetscInt i, j = 0, type; in main() local
50 PetscCall(PetscOptionsGetInt(NULL, NULL, "-n", &n, NULL)); in main()
51 PetscCall(PetscOptionsGetInt(NULL, NULL, "-first", &first, NULL)); in main()
52 PetscCall(PetscOptionsGetInt(NULL, NULL, "-step", &step, NULL)); in main()
53 PetscCall(PetscOptionsGetInt(NULL, NULL, "-offset", &offset, NULL)); in main()
54 PetscCall(PetscOptionsGetBool(NULL, NULL, "-verbose", &verbose, NULL)); in main()
57 PetscCall(CreateIS(comm, type, n, first + offset, step, &is[j])); in main()
[all …]
/petsc/src/mat/impls/baij/seq/
H A Dbaijfact13.c12 Mat_SeqBAIJ *a = (Mat_SeqBAIJ *)A->data, *b = (Mat_SeqBAIJ *)C->data; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
13 IS isrow = b->row, isicol = b->icol; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
15 PetscInt i, j, n = a->mbs, *bi = b->i, *bj = b->j; in MatILUFactorNumeric_SeqBAIJ_3_inplace() local
16 PetscInt *ajtmpold, *ajtmp, nz, row, *ai = a->i, *aj = a->j; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
22 MatScalar *ba = b->a, *aa = a->a; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
23 PetscReal shift = info->shiftamount; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
28 A->factortype = MAT_FACTOR_NONE; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
30 A->factortype = MAT_FACTOR_ILU; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
34 allowzeropivot = PetscNot(A->erroriffailure); in MatILUFactorNumeric_SeqBAIJ_3_inplace()
37 nz = bi[i + 1] - bi[i]; in MatILUFactorNumeric_SeqBAIJ_3_inplace()
[all …]

12345678910>>...49