specfem

namespace specfem

UTM forward/inverse projection (Snyder PP 1395, eqs. 8-9..8-18).

Core SPECFEM++ library namespace.

UTM (Universal Transverse Mercator) projection conversions.

Forward and inverse Transverse Mercator projection on the WGS-84 ellipsoid, following Snyder, “Map Projections – A Working Manual” (USGS PP 1395, 1987). Ported from fortran/meshfem3d/shared/utm_geo.f90 (CAMx v6.10 origin).

All computations use double precision. The depth/z component is always passed through unchanged.

Example usage:

#include "specfem/coordinate_systems.hpp"

specfem::coordinate_systems::geographic_coordinates geo{ 2.674, 51.561,
                                                         0.0 };
specfem::coordinate_systems::utm_projection_config cfg{ 31 };

// Forward: lon/lat -> UTM easting/northing
auto cart =
    specfem::coordinate_systems::transform<
        specfem::coordinate_systems::cartesian_coordinates<
            specfem::element::dimension_tag::dim3>>(geo, cfg);

// Inverse: UTM -> lon/lat
auto recovered =
    specfem::coordinate_systems::transform<
        specfem::coordinate_systems::geographic_coordinates>(cart, cfg);

// Southern hemisphere: use negative zone
auto cart_south =
    specfem::coordinate_systems::transform<
        specfem::coordinate_systems::cartesian_coordinates<
            specfem::element::dimension_tag::dim3>>(
        specfem::coordinate_systems::geographic_coordinates{
            151.209, -33.869, 0.0 },
        specfem::coordinate_systems::utm_projection_config{ -56 });

// Suppress projection (pass-through: x=lon, y=lat, z=depth)
auto passthrough =
    specfem::coordinate_systems::transform<
        specfem::coordinate_systems::cartesian_coordinates<
            specfem::element::dimension_tag::dim3>>(
        geo, specfem::coordinate_systems::utm_projection_config{ 31, true });

Contains spectral element method solver components, mesh structures, material models, I/O utilities, and program execution interfaces.

Example usage:

# Default
export PATH=/to/SPECFEMPP/bin:$PATH
# or with cmake --preset <preset_name>
export PATH=/to/SPECFEMPP/bin/<preset_name>:$PATH

specfem --help