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.
- pyvale/__init__.py +78 -64
- pyvale/analyticmeshgen.py +102 -0
- pyvale/{core/analyticsimdatafactory.py → analyticsimdatafactory.py} +44 -16
- pyvale/analyticsimdatagenerator.py +323 -0
- pyvale/blendercalibrationdata.py +15 -0
- pyvale/blenderlightdata.py +26 -0
- pyvale/blendermaterialdata.py +15 -0
- pyvale/blenderrenderdata.py +30 -0
- pyvale/blenderscene.py +488 -0
- pyvale/blendertools.py +420 -0
- pyvale/{core/camera.py → camera.py} +15 -15
- pyvale/{core/cameradata.py → cameradata.py} +27 -22
- pyvale/{core/cameradata2d.py → cameradata2d.py} +8 -6
- pyvale/camerastereo.py +217 -0
- pyvale/{core/cameratools.py → cameratools.py} +220 -26
- pyvale/{core/cython → cython}/rastercyth.py +11 -7
- pyvale/data/__init__.py +5 -7
- pyvale/data/cal_target.tiff +0 -0
- pyvale/data/case00_HEX20_out.e +0 -0
- pyvale/data/case00_HEX27_out.e +0 -0
- pyvale/data/case00_HEX8_out.e +0 -0
- pyvale/data/case00_TET10_out.e +0 -0
- pyvale/data/case00_TET14_out.e +0 -0
- pyvale/data/case00_TET4_out.e +0 -0
- pyvale/{core/dataset.py → dataset.py} +91 -16
- pyvale/{core/errorcalculator.py → errorcalculator.py} +13 -16
- pyvale/{core/errordriftcalc.py → errordriftcalc.py} +14 -14
- pyvale/{core/errorintegrator.py → errorintegrator.py} +25 -28
- pyvale/{core/errorrand.py → errorrand.py} +39 -46
- pyvale/errorsyscalib.py +134 -0
- pyvale/{core/errorsysdep.py → errorsysdep.py} +25 -29
- pyvale/{core/errorsysfield.py → errorsysfield.py} +59 -52
- pyvale/{core/errorsysindep.py → errorsysindep.py} +85 -182
- pyvale/examples/__init__.py +5 -7
- pyvale/examples/basics/ex1_1_basicscalars_therm2d.py +131 -0
- pyvale/examples/basics/ex1_2_sensormodel_therm2d.py +158 -0
- pyvale/examples/basics/ex1_3_customsens_therm3d.py +216 -0
- pyvale/examples/basics/ex1_4_basicerrors_therm3d.py +153 -0
- pyvale/examples/basics/ex1_5_fielderrs_therm3d.py +168 -0
- pyvale/examples/basics/ex1_6_caliberrs_therm2d.py +133 -0
- pyvale/examples/basics/ex1_7_spatavg_therm2d.py +123 -0
- pyvale/examples/basics/ex2_1_basicvectors_disp2d.py +112 -0
- pyvale/examples/basics/ex2_2_vectorsens_disp2d.py +111 -0
- pyvale/examples/basics/ex2_3_sensangle_disp2d.py +139 -0
- pyvale/examples/basics/ex2_4_chainfielderrs_disp2d.py +196 -0
- pyvale/examples/basics/ex2_5_vectorfields3d_disp3d.py +109 -0
- pyvale/examples/basics/ex3_1_basictensors_strain2d.py +114 -0
- pyvale/examples/basics/ex3_2_tensorsens2d_strain2d.py +111 -0
- pyvale/examples/basics/ex3_3_tensorsens3d_strain3d.py +182 -0
- pyvale/examples/basics/ex4_1_expsim2d_thermmech2d.py +171 -0
- pyvale/examples/basics/ex4_2_expsim3d_thermmech3d.py +252 -0
- pyvale/examples/{analyticdatagen → genanalyticdata}/ex1_1_scalarvisualisation.py +6 -9
- pyvale/examples/{analyticdatagen → genanalyticdata}/ex1_2_scalarcasebuild.py +8 -11
- pyvale/examples/{analyticdatagen → genanalyticdata}/ex2_1_analyticsensors.py +9 -12
- pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +8 -15
- pyvale/examples/renderblender/ex1_1_blenderscene.py +121 -0
- pyvale/examples/renderblender/ex1_2_blenderdeformed.py +119 -0
- pyvale/examples/renderblender/ex2_1_stereoscene.py +128 -0
- pyvale/examples/renderblender/ex2_2_stereodeformed.py +131 -0
- pyvale/examples/renderblender/ex3_1_blendercalibration.py +120 -0
- pyvale/examples/{rasterisation → renderrasterisation}/ex_rastenp.py +6 -7
- pyvale/examples/{rasterisation → renderrasterisation}/ex_rastercyth_oneframe.py +5 -7
- pyvale/examples/{rasterisation → renderrasterisation}/ex_rastercyth_static_cypara.py +6 -13
- pyvale/examples/{rasterisation → renderrasterisation}/ex_rastercyth_static_pypara.py +9 -12
- pyvale/examples/{ex1_4_thermal2d.py → visualisation/ex1_1_plot_traces.py} +33 -20
- pyvale/examples/{features/ex_animation_tools_3dmonoblock.py → visualisation/ex2_1_animate_sim.py} +37 -31
- pyvale/experimentsimulator.py +175 -0
- pyvale/{core/field.py → field.py} +6 -14
- pyvale/fieldconverter.py +351 -0
- pyvale/{core/fieldsampler.py → fieldsampler.py} +9 -10
- pyvale/{core/fieldscalar.py → fieldscalar.py} +17 -18
- pyvale/{core/fieldtensor.py → fieldtensor.py} +23 -26
- pyvale/{core/fieldtransform.py → fieldtransform.py} +9 -5
- pyvale/{core/fieldvector.py → fieldvector.py} +14 -16
- pyvale/{core/generatorsrandom.py → generatorsrandom.py} +29 -52
- pyvale/{core/imagedef2d.py → imagedef2d.py} +11 -8
- pyvale/{core/integratorfactory.py → integratorfactory.py} +12 -13
- pyvale/{core/integratorquadrature.py → integratorquadrature.py} +57 -32
- pyvale/integratorrectangle.py +165 -0
- pyvale/{core/integratorspatial.py → integratorspatial.py} +9 -10
- pyvale/{core/integratortype.py → integratortype.py} +7 -8
- pyvale/output.py +17 -0
- pyvale/pyvaleexceptions.py +11 -0
- pyvale/{core/raster.py → raster.py} +8 -8
- pyvale/{core/rastercy.py → rastercy.py} +11 -10
- pyvale/{core/rasternp.py → rasternp.py} +12 -13
- pyvale/{core/rendermesh.py → rendermesh.py} +10 -19
- pyvale/{core/sensorarray.py → sensorarray.py} +7 -8
- pyvale/{core/sensorarrayfactory.py → sensorarrayfactory.py} +64 -78
- pyvale/{core/sensorarraypoint.py → sensorarraypoint.py} +39 -41
- pyvale/{core/sensordata.py → sensordata.py} +7 -8
- pyvale/sensordescriptor.py +213 -0
- pyvale/{core/sensortools.py → sensortools.py} +8 -9
- pyvale/simcases/case00_HEX20.i +5 -5
- pyvale/simcases/case00_HEX27.i +5 -5
- pyvale/simcases/case00_HEX8.i +242 -0
- pyvale/simcases/case00_TET10.i +2 -2
- pyvale/simcases/case00_TET14.i +2 -2
- pyvale/simcases/case00_TET4.i +242 -0
- pyvale/simcases/run_1case.py +1 -1
- pyvale/simtools.py +67 -0
- pyvale/visualexpplotter.py +191 -0
- pyvale/{core/visualimagedef.py → visualimagedef.py} +13 -10
- pyvale/{core/visualimages.py → visualimages.py} +10 -9
- pyvale/visualopts.py +493 -0
- pyvale/{core/visualsimanimator.py → visualsimanimator.py} +47 -19
- pyvale/visualsimsensors.py +318 -0
- pyvale/visualtools.py +136 -0
- pyvale/visualtraceplotter.py +142 -0
- {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/METADATA +17 -14
- pyvale-2025.5.1.dist-info/RECORD +172 -0
- {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/WHEEL +1 -1
- pyvale/core/__init__.py +0 -7
- pyvale/core/analyticmeshgen.py +0 -59
- pyvale/core/analyticsimdatagenerator.py +0 -160
- pyvale/core/cython/rastercyth.c +0 -32267
- pyvale/core/experimentsimulator.py +0 -99
- pyvale/core/fieldconverter.py +0 -154
- pyvale/core/integratorrectangle.py +0 -88
- pyvale/core/optimcheckfuncs.py +0 -153
- pyvale/core/sensordescriptor.py +0 -101
- pyvale/core/visualexpplotter.py +0 -151
- pyvale/core/visualopts.py +0 -180
- pyvale/core/visualsimplotter.py +0 -182
- pyvale/core/visualtools.py +0 -81
- pyvale/core/visualtraceplotter.py +0 -256
- pyvale/examples/analyticdatagen/__init__.py +0 -7
- pyvale/examples/ex1_1_thermal2d.py +0 -89
- pyvale/examples/ex1_2_thermal2d.py +0 -111
- pyvale/examples/ex1_3_thermal2d.py +0 -113
- pyvale/examples/ex1_5_thermal2d.py +0 -105
- pyvale/examples/ex2_1_thermal3d .py +0 -87
- pyvale/examples/ex2_2_thermal3d.py +0 -51
- pyvale/examples/ex2_3_thermal3d.py +0 -109
- pyvale/examples/ex3_1_displacement2d.py +0 -47
- pyvale/examples/ex3_2_displacement2d.py +0 -79
- pyvale/examples/ex3_3_displacement2d.py +0 -104
- pyvale/examples/ex3_4_displacement2d.py +0 -105
- pyvale/examples/ex4_1_strain2d.py +0 -57
- pyvale/examples/ex4_2_strain2d.py +0 -79
- pyvale/examples/ex4_3_strain2d.py +0 -100
- pyvale/examples/ex5_1_multiphysics2d.py +0 -78
- pyvale/examples/ex6_1_multiphysics2d_expsim.py +0 -118
- pyvale/examples/ex6_2_multiphysics3d_expsim.py +0 -158
- pyvale/examples/features/__init__.py +0 -7
- pyvale/examples/features/ex_area_avg.py +0 -89
- pyvale/examples/features/ex_calibration_error.py +0 -108
- pyvale/examples/features/ex_chain_field_errs.py +0 -141
- pyvale/examples/features/ex_field_errs.py +0 -78
- pyvale/examples/features/ex_sensor_single_angle_batch.py +0 -110
- pyvale-2025.4.0.dist-info/RECORD +0 -157
- {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/licenses/LICENSE +0 -0
- {pyvale-2025.4.0.dist-info → pyvale-2025.5.1.dist-info}/top_level.txt +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
88
|
+
|
|
90
89
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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.
|
|
12
|
-
from pyvale.
|
|
13
|
-
import pyvale.
|
|
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.
|
|
13
|
-
from pyvale.
|
|
14
|
-
from pyvale.
|
|
15
|
-
import pyvale.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.
|
|
9
|
+
from pyvale.field import IField
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
class ISensorArray(ABC):
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.
|
|
13
|
-
from pyvale.
|
|
14
|
-
from pyvale.
|
|
15
|
-
from pyvale.
|
|
16
|
-
from pyvale.
|
|
17
|
-
from pyvale.
|
|
18
|
-
from pyvale.
|
|
19
|
-
from pyvale.
|
|
20
|
-
from pyvale.
|
|
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:
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
80
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
105
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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(
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
|
|
164
|
-
|
|
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
|
-
|
|
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(
|
|
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
|