integratorfactory.py

class 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 rect_2d_1pt(field, sensor_data)[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, sensor_data)[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, sensor_data)[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

static quad_2d_4pt(field, sensor_data)[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, sensor_data)[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.

build_spatial_averager(field, sensor_data)[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.