FMS  v0.2
Field and Mesh Specification
fms.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
3  the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
4  reserved. See files LICENSE and NOTICE for details.
5 
6  This file is part of CEED, a collection of benchmarks, miniapps, software
7  libraries and APIs for efficient high-order finite element and spectral
8  element discretizations for exascale applications. For more information and
9  source code availability see http://github.com/ceed.
10 
11  The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
12  a collaborative effort of two U.S. Department of Energy organizations (Office
13  of Science and the National Nuclear Security Administration) responsible for
14  the planning and preparation of a capable exascale ecosystem, including
15  software, applications, hardware, advanced system engineering and early
16  testbed platforms, in support of the nation's exascale computing imperative.
17 */
18 
19 #ifndef FMS_HEADER
20 #define FMS_HEADER
21 
22 #include <stddef.h>
23 #include <stdint.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 /// FMS version constant of the form: ((major*100 + minor)*100 + patch).
31 /** For example, value of 10203 means v1.2.3.
32 
33  The version is also defined in the files: CMakeLists.txt and Doxyfile.
34 
35  This macro was added in version: v0.2. */
36 #define FMS_VERSION 200
37 
38 /// Interface version constant of the form: ((major*100 + minor)*100 + patch).
39 /** Since FMS v0.2, this value is the same as the macro FMS_VERSION. */
41 
42 /// Type used by fms for representing and storing sizes and indices.
43 typedef uint64_t FmsInt;
44 
45 /// TODO: dox
46 typedef enum {
47  // signed integer types
52  // unsigned integer types
57  // the next constant defines the number of integer types
58  // also, used as an "invalid" type
60  /// The type of FmsInt identified as FmsIntType.
62  /// The type of FmsOrientation as FmsIntType.
64 } FmsIntType;
65 
66 extern const size_t FmsIntTypeSize[FMS_NUM_INT_TYPES];
67 
68 /// Added in version: v0.2.
69 extern const char * const FmsIntTypeNames[FMS_NUM_INT_TYPES];
70 
71 /// Get the enum representation of an int type from the string name.
72 /** Added in version: v0.2. */
73 int FmsGetIntTypeFromName(const char * const name, FmsIntType *type);
74 
75 /// TODO: dox
76 /** A mesh consists of:
77  - mesh domains
78  - mesh components, described in terms of the domains
79  - mesh tags (attributes), defined on components.
80 
81  The mesh is also assigned a partition id, e.g. an MPI rank. */
82 typedef struct FmsMesh_private *FmsMesh;
83 
84 /// TODO: dox
85 /** Domains describe sets of interconnected mesh entities:
86  - 0d-entities / vertices
87  - 1d-entities / edges
88  - 2d-entities / faces: triangles, quads
89  - 3d-entities / volumes / regions: tets, hexes, wedges, pyramids.
90 
91  All entities in a domain are enumerated within the domain.
92 
93  Connections to other domains are described using shared entities. (TODO)
94 
95  Other relations, such as refinement (parent-child) and non-conforming
96  (master-slave) relations can also be represented. (TODO)
97 
98  Domains are assigned a string name and an integer id. Thus, a domain is
99  identified uniquely by the tuple: (name, id, partition-id) where the
100  partition id is the one assigned to the containing mesh.
101 
102  The arrays storing the entity definitions use user-specified integer type.
103 
104  The domain names are stored in the mesh structure and the domains store just
105  pointer to the name. */
106 typedef struct FmsDomain_private *FmsDomain;
107 
108 /// TODO: dox
109 /** Components are sets of parts. A part is a set of entities of the same type,
110  described as a subset of the entities of a domain. All entities in the
111  component must have (i) the same dimension and (ii) specified orientation
112  (relative to the entity as described in its domain).
113 
114  FIXME: parts can hold more than one type of main entities!
115 
116  In order to facilitate the definition of fields on the component, the
117  following additional data can be stored in every part of the component:
118  for all lower dimensional entities that are boundary to the main entities of
119  the part, define an array that maps the local (to the part) indices to the
120  domain-indices. These arrays plus the main array (the one describing the
121  highest dimensional entities of the component) define local numberings of
122  all entities inside each part. These numberings will be used to define the
123  ordering of the degrees of freedom of a field. When the main entity array is
124  NULL (indicating that all entities in the domain are used) then the lower
125  dimensional entities will also be NULL because there is no need to have
126  local numbering of the entities - the original numbering used by the domain
127  can be reused.
128 
129  A component has a coordinates field (FmsField) which may be NULL.
130 
131  In addition to the parts, a component also stores relations to other
132  components. A relation to a component of lower or higher dimension
133  indicates a boundary or interface relation, i.e. the lower dimensional
134  component describes a subset of the boundary entities of the higher
135  dimensional component. A relation to another component of the same dimension
136  is acceptable but has no specified meaning.
137 
138  TODO: introduce additional topological constraints in a component, e.g. to
139  enforce periodicity on a non-periodic component.
140 
141  The arrays storing the entity indices into the domains use user-specified
142  integer type.
143 
144  The arrays storing the entity orientations are of type FmsOrientation.
145 
146  A domain associated with a part is stored as a domain names plus a domain id
147  of type FmsInt.
148 
149  The relations to other components are stored as an array of component ids of
150  type FmsInt.
151 
152  Mesh tags are defined on the set of all entities in a mesh component.
153 
154  Discrete fields are defined on mesh components. Unlike tags, discrete fields
155  generally associate data not only with the entities described by the mesh
156  component but also with the lower-dimensional boundary entities of the
157  component entities.
158  */
159 typedef struct FmsComponent_private *FmsComponent;
160 
161 /// TODO: dox
162 /** A tag is an array of integers describing the entities in a given component.
163  Optionally, the integer tags can be assigned string descriptions.
164 
165  The array with the integer tags is ordered part-by-part within the mesh
166  component.
167 
168  The associated component is stored as a component id of type FmsInt.
169 
170  A tag naturally defines a non-overlapping decomposition of the associated
171  component.
172 
173  Tags can be used to store the orders (polynomial degrees) associated with
174  the component entities in variable order discrete spaces.
175  */
176 typedef struct FmsTag_private *FmsTag;
177 
178 /// Constant used for initializing dimension variables.
179 enum { FMS_INVALID_DIM = 127 };
180 
181 /// TODO: dox
182 /** An entity is described by a tuple of its side entity indices. For an entity
183  of dimension d, its side entities are its boundary entities of dimension
184  d-1.
185 
186  For FMS_TRIANGLE and FMS_QUADRILATERAL, the edges (sides), "abc"/"abcd" and
187  the vertices "012"/"0123" are ordered counterclockwise, as illustrated in
188  the following diagram:
189 
190  3--c--2 2
191  | | / \
192  d b c b
193  | | / \
194  0--a--1 0---a---1
195 
196  For 3D entities, the ordering of the edges inside the faces should follow
197  the counterclockwise ordering when looking the the face from outside. This
198  rule is followed by the choices given below.
199 
200  For FMS_TETRAHEDRON, the faces (sides), "ABCD", the edges, "abcdef", and the
201  vertices, "0123" are ordered as follows:
202 
203  z=0 y=0 x=0 x+y+z=1
204  2 3 3 3
205  / \ / \ / \ / \
206  b c d e f d e f
207  / A \ / B \ / C \ / D \
208  1---a---0 0---a---1 2---c---0 1---b---2
209 
210  For example, vertex "0" has coordinates (x,y,z)=(0,0,0), vertex "1" has
211  coordinates (1,0,0), etc.
212 
213  For FMS_HEXAHEDRON, the faces (sides), "ABCDEF", the edges, "abcdefghijkl"
214  and the vertices, "01234567", are ordered as follows:
215 
216  z y
217  | / 7--g--6
218  |/ /| /|
219  +--x / l / k z=0 z=1 y=0 y=1 x=0 x=1
220  h | f | bottom top front back left right
221  / 3-/c--2 2--c--3 7--g--6 4--e--5 6--g--7 7--h--4 5--f--6
222  / / / / | | | | | | | | | | | |
223  4--e--5 / b A d h B f i C j k D l l E i j F k
224  | d | b | | | | | | | | | | | |
225  i / j / 1--a--0 4--e--5 0--a--1 2--c--3 3--d--0 1--b--2
226  |/ |/
227  0--a--1
228 
229  For example, vertex "0" has coordinates (x,y,z)=(0,0,0), vertex "6" has
230  coordinates (1,1,1), etc.
231 
232  TODO: describe the side entity orderings for all ramaining entity types used
233  by fms.
234  */
235 typedef enum {
242  FMS_WEDGE, // triangular prism (deformed)
244  // the next constant defines the number of entity types
246 } FmsEntityType;
247 
248 /// String representations of each entity type.
249 /** Added in version: v0.2. */
250 extern const char * const FmsEntityTypeNames[FMS_NUM_ENTITY_TYPES];
251 
252 /// Convert an entity-type string to FmsEntityType value.
253 /** Added in version: v0.2. */
254 int FmsGetEntityTypeFromName(const char * const name, FmsEntityType *ent_type);
255 
256 /// Dimensions of the entity types.
257 extern const FmsInt FmsEntityDim[FMS_NUM_ENTITY_TYPES];
258 
259 /// Number of sides of the entity types.
260 /** The sides of an entity of dimension d are its boundary entities of dimension
261  d-1. */
262 extern const FmsInt FmsEntityNumSides[FMS_NUM_ENTITY_TYPES];
263 
264 /// Number of vertices of the entity types.
265 extern const FmsInt FmsEntityNumVerts[FMS_NUM_ENTITY_TYPES];
266 
267 /** @brief A type describing user-defined local orderings of the side entities
268  defining an enitity. */
269 /** User-ordering to fms-ordering is performed as follows: let u=[u_0,...,u_n]
270  be the user-ordered indices for one of the entity types, say t, which has
271  reordering array ra (of size n+1), i.e. ra is the pointer given by entry t
272  from a variable of type FmsEntityReordering (which is an array of pointers).
273  Then the fms-ordered indices, v=[v_0,...,v_n], are computed as v[i] =
274  u[ra[i]], i=0,...,n. Conversely, if v is given, then u is computed as
275  u[ra[i]] = v[i], i=0,...,n. In other words, ra[fms-index] = user-index. If a
276  pointer ra is NULL, then no reordering is performed.
277 
278  This type can be used to describe orderings of other types of boundary
279  entities, e.g. reorderings for the vertices.
280  */
282 
283 /// A type used by fms to represent and store entity orientations.
284 /** Orientations identify specific permutations to the d-1 dimensional boundary
285  entities that describe a d-dimensional entity. Orientations are always
286  relative to a specific entity described as a tuple of d-1 dimensional
287  entities. For example, if the triangle A, given as A=(a,b,c) where a, b, and
288  c are edges (i.e. edge indices) then we say that the triangle B=(b,c,a) has
289  orientation 2 relative to A, see the definitions below.
290 
291  In general, the orientation of an entity B relative to an entity A is
292  different from the orientation of A relative to B. These two orientations
293  are inversees of each other: mathematically the set of all orientation of an
294  entity type form a group.
295 
296  Orientation 0 always represents the identity permutation.
297 
298  For FMS_EDGE, the orientations of an edge "ab" are defined as:
299 
300  0: ab 1: ba
301 
302  For FMS_TRIANGLE, the orientations of a triangle "abc" are defined as:
303 
304  0: abc 1: acb 2: bca 3: bac 4: cab 5: cba
305 
306  The inverses of the orientations `012345` are the orientations `014325`,
307  respectively, i.e. the orientations `2` and `4` are inverses of each other
308  while all other orientations are inverses of themselves.
309 
310  For FMS_QUADRILATERAL, the orientations of a quad "abcd" are defined as:
311 
312  0: abcd 1: adcb 2: bcda 3: badb
313  4: cdab 5: cbad 6: dabc 7: dcba
314 
315  The inverses of the orientations `01234567` are the orientations `01634527`,
316  respectively, i.e. `2` and `6` are inverses of each other while all other
317  orientations are inverses of themselves.
318  */
319 typedef uint8_t FmsOrientation;
320 
321 enum { FMS_ORIENTATION_UNKNOWN = 255 };
322 
323 /// Scalar types supported by FMS: floating-point types, real and complex.
324 typedef enum {
329  // next constant gives the number of scalar types
331 } FmsScalarType;
332 
333 extern const size_t FmsScalarTypeSize[FMS_NUM_SCALAR_TYPES];
334 
335 /// Added in version: v0.2.
336 extern const char * const FmsScalarTypeNames[FMS_NUM_SCALAR_TYPES];
337 
338 /// Get the enum representation of an int type from the string name.
339 /** Added in version: v0.2. */
340 int FmsGetScalarTypeFromName(const char * const name, FmsScalarType *type);
341 
342 /// Field descriptor types supported by FMS, see FmsFieldDescriptor.
343 typedef enum {
344  FMS_FIXED_ORDER ///< See FmsFieldDescriptorSetFixedOrder()
346 
347 /// TODO: dox
348 typedef enum {
349  FMS_CONTINUOUS, // H1-conforming
350  FMS_DISCONTINUOUS, // "L2-conforming"
351  FMS_DISCONTINUOUS_WEIGHTED, // "L2-conforming" volume weighted
352  FMS_HCURL, // H(curl)-conforming
353  FMS_HDIV // H(div)-conforming
354 } FmsFieldType;
355 
356 /// TODO: dox
357 typedef enum {
365 } FmsBasisType;
366 
367 /// TODO: dox
368 typedef enum {
369  FMS_BY_NODES, // "XX..., YY..., ZZ..."
370  FMS_BY_VDIM // "XYZ, XYZ, ..."
371 } FmsLayoutType;
372 
373 /// TODO: dox
374 typedef enum {
379  FMS_NUM_METADATA_TYPES ///< Added in version: v0.2
381 
382 /// Added in version: v0.2.
383 extern const char * const FmsMetaDataTypeNames[FMS_NUM_METADATA_TYPES];
384 
385 /// Convert a meta-data-type string to FmsMetaDataType value.
386 /** Added in version: v0.2. */
387 int FmsGetMetaDataTypeFromName(const char * const name, FmsMetaDataType *type);
388 
389 /// TODO: dox
390 /** A meta-data structure contains:
391  - a meta-data type (FmsMetaDataType)
392  - a meta-data subtype, e.g. FmsIntType, FmsScalarType; TODO: for FMS_STRING
393  type define FmsEncoding subtype
394  - a meta-data name (const char *)
395  - number of entries in the data array (FmsInt); the type of the entries in
396  the data array is based on the meta-data type and subtype, when subtype is
397  applicable; in the case of FMS_STRING, the entries are of type char (or
398  some other type depending on the FmsEncoding subtype when introduced)
399  - a data array (void *)
400  */
401 typedef struct FmsMetaData_private *FmsMetaData;
402 
403 /// TODO: dox
404 /** A field-descriptor structure contains:
405  - a field-descriptor name
406  - an associated mesh component (FmsComponent)
407  - a descriptor-type (FmsFieldDescriptorType)
408  - if descriptor-type == "fixed-order":
409  - a field type (FmsFieldType)
410  - a basis-type (FmsBasisType)
411  - an order
412  - total number of DOFs
413 
414  The degrees of freedom are ordered part-by-part of the associated mesh
415  component. Within each part, the dofs are ordered as follows:
416  - first, all DOFs on all vertices ordered according to the local (to the
417  part) enumeration of the vertices
418  - second, all DOFs on all edges ordered according to the local (to the part)
419  enumeration of the edges
420  - similarly, continue adding DOFs for all remaining entity types in the
421  order used by FmsEntityType.
422  */
423 typedef struct FmsFieldDescriptor_private *FmsFieldDescriptor;
424 
425 /// Discrete field data type.
426 /** A field structure contains:
427  - a field name
428  - meta-data - e.g. time (FmsMetaData, can be NULL)
429  - a field-descriptor (FmsFieldDescriptor)
430  - number of vector components (FmsInt)
431  - a layout type, i.e. ordering for the vector components (FmsLayoutType)
432  - a scalar type (FmsScalarType)
433  - a data array of the given scalar type.
434  */
435 typedef struct FmsField_private *FmsField;
436 
437 /// Data collection type: contains a mesh, discrete fileds, meta-data, etc.
438 /** A data collection structure contains:
439  - a name (const char *)
440  - meta-data (FmsMetaData, can be NULL)
441  - a mesh (FmsMesh)
442  - number of field-descriptors (FmsInt)
443  - an array of field-descriptors (FmsFieldDescriptor *)
444  - number of fields (FmsInt)
445  - an array of fields (FmsField *)
446  */
447 typedef struct FmsDataCollection_private *FmsDataCollection;
448 
449 
450 //
451 // General functions
452 //
453 
454 /// Get the interface version.
455 /** Version is of the form: ((major*100 + minor)*100 + patch). */
456 int FmsGetInterfaceVersion(FmsInt *version);
457 
458 
459 //
460 // Construction interface
461 //
462 
463 /// Allocate a mesh structure and initialize it to be empty.
464 /** After this call, the content of the mesh should be described by calling the
465  functions FmsMeshAdd* and, if the mesh is partitioned,
466  FmsMeshSetPartitionId.
467 
468  To complete the construction of the mesh structure, the function
469  FmsMeshFinalize must be called. */
470 int FmsMeshConstruct(FmsMesh *mesh);
471 
472 /// TODO: dox
473 int FmsMeshFinalize(FmsMesh mesh);
474 
475 /// TODO: dox
476 int FmsMeshValidate(FmsMesh mesh);
477 
478 /// TODO: dox
479 int FmsMeshDestroy(FmsMesh *mesh);
480 
481 /// TODO: dox
482 int FmsMeshSetPartitionId(FmsMesh mesh, FmsInt partition_id,
483  FmsInt num_partitions);
484 
485 /** @brief Allocates an array of domains sharing the same name, initializes
486  them, and returns a pointer to the array. */
487 /** After this call, the domains should be described via the FmsDomainSet* and
488  FmsDomainAdd* functions. */
489 int FmsMeshAddDomains(FmsMesh mesh, const char *domain_name, FmsInt num_domains,
490  FmsDomain **domains);
491 
492 /** @brief Add a new empty component to the mesh with the given name and return
493  the new component in @a comp. */
494 /** After this call, the component should be described via the FmsComponentAdd*
495  functions. */
496 int FmsMeshAddComponent(FmsMesh mesh, const char *comp_name,
497  FmsComponent *comp);
498 
499 /** @brief Add a new tag to the mesh with the given name and return the new tag
500  in @a tag. */
501 /** The tag should be set via the FmsTagSet* functions. */
502 int FmsMeshAddTag(FmsMesh mesh, const char *tag_name, FmsTag *tag);
503 
504 /// Set the number of vertices in a domain.
505 int FmsDomainSetNumVertices(FmsDomain domain, FmsInt num_verts);
506 
507 /** @brief Allocates memory for the specified entities. Destroys any existing
508  entities of the given type. */
509 /** The value of @a num_ents can be an upper bound of the actual number of
510  entities. */
511 int FmsDomainSetNumEntities(FmsDomain domain, FmsEntityType type,
512  FmsIntType id_store_type, FmsInt num_ents);
513 
514 /// TODO: dox
515 /** This function allows the internal entities array to be set directly by the
516  user. */
517 int FmsDomainGetEntitiesArray(FmsDomain domain, FmsEntityType type,
518  void **ents);
519 
520 /// TODO: dox
521 /** This function allows the internal entity side orientations array to be set
522  directly by the user. */
523 int FmsDomainGetOrientationsArray(FmsDomain domain, FmsEntityType type,
524  FmsOrientation **side_orients);
525 
526 /// TODO: dox
527 /** Entities of dimension d are described by tuples of its side entities (entity
528  indices), or in other words, by a list of its boundary entities of dimension
529  d-1.
530 
531  The content of the array @a ents is copied internally after applying the
532  side entity reordering. */
533 int FmsDomainAddEntities(FmsDomain domain, FmsEntityType type,
534  FmsEntityReordering reordering, FmsIntType ent_id_type,
535  const void *ents, FmsInt num_ents);
536 
537 /// TODO: dox
538 int FmsDomainAddOrientation(FmsDomain domain, FmsEntityType type, FmsInt ent_id,
539  FmsInt loc_side_id, FmsOrientation side_orient);
540 
541 /// TODO: dox
542 /** All entities of the highest dimension in the domain are added to the
543  component. */
544 int FmsComponentAddDomain(FmsComponent comp, FmsDomain domain);
545 
546 /// TODO: dox
547 int FmsComponentAddPart(FmsComponent comp, FmsDomain domain, FmsInt *part_id);
548 
549 /// TODO: dox
550 /** The pointer @a ents can be NULL to signify that all entities in the domain
551  of the given type are being added.
552 
553  The pointer @a ent_orients can be NULL to signify that all orientations are
554  0, i.e. the identity permutation.
555 
556  The arrays @a ents and @a ent_orients (if not NULL) have the same size, @a
557  num_ents.
558 
559  The content of the arrays @a ents and @a ent_orients is copied internally
560  after applying the @a inv_orient_map to the second array.
561 
562  TODO: inv_orient_map[user-orientation] -> fms-orientation. */
563 int FmsComponentAddPartEntities(FmsComponent comp, FmsInt part_id,
564  FmsEntityType type, FmsIntType id_store_type,
565  FmsIntType ent_id_type, FmsIntType orient_type,
566  const FmsOrientation *inv_orient_map,
567  const void *ents, const void *ent_orients,
568  FmsInt num_ents);
569 
570 /// TODO: dox
571 /// Similar to FmsComponentAddPartEntities() but for lower dimensional entities.
572 int FmsComponentAddPartSubEntities(FmsComponent comp, FmsInt part_id,
573  FmsEntityType type, FmsIntType id_store_type,
574  FmsIntType ent_id_type, const void *ents,
575  FmsInt num_ents);
576 
577 /// Describe a relation from one component to another.
578 int FmsComponentAddRelation(FmsComponent comp, FmsInt other_comp_id);
579 
580 /// Set the coordinates field of a component.
581 int FmsComponentSetCoordinates(FmsComponent comp, FmsField coords);
582 
583 /// TODO: dox
584 int FmsTagSetComponent(FmsTag tag, FmsComponent comp);
585 
586 /// TODO: dox
587 /** The array @a ent_tags is converted and copied internally. The value of
588  @a num_ents must be the same as the number of main entities in the
589  associated mesh component. */
590 int FmsTagSet(FmsTag tag, FmsIntType stored_tag_type, FmsIntType input_tag_type,
591  const void *ent_tags, FmsInt num_ents);
592 
593 /// TODO: dox
594 /** The pointer @a num_ents can be NULL. */
595 int FmsTagAllocate(FmsTag tag, FmsIntType stored_tag_type, void **ent_tags,
596  FmsInt *num_ents);
597 
598 /// TODO: dox
599 /** The arrays @a tags and @a tag_descr have the same size, @a num_tags. The
600  tags and their descriptions are copied internally. The @a tag_type is the
601  type of the input array @a tags. */
602 int FmsTagAddDescriptions(FmsTag tag, FmsIntType tag_type, const void *tags,
603  const char *const *tag_descr, FmsInt num_tags);
604 
605 /// TODO: dox
606 /// The new object, @a dc, assumes ownership of the @a mesh.
607 int FmsDataCollectionCreate(FmsMesh mesh, const char *dc_name,
608  FmsDataCollection *dc);
609 
610 /// Destroy a data collection object.
611 /** Destroys the mesh, all field-descriptors, and all fields stored by the data
612  collection. */
613 int FmsDataCollectionDestroy(FmsDataCollection *dc);
614 
615 /// TODO: dox
616 int FmsDataCollectionAddFieldDescriptor(FmsDataCollection dc,
617  const char *fd_name,
618  FmsFieldDescriptor *fd);
619 
620 /// TODO: dox
621 int FmsDataCollectionAddField(FmsDataCollection dc, const char *field_name,
622  FmsField *field);
623 
624 /** @brief Make sure the meta-data structure associated with a data collection
625  is allocated and return it in @a mdata. */
626 int FmsDataCollectionAttachMetaData(FmsDataCollection dc, FmsMetaData *mdata);
627 
628 /// TODO: dox
629 int FmsFieldDescriptorSetComponent(FmsFieldDescriptor fd, FmsComponent comp);
630 
631 /// TODO: dox
632 int FmsFieldDescriptorSetFixedOrder(FmsFieldDescriptor fd,
633  FmsFieldType field_type,
634  FmsBasisType basis_type, FmsInt order);
635 
636 /// TODO: dox
637 /// The size of the @a data array is @a num_vec_comp times the number of DOFs
638 /// as defined by the field descriptor @a fd.
639 int FmsFieldSet(FmsField field, FmsFieldDescriptor fd, FmsInt num_vec_comp,
640  FmsLayoutType layout_type, FmsScalarType data_type,
641  const void *data);
642 
643 /** @brief Make sure the meta-data structure associated with a field is
644  allocated and return it in @a mdata. */
645 int FmsFieldAttachMetaData(FmsField field, FmsMetaData *mdata);
646 
647 /// Set the contents of a meta-data structure to store an array of integers.
648 /** Returns the uninitialized meta-data array in @a data. */
649 int FmsMetaDataSetIntegers(FmsMetaData mdata, const char *mdata_name,
650  FmsIntType int_type, FmsInt size, void **data);
651 
652 /// Set the contents of a meta-data structure to store an array of scalars.
653 /** Returns the uninitialized meta-data array in @a data. */
654 int FmsMetaDataSetScalars(FmsMetaData mdata, const char *mdata_name,
655  FmsScalarType scal_type, FmsInt size, void **data);
656 
657 /// Set the contents of a meta-data structure to store a c-string.
658 int FmsMetaDataSetString(FmsMetaData mdata, const char *mdata_name,
659  const char *c_string);
660 
661 /** @brief Set the contents of a meta-data structure to store an array of
662  meta-data structures. */
663 /** Returns the meta-data array in @a data. Each meta-data entry in the array is
664  initialized to be empty. */
665 int FmsMetaDataSetMetaData(FmsMetaData mdata, const char *mdata_name,
666  FmsInt size, FmsMetaData **data);
667 
668 /// Clear the contents of @a mdata without destroying the object.
669 int FmsMetaDataClear(FmsMetaData mdata);
670 
671 /// Destroy the object that @a *mdata refers to and set @a *mdata to NULL.
672 int FmsMetaDataDestroy(FmsMetaData *mdata);
673 
674 
675 //
676 // Query interface
677 //
678 
679 /// TODO: dox
680 int FmsMeshGetPartitionId(FmsMesh mesh, FmsInt *partition_id,
681  FmsInt *num_partitions);
682 
683 /// TODO: dox
684 int FmsMeshGetNumDomainNames(FmsMesh mesh, FmsInt *num_domain_names);
685 
686 /// TODO: dox
687 int FmsMeshGetDomains(FmsMesh mesh, FmsInt domain_name_id,
688  const char **domain_name, FmsInt *num_domains,
689  FmsDomain **domains);
690 
691 /// TODO: dox
692 int FmsMeshGetDomainsByName(FmsMesh mesh, const char *domain_name,
693  FmsInt *num_domains, FmsDomain **domains);
694 
695 /// TODO: dox
696 int FmsMeshGetNumComponents(FmsMesh mesh, FmsInt *num_comp);
697 
698 /// TODO: dox
699 int FmsMeshGetComponent(FmsMesh mesh, FmsInt comp_id, FmsComponent *comp);
700 
701 /// TODO: dox
702 int FmsMeshGetNumTags(FmsMesh mesh, FmsInt *num_tags);
703 
704 /// TODO: dox
705 int FmsMeshGetTag(FmsMesh mesh, FmsInt tag_id, FmsTag *tag);
706 
707 /// Return the name and id of a mesh domain.
708 int FmsDomainGetName(FmsDomain domain, const char **domain_name,
709  FmsInt *domain_id);
710 
711 /// Return the highest dimension of an entry in a mesh domain.
712 int FmsDomainGetDimension(FmsDomain domain, FmsInt *dim);
713 
714 /// Get the number of vertices in a domain.
715 int FmsDomainGetNumVertices(FmsDomain domain, FmsInt *num_verts);
716 
717 /// Get the number of entities of a given type in a domain.
718 int FmsDomainGetNumEntities(FmsDomain domain, FmsEntityType type,
719  FmsInt *num_ents);
720 
721 /// TODO: dox
722 /// No copy, read only access to all entity definitions.
723 int FmsDomainGetAllEntities(FmsDomain domain, FmsEntityType type,
724  FmsIntType *ent_id_type, const void **ents,
725  FmsInt *num_ents);
726 
727 /// TODO: dox
728 /// Extract a subset of the entity definitions.
729 int FmsDomainGetEntities(FmsDomain domain, FmsEntityType type,
730  FmsEntityReordering reordering, FmsIntType ent_id_type,
731  FmsInt first_ent, void *ents, FmsInt num_ents);
732 
733 /// TODO: dox
734 /// Extract a subset of the entity definitions in terms of their vertices.
735 int FmsDomainGetEntitiesVerts(FmsDomain domain, FmsEntityType type,
736  FmsEntityReordering vert_reordering,
737  FmsIntType ent_id_type, FmsInt first_ent,
738  void *ents_verts, FmsInt num_ents);
739 
740 /// TODO: dox
741 /// No copy, read only access to all entity side orientations.
742 int FmsDomainGetAllOrientations(FmsDomain domain, FmsEntityType type,
743  const FmsOrientation **side_orients,
744  FmsInt *num_ents);
745 
746 /// Return the name of a mesh component.
747 int FmsComponentGetName(FmsComponent comp, const char **comp_name);
748 
749 /// Return the dimension of a mesh component.
750 int FmsComponentGetDimension(FmsComponent comp, FmsInt *dim);
751 
752 /// TODO: dox
753 int FmsComponentGetNumParts(FmsComponent comp, FmsInt *num_parts);
754 
755 /// TODO: dox
756 /** No copy, read only access to the description of part @a part_id in the
757  component.
758 
759  If the pointer returned in @a ents is NULL, then all entities in the domain
760  of the specified type are used.
761 
762  If the pointer returned in @a ent_orients is NULL, then all orientations are
763  0, i.e. the identity permutation. */
764 int FmsComponentGetPart(FmsComponent comp, FmsInt part_id, FmsEntityType type,
765  FmsDomain *domain, FmsIntType *ent_id_type,
766  const void **ents, const FmsOrientation **ent_orients,
767  FmsInt *num_ents);
768 
769 /// TODO: dox
770 /// Similar to FmsComponentGetPart() but for lower dimensional entities.
771 int FmsComponentGetPartSubEntities(FmsComponent comp, FmsInt part_id,
772  FmsEntityType type, FmsIntType *ent_id_type,
773  const void **ents, FmsInt *num_ents);
774 
775 /// Return the total number of main entities across all parts in the component.
776 int FmsComponentGetNumEntities(FmsComponent comp, FmsInt *num_ents);
777 
778 /// TODO: dox
779 int FmsComponentGetRelations(FmsComponent comp, const FmsInt **rel_comps,
780  FmsInt *num_rel_comps);
781 
782 /// Return the coordinates field of a component.
783 /** Note that the returned FmsField, @a *coords, can be NULL. */
784 int FmsComponentGetCoordinates(FmsComponent comp, FmsField *coords);
785 
786 /// TODO: dox
787 int FmsTagGetName(FmsTag tag, const char **tag_name);
788 
789 /// TODO: dox
790 int FmsTagGetComponent(FmsTag tag, FmsComponent *comp);
791 
792 /// TODO: dox
793 /// No copy, read only access to the entity-tag array.
794 int FmsTagGet(FmsTag tag, FmsIntType *tag_type, const void **ent_tags,
795  FmsInt *num_ents);
796 
797 /// TODO: dox
798 /** The arrays @a tags and @a tag_descr have the same size, @a num_tags.
799 
800  The @a tag_type is the type of the entries in the @a tags array. */
801 int FmsTagGetDescriptions(FmsTag tag, FmsIntType *tag_type, const void **tags,
802  const char *const **tag_descr, FmsInt *num_tags);
803 
804 /// Get the name of the data collection.
805 /** @param dc the data collection.
806  @param[out] name A char pointer that will be set to point to the name
807  string. The name is owned by the data collection so it
808  should not be freed or modified.
809  @return 0 on success, non-zero otherwise.
810 
811  Added in version: v0.2. */
812 int FmsDataCollectionGetName(FmsDataCollection dc, const char **name);
813 
814 /// TODO: dox
815 int FmsDataCollectionGetMesh(FmsDataCollection dc, FmsMesh *mesh);
816 
817 /// TODO: dox
818 int FmsDataCollectionGetFieldDescriptors(FmsDataCollection dc,
819  FmsFieldDescriptor **fds, FmsInt *num_fds);
820 
821 /// TODO: dox
822 int FmsDataCollectionGetFields(FmsDataCollection dc, FmsField **fields,
823  FmsInt *num_fields);
824 
825 /// TODO: dox
826 int FmsDataCollectionGetMetaData(FmsDataCollection dc, FmsMetaData *mdata);
827 
828 /// TODO: dox
829 int FmsFieldDescriptorGetName(FmsFieldDescriptor fd, const char **fd_name);
830 
831 /// TODO: dox
832 int FmsFieldDescriptorGetComponent(FmsFieldDescriptor fd, FmsComponent *comp);
833 
834 /// TODO: dox
835 int FmsFieldDescriptorGetType(FmsFieldDescriptor fd,
836  FmsFieldDescriptorType *fd_type);
837 
838 /// TODO: dox
839 int FmsFieldDescriptorGetFixedOrder(FmsFieldDescriptor fd,
840  FmsFieldType *field_type,
841  FmsBasisType *basis_type, FmsInt *order);
842 
843 /// TODO: dox
844 int FmsFieldDescriptorGetNumDofs(FmsFieldDescriptor fd, FmsInt *num_dofs);
845 
846 /// TODO: dox
847 int FmsFieldGetName(FmsField field, const char **field_name);
848 
849 /// TODO: dox
850 int FmsFieldGet(FmsField field, FmsFieldDescriptor *fd, FmsInt *num_vec_comp,
851  FmsLayoutType *layout_type, FmsScalarType *data_type,
852  const void **data);
853 
854 /// TODO: dox
855 int FmsFieldGetMetaData(FmsField field, FmsMetaData *mdata);
856 
857 /// TODO: dox
858 /** If the @a mdata structure is empty, returns an error code of 1. */
859 int FmsMetaDataGetType(FmsMetaData mdata, FmsMetaDataType *type);
860 
861 /// Get the contents of a meta-data structure that stores an array of integers.
862 /** Returns a pointer to the meta-data array in @a data. */
863 int FmsMetaDataGetIntegers(FmsMetaData mdata, const char **mdata_name,
864  FmsIntType *int_type, FmsInt *size,
865  const void **data);
866 
867 /// Get the contents of a meta-data structure that stores an array of scalars.
868 /** Returns a pointer to the meta-data array in @a data. */
869 int FmsMetaDataGetScalars(FmsMetaData mdata, const char **mdata_name,
870  FmsScalarType *scal_type, FmsInt *size,
871  const void **data);
872 
873 /// Get the contents of a meta-data structure that stores a c-string.
874 int FmsMetaDataGetString(FmsMetaData mdata, const char **mdata_name,
875  const char **c_string);
876 
877 /** @brief Get the contents of a meta-data structure that stores an array of
878  meta-data structures. */
879 /** Returns a pointer to the meta-data array in @a data. */
880 int FmsMetaDataGetMetaData(FmsMetaData mdata, const char **mdata_name,
881  FmsInt *size, FmsMetaData **data);
882 
883 
884 ///
885 /// Comparison interface
886 ///
887 
888 /// Return 0 if equivalent, not 0 otherwise
889 /** Added in version: v0.2. */
890 int FmsDataCollectionCompare(FmsDataCollection,FmsDataCollection);
891 
892 /// Return 0 if equivalent, not 0 otherwise
893 /** Added in version: v0.2. */
894 int FmsMeshCompare(FmsMesh,FmsMesh);
895 
896 /// Return 0 if equivalent, not 0 otherwise
897 /** Added in version: v0.2. */
898 int FmsFieldDescriptorCompare(FmsFieldDescriptor,FmsFieldDescriptor);
899 
900 /// Return 0 if equivalent, not 0 otherwise
901 /** Added in version: v0.2. */
902 int FmsFieldCompare(FmsField,FmsField);
903 
904 /// Return 0 if equivalent, not 0 otherwise
905 /** Added in version: v0.2. */
906 int FmsMetaDataCompare(FmsMetaData,FmsMetaData);
907 
908 /// Return 0 if equivalent, not 0 otherwise
909 /** Added in version: v0.2. */
910 int FmsDomainCompare(FmsDomain,FmsDomain);
911 
912 /// Return 0 if equivalent, not 0 otherwise
913 /** Added in version: v0.2. */
914 int FmsComponentCompare(FmsComponent,FmsComponent);
915 
916 /// Return 0 if equivalent, not 0 otherwise
917 /** Added in version: v0.2. */
918 int FmsTagCompare(FmsTag,FmsTag);
919 
920 #ifdef __cplusplus
921 } // extern "C"
922 #endif
923 
924 #endif // FMS_HEADER
int FmsComponentCompare(FmsComponent, FmsComponent)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3427
int FmsDataCollectionGetFieldDescriptors(FmsDataCollection dc, FmsFieldDescriptor **fds, FmsInt *num_fds)
TODO: dox.
Definition: fms.c:2786
int FmsDomainSetNumVertices(FmsDomain domain, FmsInt num_verts)
Set the number of vertices in a domain.
Definition: fms.c:1327
Definition: fms.h:50
int FmsDomainCompare(FmsDomain, FmsDomain)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3362
int FmsTagGetDescriptions(FmsTag tag, FmsIntType *tag_type, const void **tags, const char *const **tag_descr, FmsInt *num_tags)
TODO: dox.
Definition: fms.c:2754
FmsFieldType
TODO: dox.
Definition: fms.h:348
int FmsTagCompare(FmsTag, FmsTag)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3501
Definition: fms.h:53
int FmsComponentAddPart(FmsComponent comp, FmsDomain domain, FmsInt *part_id)
TODO: dox.
Definition: fms.c:1482
int FmsDataCollectionAddField(FmsDataCollection dc, const char *field_name, FmsField *field)
TODO: dox.
Definition: fms.c:1834
int FmsFieldDescriptorGetFixedOrder(FmsFieldDescriptor fd, FmsFieldType *field_type, FmsBasisType *basis_type, FmsInt *order)
TODO: dox.
Definition: fms.c:2836
const char *const FmsIntTypeNames[FMS_NUM_INT_TYPES]
Added in version: v0.2.
Definition: fms.c:158
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.
Definition: fms.c:2897
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: fms.c:2694
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: fms.c:2079
int FmsMeshGetDomains(FmsMesh mesh, FmsInt domain_name_id, const char **domain_name, FmsInt *num_domains, FmsDomain **domains)
TODO: dox.
Definition: fms.c:2184
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: fms.c:2298
FmsBasisType
TODO: dox.
Definition: fms.h:357
Definition: fms.h:325
int FmsTagAddDescriptions(FmsTag tag, FmsIntType tag_type, const void *tags, const char *const *tag_descr, FmsInt num_tags)
TODO: dox.
Definition: fms.c:1705
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.
Definition: fms.c:2927
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...
Definition: fms.c:1985
Definition: fms.h:48
const char *const FmsScalarTypeNames[FMS_NUM_SCALAR_TYPES]
Added in version: v0.2.
Definition: fms.c:196
FmsIntType
TODO: dox.
Definition: fms.h:46
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.
Definition: fms.c:2037
const size_t FmsScalarTypeSize[FMS_NUM_SCALAR_TYPES]
Definition: fms.c:192
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: fms.c:2919
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: fms.c:2287
int FmsFieldAttachMetaData(FmsField field, FmsMetaData *mdata)
Make sure the meta-data structure associated with a field is allocated and return it in mdata...
Definition: fms.c:2016
const int * FmsEntityReordering[FMS_NUM_ENTITY_TYPES]
A type describing user-defined local orderings of the side entities defining an enitity.
Definition: fms.h:281
const size_t FmsIntTypeSize[FMS_NUM_INT_TYPES]
Definition: fms.c:154
int FmsFieldGetName(FmsField field, const char **field_name)
TODO: dox.
Definition: fms.c:2859
Definition: fms.h:242
FmsMetaDataType
TODO: dox.
Definition: fms.h:374
int FmsFieldDescriptorSetFixedOrder(FmsFieldDescriptor fd, FmsFieldType field_type, FmsBasisType basis_type, FmsInt order)
TODO: dox.
Definition: fms.c:1888
int FmsDataCollectionAttachMetaData(FmsDataCollection dc, FmsMetaData *mdata)
Make sure the meta-data structure associated with a data collection is allocated and return it in mda...
Definition: fms.c:1861
struct FmsFieldDescriptor_private * FmsFieldDescriptor
TODO: dox.
Definition: fms.h:423
int FmsMetaDataClear(FmsMetaData mdata)
Clear the contents of mdata without destroying the object.
Definition: fms.c:2126
int FmsGetIntTypeFromName(const char *const name, FmsIntType *type)
Get the enum representation of an int type from the string name.
Definition: fms.c:877
int FmsFieldDescriptorGetType(FmsFieldDescriptor fd, FmsFieldDescriptorType *fd_type)
TODO: dox.
Definition: fms.c:2828
int FmsDomainAddOrientation(FmsDomain domain, FmsEntityType type, FmsInt ent_id, FmsInt loc_side_id, FmsOrientation side_orient)
TODO: dox.
Definition: fms.c:1426
int FmsTagAllocate(FmsTag tag, FmsIntType stored_tag_type, void **ent_tags, FmsInt *num_ents)
TODO: dox.
Definition: fms.c:1682
The type of FmsInt identified as FmsIntType.
Definition: fms.h:61
struct FmsComponent_private * FmsComponent
TODO: dox.
Definition: fms.h:159
int FmsMeshCompare(FmsMesh, FmsMesh)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3097
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 a...
Definition: fms.c:1211
int FmsComponentGetName(FmsComponent comp, const char **comp_name)
Return the name of a mesh component.
Definition: fms.c:2659
int FmsDomainGetName(FmsDomain domain, const char **domain_name, FmsInt *domain_id)
Return the name and id of a mesh domain.
Definition: fms.c:2256
Definition: fms.h:54
int FmsMeshFinalize(FmsMesh mesh)
TODO: dox.
Definition: fms.c:980
int FmsTagSetComponent(FmsTag tag, FmsComponent comp)
TODO: dox.
Definition: fms.c:1651
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: fms.c:1577
int FmsMeshGetPartitionId(FmsMesh mesh, FmsInt *partition_id, FmsInt *num_partitions)
TODO: dox.
Definition: fms.c:2169
FmsFieldDescriptorType
Field descriptor types supported by FMS, see FmsFieldDescriptor.
Definition: fms.h:343
int FmsComponentGetNumEntities(FmsComponent comp, FmsInt *num_ents)
Return the total number of main entities across all parts in the component.
Definition: fms.c:2708
int FmsFieldGetMetaData(FmsField field, FmsMetaData *mdata)
TODO: dox.
Definition: fms.c:2878
Definition: fms.h:237
int FmsComponentSetCoordinates(FmsComponent comp, FmsField coords)
Set the coordinates field of a component.
Definition: fms.c:1639
const FmsInt FmsEntityDim[FMS_NUM_ENTITY_TYPES]
Dimensions of the entity types.
Definition: fms.c:180
struct FmsDomain_private * FmsDomain
TODO: dox.
Definition: fms.h:106
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.
Definition: fms.c:1298
See FmsFieldDescriptorSetFixedOrder()
Definition: fms.h:344
int FmsComponentAddRelation(FmsComponent comp, FmsInt other_comp_id)
Describe a relation from one component to another.
Definition: fms.c:1624
int FmsDomainSetNumEntities(FmsDomain domain, FmsEntityType type, FmsIntType id_store_type, FmsInt num_ents)
Allocates memory for the specified entities.
Definition: fms.c:1334
int FmsDomainGetEntitiesArray(FmsDomain domain, FmsEntityType type, void **ents)
TODO: dox.
Definition: fms.c:1381
uint64_t FmsInt
Type used by fms for representing and storing sizes and indices.
Definition: fms.h:43
FmsLayoutType
TODO: dox.
Definition: fms.h:368
FmsEntityType
TODO: dox.
Definition: fms.h:235
int FmsComponentGetNumParts(FmsComponent comp, FmsInt *num_parts)
TODO: dox.
Definition: fms.c:2671
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: fms.c:2329
int FmsMeshValidate(FmsMesh mesh)
TODO: dox.
Definition: fms.c:1094
const char *const FmsMetaDataTypeNames[FMS_NUM_METADATA_TYPES]
Added in version: v0.2.
Definition: fms.c:203
Definition: fms.h:353
int FmsComponentGetDimension(FmsComponent comp, FmsInt *dim)
Return the dimension of a mesh component.
Definition: fms.c:2665
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.
Definition: fms.c:2908
int FmsGetEntityTypeFromName(const char *const name, FmsEntityType *ent_type)
Convert an entity-type string to FmsEntityType value.
Definition: fms.c:921
int FmsDataCollectionGetMesh(FmsDataCollection dc, FmsMesh *mesh)
TODO: dox.
Definition: fms.c:2779
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: fms.c:2644
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.
Definition: fms.c:2095
The type of FmsOrientation as FmsIntType.
Definition: fms.h:63
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...
Definition: fms.c:1270
int FmsMetaDataCompare(FmsMetaData, FmsMetaData)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3276
int FmsComponentGetCoordinates(FmsComponent comp, FmsField *coords)
Return the coordinates field of a component.
Definition: fms.c:2722
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.
Definition: fms.c:2677
Definition: fms.h:352
int FmsDomainAddEntities(FmsDomain domain, FmsEntityType type, FmsEntityReordering reordering, FmsIntType ent_id_type, const void *ents, FmsInt num_ents)
TODO: dox.
Definition: fms.c:1402
int FmsGetScalarTypeFromName(const char *const name, FmsScalarType *type)
Get the enum representation of an int type from the string name.
Definition: fms.c:903
int FmsMeshGetComponent(FmsMesh mesh, FmsInt comp_id, FmsComponent *comp)
TODO: dox.
Definition: fms.c:2228
int FmsComponentAddDomain(FmsComponent comp, FmsDomain domain)
TODO: dox.
Definition: fms.c:1443
int FmsMeshGetNumDomainNames(FmsMesh mesh, FmsInt *num_domain_names)
TODO: dox.
Definition: fms.c:2177
Definition: fms.h:51
struct FmsTag_private * FmsTag
TODO: dox.
Definition: fms.h:176
int FmsDataCollectionAddFieldDescriptor(FmsDataCollection dc, const char *fd_name, FmsFieldDescriptor *fd)
TODO: dox.
Definition: fms.c:1808
Definition: fms.h:56
struct FmsField_private * FmsField
Discrete field data type.
Definition: fms.h:435
int FmsDataCollectionGetFields(FmsDataCollection dc, FmsField **fields, FmsInt *num_fields)
TODO: dox.
Definition: fms.c:2794
int FmsMeshConstruct(FmsMesh *mesh)
Allocate a mesh structure and initialize it to be empty.
Definition: fms.c:970
int FmsFieldGet(FmsField field, FmsFieldDescriptor *fd, FmsInt *num_vec_comp, FmsLayoutType *layout_type, FmsScalarType *data_type, const void **data)
TODO: dox.
Definition: fms.c:2866
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.
Definition: fms.c:2058
int FmsFieldDescriptorGetName(FmsFieldDescriptor fd, const char **fd_name)
TODO: dox.
Definition: fms.c:2814
FmsScalarType
Scalar types supported by FMS: floating-point types, real and complex.
Definition: fms.h:324
Definition: fms.h:49
int FmsDataCollectionCompare(FmsDataCollection, FmsDataCollection)
Comparison interface.
Definition: fms.c:3035
int FmsDomainGetNumEntities(FmsDomain domain, FmsEntityType type, FmsInt *num_ents)
Get the number of entities of a given type in a domain.
Definition: fms.c:2278
struct FmsDataCollection_private * FmsDataCollection
Data collection type: contains a mesh, discrete fileds, meta-data, etc.
Definition: fms.h:447
int FmsTagGetName(FmsTag tag, const char **tag_name)
TODO: dox.
Definition: fms.c:2733
int FmsDataCollectionGetMetaData(FmsDataCollection dc, FmsMetaData *mdata)
TODO: dox.
Definition: fms.c:2802
int FmsDataCollectionCreate(FmsMesh mesh, const char *dc_name, FmsDataCollection *dc)
TODO: dox The new object, dc, assumes ownership of the mesh.
Definition: fms.c:1750
struct FmsMesh_private * FmsMesh
TODO: dox.
Definition: fms.h:82
int FmsMeshGetTag(FmsMesh mesh, FmsInt tag_id, FmsTag *tag)
TODO: dox.
Definition: fms.c:2243
int FmsMeshSetPartitionId(FmsMesh mesh, FmsInt partition_id, FmsInt num_partitions)
TODO: dox.
Definition: fms.c:1201
const char *const FmsEntityTypeNames[FMS_NUM_ENTITY_TYPES]
String representations of each entity type.
Definition: fms.c:169
int FmsGetInterfaceVersion(FmsInt *version)
Get the interface version.
Definition: fms.c:871
int FmsTagSet(FmsTag tag, FmsIntType stored_tag_type, FmsIntType input_tag_type, const void *ent_tags, FmsInt num_ents)
TODO: dox.
Definition: fms.c:1658
int FmsDataCollectionGetName(FmsDataCollection dc, const char **name)
Get the name of the data collection.
Definition: fms.c:2772
int FmsDomainGetOrientationsArray(FmsDomain domain, FmsEntityType type, FmsOrientation **side_orients)
TODO: dox.
Definition: fms.c:1393
Definition: fms.h:55
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.
Definition: fms.c:1504
int FmsMeshGetNumComponents(FmsMesh mesh, FmsInt *num_comp)
TODO: dox.
Definition: fms.c:2221
int FmsGetMetaDataTypeFromName(const char *const name, FmsMetaDataType *type)
Convert a meta-data-type string to FmsMetaDataType value.
Definition: fms.c:947
struct FmsMetaData_private * FmsMetaData
TODO: dox.
Definition: fms.h:401
int FmsDomainGetNumVertices(FmsDomain domain, FmsInt *num_verts)
Get the number of vertices in a domain.
Definition: fms.c:2271
#define FMS_VERSION
FMS version constant of the form: ((major*100 + minor)*100 + patch).
Definition: fms.h:36
int FmsDomainGetDimension(FmsDomain domain, FmsInt *dim)
Return the highest dimension of an entry in a mesh domain.
Definition: fms.c:2264
int FmsMeshGetDomainsByName(FmsMesh mesh, const char *domain_name, FmsInt *num_domains, FmsDomain **domains)
TODO: dox.
Definition: fms.c:2200
int FmsComponentGetRelations(FmsComponent comp, const FmsInt **rel_comps, FmsInt *num_rel_comps)
TODO: dox.
Definition: fms.c:2714
int FmsFieldDescriptorGetNumDofs(FmsFieldDescriptor fd, FmsInt *num_dofs)
TODO: dox.
Definition: fms.c:2847
int FmsMetaDataGetType(FmsMetaData mdata, FmsMetaDataType *type)
TODO: dox.
Definition: fms.c:2890
Added in version: v0.2.
Definition: fms.h:379
int FmsFieldDescriptorCompare(FmsFieldDescriptor, FmsFieldDescriptor)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3174
int FmsTagGetComponent(FmsTag tag, FmsComponent *comp)
TODO: dox.
Definition: fms.c:2739
int FmsMeshGetNumTags(FmsMesh mesh, FmsInt *num_tags)
TODO: dox.
Definition: fms.c:2236
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: fms.c:2745
uint8_t FmsOrientation
A type used by fms to represent and store entity orientations.
Definition: fms.h:319
int FmsFieldDescriptorGetComponent(FmsFieldDescriptor fd, FmsComponent *comp)
TODO: dox.
Definition: fms.c:2821
const FmsInt FmsEntityNumVerts[FMS_NUM_ENTITY_TYPES]
Number of vertices of the entity types.
Definition: fms.c:188
int FmsFieldDescriptorSetComponent(FmsFieldDescriptor fd, FmsComponent comp)
TODO: dox.
Definition: fms.c:1882
int FmsMetaDataDestroy(FmsMetaData *mdata)
Destroy the object that *mdata refers to and set *mdata to NULL.
Definition: fms.c:2152
const FmsInt FmsEntityNumSides[FMS_NUM_ENTITY_TYPES]
Number of sides of the entity types.
Definition: fms.c:184
int FmsFieldCompare(FmsField, FmsField)
Return 0 if equivalent, not 0 otherwise.
Definition: fms.c:3236
int FmsDataCollectionDestroy(FmsDataCollection *dc)
Destroy a data collection object.
Definition: fms.c:1765
int FmsMeshDestroy(FmsMesh *mesh)
TODO: dox.
Definition: fms.c:1142