| /libCEED/tests/ |
| H A D | t541-operator.c | 4 #include "t541-operator.h" 59 // QFunction - setup diff in main() 65 // Operator - setup diff in main() 74 // QFunction - apply in main() 80 // Operator - apply in main() 90 CeedScalar S[16]; in main() local 101 u_array[p - 1] = 1.0; in main() 104 u_array[p * p - p] = 1.0; in main() 107 u_array[p * p - 1] = 1.0; in main() 117 S[0 * 4 + i] = -v_array[0]; in main() [all …]
|
| H A D | t412-qfunction-f.f90 | 1 !----------------------------------------------------------------------- 9 integer q,s,i variable 11 parameter(s=3) 12 real*8 uu(q*s) 13 real*8 vv(q*s) 20 call ceedqfunctioncreateidentity(ceed,s,ceed_eval_interp,& 23 do i=0,q*s-1 27 call ceedvectorcreate(ceed,q*s,u,err) 30 call ceedvectorcreate(ceed,q*s,v,err) 41 do i=1,q*s [all …]
|
| /libCEED/examples/fluids/qfunctions/ |
| H A D | newtonian_state.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 31 CEED_QFUNCTION_HELPER void UnpackState_U(StateConservative s, CeedScalar U[5]) { in UnpackState_U() argument 32 U[0] = s.density; in UnpackState_U() 33 for (int i = 0; i < 3; i++) U[i + 1] = s.momentum[i]; in UnpackState_U() 34 U[4] = s.E_total; in UnpackState_U() 37 CEED_QFUNCTION_HELPER void UnpackState_Y(StatePrimitive s, CeedScalar Y[5]) { in UnpackState_Y() argument 38 Y[0] = s.pressure; in UnpackState_Y() 39 for (int i = 0; i < 3; i++) Y[i + 1] = s.velocity[i]; in UnpackState_Y() [all …]
|
| H A D | turb_spanstats.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 19 NewtonianIdealGasContext gas = &context->gas; in ChildStatsCollection() 20 CeedScalar delta_t = context->solution_time - context->previous_time; in ChildStatsCollection() 26 const State s = StateFromQ(gas, qi, state_var); in ChildStatsCollection() local 28 v[TURB_MEAN_DENSITY][i] = wdetJ * s.U.density; in ChildStatsCollection() 29 v[TURB_MEAN_PRESSURE][i] = wdetJ * s.Y.pressure; in ChildStatsCollection() 30 v[TURB_MEAN_PRESSURE_SQUARED][i] = wdetJ * Square(s.Y.pressure); in ChildStatsCollection() 31 v[TURB_MEAN_PRESSURE_VELOCITY_X][i] = wdetJ * s.Y.pressure * s.Y.velocity[0]; in ChildStatsCollection() [all …]
|
| H A D | newtonian.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 /// Operator for Navier-Stokes example using PETSc 21 …id InternalDampingLayer(const NewtonianIdealGasContext context, const State s, const CeedScalar si… in InternalDampingLayer() argument 24 State damp_s = StateFromY_fwd(context, s, damp_Y); in InternalDampingLayer() 41 State s = StateFromPrimitive(&context->gas, context->reference); in ICsNewtonianIG() local 42 StateToQ(&context->gas, s, q, state_var); in ICsNewtonianIG() 73 const State s = StateFromQ(context, qi, state_var); in MassFunction_Newtonian() local 87 Tau_diagPrim(context, s, dXdx, context->dt, Tau_d); in MassFunction_Newtonian() [all …]
|
| H A D | bc_slip.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 20 CeedScalar(*jac_data_sur) = newt_ctx->is_implicit ? out[1] : NULL; in Slip() 24 State s = StateFromQ(newt_ctx, qi, state_var); in Slip() local 28 wdetJb *= newt_ctx->is_implicit ? -1. : 1.; in Slip() 31 const CeedScalar vel_normal = Dot3(s.Y.velocity, norm); in Slip() 32 for (CeedInt j = 0; j < 3; j++) vel_reflect[j] = s.Y.velocity[j] - 2. * norm[j] * vel_normal; in Slip() 33 …const CeedScalar Y_reflect[5] = {s.Y.pressure, vel_reflect[0], vel_reflect[1], vel_reflect[2], s.Y… in Slip() 36 StateConservative flux = RiemannFlux_HLLC(newt_ctx, s, s_reflect, norm); in Slip() [all …]
|
| H A D | differential_filter.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 40 NewtonianIdealGasContext gas = &context->gas; in DifferentialFilter_RHS() 45 const State s = StateFromQ(gas, qi, state_var); in DifferentialFilter_RHS() local 47 v0[DIFF_FILTER_PRESSURE][i] = wdetJ * s.Y.pressure; in DifferentialFilter_RHS() 48 v0[DIFF_FILTER_VELOCITY_X][i] = wdetJ * s.Y.velocity[0]; in DifferentialFilter_RHS() 49 v0[DIFF_FILTER_VELOCITY_Y][i] = wdetJ * s.Y.velocity[1]; in DifferentialFilter_RHS() 50 v0[DIFF_FILTER_VELOCITY_Z][i] = wdetJ * s.Y.velocity[2]; in DifferentialFilter_RHS() 51 v0[DIFF_FILTER_TEMPERATURE][i] = wdetJ * s.Y.temperature; in DifferentialFilter_RHS() [all …]
|
| H A D | stabilization.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 28 CEED_QFUNCTION_HELPER void StabilizationMatrix(NewtonianIdealGasContext gas, State s, CeedScalar Ta… in StabilizationMatrix() argument 37 State ds = StateFromY_fwd(gas, s, dY); in StabilizationMatrix() 38 FluxInviscid_fwd(gas, s, ds, dF); in StabilizationMatrix() 46 CEED_QFUNCTION_HELPER void Stabilization(NewtonianIdealGasContext gas, State s, CeedScalar Tau_d[3]… in Stabilization() argument 48 // -- Stabilization method: none (Galerkin), SU, or SUPG in Stabilization() 50 switch (gas->stabilization) { in Stabilization() 54 FluxInviscidStrong(gas, s, ds, strong_residual); in Stabilization() [all …]
|
| H A D | blasius.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 /// Operator for Navier-Stokes example using PETSc 33 …CeedScalar Th_cheb[BLASIUS_MAX_N_CHEBYSHEV - 1]; // !< Chebyshev coefficien… 43 // Chebyshev polynomials T_0, T_1, T_2 of the first kind in (-1,1) in ChebyshevEval() 44 {1, x, 2 * x * x - 1}, in ChebyshevEval() 50 // i-th derivative of f in ChebyshevEval() 54 // T_n(x) = 2xT_{n-1}(x) - T_{n-2}(x) in ChebyshevEval() 55 table[0][i % 3] = 2 * x * table[0][(i - 1) % 3] - table[0][(i - 2) % 3]; in ChebyshevEval() [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 …]
|
| H A D | bc_freestream.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 28 CeedScalar(*jac_data_sur) = context->newtonian_ctx.is_implicit ? out[1] : NULL; in Freestream() 30 const NewtonianIdealGasContext newt_ctx = &context->newtonian_ctx; in Freestream() 31 const bool is_implicit = newt_ctx->is_implicit; in Freestream() 35 const State s = StateFromQ(newt_ctx, qi, state_var); in Freestream() local 39 wdetJb *= is_implicit ? -1. : 1.; in Freestream() 44 flux = RiemannFlux_HLL(newt_ctx, s, context->S_infty, normal); in Freestream() 47 flux = RiemannFlux_HLLC(newt_ctx, s, context->S_infty, normal); in Freestream() [all …]
|
| /libCEED/julia/LibCEED.jl/.style/ |
| H A D | ceed_style.jl | 11 @inline JuliaFormatter.getstyle(s::CeedStyle) = s 16 s::State; 21 t = FST(Binary, cst, nspaces(s)) 28 !s.opts.whitespace_typedefs 33 nospace_args = s.opts.whitespace_ops_in_indices ? false : nospace 36 n = pretty(style, cst[1], s, nonest=nonest, nospace=nospace_args) 38 n = pretty(style, cst[1], s) 42 s.opts.whitespace_ops_in_indices && 45 paren = FST(PUNCTUATION, -1, n.startline, n.startline, "(") 46 add_node!(t, paren, s) [all …]
|
| /libCEED/ |
| H A D | common.mk | 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 8 # Output using the 216-color rules mode 12 ansicolor = $(shell echo $(call last_path,$(1)) | cksum | cut -b1-2 | xargs -IS expr 2 \* S + 17) 13 emacs_out = @printf " %10s %s/%s\n" $(1) $(call rule_path,$(2)) $(call rule_file,$(2)) 14 color_out = @if [ -t 1 ]; then \ 15 printf " %10s \033[38;5;%d;1m%s\033[m/%s\n" \ 18 printf " %10s %s\n" $(1) $(2); fi 22 # if V is set to non-nil, turn the verbose mode [all …]
|
| H A D | .gitlab-ci.yml | 1 # ---------------------------------------------------------------------------------------- 3 # ---------------------------------------------------------------------------------------- 5 - test:cpu-and-tidy 6 - test:gpu-and-float 13 # ---------------------------------------------------------------------------------------- 15 # ---------------------------------------------------------------------------------------- 16 noether-asan: 17 stage: test:cpu-and-tidy 19 - cpu 24 - export COVERAGE=0 CC=gcc CXX=g++ FC=gfortran [all …]
|
| /libCEED/rust/libceed-sys/c-src/ |
| H A D | common.mk | 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 8 # Output using the 216-color rules mode 12 ansicolor = $(shell echo $(call last_path,$(1)) | cksum | cut -b1-2 | xargs -IS expr 2 \* S + 17) 13 emacs_out = @printf " %10s %s/%s\n" $(1) $(call rule_path,$(2)) $(call rule_file,$(2)) 14 color_out = @if [ -t 1 ]; then \ 15 printf " %10s \033[38;5;%d;1m%s\033[m/%s\n" \ 18 printf " %10s %s\n" $(1) $(2); fi 22 # if V is set to non-nil, turn the verbose mode [all …]
|
| /libCEED/benchmarks/ |
| H A D | postprocess_plot.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 16 log_y = 0 # use log scale on the y-axis? 17 x_range = (1e1, 4e6) # plot range for the x-axis; comment out for auto 18 y_range = (0, 2e9) # plot range for the y-axis; comment out for auto 19 draw_iter_lines = 0 # draw the "iter/s" lines? 20 ymin_iter_lines = 3e5 # minimal y value for the "iter/s" lines 21 ymax_iter_lines = 8e8 # maximal y value for the "iter/s" lines 33 rcParams['font.sans-serif'].insert(0, 'Noto Sans') [all …]
|
| /libCEED/examples/solids/ |
| H A D | index.md | 1 (example-petsc-elasticity)= 3 # Solid mechanics mini-app 6 It solves the steady-state static momentum balance equations using unstructured high-order finite/s… 7 As for the {ref}`example-petsc-navier-stokes` case, the solid mechanics elasticity example has been… 9 …ini-app, we consider three formulations used in solid mechanics applications: linear elasticity, N… 11 The stress-strain relationship (constitutive law) for each of the material models is provided. 12 Due to the nonlinearity of material models in Neo-Hookean hyperelasticity, the Newton linearization… 15 Linear elasticity and small-strain hyperelasticity can both by obtained from the finite-strain hype… 16 …ll strain regime, while $\bm S$ and $\bm E$ are their finite-strain generalizations (second Piola-… 20 {\overbrace{\bm S(\bm E)}^{\text{Finite Strain Hyperelastic}}} [all …]
|
| H A D | README.md | 7 This code solves the steady-state static momentum balance equations using unstructured high-order f… 8 …ini-app, we consider three formulations used in solid mechanics applications: linear elasticity, N… 20 ./elasticity -mesh [.exo file] -degree [degree] -nu [nu] -E [E] [boundary options] -problem [proble… 25 <!-- solids-inclusion --> 27 The elasticity mini-app is controlled via command-line options, the following of which are mandator… 29 :::{list-table} Mandatory Runtime Options 30 :header-rows: 1 33 * - Option 34 - Description 35 * - `-mesh [filename]` [all …]
|
| /libCEED/julia/LibCEED.jl/examples/ |
| H A D | common.jl | 6 s = 0 # find s: num_elem/2 < 2^s <= num_elem 9 s += 1 11 r = s%dim 13 sd = div(s, dim) 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) [all …]
|
| /libCEED/backends/cuda/ |
| H A D | ceed-cuda-compile.cpp | 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 8 #include "ceed-cuda-compile.h" 12 #include <ceed/jit-tools.h> 28 #include "ceed-cuda-common.h" 44 //------------------------------------------------------------------------------ 46 //------------------------------------------------------------------------------ 48 CeedDebug(ceed, "Running command:\n$ %s", command); in CeedCallSystem_Core() 51 …CeedCheck(output_stream != nullptr, ceed, CEED_ERROR_BACKEND, "Failed to %s\ncommand:\n$ %s", mess… in CeedCallSystem_Core() [all …]
|
| /libCEED/examples/python/ |
| H A D | tutorial-6-shell.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… 21 "uses high-order finite elements/spectral elements, namely, the high-order Lagrange\n", 22 "polynomials defined over $P$ non-uniformly spaced nodes, the\n", 23 "Gauss-Legendre-Lobatto (GLL) points, and quadrature points $\\{q_i\\}_{i=1}^Q$, with\n", 25 "or Gauss-Lobatto quadratures, that are built in the library).\n", 34 "$\\boldsymbol{X}=(X,Y,Z) \\equiv (X_1,X_2,X_3) \\in I=[-1,1]^3$\n", 37 "### Ex1-Volume\n", 42 "simple usage of libCEED to compute the volume of a given body using a matrix-free\n", 48 "$1$s. It computes:\n", [all …]
|
| /libCEED/interface/ |
| H A D | ceed-jit-tools.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 8 #include <ceed-impl.h> 11 #include <ceed/jit-tools.h> 23 @return An error code: 0 - success, otherwise - failure 34 size_t source_file_path_length = (last_colon - source_file_path + 1); in CeedCheckFilePath() 37 memcpy(source_file_path_only, source_file_path, source_file_path_length - 1); in CeedCheckFilePath() 44 CeedDebug(ceed, "%s\n", source_file_path_only); in CeedCheckFilePath() 54 CeedDebug(ceed, "%s\n", source_file_path_only); in CeedCheckFilePath() [all …]
|
| /libCEED/python/ |
| H A D | ceed_vector.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 14 # ------------------------------------------------------------------------------ 72 # Set Vector's data array 104 # Get Vector's data array 119 # Setup the pointer's pointer 138 # https://numba.pydata.org/numba-doc/latest/cuda/cuda_array_interface.html 149 # Get Vector's data array in read-only mode 151 """Get read-only access to a Vector via the specified memory type. [all …]
|
| H A D | ceed_qfunctioncontext.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 14 # ------------------------------------------------------------------------------ 62 # Set QFunction Context's data 98 # Get QFunction Context's data 114 # Setup the pointer's pointer 132 # https://numba.pydata.org/numba-doc/latest/cuda/cuda_array_interface.html 147 # Restore the QFunction Context's data 151 # Setup the pointer's pointer [all …]
|
| /libCEED/examples/rust/mesh/src/ |
| H A D | lib.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 11 // ---------------------------------------------------------------------------- 13 // ---------------------------------------------------------------------------- 14 pub fn cartesian_mesh_size(dim: usize, solution_degree: usize, problem_size: i64) -> [usize; 3] { in cartesian_mesh_size() 18 let mut s = 0; // find s: num_elem / 2 < 2^s <= num_elem localVariable 21 s += 1; 25 let mut r = s % dim; 27 .map(|_| -> usize { [all …]
|