specfem::assembly::sources_impl::locate_sources¶
Locate seismic sources within the finite element mesh.
Maps source global coordinates to local element coordinates and assigns medium tags based on element classification.
std::vector<std::shared_ptr<specfem::sources::source<specfem::element::dimension_tag::dim2>>> sources; // ... populate sources locate_sources<specfem::element::dimension_tag::dim2>(element_types, mesh, sources);
Note
This function is an implementation detail and should be only called within specfem::assembly::sources construction.
- Template Parameters:
DimensionTag – Spatial dimension (
dim2ordim3)- Parameters:
element_types – Element classification data (medium, property, boundary types)
mesh – Finite element mesh with coordinates and connectivity
sources – [in,out] Source objects to locate. Input: coordinates and time functions. Output: assigned element indices and medium tags.
- Throws:
std::runtime_error – If source cannot be located within mesh domain
std::invalid_argument – If coordinates are invalid or mesh is malformed