Skip to content

Update MESHFEM3D globe to give thin database information #2000

Description

@Rohit-Kakodkar

Additive; do not touch save_arrays_solver.f90.

  1. New writer src/meshfem3D/save_database_specfempp.F90, exposing
    save_database_specfempp(). Hook it in create_regions_mesh.F90 pass 2, at the
    same site as save_arrays_solver (~src/meshfem3D/create_regions_mesh.F90:397),
    gated by a new Par_file flag (e.g. SPECFEMPP_DATABASE = .true.). Register in
    rules.mk/Makefile.
  2. Merge regions per rank. Accumulate per-rank element/node/boundary/adjacency
    data across the region loop and emit one file at the end, or write region blocks
    and merge in the reader. Prefer accumulate-then-emit for a clean single-mesh file.
  3. Anchor extraction. Globe uses NGNOD = 27. Extract the 27 anchor nodes from
    the corner/edge/centre GLL positions of ibool (the inverse of
    hex_nodes/add_missing_nodes). Emit a deduplicated node list per rank
    (final geometry) and — when topo/ellip on — the reference-spherical anchors.
    To obtain reference anchors, capture the anchor coordinates before the
    topography/ellipticity calls in compute_element_properties (they are available
    as xelm/yelm/zelm right after Moho stretching + GLL interpolation).
  4. Per-element context. Emit idoubling, rmin, rmax, elem_in_crust,
    region, medium_tag, property_tag. rmin/rmax are the rmins/rmaxs shell
    bounds already in scope; elem_in_crust is computed in
    compute_element_properties — thread it out to the writer.
  5. Boundaries. Free surface (top of crust/mantle), CMB (bottom of crust/mantle
    / top of outer core), ICB (bottom of outer core / top of inner core), ocean-load
    faces. Source: ibelm_top/bottom per region + region adjacency.
  6. Adjacency. Translate globe MPI interfaces (create_MPI_interfaces,
    my_neighbors_*, iboolleft/right_*) into the local CSR + MPI-neighbor format.
    Globe-native representation — no Cartesian re-encoding.
  7. Dimensionalize coordinates (× R_PLANET) and write header constants.
  8. Write MODEL_CONFIG. After read_compute_parameters the mesher already
    holds the resolved model selection (MODEL name, REFERENCE_1D_MODEL,
    THREE_D_MODEL, THREE_D_MODEL_IC, REFERENCE_CRUSTAL_MODEL) and the model
    flags in shared_parameters/meshfem_models_par. Serialize them into the
    header's MODEL_CONFIG block (§4.2) so SPECFEM++ can replay them into
    models_init without ever reading the globe Par_file.
  9. Optional BAKED block. Reuse the values get_model already computes in
    pass 2 to append per-GLL material when material_mode == BAKED.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions