FMS  v0.2
Field and Mesh Specification
Macros | Functions | Variables
fms.c File Reference
#include "fms.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Include dependency graph for fms.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   600
 
#define FMS_PRETTY_FUNCTION   __func__
 
#define E_RETURN(code)
 
#define FMS_ICC_IL(src_t, src, dst_t, dst, size)
 
#define FMS_ICC_SW(src_type, src, dst_t, dst, size)
 
#define FMS_IPCC_IL(src_t, src, dst_t, dst, tuple_size, perm, tot_size)
 
#define FMS_IPCC_SW(src_type, src, dst_t, dst, ts, perm, size)
 
#define FMS_IMC_IL(src_t, src, dst_t, dst, map, size)
 
#define FMS_IMC_SW(src_type, src, dst_t, dst, map, size)
 
#define FMS_E2S_TEMPL(idx_t)
 
#define COMPARE_SCALAR_DATA(T, lhs, rhs, n, OUT_FmsInt_isdifferent)
 
#define COMPARE_INT_DATA(T, lhs, rhs, n, OUT_FmsInt_isdifferent)
 

Functions

int FmsGetInterfaceVersion (FmsInt *version)
 Get the interface version. More...
 
int FmsGetIntTypeFromName (const char *const name, FmsIntType *type)
 Get the enum representation of an int type from the string name. More...
 
int FmsGetScalarTypeFromName (const char *const name, FmsScalarType *type)
 Get the enum representation of an int type from the string name. More...
 
int FmsGetEntityTypeFromName (const char *const name, FmsEntityType *ent_type)
 Convert an entity-type string to FmsEntityType value. More...
 
int FmsGetMetaDataTypeFromName (const char *const name, FmsMetaDataType *type)
 Convert a meta-data-type string to FmsMetaDataType value. More...
 
int FmsMeshConstruct (FmsMesh *mesh)
 Allocate a mesh structure and initialize it to be empty. More...
 
int FmsMeshFinalize (FmsMesh mesh)
 TODO: dox. More...
 
int FmsMeshValidate (FmsMesh mesh)
 TODO: dox. More...
 
int FmsMeshDestroy (FmsMesh *mesh)
 TODO: dox. More...
 
int FmsMeshSetPartitionId (FmsMesh mesh, FmsInt partition_id, FmsInt num_partitions)
 TODO: dox. More...
 
int FmsMeshAddDomains (FmsMesh mesh, const char *domain_name, FmsInt num_domains, FmsDomain **domains)
 Allocates an array of domains sharing the same name, initializes them, and returns a pointer to the array. More...
 
int FmsMeshAddComponent (FmsMesh mesh, const char *comp_name, FmsComponent *comp)
 Add a new empty component to the mesh with the given name and return the new component in comp. More...
 
int FmsMeshAddTag (FmsMesh mesh, const char *tag_name, FmsTag *tag)
 Add a new tag to the mesh with the given name and return the new tag in tag. More...
 
int FmsDomainSetNumVertices (FmsDomain domain, FmsInt num_verts)
 Set the number of vertices in a domain. More...
 
int FmsDomainSetNumEntities (FmsDomain domain, FmsEntityType type, FmsIntType id_store_type, FmsInt num_ents)
 Allocates memory for the specified entities. More...
 
int FmsDomainGetEntitiesArray (FmsDomain domain, FmsEntityType type, void **ents)
 TODO: dox. More...
 
int FmsDomainGetOrientationsArray (FmsDomain domain, FmsEntityType type, FmsOrientation **side_orients)
 TODO: dox. More...
 
int FmsDomainAddEntities (FmsDomain domain, FmsEntityType type, FmsEntityReordering reordering, FmsIntType ent_id_type, const void *ents, FmsInt num_ents)
 TODO: dox. More...
 
int FmsDomainAddOrientation (FmsDomain domain, FmsEntityType type, FmsInt ent_id, FmsInt loc_side_id, FmsOrientation side_orient)
 TODO: dox. More...
 
int FmsComponentAddDomain (FmsComponent comp, FmsDomain domain)
 TODO: dox. More...
 
int FmsComponentAddPart (FmsComponent comp, FmsDomain domain, FmsInt *part_id)
 TODO: dox. More...
 
int FmsComponentAddPartEntities (FmsComponent comp, FmsInt part_id, FmsEntityType type, FmsIntType id_store_type, FmsIntType ent_id_type, FmsIntType orient_type, const FmsOrientation *inv_orient_map, const void *ents, const void *ent_orients, FmsInt num_ents)
 TODO: dox. More...
 
int FmsComponentAddPartSubEntities (FmsComponent comp, FmsInt part_id, FmsEntityType type, FmsIntType id_store_type, FmsIntType ent_id_type, const void *ents, FmsInt num_ents)
 TODO: dox Similar to FmsComponentAddPartEntities() but for lower dimensional entities. More...
 
int FmsComponentAddRelation (FmsComponent comp, FmsInt other_comp_id)
 Describe a relation from one component to another. More...
 
int FmsComponentSetCoordinates (FmsComponent comp, FmsField coords)
 Set the coordinates field of a component. More...
 
int FmsTagSetComponent (FmsTag tag, FmsComponent comp)
 TODO: dox. More...
 
int FmsTagSet (FmsTag tag, FmsIntType stored_tag_type, FmsIntType input_tag_type, const void *ent_tags, FmsInt num_ents)
 TODO: dox. More...
 
int FmsTagAllocate (FmsTag tag, FmsIntType stored_tag_type, void **ent_tags, FmsInt *num_ents)
 TODO: dox. More...
 
int FmsTagAddDescriptions (FmsTag tag, FmsIntType tag_type, const void *tags, const char *const *tag_descr, FmsInt num_tags)
 TODO: dox. More...
 
int FmsDataCollectionCreate (FmsMesh mesh, const char *dc_name, FmsDataCollection *dc)
 TODO: dox The new object, dc, assumes ownership of the mesh. More...
 
int FmsDataCollectionDestroy (FmsDataCollection *dc)
 Destroy a data collection object. More...
 
int FmsDataCollectionAddFieldDescriptor (FmsDataCollection dc, const char *fd_name, FmsFieldDescriptor *fd)
 TODO: dox. More...
 
int FmsDataCollectionAddField (FmsDataCollection dc, const char *field_name, FmsField *field)
 TODO: dox. More...
 
int FmsDataCollectionAttachMetaData (FmsDataCollection dc, FmsMetaData *mdata)
 Make sure the meta-data structure associated with a data collection is allocated and return it in mdata. More...
 
int FmsFieldDescriptorSetComponent (FmsFieldDescriptor fd, FmsComponent comp)
 TODO: dox. More...
 
int FmsFieldDescriptorSetFixedOrder (FmsFieldDescriptor fd, FmsFieldType field_type, FmsBasisType basis_type, FmsInt order)
 TODO: dox. More...
 
int FmsFieldSet (FmsField field, FmsFieldDescriptor fd, FmsInt num_vec_comp, FmsLayoutType layout_type, FmsScalarType data_type, const void *data)
 TODO: dox The size of the data array is num_vec_comp times the number of DOFs as defined by the field descriptor fd. More...
 
