| /petsc/src/dm/impls/swarm/ |
| H A D | swarmpic_da.c | 6 static PetscErrorCode private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular(PetscInt dim, PetscInt np[… in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() argument 14 switch (dim) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 25 for (d = 0; d < dim; d++) ds[d] = 2.0 / ((PetscReal)np[d]); in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 27 PetscCall(PetscMalloc1(dim * npoints, &xi)); in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 28 switch (dim) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 32 xi[dim * cnt + 0] = -1.0 + 0.5 * ds[d] + ii * ds[0]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 41 xi[dim * cnt + 0] = -1.0 + 0.5 * ds[0] + ii * ds[0]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 42 xi[dim * cnt + 1] = -1.0 + 0.5 * ds[1] + jj * ds[1]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 53 xi[dim * cnt + 0] = -1.0 + 0.5 * ds[0] + ii * ds[0]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 54 xi[dim * cnt + 1] = -1.0 + 0.5 * ds[1] + jj * ds[1]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() [all …]
|
| H A D | swarmpic_plex.c | 19 static PetscErrorCode private_PetscFECreateDefault_scalar_pk1(DM dm, PetscInt dim, PetscBool isSimp… in private_PetscFECreateDefault_scalar_pk1() argument 38 PetscCall(PetscSpaceSetNumVariables(P, dim)); in private_PetscFECreateDefault_scalar_pk1() 46 …PetscCall(DMPlexCreateReferenceCell(PETSC_COMM_SELF, DMPolytopeTypeSimpleShape(dim, isSimplex), &K… in private_PetscFECreateDefault_scalar_pk1() 70 PetscCall(PetscDTStroudConicalQuadrature(dim, 1, quadPointsPerEdge, -1.0, 1.0, &q)); in private_PetscFECreateDefault_scalar_pk1() 71 PetscCall(PetscDTStroudConicalQuadrature(dim - 1, 1, quadPointsPerEdge, -1.0, 1.0, &fq)); in private_PetscFECreateDefault_scalar_pk1() 73 PetscCall(PetscDTGaussTensorQuadrature(dim, 1, quadPointsPerEdge, -1.0, 1.0, &q)); in private_PetscFECreateDefault_scalar_pk1() 74 PetscCall(PetscDTGaussTensorQuadrature(dim - 1, 1, quadPointsPerEdge, -1.0, 1.0, &fq)); in private_PetscFECreateDefault_scalar_pk1() 85 PetscInt dim, nfaces, nbasis; in private_DMSwarmInsertPointsUsingCellDM_PLEX_SubDivide() local 101 PetscCall(DMGetDimension(dmc, &dim)); in private_DMSwarmInsertPointsUsingCellDM_PLEX_SubDivide() 105 if (nfaces == (dim + 1)) is_simplex = PETSC_TRUE; in private_DMSwarmInsertPointsUsingCellDM_PLEX_SubDivide() [all …]
|
| /petsc/src/vec/is/sf/utils/ |
| H A D | sfcoord.c | 3 static PetscErrorCode GetBoundingBox_Internal(PetscInt npoints, PetscInt dim, const PetscReal *coor… in GetBoundingBox_Internal() argument 6 for (PetscInt d = 0; d < dim; d++) { in GetBoundingBox_Internal() 7 bbox[0 * dim + d] = PETSC_MAX_REAL; in GetBoundingBox_Internal() 8 bbox[1 * dim + d] = PETSC_MIN_REAL; in GetBoundingBox_Internal() 11 for (PetscInt d = 0; d < dim; d++) { in GetBoundingBox_Internal() 12 bbox[0 * dim + d] = PetscMin(bbox[0 * dim + d], coords[i * dim + d]); in GetBoundingBox_Internal() 13 bbox[1 * dim + d] = PetscMax(bbox[1 * dim + d], coords[i * dim + d]); in GetBoundingBox_Internal() 19 static PetscBool IntersectBoundingBox_Internal(PetscInt dim, const PetscReal *a, const PetscReal *b… in IntersectBoundingBox_Internal() argument 21 for (PetscInt d = 0; d < dim; d++) { in IntersectBoundingBox_Internal() 22 …if (a[1 * dim + d] + tol < b[0 * dim + d] || b[1 * dim + d] + tol < a[0 * dim + d]) return PETSC_F… in IntersectBoundingBox_Internal() [all …]
|
| /petsc/src/mat/impls/cufft/ |
| H A D | cufft.cu | 11 PetscInt *dim; member 20 PetscInt ndim = cufft->ndim, *dim = cufft->dim; in MatMult_SeqCUFFT() local 30 PetscCallCUFFT(cufftPlan1d(&cufft->p_forward, dim[0], CUFFT_C2C, 1)); in MatMult_SeqCUFFT() 33 PetscCallCUFFT(cufftPlan2d(&cufft->p_forward, dim[0], dim[1], CUFFT_C2C)); in MatMult_SeqCUFFT() 36 PetscCallCUFFT(cufftPlan3d(&cufft->p_forward, dim[0], dim[1], dim[2], CUFFT_C2C)); in MatMult_SeqCUFFT() 43 …PetscCallCUDA(cudaMemcpy(devArray, x_array, sizeof(cufftComplex) * dim[ndim], cudaMemcpyHostToDevi… in MatMult_SeqCUFFT() 47 …PetscCallCUDA(cudaMemcpy(y_array, devArray, sizeof(cufftComplex) * dim[ndim], cudaMemcpyDeviceToHo… in MatMult_SeqCUFFT() 57 PetscInt ndim = cufft->ndim, *dim = cufft->dim; in MatMultTranspose_SeqCUFFT() local 67 PetscCallCUFFT(cufftPlan1d(&cufft->p_backward, dim[0], CUFFT_C2C, 1)); in MatMultTranspose_SeqCUFFT() 70 PetscCallCUFFT(cufftPlan2d(&cufft->p_backward, dim[0], dim[1], CUFFT_C2C)); in MatMultTranspose_SeqCUFFT() [all …]
|
| /petsc/src/sys/classes/draw/utils/ |
| H A D | lgc.c | 100 int i, j, dim, nopts; in PetscDrawLGSPDraw() local 101 dim = lg->dim; in PetscDrawLGSPDraw() 103 for (i = 0; i < dim; i++) { in PetscDrawLGSPDraw() 105 …cCall(PetscDrawLine(draw, lg->x[(j - 1) * dim + i], lg->y[(j - 1) * dim + i], lg->x[j * dim + i], … in PetscDrawLGSPDraw() 106 …if (lg->use_markers) PetscCall(PetscDrawMarker(draw, lg->x[j * dim + i], lg->y[j * dim + i], PETSC… in PetscDrawLGSPDraw() 109 dim = sp->dim; in PetscDrawLGSPDraw() 111 for (i = 0; i < dim; i++) { in PetscDrawLGSPDraw() 112 …for (j = 0; j < nopts; j++) PetscCall(PetscDrawMarker(draw, sp->x[j * dim + i], sp->y[j * dim + i]… in PetscDrawLGSPDraw() 146 PetscErrorCode PetscDrawLGCreate(PetscDraw draw, PetscInt dim, PetscDrawLG *outlg) in PetscDrawLGCreate() argument 152 PetscValidLogicalCollectiveInt(draw, dim, 2); in PetscDrawLGCreate() [all …]
|
| H A D | dscatter.c | 38 PetscErrorCode PetscDrawSPCreate(PetscDraw draw, int dim, PetscDrawSP *drawsp) in PetscDrawSPCreate() argument 52 sp->dim = -1; in PetscDrawSPCreate() 62 PetscCall(PetscDrawSPSetDimension(sp, dim)); in PetscDrawSPCreate() 82 PetscErrorCode PetscDrawSPSetDimension(PetscDrawSP sp, int dim) in PetscDrawSPSetDimension() argument 86 if (sp->dim == dim) PetscFunctionReturn(PETSC_SUCCESS); in PetscDrawSPSetDimension() 87 sp->dim = dim; in PetscDrawSPSetDimension() 89 …PetscCall(PetscMalloc3(dim * PETSC_DRAW_SP_CHUNK_SIZE, &sp->x, dim * PETSC_DRAW_SP_CHUNK_SIZE, &sp… in PetscDrawSPSetDimension() 90 sp->len = dim * PETSC_DRAW_SP_CHUNK_SIZE; in PetscDrawSPSetDimension() 109 PetscErrorCode PetscDrawSPGetDimension(PetscDrawSP sp, int *dim) in PetscDrawSPGetDimension() argument 113 PetscAssertPointer(dim, 2); in PetscDrawSPGetDimension() [all …]
|
| /petsc/src/dm/impls/product/ |
| H A D | productutils.c | 25 PetscInt dim; in DMProductGetDM() local 29 PetscCall(DMGetDimension(dm, &dim)); in DMProductGetDM() 30 …eck(slot < dim && slot >= 0, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "slot num… in DMProductGetDM() 57 PetscInt dim; in DMProductSetDM() local 61 PetscCall(DMGetDimension(dm, &dim)); in DMProductSetDM() 62 …eck(slot < dim && slot >= 0, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "slot num… in DMProductSetDM() 86 PetscInt dim; in DMProductSetDimensionIndex() local 90 PetscCall(DMGetDimension(dm, &dim)); in DMProductSetDimensionIndex() 91 …eck(slot < dim && slot >= 0, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "slot num… in DMProductSetDimensionIndex() 92 product->dim[slot] = idx; in DMProductSetDimensionIndex() [all …]
|
| /petsc/src/mat/impls/fft/fftw/ |
| H A D | fftw.c | 46 PetscInt ndim = fft->ndim, *dim = fft->dim; in MatMult_SeqFFTW() local 61 …fftw->p_forward = fftw_plan_dft_1d(dim[0], (fftw_complex *)x_array, (fftw_complex *)y_array, FFTW_… in MatMult_SeqFFTW() 63 …fftw->p_forward = fftw_plan_dft_r2c_1d(dim[0], (double *)x_array, (fftw_complex *)y_array, fftw->p… in MatMult_SeqFFTW() 68 …fftw->p_forward = fftw_plan_dft_2d(dim[0], dim[1], (fftw_complex *)x_array, (fftw_complex *)y_arra… in MatMult_SeqFFTW() 70 …fftw->p_forward = fftw_plan_dft_r2c_2d(dim[0], dim[1], (double *)x_array, (fftw_complex *)y_array,… in MatMult_SeqFFTW() 75 …fftw->p_forward = fftw_plan_dft_3d(dim[0], dim[1], dim[2], (fftw_complex *)x_array, (fftw_complex … in MatMult_SeqFFTW() 77 …fftw->p_forward = fftw_plan_dft_r2c_3d(dim[0], dim[1], dim[2], (double *)x_array, (fftw_complex *)… in MatMult_SeqFFTW() 85 iodims[ndim - 1].n = (ptrdiff_t)dim[ndim - 1]; in MatMult_SeqFFTW() 88 iodims[i].n = (ptrdiff_t)dim[i]; in MatMult_SeqFFTW() 95 iodims[ndim - 1].n = (int)dim[ndim - 1]; in MatMult_SeqFFTW() [all …]
|
| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex39.c | 24 static PetscErrorCode zero_func(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pet… in zero_func() argument 34 static PetscErrorCode linear_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pets… in linear_u() argument 40 static PetscErrorCode linear_p(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pets… in linear_p() argument 42 u[0] = dim; in linear_p() 51 static PetscErrorCode sinusoid_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pe… in sinusoid_u() argument 57 static PetscErrorCode sinusoid_p(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pe… in sinusoid_p() argument 61 for (d = 0; d < dim; ++d) u[0] += 2 * PETSC_PI * PetscCosReal(2 * PETSC_PI * x[d]); in sinusoid_p() 66 static void f0_v_linear(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pet… in f0_v_linear() argument 71 PetscCallAbort(PETSC_COMM_SELF, PetscCalloc1(dim, &u_rhs)); in f0_v_linear() 72 PetscCallAbort(PETSC_COMM_SELF, linear_u(dim, t, x, dim, u_rhs, NULL)); in f0_v_linear() [all …]
|
| /petsc/src/dm/field/tutorials/ |
| H A D | ex1.c | 7 static PetscErrorCode ViewResults(PetscViewer viewer, PetscInt N, PetscInt dim, PetscScalar *B, Pet… in ViewResults() argument 13 PetscCall(PetscScalarView(N * dim, D, viewer)); in ViewResults() 15 PetscCall(PetscScalarView(N * dim * dim, H, viewer)); in ViewResults() 20 PetscCall(PetscRealView(N * dim, rD, viewer)); in ViewResults() 22 PetscCall(PetscRealView(N * dim * dim, rH, viewer)); in ViewResults() 29 PetscInt dim, i, nc; in TestEvaluate() local 41 PetscCall(DMGetDimension(dm, &dim)); in TestEvaluate() 42 …PetscCall(VecCreateFromOptions(PetscObjectComm((PetscObject)field), NULL, 1, n * dim, PETSC_DETERM… in TestEvaluate() 43 PetscCall(VecSetBlockSize(points, dim)); in TestEvaluate() 45 for (i = 0; i < n * dim; i++) PetscCall(PetscRandomGetValue(rand, &array[i])); in TestEvaluate() [all …]
|
| /petsc/src/dm/impls/swarm/tests/ |
| H A D | ex4.c | 92 PetscInt dim; in CreateSwarm() local 95 PetscCall(DMGetDimension(dm, &dim)); in CreateSwarm() 98 PetscCall(DMSetDimension(*sw, dim)); in CreateSwarm() 102 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "velocity", dim, PETSC_REAL)); in CreateSwarm() 104 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "initCoordinates", dim, PETSC_REAL)); in CreateSwarm() 135 PetscInt dim, d, Np, p; in RHSFunction() local 139 PetscCall(DMGetDimension(sw, &dim)); in RHSFunction() 143 Np /= 2 * dim; in RHSFunction() 145 for (d = 0; d < dim; ++d) { in RHSFunction() 146 g[(p * 2 + 0) * dim + d] = u[(p * 2 + 1) * dim + d]; in RHSFunction() [all …]
|
| H A D | ex6.c | 74 static void laplacian_f1(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pe… in laplacian_f1() argument 77 for (d = 0; d < dim; ++d) f1[d] = u_x[d]; in laplacian_f1() 80 static void laplacian_g3(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pe… in laplacian_g3() argument 83 for (d = 0; d < dim; ++d) g3[d * dim + d] = 1.0; in laplacian_g3() 90 static void f0_q(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt u… in f0_q() argument 92 for (PetscInt c = 0; c < dim; ++c) f0[c] += u[uOff[0] + c]; in f0_q() 95 static void f1_q(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt u… in f1_q() argument 97 for (PetscInt d = 0; d < dim; ++d) f1[d * dim + d] += u[uOff[1]]; in f1_q() 101 static void g0_qq(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g0_qq() argument 104 for (c = 0; c < dim; ++c) g0[c * dim + c] += 1.0; in g0_qq() [all …]
|
| H A D | ex5.c | 54 PetscInt dim; in CreateSwarm() local 57 PetscCall(DMGetDimension(dm, &dim)); in CreateSwarm() 60 PetscCall(DMSetDimension(*sw, dim)); in CreateSwarm() 64 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "velocity", dim, PETSC_REAL)); in CreateSwarm() 66 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "initCoordinates", dim, PETSC_REAL)); in CreateSwarm() 67 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "initVelocity", dim, PETSC_REAL)); in CreateSwarm() 99 PetscInt dim, d, Np, p; in RHSFunction() local 103 PetscCall(DMGetDimension(sw, &dim)); in RHSFunction() 109 Np /= 2 * dim; in RHSFunction() 111 const PetscReal x0 = coords[p * dim + 0]; in RHSFunction() [all …]
|
| /petsc/src/dm/field/impls/da/ |
| H A D | dmfieldda.c | 31 PetscInt i, dim; in DMFieldView_DA() local 37 PetscCall(DMGetDimension(dm, &dim)); in DMFieldView_DA() 39 for (i = 0; i < (1 << dim); i++) { in DMFieldView_DA() 67 #define MEHess(out, cf, etaB, etaD, dim, nc, cast) \ argument 70 for (_m = 0; _m < (nc) * (dim) * (dim); _m++) (out)[_m] = 0.; \ 71 for (_j = 0; _j < (dim); _j++) { \ 72 for (_k = _j + 1; _k < (dim); _k++) { \ 76 (out)[(_m * (dim) + _k) * (dim) + _j] += cast(c); \ 77 (out)[(_m * (dim) + _j) * (dim) + _k] += cast(c); \ 83 static void MultilinearEvaluate(PetscInt dim, PetscReal (*coordRange)[2], PetscInt nc, PetscScalar … in MultilinearEvaluate() argument [all …]
|
| /petsc/src/dm/dt/tests/ |
| H A D | ex9.c | 6 static PetscErrorCode testOrthogonality(PetscInt dim, PetscInt deg) in testOrthogonality() argument 14 PetscCall(PetscDTStroudConicalQuadrature(dim, 1, deg + 1, -1., 1., &q)); in testOrthogonality() 16 PetscCall(PetscDTBinomialInt(dim + deg, dim, &Npoly)); in testOrthogonality() 18 PetscCall(PetscDTPKDEvalJet(dim, npoints, points, deg, 0, p)); in testOrthogonality() 33 static PetscErrorCode testDerivativesLegendre(PetscInt dim, PetscInt deg, PetscInt k) in testDerivativesLegendre() argument 53 PetscCall(PetscDTBinomialInt(dim + deg, dim, &Np)); in testDerivativesLegendre() 54 PetscCall(PetscDTBinomialInt(dim + k, dim, &Nk)); in testDerivativesLegendre() 57 PetscCall(PetscDTStroudConicalQuadrature(dim, 1, deg + 1, -1., 1., &q)); in testDerivativesLegendre() 60 PetscCall(PetscDTPKDEvalJet(dim, npoints, points, deg, 0, proj)); in testDerivativesLegendre() 71 PetscCall(PetscMalloc2(dim, °tup, dim, &ktup)); in testDerivativesLegendre() [all …]
|
| H A D | ex4.c | 6 static PetscErrorCode CheckSymmetry(PetscInt dim, PetscInt order, PetscBool tensor) in CheckSymmetry() argument 20 …PetscCall(DMPlexCreateReferenceCell(PETSC_COMM_SELF, DMPolytopeTypeSimpleShape(dim, tensor ? PETSC… in CheckSymmetry() 35 …nc, &ids, nFunc, &idsCopy, nFunc, &idsCopy2, nFunc * dim, &vals, nFunc * dim, &valsCopy, nFunc * d… in CheckSymmetry() 46 for (j = 0; j < dim; j++) vals[dim * i + j] = valsCopy2[dim * i + j] = (PetscScalar)points[j]; in CheckSymmetry() 75 …for (l = 0; l < dim; l++) valsCopy[kLocal * dim + l] = vals[(offset + k) * dim + l] * (flip ? flip… in CheckSymmetry() 83 …Order %" PetscInt_FMT ", Point %" PetscInt_FMT " Symmetry %" PetscInt_FMT, dim, tensor ? "Tensor" … in CheckSymmetry() 88 … PetscCall(VecCreateSeqWithArray(PETSC_COMM_SELF, dim, numDofs[depth] * dim, valsCopy, &vec)); in CheckSymmetry() 97 …for (l = 0; l < dim; l++) valsCopy2[(offset + k) * dim + l] = valsCopy[kLocal * dim + l] * (flip ?… in CheckSymmetry() 100 …, functional %" PetscInt_FMT ": (%" PetscInt_FMT " != %" PetscInt_FMT ")", dim, tensor ? "Tensor" … in CheckSymmetry() 101 for (l = 0; l < dim; l++) { in CheckSymmetry() [all …]
|
| H A D | ex15.c | 7 static PetscErrorCode testQuadrature(PetscInt dim, PetscInt degree, PetscDTSimplexQuadratureType ty… in testQuadrature() argument 19 PetscCall(PetscDTSimplexQuadrature(dim, degree, type, &quad)); in testQuadrature() 21 PetscCall(PetscDTBinomialInt(dim + p_degree, dim, &Nb)); in testQuadrature() 22 PetscCall(PetscDTBinomialInt(dim + p_degree_min, dim, &Nb_min)); in testQuadrature() 24 PetscCall(PetscDTPKDEvalJet(dim, num_points, points, p_degree, 0, eval)); in testQuadrature() 33 … %s, error in <P_PKD(%" PetscInt_FMT "),P_PKD%" PetscInt_FMT "d)> = %g\n", dim, degree, PetscDTSim… in testQuadrature() 34 …od %s, error in <P_PKD(%" PetscInt_FMT "),P_PKD(%" PetscInt_FMT ")> = %g", dim, degree, PetscDTSim… in testQuadrature() 48 for (PetscInt dim = 0; dim <= 3; dim++) { in main() local 49 for (PetscInt deg = 0; deg <= dimdeg[dim]; deg++) { in main() 52 for (PetscInt t = 0; t < 3; t++) PetscCall(testQuadrature(dim, deg, types[t])); in main()
|
| /petsc/src/ts/tests/ |
| H A D | ex27.c | 68 PetscInt dim, d, cStart, cEnd, c, Np, p; in SetInitialCoordinates() local 80 PetscCall(DMGetDimension(sw, &dim)); in SetInitialCoordinates() 86 PetscCall(PetscMalloc5(dim, ¢roid, dim, &xi0, dim, &v0, dim * dim, &J, dim * dim, &invJ)); in SetInitialCoordinates() 87 for (d = 0; d < dim; ++d) xi0[d] = -1.0; in SetInitialCoordinates() 94 for (d = 0; d < dim; ++d) coords[c * dim + d] = centroid[d]; in SetInitialCoordinates() 102 for (d = 0; d < dim; ++d) { in SetInitialCoordinates() 107 for (d = 0; d < dim; ++d) refcoords[d] -= PetscSqrtReal(dim) * sum; in SetInitialCoordinates() 109 PetscCall(DMPlexReferenceToCoordinates(dm, c, 1, refcoords, &coords[n * dim])); in SetInitialCoordinates() 116 for (d = 0; d < dim; ++d) { in SetInitialCoordinates() 120 velocity[p * dim + d] = v_val; in SetInitialCoordinates() [all …]
|
| H A D | ex35.c | 9 PetscInt dim; member 16 options->dim = 2; in ProcessOptions() 51 PetscInt p, dim, Np; in main() local 69 dim = user.dim; in main() 71 PetscCall(PetscMalloc2(Np * dim, &x, Np * dim, &v)); in main() 96 x[p * dim] = value; in main() 97 x[p * dim + 1] = 0.; in main() 99 v[p * dim] = temp; in main() 100 v[p * dim + 1] = 0.; in main() 108 PetscCall(VecSetSizes(randVec, PETSC_DECIDE, Np * dim)); in main() [all …]
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexmetric.c | 847 PetscInt dim; in DMPlexP1FieldCreate_Private() local 852 PetscCall(DMGetDimension(dm, &dim)); in DMPlexP1FieldCreate_Private() 855 PetscCall(PetscFECreateLagrange(comm, dim, size, PETSC_TRUE, 1, PETSC_DETERMINE, &fe)); in DMPlexP1FieldCreate_Private() 955 static void identity(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscI… in identity() argument 1034 static PetscErrorCode LAPACKsyevFail(PetscInt dim, PetscScalar Mpos[]) in LAPACKsyevFail() argument 1040 for (i = 0; i < dim; ++i) { in LAPACKsyevFail() 1043 for (j = 0; j < dim; ++j) { in LAPACKsyevFail() 1044 …if (j < dim - 1) PetscCall(PetscPrintf(PETSC_COMM_SELF, "%15.8e, ", (double)PetscAbsScalar(Mpos[i … in LAPACKsyevFail() 1045 … else PetscCall(PetscPrintf(PETSC_COMM_SELF, "%15.8e", (double)PetscAbsScalar(Mpos[i * dim + j]))); in LAPACKsyevFail() 1047 if (i < dim - 1) PetscCall(PetscPrintf(PETSC_COMM_SELF, "]\n")); in LAPACKsyevFail() [all …]
|
| H A D | plexgeometry.c | 205 static PetscErrorCode DMPlexGetPlaneSimplexIntersection_Coords_Internal(DM dm, PetscInt dim, PetscI… in DMPlexGetPlaneSimplexIntersection_Coords_Internal() argument 220 for (PetscInt v = 0; v < dim + 1; ++v) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 235 for (v = 0; v < dim + 1; ++v) in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 237 if (v == dim + 1) PetscFunctionReturn(PETSC_SUCCESS); in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 238 for (v = 0; v < dim + 1; ++v) in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 240 if (v == dim + 1) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 246 for (PetscInt v = 0; v < dim + 1; ++v) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 255 for (PetscInt w = v + 1; w < dim + 1; ++w) { in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 269 static PetscErrorCode DMPlexGetPlaneSimplexIntersection_Internal(DM dm, PetscInt dim, PetscInt c, c… in DMPlexGetPlaneSimplexIntersection_Internal() argument 279 …heck(cdim == dim, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "DM has coordinates in %" PetscInt_FMT "D … in DMPlexGetPlaneSimplexIntersection_Internal() [all …]
|
| /petsc/src/dm/dt/dualspace/impls/lagrange/tests/ |
| H A D | ex1.c | 10 PetscInt dim; member 19 …PetscHashCombine(PetscHashCombine(PetscHashCombine(PetscHashInt((key).dim), PetscHashInt((key).ord… 22 …(((k1).dim == (k2).dim) ? ((k1).order == (k2).order) ? ((k1).formDegree == (k2).formDegree) ? ((k1… 26 static PetscErrorCode ExpectedNumDofs_Total(PetscInt dim, PetscInt order, PetscInt formDegree, Pets… 27 static PetscErrorCode ExpectedNumDofs_Interior(PetscInt dim, PetscInt order, PetscInt formDegree, P… 29 static PetscErrorCode ExpectedNumDofs_Total(PetscInt dim, PetscInt order, PetscInt formDegree, Pets… in ExpectedNumDofs_Total() argument 40 PetscCall(PetscDTBinomialInt(order + dim, order + formDegree, &rnchooserk)); in ExpectedNumDofs_Total() 47 PetscCall(PetscDTBinomialInt(order + dim, order + formDegree, &rnchooserk)); in ExpectedNumDofs_Total() 56 PetscCall(PetscDTBinomialInt(dim, formDegree, &nchoosek)); in ExpectedNumDofs_Total() 58 rp1pownmk = PetscPowInt(order + 1, dim - formDegree); in ExpectedNumDofs_Total() [all …]
|
| /petsc/src/dm/impls/da/ |
| H A D | gr2.c | 320 hsize_t chunk_size, target_size, dim; in VecGetHDF5ChunkSize() local 360 dim = 0; in VecGetHDF5ChunkSize() 361 if (timestep >= 0) ++dim; in VecGetHDF5ChunkSize() 364 chunkDims[dim++] = (hsize_t)da->P / zslices; in VecGetHDF5ChunkSize() 365 chunkDims[dim++] = (hsize_t)da->N / yslices; in VecGetHDF5ChunkSize() 366 chunkDims[dim++] = (hsize_t)da->M / xslices; in VecGetHDF5ChunkSize() 369 chunkDims[dim++] = (hsize_t)da->N / yslices; in VecGetHDF5ChunkSize() 370 chunkDims[dim++] = (hsize_t)da->M / xslices; in VecGetHDF5ChunkSize() 376 dim = 0; in VecGetHDF5ChunkSize() 377 if (timestep >= 0) ++dim; in VecGetHDF5ChunkSize() [all …]
|
| /petsc/src/snes/tutorials/ |
| H A D | ex17.c | 59 static PetscErrorCode zero(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, PetscSca… in zero() argument 62 for (d = 0; d < dim; ++d) u[d] = 0.0; in zero() 66 static PetscErrorCode ge_shift(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pets… in ge_shift() argument 70 for (d = 1; d < dim; ++d) u[d] = 0.0; in ge_shift() 74 static PetscErrorCode quadratic_2d_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc… in quadratic_2d_u() argument 81 static PetscErrorCode quadratic_3d_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc… in quadratic_3d_u() argument 99 static void f0_vlap_quadratic_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], c… in f0_vlap_quadratic_u() argument 102 for (d = 0; d < dim; ++d) f0[d] += 2.0; in f0_vlap_quadratic_u() 126 static void f0_elas_quadratic_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], c… in f0_elas_quadratic_u() argument 131 for (PetscInt d = 0; d < dim - 1; ++d) f0[d] += 2.0 * mu; in f0_elas_quadratic_u() [all …]
|
| /petsc/src/dm/dt/dualspace/impls/lagrange/tests/output/ |
| H A D | ex1_3_wedge_continuous_trimmed.out | 3 Quadrature on a unknown of order -1 on 5 points (dim 3) 13 Quadrature on a unknown of order -1 on 9 points (dim 3) 27 Quadrature on a unknown of order -1 on 6 points (dim 3) 38 Quadrature on a unknown of order -1 on 9 points (dim 3) 52 Quadrature on a unknown of order -1 on 5 points (dim 3) 62 Quadrature on a unknown of order -1 on 1 points (dim 3) 69 Quadrature on a unknown of order -1 on 23 points (dim 3) 98 Quadrature on a unknown of order -1 on 5 points (dim 3) 102 Quadrature on a unknown of order -1 on 33 points (dim 3) 142 Quadrature on a unknown of order -1 on 1 points (dim 3) [all …]
|