12#ifndef MFEM_LIBCEED_UTIL
13#define MFEM_LIBCEED_UTIL
21#include <unordered_map>
26#include <ceed/backend.h>
33class FiniteElementSpace;
34class ElementTransformation;
51#define PCeedChk(err) do { \
54 const char * errmsg; \
55 CeedGetErrorMessage(internal::ceed, &errmsg); \
75 Ceed ceed, CeedBasis *basis,
76 CeedElemRestriction *restr);
92 const IntegrationRule &ir,
95 Ceed ceed, CeedBasis *basis,
96 CeedElemRestriction *restr);
101template <
typename Integrator>
103 const Integrator &integ,
115 return std::hash<T> {}(key);
123 return seed ^ (hash + (seed << 6) + (seed >> 2));
144using BasisMap = std::unordered_map<const BasisKey, CeedBasis, BasisHash>;
150 std::tuple<const mfem::FiniteElementSpace*, int, int, int, int>;
166 std::unordered_map<const RestrKey, CeedElemRestriction, RestrHash>;
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Abstract class for all finite elements.
Class for an integration rule - an Array of IntegrationPoint.
const std::string & GetCeedPath()
Return the path to the libCEED q-function headers.
std::size_t CeedHashCombine(std::size_t seed, std::size_t hash)
Effective way to combine hashes (from libCEED).
void InitVector(const mfem::Vector &v, CeedVector &cv)
Initialize a CeedVector from an mfem::Vector.
void RemoveBasisAndRestriction(const mfem::FiniteElementSpace *fes)
Remove from ceed_basis_map and ceed_restr_map the entries associated with the given fes.
std::unordered_map< const BasisKey, CeedBasis, BasisHash > BasisMap
std::size_t CeedHash(const T key)
Wrapper for std::hash.
std::tuple< const mfem::FiniteElementSpace *, const mfem::IntegrationRule *, int, int, int > BasisKey
std::unordered_map< const RestrKey, CeedElemRestriction, RestrHash > RestrMap
const IntegrationRule & GetRule(const Integrator &integ, const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans)
void InitBasisAndRestriction(const FiniteElementSpace &fes, const IntegrationRule &irm, Ceed ceed, CeedBasis *basis, CeedElemRestriction *restr)
Initialize a CeedBasis and a CeedElemRestriction based on an mfem::FiniteElementSpace fes,...
int CeedOperatorGetActiveField(CeedOperator oper, CeedOperatorField *field)
std::tuple< const mfem::FiniteElementSpace *, int, int, int, int > RestrKey
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
std::size_t operator()(const BasisKey &k) const
std::size_t operator()(const RestrKey &k) const