fenicsxconcrete.sensor_definition package

Submodules

fenicsxconcrete.sensor_definition.base_sensor module

class BaseSensor(name: str | None = None)[source]

Bases: ABC, LogMixin

Template for a sensor object

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

abstractmethod static base_unit() Unit[source]

Defines the base unit of this sensor

get_data_at_time(t: float) Quantity[source]

Returns the measured data at a specific time

Returns:

measured data at the specified time with the unit

Raises:

ValueError – If there is no value t in time list

get_data_list() Quantity[list][source]

Returns the measured data with respective unit

Returns:

measured data list with respective unit

get_last_entry() Quantity[source]

Returns the measured data with respective unit

Returns:

the measured data list with the respective unit

Raises:

RuntimeError – If the data list is empty

get_time_list() Quantity[list][source]

Returns the time data with respective unit

Returns:

the time stamp list with the respective unit

abstractmethod measure(problem) None[source]

Needs to be implemented in child, depends on the sensor

This function is called, when the sensor adds the data to the data list.

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

set_units(units: str) None[source]

sets the units which the sensor should return

the unit must match the dimensionality of the base unit

Parameters:

units – name of the units to convert to, must be defined in pint unit registry

class PointSensor(where: list[int | float], name: str | None = None)[source]

Bases: BaseSensor

Abstract class for a sensor that measures values at a specific point

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

where

location where the value is measured

abstractmethod static base_unit() Unit[source]

Defines the base unit of this sensor, must be specified by child

abstractmethod measure(problem) None[source]

Needs to be implemented in child, depending on the sensor

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

fenicsxconcrete.sensor_definition.displacement_sensor module

class DisplacementSensor(where: list[int | float], name: str | None = None)[source]

Bases: PointSensor

A sensor that measures displacement at a specific point

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

where

location where the value is measured

static base_unit() <pint.registry.UnitRegistry object at 0x7700084cc830>[source]

Defines the base unit of this sensor

Returns:

the base unit as pint unit object

measure(problem: MaterialProblem) None[source]

The displacement value at the defined point is added to the data list, as well as the time t to the time list

Parameters:
  • problem – FEM problem object

  • t – time of measurement for time dependent problems, default is 1

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

fenicsxconcrete.sensor_definition.doh_sensor module

fenicsxconcrete.sensor_definition.reaction_force_sensor module

class ReactionForceSensor(surface: Surface | None = None, name: str | None = None)[source]

Bases: BaseSensor

A sensor that measures the reaction force at a specified surface

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

surface

dictionary that defines the surface where the reaction force is measured

Parameters:
  • surface – a dictionary that defines the function for the reaction boundary, default is the bottom surface

  • name – name of the sensor, default is class name, but can be changed

static base_unit() <pint.registry.UnitRegistry object at 0x7700084cc830>[source]

Defines the base unit of this sensor

Returns:

the base unit as pint unit object

measure(problem: MaterialProblem) None[source]

The reaction force vector of the defined surface is added to the data list, as well as the time t to the time list

Parameters:
  • problem – FEM problem object

  • t – time of measurement for time dependent problems, default is 1

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

class Surface[source]

Bases: TypedDict

A typed dictionary class to define a surface

function

name of the function to be called to ge the surface

Type:

str

args

additional arguments to be passed to such a function

Type:

dict

args: dict
function: str

fenicsxconcrete.sensor_definition.sensor_schema module

generate_sensor_schema() dict[source]

Function that returns the sensor schema. Necessary to include the schema in the package accessible.

Returns:

Schema for sensor’s list metadata

fenicsxconcrete.sensor_definition.strain_sensor module

class StrainSensor(where: list[int | float], name: str | None = None)[source]

Bases: PointSensor

A sensor that measures strain at a specific point

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

where

location where the value is measured

static base_unit() <pint.registry.UnitRegistry object at 0x7700084cc830>[source]

Defines the base unit of this sensor

Returns:

the base unit as pint unit object

measure(problem: MaterialProblem) None[source]

The strain value at the defined point is added to the data list, as well as the time t to the time list

Parameters:
  • problem – FEM problem object

  • t – time of measurement for time dependent problems, default is 1

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

fenicsxconcrete.sensor_definition.stress_sensor module

class StressSensor(where: list[int | float], name: str | None = None)[source]

Bases: PointSensor

A sensor that measures stress at a specific point

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

where

location where the value is measured

static base_unit() <pint.registry.UnitRegistry object at 0x7700084cc830>[source]

Defines the base unit of this sensor

Returns:

the base unit as pint unit object

measure(problem: MaterialProblem) None[source]

The stress value at the defined point is added to the data list, as well as the time t to the time list

Parameters:
  • problem – FEM problem object

  • t – time of measurement for time dependent problems, default is 1

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

fenicsxconcrete.sensor_definition.temperature_sensor module

fenicsxconcrete.sensor_definition.youngs_modulus_sensor module

class YoungsModulusSensor(where: list[int | float], name: str | None = None)[source]

Bases: PointSensor

A sensor that measures degree of hydration at a specific point

data

list of measured values

time

list of time stamps

units

pint definition of the base unit a sensor returns

name

name of the sensor, default is class name, but can be changed

where

location where the value is measured

static base_unit() <pint.registry.UnitRegistry object at 0x7700084cc830>[source]

Defines the base unit of this sensor

Returns:

the base unit as pint unit object

measure(problem: MaterialProblem) None[source]

The degree of hydration value at the defined point is added to the data list, as well as the time t to the time list

Parameters:
  • problem – FEM problem object

  • t – time of measurement for time dependent problems, default is 1

report_metadata() dict[source]

Generates dictionary with the metadata of this sensor

Module contents