pyvale 2025.4.0__py3-none-any.whl → 2025.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyvale might be problematic. Click here for more details.

Files changed (153) hide show
  1. pyvale/__init__.py +78 -64
  2. pyvale/analyticmeshgen.py +102 -0
  3. pyvale/{core/analyticsimdatafactory.py → analyticsimdatafactory.py} +44 -16
  4. pyvale/analyticsimdatagenerator.py +323 -0
  5. pyvale/blendercalibrationdata.py +15 -0
  6. pyvale/blenderlightdata.py +26 -0
  7. pyvale/blendermaterialdata.py +15 -0
  8. pyvale/blenderrenderdata.py +30 -0
  9. pyvale/blenderscene.py +488 -0
  10. pyvale/blendertools.py +420 -0
  11. pyvale/{core/camera.py → camera.py} +15 -15
  12. pyvale/{core/cameradata.py → cameradata.py} +27 -22
  13. pyvale/{core/cameradata2d.py → cameradata2d.py} +8 -6
  14. pyvale/camerastereo.py +217 -0
  15. pyvale/{core/cameratools.py → cameratools.py} +220 -26
  16. pyvale/{core/cython → cython}/rastercyth.py +11 -7
  17. pyvale/data/__init__.py +5 -7
  18. pyvale/data/cal_target.tiff +0 -0
  19. pyvale/data/case00_HEX20_out.e +0 -0
  20. pyvale/data/case00_HEX27_out.e +0 -0
  21. pyvale/data/case00_HEX8_out.e +0 -0
  22. pyvale/data/case00_TET10_out.e +0 -0
  23. pyvale/data/case00_TET14_out.e +0 -0
  24. pyvale/data/case00_TET4_out.e +0 -0
  25. pyvale/{core/dataset.py → dataset.py} +91 -16
  26. pyvale/{core/errorcalculator.py → errorcalculator.py} +13 -16
  27. pyvale/{core/errordriftcalc.py → errordriftcalc.py} +14 -14
  28. pyvale/{core/errorintegrator.py → errorintegrator.py} +25 -28
  29. pyvale/{core/errorrand.py → errorrand.py} +39 -46
  30. pyvale/errorsyscalib.py +134 -0
  31. pyvale/{core/errorsysdep.py → errorsysdep.py} +25 -29
  32. pyvale/{core/errorsysfield.py → errorsysfield.py} +59 -52
  33. pyvale/{core/errorsysindep.py → errorsysindep.py} +85 -182
  34. pyvale/examples/__init__.py +5 -7
  35. pyvale/examples/basics/ex1_1_basicscalars_therm2d.py +131 -0
  36. pyvale/examples/basics/ex1_2_sensormodel_therm2d.py +158 -0
  37. pyvale/examples/basics/ex1_3_customsens_therm3d.py +216 -0
  38. pyvale/examples/basics/ex1_4_basicerrors_therm3d.py +153 -0
  39. pyvale/examples/basics/ex1_5_fielderrs_therm3d.py +168 -0
  40. pyvale/examples/basics/ex1_6_caliberrs_therm2d.py +133 -0
  41. pyvale/examples/basics/ex1_7_spatavg_therm2d.py +123 -0
  42. pyvale/examples/basics/ex2_1_basicvectors_disp2d.py +112 -0
  43. pyvale/examples/basics/ex2_2_vectorsens_disp2d.py +111 -0
  44. pyvale/examples/basics/ex2_3_sensangle_disp2d.py +139 -0
  45. pyvale/examples/basics/ex2_4_chainfielderrs_disp2d.py +196 -0
  46. pyvale/examples/basics/ex2_5_vectorfields3d_disp3d.py +109 -0
  47. pyvale/examples/basics/ex3_1_basictensors_strain2d.py +114 -0
  48. pyvale/examples/basics/ex3_2_tensorsens2d_strain2d.py +111 -0
  49. pyvale/examples/basics/ex3_3_tensorsens3d_strain3d.py +182 -0
  50. pyvale/examples/basics/ex4_1_expsim2d_thermmech2d.py +171 -0
  51. pyvale/examples/basics/ex4_2_expsim3d_thermmech3d.py +252 -0
  52. pyvale/examples/{analyticdatagen → genanalyticdata}/ex1_1_scalarvisualisation.py +6 -9
  53. pyvale/examples/{analyticdatagen → genanalyticdata}/ex1_2_scalarcasebuild.py +8 -11
  54. pyvale/examples/{analyticdatagen → genanalyticdata}/ex2_1_analyticsensors.py +9 -12
  55. pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +8 -15
  56. pyvale/examples/renderblender/ex1_1_blenderscene.py +121 -0
  57. pyvale/examples/renderblender/ex1_2_blenderdeformed.py +119 -0
  58. pyvale/examples/renderblender/ex2_1_stereoscene.py +128 -0
  59. pyvale/examples/renderblender/ex2_2_stereodeformed.py +131 -0
  60. pyvale/examples/renderblender/ex3_1_blendercalibration.py +120 -0
  61. pyvale/examples/{rasterisation → renderrasterisation}/ex_rastenp.py +6 -7
  62. pyvale/examples/{rasterisation → renderrasterisation}/ex_rastercyth_oneframe.py +5 -7
  63. pyvale/examples/{rasterisation → renderrasterisation}/ex_rastercyth_static_cypara.py +6 -13
  64. pyvale/examples/{rasterisation → renderrasterisation}/ex_rastercyth_static_pypara.py +9 -12
  65. pyvale/examples/{ex1_4_thermal2d.py → visualisation/ex1_1_plot_traces.py} +33 -20
  66. pyvale/examples/{features/ex_animation_tools_3dmonoblock.py → visualisation/ex2_1_animate_sim.py} +37 -31
  67. pyvale/experimentsimulator.py +175 -0
  68. pyvale/{core/field.py → field.py} +6 -14
  69. pyvale/fieldconverter.py +351 -0
  70. pyvale/{core/fieldsampler.py → fieldsampler.py} +9 -10
  71. pyvale/{core/fieldscalar.py → fieldscalar.py} +17 -18
  72. pyvale/{core/fieldtensor.py → fieldtensor.py} +23 -26
  73. pyvale/{core/fieldtransform.py → fieldtransform.py} +9 -5
  74. pyvale/{core/fieldvector.py → fieldvector.py} +14 -16
  75. pyvale/{core/generatorsrandom.py → generatorsrandom.py} +29 -52
  76. pyvale/{core/imagedef2d.py → imagedef2d.py} +11 -8
  77. pyvale/{core/integratorfactory.py → integratorfactory.py} +12 -13
  78. pyvale/{core/integratorquadrature.py → integratorquadrature.py} +57 -32
  79. pyvale/integratorrectangle.py +165 -0
  80. pyvale/{core/integratorspatial.py → integratorspatial.py} +9 -10
  81. pyvale/{core/integratortype.py → integratortype.py} +7 -8
  82. pyvale/output.py +17 -0
  83. pyvale/pyvaleexceptions.py +11 -0
  84. pyvale/{core/raster.py → raster.py} +8 -8
  85. pyvale/{core/rastercy.py → rastercy.py} +11 -10
  86. pyvale/{core/rasternp.py → rasternp.py} +12 -13
  87. pyvale/{core/rendermesh.py → rendermesh.py} +10 -19
  88. pyvale/{core/sensorarray.py → sensorarray.py} +7 -8
  89. pyvale/{core/sensorarrayfactory.py → sensorarrayfactory.py} +64 -78
  90. pyvale/{core/sensorarraypoint.py → sensorarraypoint.py} +39 -41
  91. pyvale/{core/sensordata.py → sensordata.py} +7 -8
  92. pyvale/sensordescriptor.py +213 -0
  93. pyvale/{core/sensortools.py → sensortools.py} +8 -9
  94. pyvale/simcases/case00_HEX20.i +5 -5
  95. pyvale/simcases/case00_HEX27.i +5 -5
  96. pyvale/simcases/case00_HEX8.i +242 -0
  97. pyvale/simcases/case00_TET10.i +2 -2
  98. pyvale/simcases/case00_TET14.i +2 -2
  99. pyvale/simcases/case00_TET4.i +242 -0
  100. pyvale/simcases/run_1case.py +1 -1
  101. pyvale/simtools.py +67 -0
  102. pyvale/visualexpplotter.py +191 -0
  103. pyvale/{core/visualimagedef.py → visualimagedef.py} +13 -10
  104. pyvale/{core/visualimages.py → visualimages.py} +10 -9
  105. pyvale/visualopts.py +493 -0
  106. pyvale/{core/visualsimanimator.py → visualsimanimator.py} +47 -19
  107. pyvale/visualsimsensors.py +318 -0
  108. pyvale/visualtools.py +136 -0
  109. pyvale/visualtraceplotter.py +142 -0
  110. {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/METADATA +17 -14
  111. pyvale-2025.5.1.dist-info/RECORD +172 -0
  112. {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/WHEEL +1 -1
  113. pyvale/core/__init__.py +0 -7
  114. pyvale/core/analyticmeshgen.py +0 -59
  115. pyvale/core/analyticsimdatagenerator.py +0 -160
  116. pyvale/core/cython/rastercyth.c +0 -32267
  117. pyvale/core/experimentsimulator.py +0 -99
  118. pyvale/core/fieldconverter.py +0 -154
  119. pyvale/core/integratorrectangle.py +0 -88
  120. pyvale/core/optimcheckfuncs.py +0 -153
  121. pyvale/core/sensordescriptor.py +0 -101
  122. pyvale/core/visualexpplotter.py +0 -151
  123. pyvale/core/visualopts.py +0 -180
  124. pyvale/core/visualsimplotter.py +0 -182
  125. pyvale/core/visualtools.py +0 -81
  126. pyvale/core/visualtraceplotter.py +0 -256
  127. pyvale/examples/analyticdatagen/__init__.py +0 -7
  128. pyvale/examples/ex1_1_thermal2d.py +0 -89
  129. pyvale/examples/ex1_2_thermal2d.py +0 -111
  130. pyvale/examples/ex1_3_thermal2d.py +0 -113
  131. pyvale/examples/ex1_5_thermal2d.py +0 -105
  132. pyvale/examples/ex2_1_thermal3d .py +0 -87
  133. pyvale/examples/ex2_2_thermal3d.py +0 -51
  134. pyvale/examples/ex2_3_thermal3d.py +0 -109
  135. pyvale/examples/ex3_1_displacement2d.py +0 -47
  136. pyvale/examples/ex3_2_displacement2d.py +0 -79
  137. pyvale/examples/ex3_3_displacement2d.py +0 -104
  138. pyvale/examples/ex3_4_displacement2d.py +0 -105
  139. pyvale/examples/ex4_1_strain2d.py +0 -57
  140. pyvale/examples/ex4_2_strain2d.py +0 -79
  141. pyvale/examples/ex4_3_strain2d.py +0 -100
  142. pyvale/examples/ex5_1_multiphysics2d.py +0 -78
  143. pyvale/examples/ex6_1_multiphysics2d_expsim.py +0 -118
  144. pyvale/examples/ex6_2_multiphysics3d_expsim.py +0 -158
  145. pyvale/examples/features/__init__.py +0 -7
  146. pyvale/examples/features/ex_area_avg.py +0 -89
  147. pyvale/examples/features/ex_calibration_error.py +0 -108
  148. pyvale/examples/features/ex_chain_field_errs.py +0 -141
  149. pyvale/examples/features/ex_field_errs.py +0 -78
  150. pyvale/examples/features/ex_sensor_single_angle_batch.py +0 -110
  151. pyvale-2025.4.0.dist-info/RECORD +0 -157
  152. {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/licenses/LICENSE +0 -0
  153. {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,12 @@
1
- """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
7
- """
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
8
7
  from abc import ABC, abstractmethod
9
8
  import numpy as np
10
- from pyvale.core.sensordata import SensorData
9
+ from pyvale.sensordata import SensorData
11
10
 
12
11
 
13
12
  def create_int_pt_array(sens_data: SensorData,
@@ -72,7 +71,7 @@ class IIntegratorSpatial(ABC):
72
71
  Array of simulated sensor measurements. shape=(num_sensors,
73
72
  num_field_components,num_time_steps).
74
73
  """
75
- pass
74
+
76
75
 
77
76
  @abstractmethod
78
77
  def get_averages(self) -> np.ndarray:
@@ -86,5 +85,5 @@ class IIntegratorSpatial(ABC):
86
85
  Array of simulated sensor measurements. shape=(num_sensors,
87
86
  num_field_components,num_time_steps).
88
87
  """
89
- pass
88
+
90
89
 
@@ -1,10 +1,9 @@
1
- """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
7
- """
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
8
7
  import enum
9
8
 
10
9
 
@@ -25,7 +24,7 @@ class EIntSpatialType(enum.Enum):
25
24
  Gaussian quadrature 2D integrator over 4 points.
26
25
 
27
26
  QUAD9PT
28
- Gaussia quadrature 2D integrator over 9 points.
27
+ Gaussian quadrature 2D integrator over 9 points.
29
28
  """
30
29
 
31
30
  RECT1PT = enum.auto()
pyvale/output.py ADDED
@@ -0,0 +1,17 @@
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+ from dataclasses import dataclass
7
+ from pathlib import Path
8
+
9
+ """
10
+ NOTE: this module is a feature under developement.
11
+ """
12
+
13
+ # TODO: remove this? but check blender tests
14
+
15
+ @dataclass(slots=True)
16
+ class Outputs():
17
+ base_dir = Path.home()
@@ -0,0 +1,11 @@
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
7
+ class BlenderError(Exception):
8
+ pass
9
+
10
+ class VisError(Exception):
11
+ pass
@@ -1,16 +1,16 @@
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
1
7
  """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
8
+ NOTE: this module is a feature under developement.
7
9
  """
10
+
8
11
  from abc import ABC, abstractmethod
9
12
  import numpy as np
10
13
 
11
- # NOTE: This module is a feature under developement.
12
-
13
-
14
14
  # NOTE:
15
15
  # - Need to render a single frame static/deformed
16
16
  # - Need to render all frames static/deformed
@@ -1,18 +1,19 @@
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
1
7
  """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
8
+ NOTE: this module is a feature under developement.
7
9
  """
10
+
8
11
  from pathlib import Path
9
12
  from multiprocessing.pool import Pool
10
13
  import numpy as np
11
- from pyvale.core.cameradata import CameraData
12
- from pyvale.core.rendermesh import RenderMeshData
13
- import pyvale.core.cython.rastercyth as rastercyth
14
-
15
- # NOTE: This module is a feature under developement.
14
+ from pyvale.cameradata import CameraData
15
+ from pyvale.rendermesh import RenderMeshData
16
+ import pyvale.cython.rastercyth as rastercyth
16
17
 
17
18
  class RasterCY:
18
19
  @staticmethod
@@ -1,22 +1,21 @@
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
1
7
  """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
8
+ NOTE: this module is a feature under developement.
7
9
  """
10
+
8
11
  from pathlib import Path
9
12
  from multiprocessing.pool import Pool
10
13
  import numpy as np
11
14
  import numba
12
- from pyvale.core.cameradata import CameraData
13
- from pyvale.core.cameratools import CameraTools
14
- from pyvale.core.rendermesh import RenderMeshData
15
- import pyvale.core.cython.rastercyth as rastercyth
16
-
17
-
18
- # NOTE: This module is a feature under developement.
19
-
15
+ from pyvale.cameradata import CameraData
16
+ from pyvale.cameratools import CameraTools
17
+ from pyvale.rendermesh import RenderMeshData
18
+ import pyvale.cython.rastercyth as rastercyth
20
19
 
21
20
  class RasterNP:
22
21
  @staticmethod
@@ -1,27 +1,18 @@
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
1
7
  """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
8
+ NOTE: this module is a feature under developement.
7
9
  """
10
+
8
11
  from enum import Enum
9
12
  from dataclasses import dataclass, field
10
13
  import numpy as np
11
14
  import mooseherder as mh
12
- from pyvale.core.fieldconverter import simdata_to_pyvista
13
-
14
-
15
- # class ImageFormat(Enum):
16
- # NPY = 0
17
- # TIFF = 1
18
-
19
- # @dataclass(slots=True)
20
- # class RenderOpts:
21
- # image_tag: str = "image"
22
- # image_formats: tuple[ImageFormat,...]
23
- # bits_per_unit: int = 1
24
- # parallel: int | None = None
15
+ from pyvale.fieldconverter import simdata_to_pyvista
25
16
 
26
17
 
27
18
  @dataclass(slots=True)
@@ -64,7 +55,7 @@ def create_render_mesh(sim_data: mh.SimData,
64
55
 
65
56
  (pv_grid,_) = simdata_to_pyvista(sim_data,
66
57
  extract_keys,
67
- spat_dim=sim_spat_dim)
58
+ elem_dims=sim_spat_dim)
68
59
 
69
60
  pv_surf = pv_grid.extract_surface()
70
61
  faces = np.array(pv_surf.faces)
@@ -1,13 +1,12 @@
1
- """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
7
- """
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
8
7
  from abc import ABC, abstractmethod
9
8
  import numpy as np
10
- from pyvale.core.field import IField
9
+ from pyvale.field import IField
11
10
 
12
11
 
13
12
  class ISensorArray(ABC):
@@ -1,26 +1,27 @@
1
- """
2
- ================================================================================
3
- pyvale: the python validation engine
4
- License: MIT
5
- Copyright (C) 2025 The Computer Aided Validation Team
6
- ================================================================================
7
- """
1
+ # ==============================================================================
2
+ # pyvale: the python validation engine
3
+ # License: MIT
4
+ # Copyright (C) 2025 The Computer Aided Validation Team
5
+ # ==============================================================================
6
+
8
7
  import numpy as np
9
8
 
10
9
  import mooseherder as mh
11
10
 
12
- from pyvale.core.fieldscalar import FieldScalar
13
- from pyvale.core.fieldvector import FieldVector
14
- from pyvale.core.fieldtensor import FieldTensor
15
- from pyvale.core.sensordescriptor import SensorDescriptorFactory
16
- from pyvale.core.sensorarraypoint import SensorArrayPoint, SensorData
17
- from pyvale.core.errorintegrator import ErrIntegrator
18
- from pyvale.core.errorsysindep import ErrSysUniformPercent
19
- from pyvale.core.errorrand import ErrRandNormPercent
20
- from pyvale.core.errorsysdep import (ErrSysDigitisation,
11
+ from pyvale.fieldscalar import FieldScalar
12
+ from pyvale.fieldvector import FieldVector
13
+ from pyvale.fieldtensor import FieldTensor
14
+ from pyvale.sensordescriptor import SensorDescriptorFactory
15
+ from pyvale.sensorarraypoint import SensorArrayPoint, SensorData
16
+ from pyvale.errorintegrator import ErrIntegrator
17
+ from pyvale.errorsysindep import ErrSysUnifPercent
18
+ from pyvale.errorrand import ErrRandNormPercent
19
+ from pyvale.errorsysdep import (ErrSysDigitisation,
21
20
  ErrSysSaturation)
22
21
 
23
- #TODO: Docstrings
22
+ # TODO:
23
+ # - docstrings
24
+ # - more sensor models
24
25
 
25
26
  class SensorArrayFactory:
26
27
  """Namespace for static methods used to build common types of sensor arrays
@@ -30,35 +31,13 @@ class SensorArrayFactory:
30
31
  @staticmethod
31
32
  def thermocouples_no_errs(sim_data: mh.SimData,
32
33
  sensor_data: SensorData,
34
+ elem_dims: int,
33
35
  field_name: str = "temperature",
34
- spat_dims: int = 3,
35
36
  ) -> SensorArrayPoint:
36
- """Builds and returns a point sensor array with common parameters used
37
- for thermocouples applied to a temperature field without any simulated
38
- measurement errors. Allows the user to build and attach their own error
39
- chain or use this for fast interpolation to sensor locations without
40
- errors.
41
-
42
- Parameters
43
- ----------
44
- sim_data : mh.SimData
45
- Simulation data containing a mesh and a temperature field for the
46
- thermocouple array to sample.
47
- sensor_data : SensorData
48
- _description_
49
- field_name : str, optional
50
- _description_, by default "temperature"
51
- spat_dims : int, optional
52
- , by default 3
53
-
54
- Returns
55
- -------
56
- SensorArrayPoint
57
- _description_
58
- """
37
+
59
38
  descriptor = SensorDescriptorFactory.temperature_descriptor()
60
39
 
61
- t_field = FieldScalar(sim_data,field_name,spat_dims)
40
+ t_field = FieldScalar(sim_data,field_name,elem_dims)
62
41
 
63
42
  sens_array = SensorArrayPoint(sensor_data,
64
43
  t_field,
@@ -69,19 +48,20 @@ class SensorArrayFactory:
69
48
  @staticmethod
70
49
  def thermocouples_basic_errs(sim_data: mh.SimData,
71
50
  sensor_data: SensorData,
51
+ elem_dims: int,
72
52
  field_name: str = "temperature",
73
- spat_dims: int = 3,
74
53
  errs_pc: float = 1.0
75
54
  ) -> SensorArrayPoint:
76
55
 
77
56
  sens_array = SensorArrayFactory.thermocouples_no_errs(sim_data,
78
57
  sensor_data,
79
- field_name,
80
- spat_dims)
58
+ elem_dims,
59
+ field_name)
81
60
 
82
61
  err_int = basic_err_integrator(sens_array.get_measurement_shape(),
83
62
  sensor_data,
84
- errs_pc)
63
+ sys_err_pc=errs_pc,
64
+ rand_err_pc=errs_pc)
85
65
 
86
66
  # Normal thermcouple amp = 5mV / K
87
67
  err_int._err_chain.append(ErrSysDigitisation(bits_per_unit=2**16/1000))
@@ -90,19 +70,22 @@ class SensorArrayFactory:
90
70
  sens_array.set_error_integrator(err_int)
91
71
  return sens_array
92
72
 
73
+
74
+
93
75
  @staticmethod
94
76
  def disp_sensors_no_errs(sim_data: mh.SimData,
95
- sensor_data: SensorData,
96
- field_name: str = "displacement",
97
- spat_dims: int = 3,
98
- ) -> SensorArrayPoint:
77
+ sensor_data: SensorData,
78
+ elem_dims: int,
79
+ field_name: str,
80
+ field_comps: tuple[str,...],
81
+ ) -> SensorArrayPoint:
99
82
 
100
83
  descriptor = SensorDescriptorFactory.displacement_descriptor()
101
84
 
102
85
  disp_field = FieldVector(sim_data,
103
86
  field_name,
104
- ('disp_x','disp_y'),
105
- spat_dims)
87
+ field_comps,
88
+ elem_dims)
106
89
 
107
90
  sens_array = SensorArrayPoint(sensor_data,
108
91
  disp_field,
@@ -113,18 +96,21 @@ class SensorArrayFactory:
113
96
  @staticmethod
114
97
  def disp_sensors_basic_errs(sim_data: mh.SimData,
115
98
  sensor_data: SensorData,
116
- field_name: str = "displacement",
117
- spat_dims: int = 3,
118
- errs_pc: float = 1
99
+ elem_dims: int,
100
+ field_name: str,
101
+ field_comps: tuple[str,...],
102
+ errs_pc: float = 1.0,
119
103
  ) -> SensorArrayPoint:
120
104
 
121
105
  sens_array = SensorArrayFactory.disp_sensors_no_errs(sim_data,
122
- sensor_data,
123
- field_name,
124
- spat_dims)
106
+ sensor_data,
107
+ elem_dims,
108
+ field_name,
109
+ field_comps)
125
110
  err_int = basic_err_integrator(sens_array.get_measurement_shape(),
126
111
  sensor_data,
127
- errs_pc)
112
+ sys_err_pc=errs_pc,
113
+ rand_err_pc=errs_pc)
128
114
  sens_array.set_error_integrator(err_int)
129
115
 
130
116
  return sens_array
@@ -132,23 +118,18 @@ class SensorArrayFactory:
132
118
  @staticmethod
133
119
  def strain_gauges_no_errs(sim_data: mh.SimData,
134
120
  sensor_data: SensorData,
135
- field_name: str = "strain",
136
- spat_dims: int = 3
121
+ elem_dims: int,
122
+ field_name: str,
123
+ norm_comps: tuple[str,...],
124
+ dev_comps: tuple[str,...]
137
125
  ) -> SensorArrayPoint:
138
- descriptor = SensorDescriptorFactory.strain_descriptor(spat_dims)
139
-
140
- if spat_dims == 2:
141
- norm_components = ('strain_xx','strain_yy')
142
- dev_components = ('strain_xy',)
143
- else:
144
- norm_components = ('strain_xx','strain_yy','strain_zz')
145
- dev_components = ('strain_xy','strain_yz','strain_xz')
126
+ descriptor = SensorDescriptorFactory.strain_descriptor(elem_dims)
146
127
 
147
128
  strain_field = FieldTensor(sim_data,
148
- field_name,
149
- norm_components,
150
- dev_components,
151
- spat_dims)
129
+ field_name,
130
+ norm_comps,
131
+ dev_comps,
132
+ elem_dims)
152
133
 
