CEED/libCEED

Support additional `CeedContextFieldType` values

開放

#2,004 建立於 2026年8月10日

 (8 則留言) (0 個反應) (0 位負責人)C (74 個分叉)github user discovery
good first issueinterface

倉庫指標

星標
 (264 顆星)
PR 合併指標
 (平均合併 8天 15小時) (30 天內合併 10 個 PR)

描述

Summary

Add new enum values to CeedContextFieldType for single-precision floating point, 64-bit integer, byte, and CeedInt and CeedScalar types.

Possible Implementation

  • Expand the CeedContextFieldType interface to include:
typedef enum {
  /// Byte value, C type of char
  CEED_CONTEXT_FIELD_BYTE = 1,
  /// CeedScalar value
  CEED_CONTEXT_FIELD_SCALAR = 2,
  /// Single precision value
  CEED_CONTEXT_FIELD_FLOAT = 3,
  /// Double precision value
  CEED_CONTEXT_FIELD_DOUBLE = 4,
  /// CeedInt value
  CEED_CONTEXT_FIELD_INT = 5,
  /// 32 bit integer value
  CEED_CONTEXT_FIELD_INT32 = 6,
  /// 64 bit integer value
  CEED_CONTEXT_FIELD_INT64 = 7,
  /// Boolean value
  CEED_CONTEXT_FIELD_BOOL = 8,
} CeedContextFieldType;
  • Add strings/update indices in CeedContextFieldTypes.

  • Add associated public registration functions:

int CeedQFunctionContextRegisterByte(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, const char *field_description);
int CeedQFunctionContextRegisterScalar(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, const char *field_description);
int CeedQFunctionContextRegisterFloat(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, const char *field_description);
int CeedQFunctionContextRegisterInt(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, const char *field_description);
int CeedQFunctionContextRegisterInt64(CeedQFunctionContext ctx, const char *field_name, size_t field_offset, size_t num_values, const char *field_description);
  • Add the associated public Get[TYPE]Read/Restore[TYPE]Read/Set[TYPE] functions (byte used as an example):
int CeedOperatorGetContextByteRead(CeedOperator op, CeedContextFieldLabel field_label, size_t *num_values, const char **values);
int CeedOperatorRestoreContextByteRead(CeedOperator op, CeedContextFieldLabel field_label, size_t *num_values, const char **values);
int CeedOperatorSetContextByte(CeedOperator op, CeedContextFieldLabel field_label, char *values);
int CeedQFunctionContextGetByteRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, size_t *num_values, const char **values);
int CeedQFunctionContextRestoreByteRead(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, const char **values);
int CeedQFunctionContextSetByte(CeedQFunctionContext ctx, CeedContextFieldLabel field_label, char *values);
  • Update CeedQFunctionContextRegisterGeneric, CeedQFunctionContextGetGenericRead.

  • Regenerate Julia bindings.

  • Add new values to tests/t407-qfunction.

貢獻者指南