Skip to content

Instantly share code, notes, and snippets.

@ampdes
Last active August 6, 2024 07:56
Show Gist options
  • Save ampdes/1b7c2785c03ce867b883b788a144fe64 to your computer and use it in GitHub Desktop.
Save ampdes/1b7c2785c03ce867b883b788a144fe64 to your computer and use it in GitHub Desktop.
Meta data of dolfinx objects

Meta data of dolfinx objects

Mesh

Mesh data is constant over time.

  1. Attributes
  • name : name of the mesh
  • dim : geometrical dimension of the mesh
  • cell_type : cell type of the coordinate element
  • degree :
  • lagrange_variant : integration points
  1. Variables
    • Scalars

      • num_vertices : number of vertices in the mesh
      • num_cells : number of cells
      • num_dofs_per_cell :
    • Arrays

      • x : coordinate array, size (num_vertices, 3)
      • topology : cell to vertex connectivity
        • topology_array : flattened array
        • topolgy_offset : offsets demarcating the cells
      • input_global_indices : original input mesh's global indices
      • orginal_cell_indices : original input mesh's cell indices

Meshtags

Note:

  1. One can have meshtags for different entity types: points, edges, facets, cells.

  2. One can have multiplicities of meshtags for the same entity type.

  3. Suffixes, prefixes can be used.

  4. Attributes

    • name
  5. Variables

    • Scalars

      • num_tag_entities_global_{entity}
      • num_dofs_per_entity_{entity}
      • num_saved_tag_entities_{entity}
    • Arrays

      • topology_{entity}
      • values_{entity}

Function

Note:

  1. Multiplicities of FunctionSpaces

  2. Multiplicities of Functions from the same FunctionSpace

  3. Attributes

    • functionspace_names :
    • function_names : Array of strings of function names
  4. Variables

    • Scalars

      • num_cells_global
      • num_dofs_per_cell : different than the one for mesh
      • dofmap_bs :
      • num_dofs_global_dmap :
    • Arrays

      • cell_permutations :
      • topology :
        • topology_array : dofmap of the function space
        • topology_offsets : xdofmap
      • values :

ADIOS2 variables

One needs to define ADIOS2 variables for each of the above. Should we create the ADIOS2 variable with some prefix/suffix to the above variable names?

Example:

   adios2::Variable<T> values_var = io.DefineVariable<T>(funcname + "_values",
                                                {num_dofs_global},
                                                {dof_offset},
                                                {num_dofs_local},
                                                adios2::ConstantDims);
 
   writer.Put(values_var, values.data());
@jorgensd
Copy link

jorgensd commented Aug 6, 2024

num_vertices is not necessarily correct for higher order meshes.
num_nodes would be a better name

@jorgensd
Copy link

jorgensd commented Aug 6, 2024

I guess the num_dofs_per_cell-variable is not required if you store topolgy_offset as it would give the same information, but more generalized for multiple cell type topologies (if one store these in one array).

@jorgensd
Copy link

jorgensd commented Aug 6, 2024

Could you elaborate on what:

    num_tag_entities_global_{entity}
    num_dofs_per_entity_{entity}
    num_saved_tag_entities_{entity}

signifies?
num_tag_entities_global should be possible to infer from the shape of values_{entity}?
Similarly, one can then infer num_dofs_per_entity_{entity} from the shape of topology_{entity} as ADIOS2 allows you to store two-dimensional arrays. Of course, if we want to target multiple cell type meshes, one would have to store this topology with an array and offsets, as done in the mesh.

@jorgensd
Copy link

jorgensd commented Aug 6, 2024

For Function, same comment regarding num_dofs_per_cell, as this would be inferred from topology offsets, and would work for multi-cell meshes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment