Vector Source Implementation

2D Vector Sources

void specfem::assembly::compute_source_array_impl::from_vector(const specfem::sources::vector_source<specfem::dimension::type::dim2> &source, Kokkos::View<type_real***, Kokkos::LayoutRight, Kokkos::HostSpace> source_array)

Compute source array for a 2D vector source using Lagrange interpolation.

Algorithm:

  1. Extract GLL quadrature points from source_array dimensions

  2. Compute Lagrange interpolants at source location (xi, gamma)

  3. Distribute force vector to GLL points weighted by interpolant products

Evaluates Lagrange basis functions at the source location and distributes force vector components to GLL quadrature points.

For a source at local coordinates \( (\xi_s, \gamma_s) \) with force vector \( \mathbf{f} \), the source array is: \( S_{i,jz,jx} = L_{jx}(\xi_s) L_{jz}(\gamma_s) f_i \)

where \( L_{jx}(\xi_s) \) is the Lagrange polynomial evaluated at the source location.

Note

source_array values are non-zero only at the source’s element location. The magnitude at each GLL point equals the force vector component scaled by the Lagrange interpolant product.

Parameters:
  • source – Vector source containing force components and local coordinates

  • source_array – Output array of shape (ncomponents, ngllz, ngllx)

3D Vector Sources

void specfem::assembly::compute_source_array_impl::from_vector(const specfem::sources::vector_source<specfem::dimension::type::dim3> &source, Kokkos::View<type_real****, Kokkos::LayoutRight, Kokkos::HostSpace> source_array)

Compute source array for a 3D vector source using Lagrange interpolation.

Algorithm:

  1. Extract GLL quadrature points from source_array dimensions

  2. Compute Lagrange interpolants at source location (xi, eta, gamma)

  3. Distribute force vector to GLL points weighted by Lagrange interpolants

Evaluates Lagrange basis functions at the source location and distributes force vector components to GLL quadrature points.

For a source at local coordinates \( (\xi_s, \eta_s, \gamma_s) \) with force vector \( \mathbf{f} \), the source array is: \( S_{i,jz,jy,jx} = L_{jx}(\xi_s) L_{jy}(\eta_s) L_{jz}(\gamma_s) f_i \)

where \( L_{jx}(\xi_s) \) is the Lagrange polynomial evaluated at the source location.

Note

source_array values are non-zero only at the source’s element location. The magnitude at each GLL point equals the force vector component scaled by the Lagrange interpolant product.

Parameters:
  • source – Vector source containing force components and local coordinates

  • source_array – Output array of shape (ncomponents, ngllz, nglly, ngllx)