specfem::point::assembly_index¶
Datatype used to store index of a quadrature point within an assembled mesh.
-
template<bool using_simd = false>
struct assembly_index¶ Struct to store the assembled index for a quadrature point.
- Template Parameters:
using_simd – Flag to indicate if this is a simd index
SIMD and Non-SIMD Specializations¶
-
template<>
struct assembly_index<false> : public specfem::data_access::Accessor<specfem::data_access::AccessorType::point, specfem::data_access::DataClassType::assembly_index, specfem::dimension::type::dim2, false>¶ Struct to store the assembled index for a quadrature point.
This struct stores a 1D index that corresponds to a global numbering of the quadrature point within the mesh.
Constructors
Constructors for initializing the assembly index.
-
assembly_index() = default¶
Default constructor.
Initializes an empty assembly index.
-
inline assembly_index(const int &iglob)¶
Constructor with global index.
Initializes the assembly index with a specific global index.
- Parameters:
iglob – Global index number of the quadrature point.
Public Members
-
int iglob¶
Global index number of the quadrature point.
This index uniquely identifies the quadrature point within the global mesh numbering system. It is used for gathering and scattering data to global arrays.
-
assembly_index() = default¶
-
template<>
struct assembly_index<true> : public specfem::data_access::Accessor<specfem::data_access::AccessorType::point, specfem::data_access::DataClassType::assembly_index, specfem::dimension::type::dim2, true>¶ Struct to store the SIMD assembled indices for a quadrature point.
SIMD indices are intended to be used for loading
load_on_deviceand storingstore_on_devicedata into SIMD vectors and operating on those data using SIMD instructions.Constructors
Constructors for initializing the SIMD assembly index.
-
assembly_index() = default¶
Default constructor.
Initializes an empty SIMD assembly index.
-
inline assembly_index(const int &iglob, const int &number_points)¶
Constructor with values.
Initializes the SIMD assembly index with a starting global index and the number of valid points.
- Parameters:
iglob – Global index number of the first quadrature point.
number_points – Number of valid points in the SIMD vector.
Public Functions
-
inline bool mask(const std::size_t &lane) const¶
Mask function to determine if a SIMD lane is valid.
Checks if the given lane index is within the valid range of points for this SIMD batch.
- Parameters:
lane – The SIMD lane index to check (0 to vector_width-1).
- Returns:
true if the lane is active/valid, false otherwise.
Public Members
-
int number_points¶
Number of active points in the SIMD vector.
Indicates how many lanes in the SIMD vector contain valid data. This is used for masking operations at boundaries or when the number of points is not a multiple of the SIMD width.
-
int iglob¶
Global index number of the first quadrature point in the SIMD batch.
Represents the starting global index. Subsequent points in the SIMD vector are typically assumed to be contiguous or strided based on the access pattern.
-
assembly_index() = default¶