153
134
  sens_array = SensorArrayPoint(sensor_data,
154
135
  strain_field,
@@ -160,19 +141,24 @@ class SensorArrayFactory:
160
141
  @staticmethod
161
142
  def strain_gauges_basic_errs(sim_data: mh.SimData,
162
143
  sensor_data: SensorData,
163
- field_name: str = "strain",
164
- spat_dims: int = 3,
144
+ elem_dims: int,
145
+ field_name: str,
146
+ norm_comps: tuple[str,...],
147
+ dev_comps: tuple[str,...],
165
148
  errs_pc: float = 1.0
166
149
  ) -> SensorArrayPoint:
167
150
 
168
151
  sens_array = SensorArrayFactory.strain_gauges_no_errs(sim_data,
169
152
  sensor_data,
153
+ elem_dims,
170
154
  field_name,
171
- spat_dims)
155
+ norm_comps,
156
+ dev_comps)
172
157
 
173
158
  err_int = basic_err_integrator(sens_array.get_measurement_shape(),
174
159
  sensor_data,
175
- errs_pc)
160
+ sys_err_pc=errs_pc,
161
+ rand_err_pc=errs_pc)
176
162
  sens_array.set_error_integrator(err_int)
177
163
 
178
164
  return sens_array
@@ -204,7 +190,7 @@ def basic_err_integrator(meas_shape: np.ndarray,
204
190
  a normal percentage random error.
205
191
  """
206
192
  err_chain = []
207
- err_chain.append(ErrSysUniformPercent(-sys_err_pc,sys_err_pc))
193
+ err_chain.append(ErrSysUnifPercent(-sys_err_pc,sys_err_pc))
208
194
  err_chain.append(ErrRandNormPercent(rand_err_pc))
209
195
  err_int = ErrIntegrator(err_chain,sensor_data,meas_shape)
210
196
  return err_int