![]() |
FMS
v0.2
Field and Mesh Specification
|
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | FMS_VERSION 200 |
FMS version constant of the form: ((major*100 + minor)*100 + patch). More... | |
Typedefs | |
typedef uint64_t | FmsInt |
Type used by fms for representing and storing sizes and indices. More... | |
typedef struct FmsMesh_private * | FmsMesh |
TODO: dox. More... | |
typedef struct FmsDomain_private * | FmsDomain |
TODO: dox. More... | |
typedef struct FmsComponent_private * | FmsComponent |
TODO: dox. More... | |
typedef struct FmsTag_private * | FmsTag |
TODO: dox. More... | |
typedef const int * | FmsEntityReordering[FMS_NUM_ENTITY_TYPES] |
A type describing user-defined local orderings of the side entities defining an enitity. More... | |
typedef uint8_t | FmsOrientation |
A type used by fms to represent and store entity orientations. More... | |
typedef struct FmsMetaData_private * | FmsMetaData |
TODO: dox. More... | |
typedef struct FmsFieldDescriptor_private * | FmsFieldDescriptor |
TODO: dox. More... | |
typedef struct FmsField_private * | FmsField |
Discrete field data type. More... | |
typedef struct FmsDataCollection_private * | FmsDataCollection |
Data collection type: contains a mesh, discrete fileds, meta-data, etc. More... | |
Functions | |
int | FmsGetIntTypeFromName (const char *const name, FmsIntType *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 | FmsGetScalarTypeFromName (const char *const name, FmsScalarType *type) |
Get the enum representation of an int type from the string name. More... | |
int | FmsGetMetaDataTypeFromName (const char *const name, FmsMetaDataType *type) |
Convert a meta-data-type string to FmsMetaDataType value. More... | |
int | FmsGetInterfaceVersion (FmsInt *version) |
Get the interface version. 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, FmsDataCollection) |
Comparison interface. More... | |
int | FmsMeshCompare (FmsMesh, FmsMesh) |
Return 0 if equivalent, not 0 otherwise. More... | |
int | FmsFieldDescriptorCompare (FmsFieldDescriptor, FmsFieldDescriptor) |
Return 0 if equivalent, not 0 otherwise. More... | |
int | FmsFieldCompare (FmsField, FmsField) |
Return 0 if equivalent, not 0 otherwise. More... | |
int | FmsMetaDataCompare (FmsMetaData, FmsMetaData) |
Return 0 if equivalent, not 0 otherwise. More... | |
int | FmsDomainCompare (FmsDomain, FmsDomain) |
Return 0 if equivalent, not 0 otherwise. More... | |
int | FmsComponentCompare (FmsComponent, FmsComponent) |
Return 0 if equivalent, not 0 otherwise. More... | |
int | FmsTagCompare (FmsTag, FmsTag) |
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... | |
#define FMS_VERSION 200 |
typedef struct FmsComponent_private* FmsComponent |
TODO: dox.
Components are sets of parts. A part is a set of entities of the same type, described as a subset of the entities of a domain. All entities in the component must have (i) the same dimension and (ii) specified orientation (relative to the entity as described in its domain).
FIXME: parts can hold more than one type of main entities!
In order to facilitate the definition of fields on the component, the following additional data can be stored in every part of the component: for all lower dimensional entities that are boundary to the main entities of the part, define an array that maps the local (to the part) indices to the domain-indices. These arrays plus the main array (the one describing the highest dimensional entities of the component) define local numberings of all entities inside each part. These numberings will be used to define the ordering of the degrees of freedom of a field. When the main entity array is NULL (indicating that all entities in the domain are used) then the lower dimensional entities will also be NULL because there is no need to have local numbering of the entities - the original numbering used by the domain can be reused.
A component has a coordinates field (FmsField) which may be NULL.
In addition to the parts, a component also stores relations to other components. A relation to a component of lower or higher dimension indicates a boundary or interface relation, i.e. the lower dimensional component describes a subset of the boundary entities of the higher dimensional component. A relation to another component of the same dimension is acceptable but has no specified meaning.
TODO: introduce additional topological constraints in a component, e.g. to enforce periodicity on a non-periodic component.
The arrays storing the entity indices into the domains use user-specified integer type.
The arrays storing the entity orientations are of type FmsOrientation.
A domain associated with a part is stored as a domain names plus a domain id of type FmsInt.
The relations to other components are stored as an array of component ids of type FmsInt.
Mesh tags are defined on the set of all entities in a mesh component.
Discrete fields are defined on mesh components. Unlike tags, discrete fields generally associate data not only with the entities described by the mesh component but also with the lower-dimensional boundary entities of the component entities.
typedef struct FmsDataCollection_private* FmsDataCollection |
Data collection type: contains a mesh, discrete fileds, meta-data, etc.
A data collection structure contains:
typedef struct FmsDomain_private* FmsDomain |
TODO: dox.
Domains describe sets of interconnected mesh entities:
All entities in a domain are enumerated within the domain.
Connections to other domains are described using shared entities. (TODO)
Other relations, such as refinement (parent-child) and non-conforming (master-slave) relations can also be represented. (TODO)
Domains are assigned a string name and an integer id. Thus, a domain is identified uniquely by the tuple: (name, id, partition-id) where the partition id is the one assigned to the containing mesh.
The arrays storing the entity definitions use user-specified integer type.
The domain names are stored in the mesh structure and the domains store just pointer to the name.
typedef const int* FmsEntityReordering[FMS_NUM_ENTITY_TYPES] |
A type describing user-defined local orderings of the side entities defining an enitity.
User-ordering to fms-ordering is performed as follows: let u=[u_0,...,u_n] be the user-ordered indices for one of the entity types, say t, which has reordering array ra (of size n+1), i.e. ra is the pointer given by entry t from a variable of type FmsEntityReordering (which is an array of pointers). Then the fms-ordered indices, v=[v_0,...,v_n], are computed as v[i] = u[ra[i]], i=0,...,n. Conversely, if v is given, then u is computed as u[ra[i]] = v[i], i=0,...,n. In other words, ra[fms-index] = user-index. If a pointer ra is NULL, then no reordering is performed.
This type can be used to describe orderings of other types of boundary entities, e.g. reorderings for the vertices.
typedef struct FmsField_private* FmsField |
Discrete field data type.
A field structure contains:
typedef struct FmsFieldDescriptor_private* FmsFieldDescriptor |
TODO: dox.
A field-descriptor structure contains:
The degrees of freedom are ordered part-by-part of the associated mesh component. Within each part, the dofs are ordered as follows:
typedef uint64_t FmsInt |
typedef struct FmsMesh_private* FmsMesh |
typedef struct FmsMetaData_private* FmsMetaData |
TODO: dox.
A meta-data structure contains:
typedef uint8_t FmsOrientation |
A type used by fms to represent and store entity orientations.
Orientations identify specific permutations to the d-1 dimensional boundary entities that describe a d-dimensional entity. Orientations are always relative to a specific entity described as a tuple of d-1 dimensional entities. For example, if the triangle A, given as A=(a,b,c) where a, b, and c are edges (i.e. edge indices) then we say that the triangle B=(b,c,a) has orientation 2 relative to A, see the definitions below.
In general, the orientation of an entity B relative to an entity A is different from the orientation of A relative to B. These two orientations are inversees of each other: mathematically the set of all orientation of an entity type form a group.
Orientation 0 always represents the identity permutation.
For FMS_EDGE, the orientations of an edge "ab" are defined as:
0: ab 1: ba
For FMS_TRIANGLE, the orientations of a triangle "abc" are defined as:
0: abc 1: acb 2: bca 3: bac 4: cab 5: cba
The inverses of the orientations 012345
are the orientations 014325
, respectively, i.e. the orientations 2
and 4
are inverses of each other while all other orientations are inverses of themselves.
For FMS_QUADRILATERAL, the orientations of a quad "abcd" are defined as:
0: abcd 1: adcb 2: bcda 3: badb 4: cdab 5: cbad 6: dabc 7: dcba
The inverses of the orientations 01234567
are the orientations 01634527
, respectively, i.e. 2
and 6
are inverses of each other while all other orientations are inverses of themselves.
typedef struct FmsTag_private* FmsTag |
TODO: dox.
A tag is an array of integers describing the entities in a given component. Optionally, the integer tags can be assigned string descriptions.
The array with the integer tags is ordered part-by-part within the mesh component.
The associated component is stored as a component id of type FmsInt.
A tag naturally defines a non-overlapping decomposition of the associated component.
Tags can be used to store the orders (polynomial degrees) associated with the component entities in variable order discrete spaces.
anonymous enum |
anonymous enum |
enum FmsBasisType |
enum FmsEntityType |
TODO: dox.
An entity is described by a tuple of its side entity indices. For an entity of dimension d, its side entities are its boundary entities of dimension d-1.
For FMS_TRIANGLE and FMS_QUADRILATERAL, the edges (sides), "abc"/"abcd" and the vertices "012"/"0123" are ordered counterclockwise, as illustrated in the following diagram:
3--c--2 2 | | / \ d b c b | | / \ 0--a--1 0---a---1
For 3D entities, the ordering of the edges inside the faces should follow the counterclockwise ordering when looking the the face from outside. This rule is followed by the choices given below.
For FMS_TETRAHEDRON, the faces (sides), "ABCD", the edges, "abcdef", and the vertices, "0123" are ordered as follows:
z=0 y=0 x=0 x+y+z=1 2 3 3 3 / \ / \ / \ / \ b c d e f d e f / A \ / B \ / C \ / D \ 1---a---0 0---a---1 2---c---0 1---b---2
For example, vertex "0" has coordinates (x,y,z)=(0,0,0), vertex "1" has coordinates (1,0,0), etc.
For FMS_HEXAHEDRON, the faces (sides), "ABCDEF", the edges, "abcdefghijkl" and the vertices, "01234567", are ordered as follows:
z y | / 7--g--6 |/ /| /| +--x / l / k z=0 z=1 y=0 y=1 x=0 x=1 h | f | bottom top front back left right / 3-/c--2 2--c--3 7--g--6 4--e--5 6--g--7 7--h--4 5--f--6 / / / / | | | | | | | | | | | | 4--e--5 / b A d h B f i C j k D l l E i j F k | d | b | | | | | | | | | | | | i / j / 1--a--0 4--e--5 0--a--1 2--c--3 3--d--0 1--b--2 |/ |/ 0--a--1
For example, vertex "0" has coordinates (x,y,z)=(0,0,0), vertex "6" has coordinates (1,1,1), etc.
TODO: describe the side entity orderings for all ramaining entity types used by fms.
Enumerator | |
---|---|
FMS_VERTEX | |
FMS_EDGE | |
FMS_TRIANGLE | |
FMS_QUADRILATERAL | |
FMS_TETRAHEDRON | |
FMS_HEXAHEDRON | |
FMS_WEDGE | |
FMS_PYRAMID | |
FMS_NUM_ENTITY_TYPES |
enum FmsFieldType |
enum FmsIntType |
enum FmsLayoutType |
enum FmsMetaDataType |
enum FmsScalarType |
int FmsComponentAddDomain | ( | FmsComponent | comp, |
FmsDomain | domain | ||
) |
int FmsComponentAddPart | ( | FmsComponent | comp, |
FmsDomain | domain, | ||
FmsInt * | part_id | ||
) |
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.
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.
int FmsComponentAddRelation | ( | FmsComponent | comp, |
FmsInt | other_comp_id | ||
) |
int FmsComponentCompare | ( | FmsComponent | , |
FmsComponent | |||
) |
int FmsComponentGetCoordinates | ( | FmsComponent | comp, |
FmsField * | coords | ||
) |
int FmsComponentGetDimension | ( | FmsComponent | comp, |
FmsInt * | dim | ||
) |
int FmsComponentGetName | ( | FmsComponent | comp, |
const char ** | comp_name | ||
) |
int FmsComponentGetNumEntities | ( | FmsComponent | comp, |
FmsInt * | num_ents | ||
) |
int FmsComponentGetNumParts | ( | FmsComponent | comp, |
FmsInt * | num_parts | ||
) |
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.
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.
int FmsComponentGetRelations | ( | FmsComponent | comp, |
const FmsInt ** | rel_comps, | ||
FmsInt * | num_rel_comps | ||
) |
int FmsComponentSetCoordinates | ( | FmsComponent | comp, |
FmsField | coords | ||
) |
int FmsDataCollectionAddField | ( | FmsDataCollection | dc, |
const char * | field_name, | ||
FmsField * | field | ||
) |
int FmsDataCollectionAddFieldDescriptor | ( | FmsDataCollection | dc, |
const char * | fd_name, | ||
FmsFieldDescriptor * | fd | ||
) |
int FmsDataCollectionAttachMetaData | ( | FmsDataCollection | dc, |
FmsMetaData * | mdata | ||
) |
int FmsDataCollectionCompare | ( | FmsDataCollection | , |
FmsDataCollection | |||
) |
int FmsDataCollectionCreate | ( | FmsMesh | mesh, |
const char * | dc_name, | ||
FmsDataCollection * | dc | ||
) |
int FmsDataCollectionDestroy | ( | FmsDataCollection * | dc | ) |
int FmsDataCollectionGetFieldDescriptors | ( | FmsDataCollection | dc, |
FmsFieldDescriptor ** | fds, | ||
FmsInt * | num_fds | ||
) |
int FmsDataCollectionGetFields | ( | FmsDataCollection | dc, |
FmsField ** | fields, | ||
FmsInt * | num_fields | ||
) |
int FmsDataCollectionGetMesh | ( | FmsDataCollection | dc, |
FmsMesh * | mesh | ||
) |
int FmsDataCollectionGetMetaData | ( | FmsDataCollection | dc, |
FmsMetaData * | mdata | ||
) |
int FmsDataCollectionGetName | ( | FmsDataCollection | dc, |
const char ** | name | ||
) |
Get the name of the data collection.
dc | the data collection. | |
[out] | name | A 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. |
Added in version: v0.2.
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.
int FmsDomainAddOrientation | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsInt | ent_id, | ||
FmsInt | loc_side_id, | ||
FmsOrientation | side_orient | ||
) |
int FmsDomainGetAllEntities | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsIntType * | ent_id_type, | ||
const void ** | ents, | ||
FmsInt * | num_ents | ||
) |
int FmsDomainGetAllOrientations | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
const FmsOrientation ** | side_orients, | ||
FmsInt * | num_ents | ||
) |
int FmsDomainGetEntities | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsEntityReordering | reordering, | ||
FmsIntType | ent_id_type, | ||
FmsInt | first_ent, | ||
void * | ents, | ||
FmsInt | num_ents | ||
) |
int FmsDomainGetEntitiesArray | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
void ** | ents | ||
) |
int FmsDomainGetEntitiesVerts | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsEntityReordering | vert_reordering, | ||
FmsIntType | ent_id_type, | ||
FmsInt | first_ent, | ||
void * | ents_verts, | ||
FmsInt | num_ents | ||
) |
int FmsDomainGetNumEntities | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsInt * | num_ents | ||
) |
int FmsDomainGetOrientationsArray | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsOrientation ** | side_orients | ||
) |
int FmsDomainSetNumEntities | ( | FmsDomain | domain, |
FmsEntityType | type, | ||
FmsIntType | id_store_type, | ||
FmsInt | num_ents | ||
) |
int FmsFieldAttachMetaData | ( | FmsField | field, |
FmsMetaData * | mdata | ||
) |
int FmsFieldDescriptorCompare | ( | FmsFieldDescriptor | , |
FmsFieldDescriptor | |||
) |
int FmsFieldDescriptorGetComponent | ( | FmsFieldDescriptor | fd, |
FmsComponent * | comp | ||
) |
int FmsFieldDescriptorGetFixedOrder | ( | FmsFieldDescriptor | fd, |
FmsFieldType * | field_type, | ||
FmsBasisType * | basis_type, | ||
FmsInt * | order | ||
) |
int FmsFieldDescriptorGetName | ( | FmsFieldDescriptor | fd, |
const char ** | fd_name | ||
) |
int FmsFieldDescriptorGetNumDofs | ( | FmsFieldDescriptor | fd, |
FmsInt * | num_dofs | ||
) |
int FmsFieldDescriptorGetType | ( | FmsFieldDescriptor | fd, |
FmsFieldDescriptorType * | fd_type | ||
) |
int FmsFieldDescriptorSetComponent | ( | FmsFieldDescriptor | fd, |
FmsComponent | comp | ||
) |
int FmsFieldDescriptorSetFixedOrder | ( | FmsFieldDescriptor | fd, |
FmsFieldType | field_type, | ||
FmsBasisType | basis_type, | ||
FmsInt | order | ||
) |
int FmsFieldGet | ( | FmsField | field, |
FmsFieldDescriptor * | fd, | ||
FmsInt * | num_vec_comp, | ||
FmsLayoutType * | layout_type, | ||
FmsScalarType * | data_type, | ||
const void ** | data | ||
) |
int FmsFieldGetMetaData | ( | FmsField | field, |
FmsMetaData * | mdata | ||
) |
int FmsFieldGetName | ( | FmsField | field, |
const char ** | field_name | ||
) |
int FmsFieldSet | ( | FmsField | field, |
FmsFieldDescriptor | fd, | ||
FmsInt | num_vec_comp, | ||
FmsLayoutType | layout_type, | ||
FmsScalarType | data_type, | ||
const void * | data | ||
) |
int FmsGetEntityTypeFromName | ( | const char *const | name, |
FmsEntityType * | ent_type | ||
) |
int FmsGetInterfaceVersion | ( | FmsInt * | version | ) |
int FmsGetIntTypeFromName | ( | const char *const | name, |
FmsIntType * | type | ||
) |
int FmsGetMetaDataTypeFromName | ( | const char *const | name, |
FmsMetaDataType * | type | ||
) |
int FmsGetScalarTypeFromName | ( | const char *const | name, |
FmsScalarType * | type | ||
) |
int FmsMeshAddComponent | ( | FmsMesh | mesh, |
const char * | comp_name, | ||
FmsComponent * | comp | ||
) |
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.
int FmsMeshGetComponent | ( | FmsMesh | mesh, |
FmsInt | comp_id, | ||
FmsComponent * | comp | ||
) |
int FmsMetaDataClear | ( | FmsMetaData | mdata | ) |
int FmsMetaDataCompare | ( | FmsMetaData | , |
FmsMetaData | |||
) |
int FmsMetaDataDestroy | ( | FmsMetaData * | mdata | ) |
int FmsMetaDataGetIntegers | ( | FmsMetaData | mdata, |
const char ** | mdata_name, | ||
FmsIntType * | int_type, | ||
FmsInt * | size, | ||
const void ** | data | ||
) |
int FmsMetaDataGetMetaData | ( | FmsMetaData | mdata, |
const char ** | mdata_name, | ||
FmsInt * | size, | ||
FmsMetaData ** | data | ||
) |
int FmsMetaDataGetScalars | ( | FmsMetaData | mdata, |
const char ** | mdata_name, | ||
FmsScalarType * | scal_type, | ||
FmsInt * | size, | ||
const void ** | data | ||
) |
int FmsMetaDataGetString | ( | FmsMetaData | mdata, |
const char ** | mdata_name, | ||
const char ** | c_string | ||
) |
int FmsMetaDataGetType | ( | FmsMetaData | mdata, |
FmsMetaDataType * | type | ||
) |
int FmsMetaDataSetIntegers | ( | FmsMetaData | mdata, |
const char * | mdata_name, | ||
FmsIntType | int_type, | ||
FmsInt | size, | ||
void ** | data | ||
) |
int FmsMetaDataSetMetaData | ( | FmsMetaData | mdata, |
const char * | mdata_name, | ||
FmsInt | size, | ||
FmsMetaData ** | data | ||
) |
int FmsMetaDataSetScalars | ( | FmsMetaData | mdata, |
const char * | mdata_name, | ||
FmsScalarType | scal_type, | ||
FmsInt | size, | ||
void ** | data | ||
) |
int FmsMetaDataSetString | ( | FmsMetaData | mdata, |
const char * | mdata_name, | ||
const char * | c_string | ||
) |
int FmsTagAddDescriptions | ( | FmsTag | tag, |
FmsIntType | tag_type, | ||
const void * | tags, | ||
const char *const * | tag_descr, | ||
FmsInt | num_tags | ||
) |
int FmsTagAllocate | ( | FmsTag | tag, |
FmsIntType | stored_tag_type, | ||
void ** | ent_tags, | ||
FmsInt * | num_ents | ||
) |
int FmsTagGet | ( | FmsTag | tag, |
FmsIntType * | tag_type, | ||
const void ** | ent_tags, | ||
FmsInt * | num_ents | ||
) |
int FmsTagGetComponent | ( | FmsTag | tag, |
FmsComponent * | comp | ||
) |
int FmsTagGetDescriptions | ( | FmsTag | tag, |
FmsIntType * | tag_type, | ||
const void ** | tags, | ||
const char *const ** | tag_descr, | ||
FmsInt * | num_tags | ||
) |
int FmsTagGetName | ( | FmsTag | tag, |
const char ** | tag_name | ||
) |
int FmsTagSet | ( | FmsTag | tag, |
FmsIntType | stored_tag_type, | ||
FmsIntType | input_tag_type, | ||
const void * | ent_tags, | ||
FmsInt | num_ents | ||
) |
int FmsTagSetComponent | ( | FmsTag | tag, |
FmsComponent | comp | ||
) |
const FmsInt FmsEntityDim[FMS_NUM_ENTITY_TYPES] |
const FmsInt FmsEntityNumSides[FMS_NUM_ENTITY_TYPES] |
const FmsInt FmsEntityNumVerts[FMS_NUM_ENTITY_TYPES] |
const char* const FmsEntityTypeNames[FMS_NUM_ENTITY_TYPES] |
const char* const FmsIntTypeNames[FMS_NUM_INT_TYPES] |
const size_t FmsIntTypeSize[FMS_NUM_INT_TYPES] |
const char* const FmsMetaDataTypeNames[FMS_NUM_METADATA_TYPES] |
const char* const FmsScalarTypeNames[FMS_NUM_SCALAR_TYPES] |
const size_t FmsScalarTypeSize[FMS_NUM_SCALAR_TYPES] |