int FmsFieldAttachMetaData (FmsField field, FmsMetaData *mdata)
 Make sure the meta-data structure associated with a field is allocated and return it in mdata. More...
 
int FmsMetaDataSetIntegers (FmsMetaData mdata, const char *mdata_name, FmsIntType int_type, FmsInt size, void **data)
 Set the contents of a meta-data structure to store an array of integers. More...
 
int FmsMetaDataSetScalars (FmsMetaData mdata, const char *mdata_name, FmsScalarType scal_type, FmsInt size, void **data)
 Set the contents of a meta-data structure to store an array of scalars. More...
 
int FmsMetaDataSetString (FmsMetaData mdata, const char *mdata_name, const char *c_string)
 Set the contents of a meta-data structure to store a c-string. More...
 
int FmsMetaDataSetMetaData (FmsMetaData mdata, const char *mdata_name, FmsInt size, FmsMetaData **data)
 Set the contents of a meta-data structure to store an array of meta-data structures. More...
 
int FmsMetaDataClear (FmsMetaData mdata)
 Clear the contents of mdata without destroying the object. More...
 
int FmsMetaDataDestroy (FmsMetaData *mdata)
 Destroy the object that *mdata refers to and set *mdata to NULL. More...
 
int FmsMeshGetPartitionId (FmsMesh mesh, FmsInt *partition_id, FmsInt *num_partitions)
 TODO: dox. More...
 
int FmsMeshGetNumDomainNames (FmsMesh mesh, FmsInt *num_domain_names)
 TODO: dox. More...
 
int FmsMeshGetDomains (FmsMesh mesh, FmsInt domain_name_id, const char **domain_name, FmsInt *num_domains, FmsDomain **domains)
 TODO: dox. More...
 
int FmsMeshGetDomainsByName (FmsMesh mesh, const char *domain_name, FmsInt *num_domains, FmsDomain **domains)
 TODO: dox. More...
 
int FmsMeshGetNumComponents (FmsMesh mesh, FmsInt *num_comp)
 TODO: dox. More...
 
int FmsMeshGetComponent (FmsMesh mesh, FmsInt comp_id, FmsComponent *comp)
 TODO: dox. More...
 
int FmsMeshGetNumTags (FmsMesh mesh, FmsInt *num_tags)
 TODO: dox. More...
 
int FmsMeshGetTag (FmsMesh mesh, FmsInt tag_id, FmsTag *tag)
 TODO: dox. More...
 
int FmsDomainGetName (FmsDomain domain, const char **domain_name, FmsInt *domain_id)
 Return the name and id of a mesh domain. More...
 
int FmsDomainGetDimension (FmsDomain domain, FmsInt *dim)
 Return the highest dimension of an entry in a mesh domain. More...
 
int FmsDomainGetNumVertices (FmsDomain domain, FmsInt *num_verts)
 Get the number of vertices in a domain. More...
 
int FmsDomainGetNumEntities (FmsDomain domain, FmsEntityType type, FmsInt *num_ents)
 Get the number of entities of a given type in a domain. More...
 
int FmsDomainGetAllEntities (FmsDomain domain, FmsEntityType type, FmsIntType *ent_id_type, const void **ents, FmsInt *num_ents)
 TODO: dox No copy, read only access to all entity definitions. More...
 
int FmsDomainGetEntities (FmsDomain domain, FmsEntityType type, FmsEntityReordering reordering, FmsIntType ent_id_type, FmsInt first_ent, void *ents, FmsInt num_ents)
 TODO: dox Extract a subset of the entity definitions. More...
 
int FmsDomainGetEntitiesVerts (FmsDomain domain, FmsEntityType type, FmsEntityReordering vert_reordering, FmsIntType ent_id_type, FmsInt first_ent, void *ents_verts, FmsInt num_ents)
 TODO: dox Extract a subset of the entity definitions in terms of their vertices. More...
 
int FmsDomainGetAllOrientations (FmsDomain domain, FmsEntityType type, const FmsOrientation **side_orients, FmsInt *num_ents)
 TODO: dox No copy, read only access to all entity side orientations. More...
 
int FmsComponentGetName (FmsComponent comp, const char **comp_name)
 Return the name of a mesh component. More...
 
int FmsComponentGetDimension (FmsComponent comp, FmsInt *dim)
 Return the dimension of a mesh component. More...
 
int FmsComponentGetNumParts (FmsComponent comp, FmsInt *num_parts)
 TODO: dox. More...
 
int FmsComponentGetPart (FmsComponent comp, FmsInt part_id, FmsEntityType type, FmsDomain *domain, FmsIntType *ent_id_type, const void **ents, const FmsOrientation **ent_orients, FmsInt *num_ents)
 TODO: dox. More...
 
int FmsComponentGetPartSubEntities (FmsComponent comp, FmsInt part_id, FmsEntityType type, FmsIntType *ent_id_type, const void **ents, FmsInt *num_ents)
 TODO: dox Similar to FmsComponentGetPart() but for lower dimensional entities. More...
 
int FmsComponentGetNumEntities (FmsComponent comp, FmsInt *num_ents)
 Return the total number of main entities across all parts in the component. More...
 
int FmsComponentGetRelations (FmsComponent comp, const FmsInt **rel_comps, FmsInt *num_rel_comps)
 TODO: dox. More...
 
int FmsComponentGetCoordinates (FmsComponent comp, FmsField *coords)
 Return the coordinates field of a component. More...
 
int FmsTagGetName (FmsTag tag, const char **tag_name)
 TODO: dox. More...
 
int FmsTagGetComponent (FmsTag tag, FmsComponent *comp)
 TODO: dox. More...
 
int FmsTagGet (FmsTag tag, FmsIntType *tag_type, const void **ent_tags, FmsInt *num_ents)
 TODO: dox No copy, read only access to the entity-tag array. More...
 
int FmsTagGetDescriptions (FmsTag tag, FmsIntType *tag_type, const void **tags, const char *const **tag_descr, FmsInt *num_tags)
 TODO: dox. More...
 
int FmsDataCollectionGetName (FmsDataCollection dc, const char **name)
 Get the name of the data collection. More...
 
int FmsDataCollectionGetMesh (FmsDataCollection dc, FmsMesh *mesh)
 TODO: dox. More...
 
int FmsDataCollectionGetFieldDescriptors (FmsDataCollection dc, FmsFieldDescriptor **fds, FmsInt *num_fds)
 TODO: dox. More...
 
int FmsDataCollectionGetFields (FmsDataCollection dc, FmsField **fields, FmsInt *num_fields)
 TODO: dox. More...
 
int FmsDataCollectionGetMetaData (FmsDataCollection dc, FmsMetaData *mdata)
 TODO: dox. More...
 
int FmsFieldDescriptorGetName (FmsFieldDescriptor fd, const char **fd_name)
 TODO: dox. More...
 
int FmsFieldDescriptorGetComponent (FmsFieldDescriptor fd, FmsComponent *comp)
 TODO: dox. More...
 
int FmsFieldDescriptorGetType (FmsFieldDescriptor fd, FmsFieldDescriptorType *fd_type)
 TODO: dox. More...
 
int FmsFieldDescriptorGetFixedOrder (FmsFieldDescriptor fd, FmsFieldType *field_type, FmsBasisType *basis_type, FmsInt *order)
 TODO: dox. More...
 
int FmsFieldDescriptorGetNumDofs (FmsFieldDescriptor fd, FmsInt *num_dofs)
 TODO: dox. More...
 
int FmsFieldGetName (FmsField field, const char **field_name)
 TODO: dox. More...
 
int FmsFieldGet (FmsField field, FmsFieldDescriptor *fd, FmsInt *num_vec_comp, FmsLayoutType *layout_type, FmsScalarType *data_type, const void **data)
 TODO: dox. More...
 
int FmsFieldGetMetaData (FmsField field, FmsMetaData *mdata)
 TODO: dox. More...
 
int FmsMetaDataGetType (FmsMetaData mdata, FmsMetaDataType *type)
 TODO: dox. More...
 
int FmsMetaDataGetIntegers (FmsMetaData mdata, const char **mdata_name, FmsIntType *int_type, FmsInt *size, const void **data)
 Get the contents of a meta-data structure that stores an array of integers. More...
 
int FmsMetaDataGetScalars (FmsMetaData mdata, const char **mdata_name, FmsScalarType *scal_type, FmsInt *size, const void **data)
 Get the contents of a meta-data structure that stores an array of scalars. More...
 
int FmsMetaDataGetString (FmsMetaData mdata, const char **mdata_name, const char **c_string)
 Get the contents of a meta-data structure that stores a c-string. More...
 
int FmsMetaDataGetMetaData (FmsMetaData mdata, const char **mdata_name, FmsInt *size, FmsMetaData **data)
 Get the contents of a meta-data structure that stores an array of meta-data structures. More...
 
int FmsDataCollectionCompare (FmsDataCollection lhs, FmsDataCollection rhs)
 Comparison interface. More...
 
int FmsMeshCompare (FmsMesh lhs, FmsMesh rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 
int FmsFieldDescriptorCompare (FmsFieldDescriptor lhs, FmsFieldDescriptor rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 
int FmsFieldCompare (FmsField lhs, FmsField rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 
int FmsMetaDataCompare (FmsMetaData lhs, FmsMetaData rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 
int FmsDomainCompare (FmsDomain lhs, FmsDomain rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 
int FmsComponentCompare (FmsComponent lhs, FmsComponent rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 
int FmsTagCompare (FmsTag lhs, FmsTag rhs)
 Return 0 if equivalent, not 0 otherwise. More...
 

Variables

const size_t FmsIntTypeSize [FMS_NUM_INT_TYPES]
 
const char *const FmsIntTypeNames [FMS_NUM_INT_TYPES]
 Added in version: v0.2. More...
 
const char *const FmsEntityTypeNames [FMS_NUM_ENTITY_TYPES]
 String representations of each entity type. More...
 
const FmsInt FmsEntityDim [FMS_NUM_ENTITY_TYPES]
 Dimensions of the entity types. More...
 
const FmsInt FmsEntityNumSides [FMS_NUM_ENTITY_TYPES]
 Number of sides of the entity types. More...
 
const FmsInt FmsEntityNumVerts [FMS_NUM_ENTITY_TYPES]
 Number of vertices of the entity types. More...
 
const size_t FmsScalarTypeSize [FMS_NUM_SCALAR_TYPES]
 
const char *const FmsScalarTypeNames [FMS_NUM_SCALAR_TYPES]
 Added in version: v0.2. More...
 
const char *const FmsMetaDataTypeNames [FMS_NUM_METADATA_TYPES]
 Added in version: v0.2. More...
 

Macro Definition Documentation

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE   600

Definition at line 20 of file fms.c.

◆ COMPARE_INT_DATA

#define COMPARE_INT_DATA (   T,
  lhs,
  rhs,
  n,
  OUT_FmsInt_isdifferent 
)
Value:
do { \
const T *lhs_data = (const T*)lhs; \
const T *rhs_data = (const T*)rhs; \
const FmsInt N = n; \
OUT_FmsInt_isdifferent = 0; \
for(FmsInt i = 0; i < N; i++) { \
if(lhs_data[i] != rhs_data[i]) { \
OUT_FmsInt_isdifferent = i+1; \
break; \
} \
} \
} while(0)
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43

Definition at line 2959 of file fms.c.

◆ COMPARE_SCALAR_DATA

#define COMPARE_SCALAR_DATA (   T,
  lhs,
  rhs,
  n,
  OUT_FmsInt_isdifferent 
)
Value:
do { \
const T *lhs_data = (const T*)lhs; \
const T *rhs_data = (const T*)rhs; \
const FmsInt N = n; \
OUT_FmsInt_isdifferent = 0; \
for(FmsInt i = 0; i < N; i++) { \
if(FmsAbs(lhs_data[i] - rhs_data[i]) > 1e-6) { \
OUT_FmsInt_isdifferent = i+1; \
break; \
} \
} \
} while(0)
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43

Definition at line 2945 of file fms.c.

◆ E_RETURN

#define E_RETURN (   code)
Value:
do { \
if (code) { \
FmsErrorDebug(code, FMS_PRETTY_FUNCTION, __FILE__, __LINE__); \
} \
return (code); \
} while (0)
#define FMS_PRETTY_FUNCTION
Definition: fms.c:235

Definition at line 239 of file fms.c.

◆ FMS_E2S_TEMPL

#define FMS_E2S_TEMPL (   idx_t)
Value:
do { \
const idx_t *ents_ = (idx_t*)ents + loc_side_begin; \
const idx_t *sides_ = sides; \
for (FmsInt ent_id = 0; ent_id < num_ents; ent_id++) { \
const idx_t *ent_off = &ents_[ent_id*ent_sides]; \
FmsInt *res_ent = &res_[ent_id*res_stride]; \
for (FmsInt loc_off = 0; loc_off < num_loc_sides; loc_off++) { \
const idx_t side_id = ent_off[loc_off]; \
const idx_t *side = &sides_[side_id*side_sides]; \
FmsInt *res_side = &res_ent[loc_off*side_sides]; \
for (FmsInt ss_id = 0; ss_id < side_sides; ss_id++) { \
res_side[ss_id] = side[ss_id]; \
} \
} \
} \
} while (0); break
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43

Definition at line 426 of file fms.c.

◆ FMS_ICC_IL

#define FMS_ICC_IL (   src_t,
  src,
  dst_t,
  dst,
  size 
)
Value:
do { \
for (FmsInt idx = 0; idx < (size); idx++) { \
((dst_t*)(dst))[idx] = (dst_t)(((src_t*)(src))[idx]); \
} \
} while (0)
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43

Definition at line 288 of file fms.c.

◆ FMS_ICC_SW

#define FMS_ICC_SW (   src_type,
  src,
  dst_t,
  dst,
  size 
)
Value:
switch (src_type) { \
case FMS_INT8: FMS_ICC_IL( int8_t,src,dst_t,dst,size); break; \
case FMS_INT16: FMS_ICC_IL( int16_t,src,dst_t,dst,size); break; \
case FMS_INT32: FMS_ICC_IL( int32_t,src,dst_t,dst,size); break; \
case FMS_INT64: FMS_ICC_IL( int64_t,src,dst_t,dst,size); break; \
case FMS_UINT8: FMS_ICC_IL( uint8_t,src,dst_t,dst,size); break; \
case FMS_UINT16: FMS_ICC_IL(uint16_t,src,dst_t,dst,size); break; \
case FMS_UINT32: FMS_ICC_IL(uint32_t,src,dst_t,dst,size); break; \
case FMS_UINT64: FMS_ICC_IL(uint64_t,src,dst_t,dst,size); break; \
default: FmsAbortNotImplemented(); \
} \
break
Definition: fms.h:50
Definition: fms.h:53
#define FMS_ICC_IL(src_t, src, dst_t, dst, size)
Definition: fms.c:288
Definition: fms.h:48
Definition: fms.h:54
Definition: fms.h:51
Definition: fms.h:56
Definition: fms.h:49
Definition: fms.h:55

Definition at line 296 of file fms.c.

◆ FMS_IMC_IL

#define FMS_IMC_IL (   src_t,
  src,
  dst_t,
  dst,
  map,
  size 
)
Value:
do { \
for (FmsInt idx = 0; idx < (size); idx++) { \
((dst_t*)(dst))[idx] = ((dst_t*)(map))[((src_t*)(src))[idx]]; \
} \
} while (0)
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43

Definition at line 383 of file fms.c.

◆ FMS_IMC_SW

#define FMS_IMC_SW (   src_type,
  src,
  dst_t,
  dst,
  map,
  size 
)
Value:
switch (src_type) { \
case FMS_INT8: FMS_IMC_IL( int8_t,src,dst_t,dst,map,size); break; \
case FMS_INT16: FMS_IMC_IL( int16_t,src,dst_t,dst,map,size); break; \
case FMS_INT32: FMS_IMC_IL( int32_t,src,dst_t,dst,map,size); break; \
case FMS_INT64: FMS_IMC_IL( int64_t,src,dst_t,dst,map,size); break; \
case FMS_UINT8: FMS_IMC_IL( uint8_t,src,dst_t,dst,map,size); break; \
case FMS_UINT16: FMS_IMC_IL(uint16_t,src,dst_t,dst,map,size); break; \
case FMS_UINT32: FMS_IMC_IL(uint32_t,src,dst_t,dst,map,size); break; \
case FMS_UINT64: FMS_IMC_IL(uint64_t,src,dst_t,dst,map,size); break; \
default: FmsAbortNotImplemented(); \
} \
break
Definition: fms.h:50
Definition: fms.h:53
Definition: fms.h:48
Definition: fms.h:54
#define FMS_IMC_IL(src_t, src, dst_t, dst, map, size)
Definition: fms.c:383
Definition: fms.h:51
Definition: fms.h:56
Definition: fms.h:49
Definition: fms.h:55

