Crate libceed[−][src]
libCEED Rust Interface
This is the documentation for the high level libCEED Rust interface. See the full libCEED user manual here.
libCEED is a low-level API for for the efficient high-order discretization methods developed by the ECP co-design Center for Efficient Exascale Discretizations (CEED). While our focus is on high-order finite elements, the approach is mostly algebraic and thus applicable to other discretizations in factored form.
Usage
To call libCEED from a Rust package, the following Cargo.toml can be used.
[dependencies]
libceed = { git = "https://github.com/CEED/libCEED", branch = "main" }
Supported features:
static(default): link to static libceed.asystem: use libceed from a system directory (otherwise, install from source)
extern crate libceed; fn main() { let ceed = libceed::Ceed::init("/cpu/self/ref"); let xc = ceed.vector_from_slice(&[0., 0.5, 1.0]).unwrap(); let xs = xc.view(); assert_eq!(xs[..], [0., 0.5, 1.0]); }
Examples
Examples of libCEED can be found in the libCEED GitHub repository under the
examples/rust folder.
Development
To develop libCEED, use cargo build in the rust/ directory to install a
local copy and build the bindings. If you need custom flags for the C
project, we recommend using make configure to cache arguments. If you
disable the static feature, then you’ll need to set LD_LIBRARY_PATH for
doctests to be able to find it. You can do this in $CEED_DIR/lib and set
PKG_CONFIG_PATH.
Note: the LD_LIBRARY_PATH workarounds will become unnecessary if this
issue is resolved – it’s
currently closed, but the problem still exists.
Modules
| basis | A Ceed Basis defines the discrete finite element basis and associated quadrature rule. |
| elem_restriction | A Ceed ElemRestriction decomposes elements and groups the degrees of freedom (dofs) according to the different elements they belong to. |
| operator | A Ceed Operator defines the finite/spectral element operator associated to a Ceed QFunction. A Ceed Operator connects Ceed ElemRestrictions, Ceed Bases, and Ceed QFunctions. |
| prelude | |
| qfunction | A Ceed QFunction represents the spatial terms of the point-wise functions describing the physics at the quadrature points. |
| vector | A Ceed Vector constitutes the main data structure and serves as input/output for Ceed Operators. |
Structs
| Ceed | A Ceed is a library context representing control of a logical hardware resource. |
| CeedError |
Enums
| CeedErrorHandler | |
| ElemTopology | Type of basis shape to create non-tensor H1 element basis |
| EvalMode | Basis evaluation mode |
| MemType | Many Ceed interfaces take or return pointers to memory. This enum is used to specify where the memory being provided or requested must reside. |
| NormType | Denotes type of vector norm to be computed |
| QuadMode | Type of quadrature; also used for location of nodes |
| TransposeMode | Denotes whether a linear transformation or its transpose should be applied |
Constants
| CEED_STRIDES_BACKEND | |
| MAX_QFUNCTION_FIELDS |