Mondaic

salvus.mesh.data_structures.salvus_mesh.algorithms.assembly

salvus.mesh.data_structures.salvus_mesh.algorithms.assembly salvus mesh data_structures salvus_mesh algorithms assembly

Functions to assemble meshes and blocks from chunks.

Helpful definitions:

  • Surjective (onto): Every global index that should exist is covered by the map. Example: if global size is 5 and your map contains [0,1,2,3,4] (possibly with repeats), the mapping is surjective. If an index is missing, it’s not. Surjective means “all targets get hit at least once.”
  • Injective (one-to-one): No duplicates in the map. Each local index goes to a unique global index. Example: [0,2,4] is injective, [0,2,2] is not.
  • Bijective (one-to-one and onto): Both injective and surjective. Every global index appears exactly once. Example: [0,1,2,3] for a global of size 4.

Functions

assemble_mesh()

def assemble_mesh(
    mesh_chunks: Mesh | list[Mesh],
    global_section: Section,
    nodal_field_reduction: np_utils._UfuncLike | None = None,
    nodal_fields: str | list[str] | None = None,
) -> Mesh: ...

Assemble one or more mesh chunks into a single mesh.

The first mesh chunk is used as a template for the assembled mesh, and as such provides the global variables of the assembled mesh.

Parameters
  • mesh_chunks Mesh | list[Mesh] — The mesh chunks to assemble. The first mesh chunk is used as a template for the assembled mesh, and as such provides the global variables of the assembled mesh.
  • global_section Section — The global section to align to.
  • nodal_field_reduction np_utils._UfuncLike | None — The reduction operation to apply to the nodal fields. For more information, see the documentation of salvus.utils.numpy_utils.assemble.
  • nodal_fields str | list[str] | None — The nodal fields to include in the assembled mesh. Within each block, the intersection of this parameter with the nodal fields present in the block is taken.
Returns Mesh — The assembled mesh.