Definition at line 391 of file fms.c.

◆ FMS_IPCC_IL

#define FMS_IPCC_IL (   src_t,
  src,
  dst_t,
  dst,
  tuple_size,
  perm,
  tot_size 
)
Value:
do { \
for (FmsInt i = 0; i < (tot_size); i += (tuple_size)) { \
src_t *loc_src = (src_t*)(src) + i; \
dst_t *loc_dst = (dst_t*)(dst) + i; \
for (FmsInt j = 0; j < (tuple_size); j++) { \
loc_dst[j] = (dst_t)(loc_src[perm[j]]); \
} \
} \
} while (0)
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43

Definition at line 331 of file fms.c.

◆ FMS_IPCC_SW

#define FMS_IPCC_SW (   src_type,
  src,
  dst_t,
  dst,
  ts,
  perm,
  size 
)
Value:
switch (src_type) { \
case FMS_INT8: FMS_IPCC_IL( int8_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_INT16: FMS_IPCC_IL( int16_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_INT32: FMS_IPCC_IL( int32_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_INT64: FMS_IPCC_IL( int64_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_UINT8: FMS_IPCC_IL( uint8_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_UINT16: FMS_IPCC_IL(uint16_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_UINT32: FMS_IPCC_IL(uint32_t,src,dst_t,dst,ts,perm,size); break; \
case FMS_UINT64: FMS_IPCC_IL(uint64_t,src,dst_t,dst,ts,perm,size); break; \
default: FmsAbortNotImplemented(); \
} \
break
Definition: fms.h:50
Definition: fms.h:53
Definition: fms.h:48
Definition: fms.h:54
Definition: fms.h:51
Definition: fms.h:56
Definition: fms.h:49
#define FMS_IPCC_IL(src_t, src, dst_t, dst, tuple_size, perm, tot_size)
Definition: fms.c:331
Definition: fms.h:55

Definition at line 343 of file fms.c.

◆ FMS_PRETTY_FUNCTION

#define FMS_PRETTY_FUNCTION   __func__

Definition at line 235 of file fms.c.

Function Documentation

◆ FmsComponentAddDomain()

int FmsComponentAddDomain ( FmsComponent  comp,
FmsDomain  domain 
)

TODO: dox.

All entities of the highest dimension in the domain are added to the component.

Definition at line 1443 of file fms.c.

◆ FmsComponentAddPart()

int FmsComponentAddPart ( FmsComponent  comp,
FmsDomain  domain,
FmsInt part_id 
)

TODO: dox.

Definition at line 1482 of file fms.c.

◆ FmsComponentAddPartEntities()

int FmsComponentAddPartEntities ( FmsComponent  comp,
FmsInt  part_id,
FmsEntityType  type,
FmsIntType  id_store_type,
FmsIntType  ent_id_type,
FmsIntType  orient_type,
const FmsOrientation inv_orient_map,
const void *  ents,
const void *  ent_orients,
FmsInt  num_ents 
)

TODO: dox.

The pointer ents can be NULL to signify that all entities in the domain of the given type are being added.

The pointer ent_orients can be NULL to signify that all orientations are 0, i.e. the identity permutation.

The arrays ents and ent_orients (if not NULL) have the same size, num_ents.

The content of the arrays ents and ent_orients is copied internally after applying the inv_orient_map to the second array.

TODO: inv_orient_map[user-orientation] -> fms-orientation.

Definition at line 1504 of file fms.c.

◆ FmsComponentAddPartSubEntities()

int FmsComponentAddPartSubEntities ( FmsComponent  comp,
FmsInt  part_id,
FmsEntityType  type,
FmsIntType  id_store_type,
FmsIntType  ent_id_type,
const void *  ents,
FmsInt  num_ents 
)

TODO: dox Similar to FmsComponentAddPartEntities() but for lower dimensional entities.

Definition at line 1577 of file fms.c.

◆ FmsComponentAddRelation()

int FmsComponentAddRelation ( FmsComponent  comp,
FmsInt  other_comp_id 
)

Describe a relation from one component to another.

Definition at line 1624 of file fms.c.

◆ FmsComponentCompare()

int FmsComponentCompare ( FmsComponent  ,
FmsComponent   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3427 of file fms.c.

◆ FmsComponentGetCoordinates()

int FmsComponentGetCoordinates ( FmsComponent  comp,
FmsField coords 
)

Return the coordinates field of a component.

Note that the returned FmsField, *coords, can be NULL.

Definition at line 2722 of file fms.c.

◆ FmsComponentGetDimension()

int FmsComponentGetDimension ( FmsComponent  comp,
FmsInt dim 
)

Return the dimension of a mesh component.

Definition at line 2665 of file fms.c.

◆ FmsComponentGetName()

int FmsComponentGetName ( FmsComponent  comp,
const char **  comp_name 
)

Return the name of a mesh component.

Definition at line 2659 of file fms.c.

◆ FmsComponentGetNumEntities()

int FmsComponentGetNumEntities ( FmsComponent  comp,
FmsInt num_ents 
)

Return the total number of main entities across all parts in the component.

Definition at line 2708 of file fms.c.

◆ FmsComponentGetNumParts()

int FmsComponentGetNumParts ( FmsComponent  comp,
FmsInt num_parts 
)

TODO: dox.

Definition at line 2671 of file fms.c.

◆ FmsComponentGetPart()

int FmsComponentGetPart ( FmsComponent  comp,
FmsInt  part_id,
FmsEntityType  type,
FmsDomain domain,
FmsIntType ent_id_type,
const void **  ents,
const FmsOrientation **  ent_orients,
FmsInt num_ents 
)

TODO: dox.

No copy, read only access to the description of part part_id in the component.

If the pointer returned in ents is NULL, then all entities in the domain of the specified type are used.

If the pointer returned in ent_orients is NULL, then all orientations are 0, i.e. the identity permutation.

Definition at line 2677 of file fms.c.

◆ FmsComponentGetPartSubEntities()

int FmsComponentGetPartSubEntities ( FmsComponent  comp,
FmsInt  part_id,
FmsEntityType  type,
FmsIntType ent_id_type,
const void **  ents,
FmsInt num_ents 
)

TODO: dox Similar to FmsComponentGetPart() but for lower dimensional entities.

Definition at line 2694 of file fms.c.

◆ FmsComponentGetRelations()

int FmsComponentGetRelations ( FmsComponent  comp,
const FmsInt **  rel_comps,
FmsInt num_rel_comps 
)

TODO: dox.

Definition at line 2714 of file fms.c.

◆ FmsComponentSetCoordinates()

int FmsComponentSetCoordinates ( FmsComponent  comp,
FmsField  coords 
)

Set the coordinates field of a component.

Definition at line 1639 of file fms.c.

◆ FmsDataCollectionAddField()

int FmsDataCollectionAddField ( FmsDataCollection  dc,
const char *  field_name,
FmsField field 
)

TODO: dox.

Definition at line 1834 of file fms.c.

◆ FmsDataCollectionAddFieldDescriptor()

int FmsDataCollectionAddFieldDescriptor ( FmsDataCollection  dc,
const char *  fd_name,
FmsFieldDescriptor fd 
)

TODO: dox.

Definition at line 1808 of file fms.c.

◆ FmsDataCollectionAttachMetaData()

int FmsDataCollectionAttachMetaData ( FmsDataCollection  dc,
FmsMetaData mdata 
)

Make sure the meta-data structure associated with a data collection is allocated and return it in mdata.

Definition at line 1861 of file fms.c.

◆ FmsDataCollectionCompare()

int FmsDataCollectionCompare ( FmsDataCollection  ,
FmsDataCollection   
)

Comparison interface.

Return 0 if equivalent, not 0 otherwise Added in version: v0.2.

Definition at line 3035 of file fms.c.

◆ FmsDataCollectionCreate()

int FmsDataCollectionCreate ( FmsMesh  mesh,
const char *  dc_name,
FmsDataCollection dc 
)

TODO: dox The new object, dc, assumes ownership of the mesh.

Definition at line 1750 of file fms.c.

◆ FmsDataCollectionDestroy()

int FmsDataCollectionDestroy ( FmsDataCollection dc)

Destroy a data collection object.

Destroys the mesh, all field-descriptors, and all fields stored by the data collection.

Definition at line 1765 of file fms.c.

◆ FmsDataCollectionGetFieldDescriptors()

int FmsDataCollectionGetFieldDescriptors ( FmsDataCollection  dc,
FmsFieldDescriptor **  fds,
FmsInt num_fds 
)

TODO: dox.

Definition at line 2786 of file fms.c.

◆ FmsDataCollectionGetFields()

int FmsDataCollectionGetFields ( FmsDataCollection  dc,
FmsField **  fields,
FmsInt num_fields 
)

TODO: dox.

Definition at line 2794 of file fms.c.

◆ FmsDataCollectionGetMesh()

int FmsDataCollectionGetMesh ( FmsDataCollection  dc,
FmsMesh mesh 
)

TODO: dox.

Definition at line 2779 of file fms.c.

◆ FmsDataCollectionGetMetaData()

int FmsDataCollectionGetMetaData ( FmsDataCollection  dc,
FmsMetaData mdata 
)

TODO: dox.

Definition at line 2802 of file fms.c.

◆ FmsDataCollectionGetName()

int FmsDataCollectionGetName ( FmsDataCollection  dc,
const char **  name 
)

Get the name of the data collection.

Parameters
dcthe data collection.
[out]nameA char pointer that will be set to point to the name string. The name is owned by the data collection so it should not be freed or modified.
Returns
0 on success, non-zero otherwise.

Added in version: v0.2.

Definition at line 2772 of file fms.c.

◆ FmsDomainAddEntities()

int FmsDomainAddEntities ( FmsDomain  domain,
FmsEntityType  type,
FmsEntityReordering  reordering,
FmsIntType  ent_id_type,
const void *  ents,
FmsInt  num_ents 
)

TODO: dox.

Entities of dimension d are described by tuples of its side entities (entity indices), or in other words, by a list of its boundary entities of dimension d-1.

The content of the array ents is copied internally after applying the side entity reordering.

Definition at line 1402 of file fms.c.

◆ FmsDomainAddOrientation()

int FmsDomainAddOrientation ( FmsDomain  domain,
FmsEntityType  type,
FmsInt  ent_id,
FmsInt  loc_side_id,
FmsOrientation  side_orient 
)

TODO: dox.

Definition at line 1426 of file fms.c.

◆ FmsDomainCompare()

int FmsDomainCompare ( FmsDomain  ,
FmsDomain   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3362 of file fms.c.

◆ FmsDomainGetAllEntities()

int FmsDomainGetAllEntities ( FmsDomain  domain,
FmsEntityType  type,
FmsIntType ent_id_type,
const void **  ents,
FmsInt num_ents 
)

TODO: dox No copy, read only access to all entity definitions.

Definition at line 2287 of file fms.c.

◆ FmsDomainGetAllOrientations()

int FmsDomainGetAllOrientations ( FmsDomain  domain,
FmsEntityType  type,
const FmsOrientation **  side_orients,
FmsInt num_ents 
)

TODO: dox No copy, read only access to all entity side orientations.

Definition at line 2644 of file fms.c.

◆ FmsDomainGetDimension()

int FmsDomainGetDimension ( FmsDomain  domain,
FmsInt dim 
)

Return the highest dimension of an entry in a mesh domain.

Definition at line 2264 of file fms.c.

◆ FmsDomainGetEntities()

int FmsDomainGetEntities ( FmsDomain  domain,
FmsEntityType  type,
FmsEntityReordering  reordering,
FmsIntType  ent_id_type,
FmsInt  first_ent,
void *  ents,
FmsInt  num_ents 
)

TODO: dox Extract a subset of the entity definitions.

Definition at line 2298 of file fms.c.

◆ FmsDomainGetEntitiesArray()

int FmsDomainGetEntitiesArray ( FmsDomain  domain,
FmsEntityType  type,
void **  ents 
)

TODO: dox.

This function allows the internal entities array to be set directly by the user.

Definition at line 1381 of file fms.c.

◆ FmsDomainGetEntitiesVerts()

int FmsDomainGetEntitiesVerts ( FmsDomain  domain,
FmsEntityType  type,
FmsEntityReordering  vert_reordering,
FmsIntType  ent_id_type,
FmsInt  first_ent,
void *  ents_verts,
FmsInt  num_ents 
)

TODO: dox Extract a subset of the entity definitions in terms of their vertices.

Definition at line 2329 of file fms.c.

◆ FmsDomainGetName()

int FmsDomainGetName ( FmsDomain  domain,
const char **  domain_name,
FmsInt domain_id 
)

Return the name and id of a mesh domain.

Definition at line 2256 of file fms.c.

◆ FmsDomainGetNumEntities()

int FmsDomainGetNumEntities ( FmsDomain  domain,
FmsEntityType  type,
FmsInt num_ents 
)

Get the number of entities of a given type in a domain.

Definition at line 2278 of file fms.c.

◆ FmsDomainGetNumVertices()

int FmsDomainGetNumVertices ( FmsDomain  domain,
FmsInt num_verts 
)

Get the number of vertices in a domain.

Definition at line 2271 of file fms.c.

◆ FmsDomainGetOrientationsArray()

int FmsDomainGetOrientationsArray ( FmsDomain  domain,
FmsEntityType  type,
FmsOrientation **  side_orients 
)

TODO: dox.

This function allows the internal entity side orientations array to be set directly by the user.

Definition at line 1393 of file fms.c.

◆ FmsDomainSetNumEntities()

int FmsDomainSetNumEntities ( FmsDomain  domain,
FmsEntityType  type,
FmsIntType  id_store_type,
FmsInt  num_ents 
)

Allocates memory for the specified entities.

Destroys any existing entities of the given type. The value of num_ents can be an upper bound of the actual number of entities.

Definition at line 1334 of file fms.c.

◆ FmsDomainSetNumVertices()

int FmsDomainSetNumVertices ( FmsDomain  domain,
FmsInt  num_verts 
)

Set the number of vertices in a domain.

Definition at line 1327 of file fms.c.

◆ FmsFieldAttachMetaData()

int FmsFieldAttachMetaData ( FmsField  field,
FmsMetaData mdata 
)

Make sure the meta-data structure associated with a field is allocated and return it in mdata.

Definition at line 2016 of file fms.c.

◆ FmsFieldCompare()

int FmsFieldCompare ( FmsField  ,
FmsField   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3236 of file fms.c.

◆ FmsFieldDescriptorCompare()

int FmsFieldDescriptorCompare ( FmsFieldDescriptor  ,
FmsFieldDescriptor   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3174 of file fms.c.

◆ FmsFieldDescriptorGetComponent()

int FmsFieldDescriptorGetComponent ( FmsFieldDescriptor  fd,
FmsComponent comp 
)

TODO: dox.

Definition at line 2821 of file fms.c.

◆ FmsFieldDescriptorGetFixedOrder()

int FmsFieldDescriptorGetFixedOrder ( FmsFieldDescriptor  fd,
FmsFieldType field_type,
FmsBasisType basis_type,
FmsInt order 
)

TODO: dox.

Definition at line 2836 of file fms.c.

◆ FmsFieldDescriptorGetName()

int FmsFieldDescriptorGetName ( FmsFieldDescriptor  fd,
const char **  fd_name 
)

TODO: dox.

Definition at line 2814 of file fms.c.

◆ FmsFieldDescriptorGetNumDofs()

int FmsFieldDescriptorGetNumDofs ( FmsFieldDescriptor  fd,
FmsInt num_dofs 
)

TODO: dox.

Definition at line 2847 of file fms.c.

◆ FmsFieldDescriptorGetType()

int FmsFieldDescriptorGetType ( FmsFieldDescriptor  fd,
FmsFieldDescriptorType fd_type 
)

TODO: dox.

Definition at line 2828 of file fms.c.

◆ FmsFieldDescriptorSetComponent()

int FmsFieldDescriptorSetComponent ( FmsFieldDescriptor  fd,
FmsComponent  comp 
)

TODO: dox.

Definition at line 1882 of file fms.c.

◆ FmsFieldDescriptorSetFixedOrder()

int FmsFieldDescriptorSetFixedOrder ( FmsFieldDescriptor  fd,
FmsFieldType  field_type,
FmsBasisType  basis_type,
FmsInt  order 
)

TODO: dox.

Definition at line 1888 of file fms.c.

◆ FmsFieldGet()

int FmsFieldGet ( FmsField  field,
FmsFieldDescriptor fd,
FmsInt num_vec_comp,
FmsLayoutType layout_type,
FmsScalarType data_type,
const void **  data 
)

TODO: dox.

Definition at line 2866 of file fms.c.

◆ FmsFieldGetMetaData()

int FmsFieldGetMetaData ( FmsField  field,
FmsMetaData mdata 
)

TODO: dox.

Definition at line 2878 of file fms.c.

◆ FmsFieldGetName()

int FmsFieldGetName ( FmsField  field,
const char **  field_name 
)

TODO: dox.

Definition at line 2859 of file fms.c.

◆ FmsFieldSet()

int FmsFieldSet ( FmsField  field,
FmsFieldDescriptor  fd,
FmsInt  num_vec_comp,
FmsLayoutType  layout_type,
FmsScalarType  data_type,
const void *  data 
)

TODO: dox The size of the data array is num_vec_comp times the number of DOFs as defined by the field descriptor fd.

Definition at line 1985 of file fms.c.

◆ FmsGetEntityTypeFromName()

int FmsGetEntityTypeFromName ( const char *const  name,
FmsEntityType ent_type 
)

Convert an entity-type string to FmsEntityType value.

Added in version: v0.2.

Definition at line 921 of file fms.c.

◆ FmsGetInterfaceVersion()

int FmsGetInterfaceVersion ( FmsInt version)

Get the interface version.

Version is of the form: ((major*100 + minor)*100 + patch).

Definition at line 871 of file fms.c.

◆ FmsGetIntTypeFromName()

int FmsGetIntTypeFromName ( const char *const  name,
FmsIntType type 
)

Get the enum representation of an int type from the string name.

Added in version: v0.2.

Definition at line 877 of file fms.c.

◆ FmsGetMetaDataTypeFromName()

int FmsGetMetaDataTypeFromName ( const char *const  name,
FmsMetaDataType type 
)

Convert a meta-data-type string to FmsMetaDataType value.

Added in version: v0.2.

Definition at line 947 of file fms.c.

◆ FmsGetScalarTypeFromName()

int FmsGetScalarTypeFromName ( const char *const  name,
FmsScalarType type 
)

Get the enum representation of an int type from the string name.

Added in version: v0.2.

Definition at line 903 of file fms.c.

◆ FmsMeshAddComponent()

int FmsMeshAddComponent ( FmsMesh  mesh,
const char *  comp_name,
FmsComponent comp 
)

Add a new empty component to the mesh with the given name and return the new component in comp.

After this call, the component should be described via the FmsComponentAdd* functions.

Definition at line 1270 of file fms.c.

◆ FmsMeshAddDomains()

int FmsMeshAddDomains ( FmsMesh  mesh,
const char *  domain_name,
FmsInt  num_domains,
FmsDomain **  domains 
)

Allocates an array of domains sharing the same name, initializes them, and returns a pointer to the array.

After this call, the domains should be described via the FmsDomainSet* and FmsDomainAdd* functions.

Definition at line 1211 of file fms.c.

◆ FmsMeshAddTag()

int FmsMeshAddTag ( FmsMesh  mesh,
const char *  tag_name,
FmsTag tag 
)

Add a new tag to the mesh with the given name and return the new tag in tag.

The tag should be set via the FmsTagSet* functions.

Definition at line 1298 of file fms.c.

◆ FmsMeshCompare()

int FmsMeshCompare ( FmsMesh  ,
FmsMesh   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3097 of file fms.c.

◆ FmsMeshConstruct()

int FmsMeshConstruct ( FmsMesh mesh)

Allocate a mesh structure and initialize it to be empty.

After this call, the content of the mesh should be described by calling the functions FmsMeshAdd* and, if the mesh is partitioned, FmsMeshSetPartitionId.

To complete the construction of the mesh structure, the function FmsMeshFinalize must be called.

Definition at line 970 of file fms.c.

◆ FmsMeshDestroy()

int FmsMeshDestroy ( FmsMesh mesh)

TODO: dox.

Definition at line 1142 of file fms.c.

◆ FmsMeshFinalize()

int FmsMeshFinalize ( FmsMesh  mesh)

TODO: dox.

Definition at line 980 of file fms.c.

◆ FmsMeshGetComponent()

int FmsMeshGetComponent ( FmsMesh  mesh,
FmsInt  comp_id,
FmsComponent comp 
)

TODO: dox.

Definition at line 2228 of file fms.c.

◆ FmsMeshGetDomains()

int FmsMeshGetDomains ( FmsMesh  mesh,
FmsInt  domain_name_id,
const char **  domain_name,
FmsInt num_domains,
FmsDomain **  domains 
)

TODO: dox.

Definition at line 2184 of file fms.c.

◆ FmsMeshGetDomainsByName()

int FmsMeshGetDomainsByName ( FmsMesh  mesh,
const char *  domain_name,
FmsInt num_domains,
FmsDomain **  domains 
)

TODO: dox.

Definition at line 2200 of file fms.c.

◆ FmsMeshGetNumComponents()

int FmsMeshGetNumComponents ( FmsMesh  mesh,
FmsInt num_comp 
)

TODO: dox.

Definition at line 2221 of file fms.c.

◆ FmsMeshGetNumDomainNames()

int FmsMeshGetNumDomainNames ( FmsMesh  mesh,
FmsInt num_domain_names 
)

TODO: dox.

Definition at line 2177 of file fms.c.

◆ FmsMeshGetNumTags()

int FmsMeshGetNumTags ( FmsMesh  mesh,
FmsInt num_tags 
)

TODO: dox.

Definition at line 2236 of file fms.c.

◆ FmsMeshGetPartitionId()

int FmsMeshGetPartitionId ( FmsMesh  mesh,
FmsInt partition_id,
FmsInt num_partitions 
)

TODO: dox.

Definition at line 2169 of file fms.c.

◆ FmsMeshGetTag()

int FmsMeshGetTag ( FmsMesh  mesh,
FmsInt  tag_id,
FmsTag tag 
)

TODO: dox.

Definition at line 2243 of file fms.c.

◆ FmsMeshSetPartitionId()

int FmsMeshSetPartitionId ( FmsMesh  mesh,
FmsInt  partition_id,
FmsInt  num_partitions 
)

TODO: dox.

Definition at line 1201 of file fms.c.

◆ FmsMeshValidate()

int FmsMeshValidate ( FmsMesh  mesh)

TODO: dox.

Definition at line 1094 of file fms.c.

◆ FmsMetaDataClear()

int FmsMetaDataClear ( FmsMetaData  mdata)

Clear the contents of mdata without destroying the object.

Definition at line 2126 of file fms.c.

◆ FmsMetaDataCompare()

int FmsMetaDataCompare ( FmsMetaData  ,
FmsMetaData   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3276 of file fms.c.

◆ FmsMetaDataDestroy()

int FmsMetaDataDestroy ( FmsMetaData mdata)

Destroy the object that *mdata refers to and set *mdata to NULL.

Definition at line 2152 of file fms.c.

◆ FmsMetaDataGetIntegers()

int FmsMetaDataGetIntegers ( FmsMetaData  mdata,
const char **  mdata_name,
FmsIntType int_type,
FmsInt size,
const void **  data 
)

Get the contents of a meta-data structure that stores an array of integers.

Returns a pointer to the meta-data array in data.

Definition at line 2897 of file fms.c.

◆ FmsMetaDataGetMetaData()

int FmsMetaDataGetMetaData ( FmsMetaData  mdata,
const char **  mdata_name,
FmsInt size,
FmsMetaData **  data 
)

Get the contents of a meta-data structure that stores an array of meta-data structures.

Returns a pointer to the meta-data array in data.

Definition at line 2927 of file fms.c.

◆ FmsMetaDataGetScalars()

int FmsMetaDataGetScalars ( FmsMetaData  mdata,
const char **  mdata_name,
FmsScalarType scal_type,
FmsInt size,
const void **  data 
)

Get the contents of a meta-data structure that stores an array of scalars.

Returns a pointer to the meta-data array in data.

Definition at line 2908 of file fms.c.

◆ FmsMetaDataGetString()

int FmsMetaDataGetString ( FmsMetaData  mdata,
const char **  mdata_name,
const char **  c_string 
)

Get the contents of a meta-data structure that stores a c-string.

Definition at line 2919 of file fms.c.

◆ FmsMetaDataGetType()

int FmsMetaDataGetType ( FmsMetaData  mdata,
FmsMetaDataType type 
)

TODO: dox.

If the mdata structure is empty, returns an error code of 1.

Definition at line 2890 of file fms.c.

◆ FmsMetaDataSetIntegers()

int FmsMetaDataSetIntegers ( FmsMetaData  mdata,
const char *  mdata_name,
FmsIntType  int_type,
FmsInt  size,
void **  data 
)

Set the contents of a meta-data structure to store an array of integers.

Returns the uninitialized meta-data array in data.

Definition at line 2037 of file fms.c.

◆ FmsMetaDataSetMetaData()

int FmsMetaDataSetMetaData ( FmsMetaData  mdata,
const char *  mdata_name,
FmsInt  size,
FmsMetaData **  data 
)

Set the contents of a meta-data structure to store an array of meta-data structures.

Returns the meta-data array in data. Each meta-data entry in the array is initialized to be empty.

Definition at line 2095 of file fms.c.

◆ FmsMetaDataSetScalars()

int FmsMetaDataSetScalars ( FmsMetaData  mdata,
const char *  mdata_name,
FmsScalarType  scal_type,
FmsInt  size,
void **  data 
)

Set the contents of a meta-data structure to store an array of scalars.

Returns the uninitialized meta-data array in data.

Definition at line 2058 of file fms.c.

◆ FmsMetaDataSetString()

int FmsMetaDataSetString ( FmsMetaData  mdata,
const char *  mdata_name,
const char *  c_string 
)

Set the contents of a meta-data structure to store a c-string.

Definition at line 2079 of file fms.c.

◆ FmsTagAddDescriptions()

int FmsTagAddDescriptions ( FmsTag  tag,
FmsIntType  tag_type,
const void *  tags,
const char *const *  tag_descr,
FmsInt  num_tags 
)

TODO: dox.

The arrays tags and tag_descr have the same size, num_tags. The tags and their descriptions are copied internally. The tag_type is the type of the input array tags.

Definition at line 1705 of file fms.c.

◆ FmsTagAllocate()

int FmsTagAllocate ( FmsTag  tag,
FmsIntType  stored_tag_type,
void **  ent_tags,
FmsInt num_ents 
)

TODO: dox.

The pointer num_ents can be NULL.

Definition at line 1682 of file fms.c.

◆ FmsTagCompare()

int FmsTagCompare ( FmsTag  ,
FmsTag   
)

Return 0 if equivalent, not 0 otherwise.

Added in version: v0.2.

Definition at line 3501 of file fms.c.

◆ FmsTagGet()

int FmsTagGet ( FmsTag  tag,
FmsIntType tag_type,
const void **  ent_tags,
FmsInt num_ents 
)

TODO: dox No copy, read only access to the entity-tag array.

Definition at line 2745 of file fms.c.

◆ FmsTagGetComponent()

int FmsTagGetComponent ( FmsTag  tag,
FmsComponent comp 
)

TODO: dox.

Definition at line 2739 of file fms.c.

◆ FmsTagGetDescriptions()

int FmsTagGetDescriptions ( FmsTag  tag,
FmsIntType tag_type,
const void **  tags,
const char *const **  tag_descr,
FmsInt num_tags 
)

TODO: dox.

The arrays tags and tag_descr have the same size, num_tags.

The tag_type is the type of the entries in the tags array.

Definition at line 2754 of file fms.c.

◆ FmsTagGetName()

int FmsTagGetName ( FmsTag  tag,
const char **  tag_name 
)

TODO: dox.

Definition at line 2733 of file fms.c.

◆ FmsTagSet()

int FmsTagSet ( FmsTag  tag,
FmsIntType  stored_tag_type,
FmsIntType  input_tag_type,
const void *  ent_tags,
FmsInt  num_ents 
)

TODO: dox.

The array ent_tags is converted and copied internally. The value of num_ents must be the same as the number of main entities in the associated mesh component.

Definition at line 1658 of file fms.c.

◆ FmsTagSetComponent()

int FmsTagSetComponent ( FmsTag  tag,
FmsComponent  comp 
)

TODO: dox.

Definition at line 1651 of file fms.c.

Variable Documentation

◆ FmsEntityDim

const FmsInt FmsEntityDim[FMS_NUM_ENTITY_TYPES]
Initial value:
= {
0, 1, 2, 2, 3, 3, 3, 3
}

Dimensions of the entity types.

Definition at line 180 of file fms.c.

◆ FmsEntityNumSides

const FmsInt FmsEntityNumSides[FMS_NUM_ENTITY_TYPES]
Initial value:
= {
0, 2, 3, 4, 4, 6, 5, 5
}

Number of sides of the entity types.

The sides of an entity of dimension d are its boundary entities of dimension d-1.

Definition at line 184 of file fms.c.

◆ FmsEntityNumVerts

const FmsInt FmsEntityNumVerts[FMS_NUM_ENTITY_TYPES]
Initial value:
= {
1, 2, 3, 4, 4, 8, 6, 5
}

Number of vertices of the entity types.

Definition at line 188 of file fms.c.

◆ FmsEntityTypeNames

const char* const FmsEntityTypeNames[FMS_NUM_ENTITY_TYPES]
Initial value:
= {
"FMS_VERTEX",
"FMS_EDGE",
"FMS_TRIANGLE",
"FMS_QUADRILATERAL",
"FMS_TETRAHEDRON",
"FMS_HEXAHEDRON",
"FMS_WEDGE",
"FMS_PYRAMID"
}

String representations of each entity type.

Added in version: v0.2.

Definition at line 169 of file fms.c.

◆ FmsIntTypeNames

const char* const FmsIntTypeNames[FMS_NUM_INT_TYPES]
Initial value:
= {
"FMS_INT8",
"FMS_INT16",
"FMS_INT32",
"FMS_INT64",
"FMS_UINT8",
"FMS_UINT16",
"FMS_UINT32",
"FMS_UINT64",
}

Added in version: v0.2.

Definition at line 158 of file fms.c.

◆ FmsIntTypeSize

const size_t FmsIntTypeSize[FMS_NUM_INT_TYPES]
Initial value:
= {
1, 2, 4, 8, 1, 2, 4, 8
}

Definition at line 154 of file fms.c.

◆ FmsMetaDataTypeNames

const char* const FmsMetaDataTypeNames[FMS_NUM_METADATA_TYPES]
Initial value:
= {
"FMS_INTEGER",
"FMS_SCALAR",
"FMS_STRING",
"FMS_META_DATA",
}

Added in version: v0.2.

Definition at line 203 of file fms.c.

◆ FmsScalarTypeNames

const char* const FmsScalarTypeNames[FMS_NUM_SCALAR_TYPES]
Initial value:
= {
"FMS_FLOAT",
"FMS_DOUBLE",
"FMS_COMPLEX_FLOAT",
"FMS_COMPLEX_DOUBLE",
}

Added in version: v0.2.

Definition at line 196 of file fms.c.

◆ FmsScalarTypeSize

const size_t FmsScalarTypeSize[FMS_NUM_SCALAR_TYPES]
Initial value:
= {
sizeof(float), sizeof(double), 2*sizeof(float), 2*sizeof(double)
}

Definition at line 192 of file fms.c.