integratorfactory¶
- class pyvale.integratorfactory.IntegratorSpatialFactory[source]¶
Bases:
object
Namespace for static methods used to build 2D spatial integrators. These integrators are used to simulate spatial averaging for sensors.
- static quad_2d_4pt(field: IField, sensor_data: SensorData) Quadrature2D [source]¶
Builds and returns a Gaussian quadrature spatal integrator based on a rectangular area with four integration points.
- Parameters:
field (IField) -- Interface specifying the physical field that the integrator will sample from.
sensor_data (SensorData) -- Sensor data specifying the location of the sensors that will be used for the spatial integration
- Returns:
Quadrature2D -- Quadrature integrator that can be used to sample the physical field at specified locations.
- static quad_2d_9pt(field: IField, sensor_data: SensorData) Quadrature2D [source]¶
Builds and returns a Gaussian quadrature spatal integrator based on a rectangular area with nine integration points.
- Parameters:
field (IField) -- Interface specifying the physical field that the integrator will sample from.
sensor_data (SensorData) -- Sensor data specifying the location of the sensors that will be used for the spatial integration
- Returns:
Quadrature2D -- Quadrature integrator that can be used to sample the physical field at specified locations.
- static rect_2d_1pt(field: IField, sensor_data: SensorData) Rectangle2D [source]¶
Builds and returns a 2D rectangular spatial integrator with a single integration point.
- Parameters:
field (IField) -- Interface specifying the physical field that the integrator will sample from.
sensor_data (SensorData) -- Sensor data specifying the location of the sensors that will be used for the spatial integration
- Returns:
Rectangle2D -- Rectangular spatial integrator that can sample the specified physical field at specified locations
- static rect_2d_4pt(field: IField, sensor_data: SensorData) Rectangle2D [source]¶
Builds and returns a 2D rectangular spatial integrator with four equally spaced integration points in a grid pattern.
- Parameters:
field (IField) -- Interface specifying the physical field that the integrator will sample from.
sensor_data (SensorData) -- Sensor data specifying the location of the sensors that will be used for the spatial integration
- Returns:
Rectangle2D -- Rectangular spatial integrator that can sample the specified physical field at specified locations
- static rect_2d_9pt(field: IField, sensor_data: SensorData) Rectangle2D [source]¶
Builds and returns a 2D rectangular spatial integrator with nine equally spaced integration points in a grid pattern.
- Parameters:
field (IField) -- Interface specifying the physical field that the integrator will sample from.
sensor_data (SensorData) -- Sensor data specifying the location of the sensors that will be used for the spatial integration
- Returns:
Rectangle2D -- Rectangular spatial integrator that can sample the specified physical field at specified locations
- pyvale.integratorfactory.build_spatial_averager(field: IField, sensor_data: SensorData) IIntegratorSpatial | None [source]¶
Helper function to build a spatial integrator based on the "EIntSpatialType" enumeration in the SensorData object. Separates the spatial integration object from the SensorData object.
- Parameters:
field (IField) -- Physical field that will be sampled by the spatial averager.
sensor_data (SensorData) -- Sensor data containing the type of spatial integrator to build in the sensor_data.spatial_averager as an EIntSpatialType enumeration.
- Returns:
IIntegratorSpatial | None -- The spatial averager that will sample the physical field at the specified sensor locations. If sensor_data.spatial_averager or sensor_data.spatial_dims are None then it is not possible to build a spatial integrator and None is returned.