| /libCEED/python/tests/ |
| H A D | buildmats.py | 5 P, Q, dim = 6, 4, 2 6 interp = np.empty(P * Q, dtype=mat_dtype) 7 grad = np.empty(dim * P * Q, dtype=mat_dtype) 27 interp[i * P + 0] = 2. * (x1 + x2 - 1.) * (x1 + x2 - 1. / 2.) 28 interp[i * P + 1] = -4. * x1 * (x1 + x2 - 1.) 29 interp[i * P + 2] = 2. * x1 * (x1 - 1. / 2.) 30 interp[i * P + 3] = -4. * x2 * (x1 + x2 - 1.) 31 interp[i * P + 4] = 4. * x1 * x2 32 interp[i * P + 5] = 2. * x2 * (x2 - 1. / 2.) 34 grad[(i + 0) * P + 0] = 2. * \ [all …]
|
| H A D | test-3-basis.py | 146 P, Q = 8, 10 147 Pdim = P**dim 172 bxl = ceed.BasisTensorH1Lagrange(dim, dim, 2, P, libceed.GAUSS_LOBATTO) 185 bug = ceed.BasisTensorH1Lagrange(dim, 1, P, Q, libceed.GAUSS) 206 P, Q, dim = 6, 4, 2 208 in_array = np.empty(P, dtype=ceed.scalar_type()) 215 b = ceed.BasisH1(libceed.TRIANGLE, 1, P, Q, interp, grad, qref, qweight) 228 P, Q, dim = 6, 4, 2 232 in_array = np.empty(P, dtype=ceed.scalar_type()) 239 b = ceed.BasisH1(libceed.TRIANGLE, 1, P, Q, interp, grad, qref, qweight) [all …]
|
| /libCEED/tests/ |
| H A D | t340-basis.h | 13 CeedInt P = 8, Q = 4; in BuildHcurl2DSimplex() local 32 interp[(i + 0) * P + 0] = 2. * x2 * (1. - 4. * x1); in BuildHcurl2DSimplex() 33 interp[(i + Q) * P + 0] = 4. * x1 * (2. * x1 - 1.); in BuildHcurl2DSimplex() 34 interp[(i + 0) * P + 1] = 4. * x2 * (1. - 2. * x2); in BuildHcurl2DSimplex() 35 interp[(i + Q) * P + 1] = 2. * x1 * (4. * x2 - 1.); in BuildHcurl2DSimplex() 36 interp[(i + 0) * P + 2] = 2. * x2 * (-4. * x1 - 4. * x2 + 3.); in BuildHcurl2DSimplex() 37 interp[(i + Q) * P + 2] = 8. * x1 * x1 + 8. * x1 * x2 - 12. * x1 - 6. * x2 + 4.; in BuildHcurl2DSimplex() 38 interp[(i + 0) * P + 3] = 4. * x2 * (2. * x2 - 1.); in BuildHcurl2DSimplex() 39 interp[(i + Q) * P + 3] = -8. * x1 * x2 + 2. * x1 + 6. * x2 - 2.; in BuildHcurl2DSimplex() 40 interp[(i + 0) * P + 4] = 8. * x1 * x2 - 6. * x1 + 8. * x2 * x2 - 12. * x2 + 4.; in BuildHcurl2DSimplex() [all …]
|
| H A D | t320-basis.h | 11 CeedInt P = 6, Q = 4; in Build2DSimplex() local 30 interp[i * P + 0] = 2. * (x1 + x2 - 1.) * (x1 + x2 - 1. / 2.); in Build2DSimplex() 31 interp[i * P + 1] = -4. * x1 * (x1 + x2 - 1.); in Build2DSimplex() 32 interp[i * P + 2] = 2. * x1 * (x1 - 1. / 2.); in Build2DSimplex() 33 interp[i * P + 3] = -4. * x2 * (x1 + x2 - 1.); in Build2DSimplex() 34 interp[i * P + 4] = 4. * x1 * x2; in Build2DSimplex() 35 interp[i * P + 5] = 2. * x2 * (x2 - 1. / 2.); in Build2DSimplex() 37 grad[(i + 0) * P + 0] = 2. * (1. * (x1 + x2 - 1. / 2.) + (x1 + x2 - 1.) * 1.); in Build2DSimplex() 38 grad[(i + Q) * P + 0] = 2. * (1. * (x1 + x2 - 1. / 2.) + (x1 + x2 - 1.) * 1.); in Build2DSimplex() 39 grad[(i + 0) * P + 1] = -4. * (1. * (x1 + x2 - 1.) + x1 * 1.); in Build2DSimplex() [all …]
|
| H A D | t320-basis-f.h | 28 interp(i*P+1)=2.*(x1+x2-1.)*(x1+x2-1./2.); 29 interp(i*P+2)=-4.*x1*(x1+x2-1.); 30 interp(i*P+3)=2.*x1*(x1-1./2.); 31 interp(i*P+4)=-4.*x2*(x1+x2-1.); 32 interp(i*P+5)=4.*x1*x2; 33 interp(i*P+6)=2.*x2*(x2-1./2.); 35 grad((i+0)*P+1)=2.*(1.*(x1+x2-1./2.)+(x1+x2-1.)*1.); 36 grad((i+Q)*P+1)=2.*(1.*(x1+x2-1./2.)+(x1+x2-1.)*1.); 37 grad((i+0)*P+2)=-4.*(1.*(x1+x2-1.)+x1*1.); 38 grad((i+Q)*P+2)=-4.*(x1*1.); [all …]
|
| H A D | t319-basis.h | 60 static void GetCellToFaceTabulation(CeedQuadMode quad_mode, CeedInt *P, CeedInt *Q, const CeedScala… in GetCellToFaceTabulation() argument 61 if (P) *P = 8; in GetCellToFaceTabulation()
|
| /libCEED/include/ceed/jit-source/magma/ |
| H A D | magma-common-nontensor.h | 19 template <typename T, int P, int Q, int BY> 21 const int tid = ty * P + tx; in read_A_notrans_g2r_1D_nosync() 25 for (i = 0; i < P * Q - P * BY; i += P * BY) { in read_A_notrans_g2r_1D_nosync() 28 if (i + tid < P * Q) { in read_A_notrans_g2r_1D_nosync() 35 rA[j] = sA[j * P + tx]; in read_A_notrans_g2r_1D_nosync() 44 template <typename T, int P, int Q, int BY> 46 const int tid = ty * P + tx; in read_A_trans_g2r_1D_nosync() 50 for (i = 0; i < P * Q - P * BY; i += P * BY) { in read_A_trans_g2r_1D_nosync() 53 if (i + tid < P * Q) { in read_A_trans_g2r_1D_nosync() 69 template <typename T, int P, int Q, int NB> [all …]
|
| H A D | magma-basis-interp-deriv-nontensor.h | 13 template <typename T, int Q_COMP, int P, int Q, int NB> 22 dB += id * P * NB; in magma_basis_nontensor_device_n() 26 CeedScalar *sB = shared_data + ty * P * NB; in magma_basis_nontensor_device_n() 27 CeedScalar *sA = shared_data + blockDim.y * P * NB; in magma_basis_nontensor_device_n() 31 read_B_g2s_1D_nosync<CeedScalar, Q, P, NB>(tx, myn, dB, sB); in magma_basis_nontensor_device_n() 37 CeedScalar rA[P]; in magma_basis_nontensor_device_n() 38 …read_A_trans_g2r_1D_nosync<CeedScalar, Q, P, MAGMA_BASIS_NTCOL(Q, MAGMA_MAXTHREADS_1D)>(tx, ty, dA… in magma_basis_nontensor_device_n() 41 mul_rAsBrC_1D_nosync<CeedScalar, Q, P, NB>(rA, sB, rC); in magma_basis_nontensor_device_n() 45 write_C_r2g_1D_nosync<CeedScalar, Q, P, NB>(tx, myn, rC, dC); in magma_basis_nontensor_device_n() 48 dA += Q * P; in magma_basis_nontensor_device_n() [all …]
|
| H A D | magma-common-tensor.h | 58 template <typename T, int P, int DIM_U, int NUM_COMP, int rU_SIZE, int i_DIM> 72 if (tx < P) { in read_U_2d() 73 for (int i = 0; i < P; i++) { in read_U_2d() 74 sTmp[i * P + tx] = dU[comp * compstride + i * P + tx]; in read_U_2d() 79 if (tx < P) { in read_U_2d() 80 for (int i = 0; i < P; i++) { in read_U_2d() 81 rU[i_DIM][comp][i] = sTmp[tx * P + i]; in read_U_2d() 146 template <typename T, int P, int DIM_U, int NUM_COMP, int rU_SIZE, int i_DIM> 160 if (tx < P * P) { in read_U_3d() 161 for (int i = 0; i < P; i++) { in read_U_3d() [all …]
|
| H A D | magma-basis-interp-3d.h | 13 #define sT(i, j) sT[(j) * P + (i)] 18 template <typename T, int DIM_U, int DIM_V, int NUM_COMP, int P, int Q, int rU_SIZE, int rV_SIZE> 34 if (tx < (P * P)) { in magma_interp_3d_device() 40 for (int i = 0; i < P; i++) { in magma_interp_3d_device() 49 if (tx < (P * Q)) { in magma_interp_3d_device() 53 T *sTmp = swork + batchid * (Q * P); // sTmp is input in magma_interp_3d_device() 56 for (int i = 0; i < P; i++) { in magma_interp_3d_device() 64 if (tx < (P * Q)) { in magma_interp_3d_device() 83 for (int i = 0; i < P; i++) { in magma_interp_3d_device()
|
| /libCEED/backends/ref/ |
| H A D | ceed-ref-basis.c | 61 CeedInt P = P_1d, Q = Q_1d; in CeedBasisApplyCore_Ref() local 64 P = Q_1d; in CeedBasisApplyCore_Ref() 67 CeedInt pre = num_comp * CeedIntPow(P, dim - 1), post = num_elem; in CeedBasisApplyCore_Ref() 68 CeedScalar tmp[2][num_elem * num_comp * Q * CeedIntPow(P > Q ? P : Q, dim - 1)]; in CeedBasisApplyCore_Ref() 73 …CeedCallBackend(CeedTensorContractApply(contract, pre, P, post, Q, interp_1d, t_mode, add && (d ==… in CeedBasisApplyCore_Ref() 75 pre /= P; in CeedBasisApplyCore_Ref() 86 CeedInt P = P_1d, Q = Q_1d; in CeedBasisApplyCore_Ref() local 89 P = Q_1d; in CeedBasisApplyCore_Ref() 92 CeedInt pre = num_comp * CeedIntPow(P, dim - 1), post = num_elem; in CeedBasisApplyCore_Ref() 97 CeedScalar tmp[2][num_elem * num_comp * Q * CeedIntPow(P > Q ? P : Q, dim - 1)]; in CeedBasisApplyCore_Ref() [all …]
|
| /libCEED/include/ceed/jit-source/cuda/ |
| H A D | cuda-shared-basis-nontensor-templates.h | 46 template <int NUM_COMP, int P, int Q, int T_1D> 50 Contract1d<NUM_COMP, P, Q>(data, &r_U[comp], c_B, &r_V[comp]); in InterpNonTensor() 57 template <int NUM_COMP, int P, int Q, int T_1D> 62 ContractTranspose1d<NUM_COMP, P, Q>(data, &r_U[comp], c_B, &r_V[comp]); in InterpTransposeNonTensor() 69 template <int NUM_COMP, int DIM, int P, int Q, int T_1D> 73 Contract1d<NUM_COMP, P, Q>(data, &r_U[comp], &c_G[dim * P * Q], &r_V[comp + dim * NUM_COMP]); in GradNonTensor() 81 template <int NUM_COMP, int DIM, int P, int Q, int T_1D> 87 …ContractTranspose1d<NUM_COMP, P, Q>(data, &r_U[comp + dim * NUM_COMP], &c_G[dim * P * Q], &r_V[com… in GradTransposeNonTensor() 95 template <int P, int Q>
|
| H A D | cuda-ref-basis-nontensor-templates.h | 15 template <int NUM_COMP, int Q_COMP, int P, int Q> 28 for (CeedInt i = 0; i < P; i++) { in Contract() 31 for (CeedInt d = 0; d < Q_COMP; d++) r_V[d] += d_B[i + t_id * P + d * P * Q] * val; in Contract() 42 template <int NUM_COMP, int Q_COMP, int P, int Q> 56 for (CeedInt i = 0; i < Q; i++) r_V += d_B[t_id + i * P + d * P * Q] * U[i]; in ContractTranspose()
|
| H A D | cuda-ref-basis-tensor-at-points.h | 58 const CeedInt P = BASIS_P_1D; in InterpAtPoints() local 78 pre /= P; in InterpAtPoints() 90 …for (CeedInt b = 0; b < P; b++) v_k += s_chebyshev_interp_1d[j * BASIS_P_1D + b] * in[(a * P + b) … in InterpAtPoints() 141 const CeedInt P = BASIS_P_1D; in InterpTransposeAtPoints() local 200 const CeedInt writeLen = pre * post * P; in InterpTransposeAtPoints() 205 const CeedInt j = (k / post) % P; in InterpTransposeAtPoints() 206 const CeedInt a = k / (post * P); in InterpTransposeAtPoints() 213 post *= P; in InterpTransposeAtPoints() 237 const CeedInt P = BASIS_P_1D; in GradAtPoints() local 258 pre /= P; in GradAtPoints() [all …]
|
| /libCEED/include/ceed/jit-source/hip/ |
| H A D | hip-shared-basis-nontensor-templates.h | 46 template <int NUM_COMP, int P, int Q, int T_1D> 50 Contract1d<NUM_COMP, P, Q>(data, &r_U[comp], c_B, &r_V[comp]); in InterpNonTensor() 57 template <int NUM_COMP, int P, int Q, int T_1D> 62 ContractTranspose1d<NUM_COMP, P, Q>(data, &r_U[comp], c_B, &r_V[comp]); in InterpTransposeNonTensor() 69 template <int NUM_COMP, int DIM, int P, int Q, int T_1D> 73 Contract1d<NUM_COMP, P, Q>(data, &r_U[comp], &c_G[dim * P * Q], &r_V[comp + dim * NUM_COMP]); in GradNonTensor() 81 template <int NUM_COMP, int DIM, int P, int Q, int T_1D> 87 …ContractTranspose1d<NUM_COMP, P, Q>(data, &r_U[comp + dim * NUM_COMP], &c_G[dim * P * Q], &r_V[com… in GradTransposeNonTensor() 95 template <int P, int Q>
|
| H A D | hip-ref-basis-nontensor-templates.h | 15 template <int NUM_COMP, int Q_COMP, int P, int Q> 28 for (CeedInt i = 0; i < P; i++) { in Contract() 31 for (CeedInt d = 0; d < Q_COMP; d++) r_V[d] += d_B[i + t_id * P + d * P * Q] * val; in Contract() 42 template <int NUM_COMP, int Q_COMP, int P, int Q> 56 for (CeedInt i = 0; i < Q; i++) r_V += d_B[t_id + i * P + d * P * Q] * U[i]; in ContractTranspose()
|
| H A D | hip-ref-basis-tensor-at-points.h | 58 const CeedInt P = BASIS_P_1D; in InterpAtPoints() local 78 pre /= P; in InterpAtPoints() 90 …for (CeedInt b = 0; b < P; b++) v_k += s_chebyshev_interp_1d[j * BASIS_P_1D + b] * in[(a * P + b) … in InterpAtPoints() 141 const CeedInt P = BASIS_P_1D; in InterpTransposeAtPoints() local 200 const CeedInt writeLen = pre * post * P; in InterpTransposeAtPoints() 205 const CeedInt j = (k / post) % P; in InterpTransposeAtPoints() 206 const CeedInt a = k / (post * P); in InterpTransposeAtPoints() 213 post *= P; in InterpTransposeAtPoints() 237 const CeedInt P = BASIS_P_1D; in GradAtPoints() local 258 pre /= P; in GradAtPoints() [all …]
|
| /libCEED/backends/magma/tuning/ |
| H A D | tuning.cpp | 50 for (const auto [P, Q, dim] : PQ_VALUES) { in main() 54 std::vector<double> q_ref(dim * Q, 0.0), q_weight(Q, 0.0), interp(P * Q), grad(P * Q * dim); in main() 58 …CeedBasisCreateH1(ceed, (dim < 3) ? CEED_TOPOLOGY_TRIANGLE : CEED_TOPOLOGY_TET, 1, P, Q, interp.da… in main() 67 CeedVectorCreate(ceed, P * N, &u); in main() 100 CeedVectorCreate(ceed, P * N, &u); in main() 132 const double interp_flops = P * Q * (double)N; in main() 133 const double grad_flops = P * Q * dim * (double)N; in main() 137 width, P, width, Q, width, N, width, 1, width, 0, width, precision, in main() 140 width, P, width, Q, width, N, width, 1, width, 1, width, precision, in main() 143 width, P, width, Q, width, N, width, dim, width, 0, width, precision, in main() [all …]
|
| /libCEED/examples/ |
| H A D | README.md | 26 - * BP1 (scalar mass operator) with $Q=P+1$ 27 * BP2 (vector mass operator) with $Q=P+1$ 28 * BP3 (scalar Laplace operator) with $Q=P+1$ 29 * BP4 (vector Laplace operator) with $Q=P+1$ 30 * BP5 (collocated scalar Laplace operator) with $Q=P$ 31 * BP6 (collocated vector Laplace operator) with $Q=P$ 33 - * BP1 (scalar mass operator) with $Q=P+1$ 34 * BP3 (scalar Laplace operator) with $Q=P+1$ 36 - * BP1 (scalar mass operator) with $Q=P+1$ 37 * BP2 (vector mass operator) with $Q=P+1$ [all …]
|
| /libCEED/backends/magma/ |
| H A D | ceed-magma-basis.c | 33 CeedInt dim, num_comp, num_nodes, P_1d, Q_1d, P, Q; in CeedBasisApplyCore_Magma() local 46 P = P_1d; in CeedBasisApplyCore_Magma() 49 P = Q_1d; in CeedBasisApplyCore_Magma() 92 CeedInt max_P_Q = CeedIntMax(P, Q); in CeedBasisApplyCore_Magma() 98 shared_mem += sizeof(CeedScalar) * num_t_col * (num_comp * (1 * P + 1 * Q)); in CeedBasisApplyCore_Magma() 99 shared_mem += sizeof(CeedScalar) * (P * Q); in CeedBasisApplyCore_Magma() 104 shared_mem += P * Q * sizeof(CeedScalar); // for sT in CeedBasisApplyCore_Magma() 106 shared_mem += num_t_col * (P * max_P_Q * sizeof(CeedScalar)); in CeedBasisApplyCore_Magma() 111 shared_mem += sizeof(CeedScalar) * (P * Q); // for sT in CeedBasisApplyCore_Magma() 113 shared_mem += sizeof(CeedScalar) * num_t_col * (CeedIntMax(P * P * max_P_Q, P * Q * Q)); in CeedBasisApplyCore_Magma() [all …]
|
| /libCEED/julia/LibCEED.jl/test/ |
| H A D | buildmats.jl | 2 P, Q, dim = 4, 4, 2 3 interp = Array{T}(undef, dim, Q, P) 4 div = Array{T}(undef, Q, P) 43 P, Q, dim = 3, 4, 2 44 interp = Array{T}(undef, dim, Q, P) 45 curl = Array{T}(undef, 1, Q, P)
|
| /libCEED/tests/output/ |
| H A D | t300-basis.out | 2 P: 4 19 P: 4 36 P: 4
|
| H A D | t300-basis-f.out | 2 P: 4 19 P: 4 36 P: 4
|
| /libCEED/examples/fluids/qfunctions/ |
| H A D | eulervortex.h | 87 CeedScalar rho, P, T, E, u[3] = {0.}; in Exact_Euler() local 97 P = rho * T; in Exact_Euler() 106 q[4] = P / (gamma - 1.) + rho * (u[0] * u[0] + u[1] * u[1]) / 2.; in Exact_Euler() 135 P = 1.; in Exact_Euler() 137 rho = P / (R * T); in Exact_Euler() 148 P = 1.; in Exact_Euler() 150 rho = P / (R * T); in Exact_Euler() 162 P = 1.; in Exact_Euler() 164 rho = P / (R * T); in Exact_Euler() 312 P = E_internal * (gamma - 1.); // P = pressure in Euler() local [all …]
|
| /libCEED/examples/python/ |
| H A D | tutorial-3-basis.ipynb | 95 " P=4, # number of basis functions (nodes) per dimension\n", 114 "P = b.get_num_nodes()\n", 116 "basis_viz = ceed.BasisTensorH1Lagrange(1, 1, P, Q_viz, libceed.GAUSS_LOBATTO)\n", 118 "# Construct P \"elements\" with one node activated\n", 119 "I = ceed.Vector(P * P)\n", 120 "with I.array_write(P, P) as x:\n", 121 " x[...] = np.eye(P)\n", 123 "basis_fns = ceed.Vector(P * Q_viz)\n", 127 "with basis_fns.array_read(Q_viz, P) as B_array:\n", 131 "nodes, _ = ceed.lobatto_quadrature(P)\n", [all …]
|