| /libCEED/julia/LibCEED.jl/src/ |
| H A D | ElemRestriction.jl | 29 destroy(r::ElemRestriction) = C.CeedElemRestrictionDestroy(r.ref) # COV_EXCL_LINE 30 Base.getindex(r::ElemRestriction) = r.ref[] 49 !!! warning "Zero-based indexing" 50 In the below notation, we are using **0-based indexing**. libCEED expects the offset 51 indices to be 0-based. 54 - `ceed`: The [`Ceed`](@ref) object 55 - `nelem`: Number of elements described in the `offsets` array 56 - `elemsize`: Size (number of "nodes") per element 57 - `ncomp`: Number of field components per interpolation node (1 for scalar fields) 58 - `compstride`: Stride between components for the same L-vector "node". Data for node $i$, [all …]
|
| /libCEED/tests/ |
| H A D | t212-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 7 integer r variable 20 & strides,r,err) 22 call ceedelemrestrictionview(r,err) 24 call ceedelemrestrictionsetnumviewtabs(r,1,err) 25 call ceedelemrestrictionview(r,err) 27 call ceedelemrestrictiondestroy(r,err) 31 !-----------------------------------------------------------------------
|
| H A D | t211-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 7 integer r variable 19 call ceedelemrestrictioncreatestrided(ceed,ne,2,1,ne*2,strides,r,err) 21 call ceedelemrestrictionview(r,err) 23 call ceedelemrestrictionsetnumviewtabs(r,1,err) 24 call ceedelemrestrictionview(r,err) 26 call ceedelemrestrictiondestroy(r,err) 30 !-----------------------------------------------------------------------
|
| H A D | t210-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 7 integer r variable 21 ind(2*i-1)=i-1 26 & ceed_use_pointer,ind,r,err) 28 call ceedelemrestrictionview(r,err) 30 call ceedelemrestrictionsetnumviewtabs(r,1,err) 31 call ceedelemrestrictionview(r,err) 33 call ceedelemrestrictiondestroy(r,err) 37 !-----------------------------------------------------------------------
|
| H A D | t208-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 8 integer r variable 31 a(i)=10+i-1 38 ind(2*i-1)=i-1 42 & ceed_mem_host,ceed_use_pointer,ind,r,err) 48 call ceedelemrestrictionapplyblock(r,1,ceed_notranspose,x,y,& 51 call ceedelemrestrictiongetelayout(r,layout,err) 52 do i=0,elemsize-1 54 do k=blksize,ne-1 57 indx = (i*blksize+elem)*layout(1)+j*layout(2)*blksize+blk*layout(3)*blksize-& [all …]
|
| H A D | t202-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 8 integer r variable 31 a(i)=10+i-1 38 ind(2*i-1)=i-1 42 & ceed_mem_host,ceed_use_pointer,ind,r,err) 48 call ceedelemrestrictionapply(r,ceed_notranspose,x,y,& 51 call ceedelemrestrictiongetelayout(r,layout,err) 52 do i=0,elemsize-1 54 do k=0,ne-1 59 diff=diff-a(ind(k*elemsize+i+1)+1) [all …]
|
| H A D | t201-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 8 integer r variable 29 a(i)=10+i-1 36 call ceedelemrestrictioncreatestrided(ceed,ne,2,1,2*ne,strides,r,err) 40 call ceedelemrestrictionapply(r,ceed_notranspose,x,y,& 44 call ceedelemrestrictiongetelayout(r,layout,err) 47 do k=0,ne-1 49 diff=diff-a(i*strides(1)+j*strides(2)+k*strides(3)+1) 50 if (abs(diff) > 1.0D-15) then 63 call ceedelemrestrictiondestroy(r,err) [all …]
|
| H A D | t209-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 8 integer r variable 29 ind(4*i-3)=3*i-3 30 ind(4*i-2)=3*i-2 31 ind(4*i-1)=3*i-1 32 ind(4*i-0)=3*i-0 35 & ceed_use_pointer,ind,r,err) 37 call ceedelemrestrictiongetmultiplicity(r,mult,err) 41 if(i > 1 .and. i < 3*ne+1 .and. mod(i-1,3)==0) then 46 diff=1+offset-mm(i+moffset) [all …]
|
| H A D | t200-elemrestriction-f.f90 | 1 !----------------------------------------------------------------------- 8 integer r variable 28 a(i)=10+i-1 35 ind(2*i-1)=i-1 40 & ceed_use_pointer,ind,r,err) 44 call ceedelemrestrictionapply(r,ceed_notranspose,x,y,& 49 diff=10+i/2-yy(i+yoffset) 50 if (abs(diff) > 1.0D-15) then 60 call ceedelemrestrictiondestroy(r,err) 64 !-----------------------------------------------------------------------
|
| /libCEED/python/tests/ |
| H A D | test-2-elemrestriction.py | 1 # Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors 2 # All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 # SPDX-License-Identifier: BSD-2-Clause 16 # ------------------------------------------------------------------------------- 18 # ------------------------------------------------------------------------------- 34 r = ceed.ElemRestriction(num_elem, 2, 1, 1, num_elem + 1, ind, 40 r.apply(x, y) 46 # ------------------------------------------------------------------------------- 48 # ------------------------------------------------------------------------------- 61 r = ceed.StridedElemRestriction(num_elem, 2, 1, 2 * num_elem, strides) [all …]
|
| /libCEED/julia/LibCEED.jl/test/ |
| H A D | runtests.jl | 23 const run_dev_tests = !isrelease() || ("--run-dev-tests" in ARGS) 89 witharray(x -> x .= 1.0, v) 92 @test summarystr(v) == "$n-element CeedVector" 154 @test q1d ≈ CeedScalar[-1.0, 0.0, 1.0] 158 @test q1d ≈ CeedScalar[-sqrt(3/5), 0.0, sqrt(3/5)] 162 d1d = CeedScalar[-0.5 0.5; -0.5 0.5; -0.5 0.5] 163 q1d = CeedScalar[-1.0, 0.0, 1.0] 232 offsets = Vector{CeedInt}(0:n-1) 233 r = create_elem_restriction(c, 1, n, 1, 1, n, offsets) 238 (:input, r, b, CeedVectorActive()), [all …]
|
| H A D | rundevtests.jl | 24 offsets = Vector{CeedInt}(0:n-1) 25 r = create_elem_restriction(c, 1, n, 1, 1, n, offsets) 30 (:input, r, b, CeedVectorActive()), 31 (:output, r, b, CeedVectorActive()),
|
| /libCEED/julia/LibCEED.jl/examples/ |
| H A D | common.jl | 11 r = s%dim 14 if r > 0 16 r -= 1 50 # elem: 0 1 n-1 51 # |---*-...-*---|---*-...-*---|- ... -|--...--| 52 # nnodes: 0 1 p-1 p p+1 2*p n*p 57 @inbounds @simd for e = 0:(num_elem-1) 63 for lnodes::CeedInt = 0:(nnodes-1) 69 r = rnodes - pp1*q 70 gnodes::CeedInt += (exyz[d]*p + r)*gnodes_stride [all …]
|
| /libCEED/backends/magma/tuning/ |
| H A D | generate_tuning.py | 3 # Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 4 # All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 6 # SPDX-License-Identifier: BSD-2-Clause 24 ceed_magma_h = f"{script_dir}/../ceed-magma.h" 26 with open(ceed_magma_h, "r") as f: 29 r".*(#define ceed_magma_queue_sync\(\.\.\.\)).*", 30 r"\1 " + 36 ceed_magma_gemm_selector_cpp = f"{script_dir}/../ceed-magma-gemm-selector.cpp" 41 with open(ceed_magma_gemm_selector_cpp, "r") as f: 45 r"\1 " + f"{nb}", [all …]
|
| /libCEED/examples/python/ |
| H A D | tutorial-2-elemrestriction.ipynb | 9 …ithub.com/CEED/libCEED/), the low-level API library for efficient high-order discretization method… 11 …"While libCEED's focus is on high-order finite/spectral element method implementations, the approa… 29 "! python -m pip install libceed" 38 …documentation](https://libceed.org/en/latest/libCEEDapi.html#finite-element-operator-decomposition… 55 "# x -- x -- x -- x\n", 56 "# 10 -- 11 -- 12 -- 13\n", 59 "# x -- x | x -- x | x -- x\n", 60 "# 10 -- 11 | 11 -- 12 | 12 -- 13\n", 75 "r = ceed.ElemRestriction(num_elem, 2, 1, 1, num_elem+1, indices, cmode=libceed.USE_POINTER)\n", 80 "r.apply(x, y)\n", [all …]
|
| /libCEED/rust/libceed/src/ |
| H A D | elem_restriction.rs | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 13 // ----------------------------------------------------------------------------- 15 // ----------------------------------------------------------------------------- 23 fn from(rstr: &'a ElemRestriction) -> Self { in from() 31 pub(crate) fn to_raw(&self) -> bind_ceed::CeedElemRestriction { in to_raw() 42 /// # fn main() -> libceed::Result<()> { 50 /// let r = ceed.elem_restriction(nelem, 2, 1, 1, nelem + 1, MemType::Host, &ind)?; 51 /// let r_opt = ElemRestrictionOpt::from(&r); [all …]
|
| /libCEED/examples/petsc/qfunctions/bps/ |
| H A D | bp4sphere.h | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 16 // ----------------------------------------------------------------------------- 18 // ----------------------------------------------------------------------------- 27 const CeedScalar R = context[0]; in SetupDiffRhs3() local 35 x *= R / rad; in SetupDiffRhs3() 36 y *= R / rad; in SetupDiffRhs3() 37 z *= R / rad; in SetupDiffRhs3() 39 const CeedScalar theta = asin(z / R); // latitude in SetupDiffRhs3() [all …]
|
| H A D | bp3sphere.h | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 16 // ----------------------------------------------------------------------------- 20 // Reference (parent) 2D coordinates: X \in [-1, 1]^2 22 // Global 3D physical coordinates given by the mesh: xx \in [-R, R]^3 with R radius of the sphere 24 // Local 3D physical coordinates on the 2D manifold: x \in [-l, l]^3 with l half edge of the cube i… 48 // dX_i/dx_j [2 * 3] = (dx_i/dX_j)+ = (dxdX^T dxdX)^(-1) dxdX 52 // g^{ij} = dX_i/dx_k dX_j/dx_k = (dxdX^T dxdX)^{-1} 58 // ----------------------------------------------------------------------------- [all …]
|
| /libCEED/examples/fluids/qfunctions/ |
| H A D | densitycurrent.h | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 9 /// Density current initial condition and operator for Navier-Stokes example using PETSc 12 // Semi-Implicit Formulations of the Navier-Stokes Equations: Application to 45 // delta_theta = r <= rc : thetaC(1 + cos(pi r/rc)) / 2 46 // r > rc : 0 47 // r = sqrt( (x - xc)**2 + (y - yc)**2 + (z - zc)**2 ) 51 // Pibar = 1. + g**2 (exp( - N**2 z / g ) - 1) / (cp theta0 N**2) 72 // N , Brunt-Vaisala frequency [all …]
|
| H A D | riemann_solver.h | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 10 // The left and right states are specified from the perspective of an outward-facing normal vector … 14 // |------------| / 16 // | Left |----> Right 18 // |------------| 41 …CeedScalar r_right = (sqrt_left / (2 * sqrt_right * square_sum_root)) * drho_right - (sqrt_right /… in RoeSetup_fwd() 42 …CeedScalar r_left = (sqrt_right / (2 * sqrt_left * square_sum_root)) * drho_left - (sqrt_left / (… in RoeSetup_fwd() 47 …_HELPER CeedScalar RoeAverage(RoeWeights r, CeedScalar q_left, CeedScalar q_right) { return r.left… in RoeAverage() argument [all …]
|
| H A D | advection.h | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 9 /// Advection initial condition and operator for Navier-Stokes example using PETSc 26 // -- ROTATION (default) 34 // increases to (1.-r/rc), then 0. everywhere else 44 // -- TRANSLATION 52 // increases to (1.-r/rc), then 0. everywhere else 70 // This helper function provides the exact, time-dependent solution and IC formulation for 2D advec… 74 const CeedScalar rc = context->rc; in Exact_AdvectionGeneric() [all …]
|
| /libCEED/examples/fluids/problems/ |
| H A D | blasius.c | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 20 PetscErrorCode CompressibleBlasiusResidual(SNES snes, Vec X, Vec R, void *ctx) { in CompressibleBlasiusResidual() argument 23 PetscScalar *r, f[4], h[4]; in CompressibleBlasiusResidual() local 24 PetscInt N = blasius->n_cheb; in CompressibleBlasiusResidual() 25 State S_infty = blasius->S_infty; in CompressibleBlasiusResidual() 29 …PetscScalar Ma = Mach(&blasius->newtonian_ctx, S_infty.Y.temperature, U_infty), Pr = Prandtl(&blas… in CompressibleBlasiusResidual() 30 gamma = HeatCapacityRatio(&blasius->newtonian_ctx); in CompressibleBlasiusResidual() 34 PetscCall(VecGetArray(R, &r)); in CompressibleBlasiusResidual() [all …]
|
| /libCEED/backends/sycl/ |
| H A D | ceed-sycl-common.hpp | 1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 4 // SPDX-License-Identifier: BSD-2-Clause 10 #include <ceed/jit-source/sycl/sycl-types.h> 26 template <typename R, class... Args> 27 int CeedSetBackendFunctionCpp(Ceed ceed, const char *type, void *object, const char *fname, R (*f)(… in CeedSetBackendFunctionCpp() 28 static_assert(std::is_same_v<int, R>, "Ceed backend functions must return int"); in CeedSetBackendFunctionCpp()
|
| /libCEED/doc/ |
| H A D | README.md | 10 pip install --user -r doc/sphinx/requirements.txt # only needed once 18 …e to libCEED's User Manual, Sphinx needs to be [installed](http://www.sphinx-doc.org/en/master/usa… 29 make -C doc/sphinx html 35 make -C doc/sphinx latexpdf 39 This requires the `rsvg-convert` utility, which is likely available from your package manager under… 44 make -C doc/sphinx help 52 pip install --user -r doc/sphinx/requirements.txt 61 pip install -r doc/sphinx/requirements.txt # install dependencies inside VENV
|
| /libCEED/.github/workflows/ |
| H A D | python-test-with-style.yml | 6 - main 13 os: [ubuntu-24.04] 15 python-version: ['3.x'] 17 runs-on: ${{ matrix.os }} 20 - name: Environment setup 22 - name: Python setup 23 uses: actions/setup-python@v5 25 python-version: ${{ matrix.python-version }} 26 - name: Python dependencies 28 pip install -r requirements.txt [all …]
|