pyvale 2025.7.1__cp311-cp311-macosx_14_0_arm64.whl → 2025.8.1__cp311-cp311-macosx_14_0_arm64.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 +12 -92
- pyvale/blender/__init__.py +23 -0
- pyvale/{pyvaleexceptions.py → blender/blenderexceptions.py} +0 -3
- pyvale/{blenderlightdata.py → blender/blenderlightdata.py} +3 -3
- pyvale/{blendermaterialdata.py → blender/blendermaterialdata.py} +1 -1
- pyvale/{blenderrenderdata.py → blender/blenderrenderdata.py} +5 -3
- pyvale/{blenderscene.py → blender/blenderscene.py} +33 -30
- pyvale/{blendertools.py → blender/blendertools.py} +14 -10
- pyvale/dataset/__init__.py +7 -0
- pyvale/dataset/dataset.py +443 -0
- pyvale/dic/__init__.py +20 -0
- pyvale/dic/cpp/dicfourier.cpp +36 -4
- pyvale/dic/cpp/dicinterpolator.cpp +56 -1
- pyvale/dic/cpp/dicmain.cpp +24 -19
- pyvale/dic/cpp/dicoptimizer.cpp +6 -1
- pyvale/dic/cpp/dicscanmethod.cpp +32 -32
- pyvale/dic/cpp/dicsignalhandler.cpp +16 -0
- pyvale/dic/cpp/dicstrain.cpp +7 -3
- pyvale/dic/cpp/dicutil.cpp +79 -23
- pyvale/{dic2d.py → dic/dic2d.py} +51 -29
- pyvale/dic/dic2dconv.py +6 -0
- pyvale/dic/dic2dcpp.cpython-311-darwin.so +0 -0
- pyvale/{dicchecks.py → dic/dicchecks.py} +28 -16
- pyvale/dic/dicdataimport.py +370 -0
- pyvale/{dicregionofinterest.py → dic/dicregionofinterest.py} +169 -12
- pyvale/{dicresults.py → dic/dicresults.py} +4 -1
- pyvale/{dicstrain.py → dic/dicstrain.py} +9 -9
- pyvale/examples/basics/{ex1_1_basicscalars_therm2d.py → ex1a_basicscalars_therm2d.py} +12 -9
- pyvale/examples/basics/{ex1_2_sensormodel_therm2d.py → ex1b_sensormodel_therm2d.py} +17 -14
- pyvale/examples/basics/{ex1_3_customsens_therm3d.py → ex1c_customsens_therm3d.py} +27 -24
- pyvale/examples/basics/{ex1_4_basicerrors_therm3d.py → ex1d_basicerrors_therm3d.py} +32 -29
- pyvale/examples/basics/{ex1_5_fielderrs_therm3d.py → ex1e_fielderrs_therm3d.py} +19 -15
- pyvale/examples/basics/{ex1_6_caliberrs_therm2d.py → ex1f_caliberrs_therm2d.py} +20 -16
- pyvale/examples/basics/{ex1_7_spatavg_therm2d.py → ex1g_spatavg_therm2d.py} +19 -16
- pyvale/examples/basics/{ex2_1_basicvectors_disp2d.py → ex2a_basicvectors_disp2d.py} +13 -10
- pyvale/examples/basics/{ex2_2_vectorsens_disp2d.py → ex2b_vectorsens_disp2d.py} +19 -15
- pyvale/examples/basics/{ex2_3_sensangle_disp2d.py → ex2c_sensangle_disp2d.py} +21 -18
- pyvale/examples/basics/{ex2_4_chainfielderrs_disp2d.py → ex2d_chainfielderrs_disp2d.py} +31 -29
- pyvale/examples/basics/{ex2_5_vectorfields3d_disp3d.py → ex2e_vectorfields3d_disp3d.py} +21 -18
- pyvale/examples/basics/{ex3_1_basictensors_strain2d.py → ex3a_basictensors_strain2d.py} +16 -14
- pyvale/examples/basics/{ex3_2_tensorsens2d_strain2d.py → ex3b_tensorsens2d_strain2d.py} +17 -14
- pyvale/examples/basics/{ex3_3_tensorsens3d_strain3d.py → ex3c_tensorsens3d_strain3d.py} +25 -22
- pyvale/examples/basics/{ex4_1_expsim2d_thermmech2d.py → ex4a_expsim2d_thermmech2d.py} +17 -14
- pyvale/examples/basics/{ex4_2_expsim3d_thermmech3d.py → ex4b_expsim3d_thermmech3d.py} +37 -34
- pyvale/examples/basics/ex5_nomesh.py +24 -0
- pyvale/examples/dic/ex1_2_blenderdeformed.py +174 -0
- pyvale/examples/dic/ex1_region_of_interest.py +6 -3
- pyvale/examples/dic/ex2_plate_with_hole.py +21 -18
- pyvale/examples/dic/ex3_plate_with_hole_strain.py +8 -6
- pyvale/examples/dic/ex4_dic_blender.py +17 -15
- pyvale/examples/dic/ex5_dic_challenge.py +19 -14
- pyvale/examples/genanalyticdata/ex1_1_scalarvisualisation.py +16 -10
- pyvale/examples/genanalyticdata/ex1_2_scalarcasebuild.py +3 -3
- pyvale/examples/genanalyticdata/ex2_1_analyticsensors.py +29 -23
- pyvale/examples/genanalyticdata/ex2_2_analyticsensors_nomesh.py +67 -0
- pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +12 -9
- pyvale/examples/mooseherder/ex0_create_moose_config.py +65 -0
- pyvale/examples/mooseherder/ex1a_modify_moose_input.py +71 -0
- pyvale/examples/mooseherder/ex1b_modify_gmsh_input.py +69 -0
- pyvale/examples/mooseherder/ex2a_run_moose_once.py +80 -0
- pyvale/examples/mooseherder/ex2b_run_gmsh_once.py +64 -0
- pyvale/examples/mooseherder/ex2c_run_both_once.py +114 -0
- pyvale/examples/mooseherder/ex3_run_moose_seq_para.py +157 -0
- pyvale/examples/mooseherder/ex4_run_gmsh-moose_seq_para.py +176 -0
- pyvale/examples/mooseherder/ex5_run_moose_paramulti.py +136 -0
- pyvale/examples/mooseherder/ex6_read_moose_exodus.py +163 -0
- pyvale/examples/mooseherder/ex7a_read_moose_herd_results.py +153 -0
- pyvale/examples/mooseherder/ex7b_read_multi_herd_results.py +116 -0
- pyvale/examples/mooseherder/ex7c_read_multi_gmshmoose_results.py +127 -0
- pyvale/examples/mooseherder/ex7d_readconfig_multi_gmshmoose_results.py +143 -0
- pyvale/examples/mooseherder/ex8_read_existing_sweep_output.py +72 -0
- pyvale/examples/renderblender/ex1_1_blenderscene.py +24 -20
- pyvale/examples/renderblender/ex1_2_blenderdeformed.py +22 -18
- pyvale/examples/renderblender/ex2_1_stereoscene.py +36 -29
- pyvale/examples/renderblender/ex2_2_stereodeformed.py +26 -20
- pyvale/examples/renderblender/ex3_1_blendercalibration.py +24 -17
- pyvale/examples/renderrasterisation/ex_rastenp.py +14 -12
- pyvale/examples/renderrasterisation/ex_rastercyth_oneframe.py +14 -15
- pyvale/examples/renderrasterisation/ex_rastercyth_static_cypara.py +13 -11
- pyvale/examples/renderrasterisation/ex_rastercyth_static_pypara.py +13 -11
- pyvale/mooseherder/__init__.py +32 -0
- pyvale/mooseherder/directorymanager.py +416 -0
- pyvale/mooseherder/exodusreader.py +763 -0
- pyvale/mooseherder/gmshrunner.py +163 -0
- pyvale/mooseherder/inputmodifier.py +236 -0
- pyvale/mooseherder/mooseconfig.py +226 -0
- pyvale/mooseherder/mooseherd.py +527 -0
- pyvale/mooseherder/mooserunner.py +303 -0
- pyvale/mooseherder/outputreader.py +22 -0
- pyvale/mooseherder/simdata.py +92 -0
- pyvale/mooseherder/simrunner.py +31 -0
- pyvale/mooseherder/sweepreader.py +356 -0
- pyvale/mooseherder/sweeptools.py +76 -0
- pyvale/sensorsim/__init__.py +82 -0
- pyvale/{camera.py → sensorsim/camera.py} +7 -7
- pyvale/{camerasensor.py → sensorsim/camerasensor.py} +7 -7
- pyvale/{camerastereo.py → sensorsim/camerastereo.py} +2 -2
- pyvale/{cameratools.py → sensorsim/cameratools.py} +4 -4
- pyvale/{cython → sensorsim/cython}/rastercyth.c +596 -596
- pyvale/{cython → sensorsim/cython}/rastercyth.cpython-311-darwin.so +0 -0
- pyvale/{cython → sensorsim/cython}/rastercyth.py +16 -17
- pyvale/{errorcalculator.py → sensorsim/errorcalculator.py} +1 -1
- pyvale/{errorintegrator.py → sensorsim/errorintegrator.py} +2 -2
- pyvale/{errorrand.py → sensorsim/errorrand.py} +4 -4
- pyvale/{errorsyscalib.py → sensorsim/errorsyscalib.py} +2 -2
- pyvale/{errorsysdep.py → sensorsim/errorsysdep.py} +2 -2
- pyvale/{errorsysfield.py → sensorsim/errorsysfield.py} +8 -8
- pyvale/{errorsysindep.py → sensorsim/errorsysindep.py} +3 -3
- pyvale/sensorsim/exceptions.py +8 -0
- pyvale/{experimentsimulator.py → sensorsim/experimentsimulator.py} +23 -3
- pyvale/{field.py → sensorsim/field.py} +1 -1
- pyvale/{fieldconverter.py → sensorsim/fieldconverter.py} +72 -19
- pyvale/sensorsim/fieldinterp.py +37 -0
- pyvale/sensorsim/fieldinterpmesh.py +124 -0
- pyvale/sensorsim/fieldinterppoints.py +55 -0
- pyvale/{fieldsampler.py → sensorsim/fieldsampler.py} +4 -4
- pyvale/{fieldscalar.py → sensorsim/fieldscalar.py} +28 -24
- pyvale/{fieldtensor.py → sensorsim/fieldtensor.py} +33 -31
- pyvale/{fieldvector.py → sensorsim/fieldvector.py} +33 -31
- pyvale/{imagedef2d.py → sensorsim/imagedef2d.py} +9 -5
- pyvale/{integratorfactory.py → sensorsim/integratorfactory.py} +6 -6
- pyvale/{integratorquadrature.py → sensorsim/integratorquadrature.py} +3 -3
- pyvale/{integratorrectangle.py → sensorsim/integratorrectangle.py} +3 -3
- pyvale/{integratorspatial.py → sensorsim/integratorspatial.py} +1 -1
- pyvale/{rastercy.py → sensorsim/rastercy.py} +5 -5
- pyvale/{rasternp.py → sensorsim/rasternp.py} +9 -9
- pyvale/{rasteropts.py → sensorsim/rasteropts.py} +1 -1
- pyvale/{renderer.py → sensorsim/renderer.py} +1 -1
- pyvale/{rendermesh.py → sensorsim/rendermesh.py} +5 -5
- pyvale/{renderscene.py → sensorsim/renderscene.py} +2 -2
- pyvale/{sensorarray.py → sensorsim/sensorarray.py} +1 -1
- pyvale/{sensorarrayfactory.py → sensorsim/sensorarrayfactory.py} +12 -12
- pyvale/{sensorarraypoint.py → sensorsim/sensorarraypoint.py} +10 -8
- pyvale/{sensordata.py → sensorsim/sensordata.py} +1 -1
- pyvale/{sensortools.py → sensorsim/sensortools.py} +2 -20
- pyvale/sensorsim/simtools.py +174 -0
- pyvale/{visualexpplotter.py → sensorsim/visualexpplotter.py} +3 -3
- pyvale/{visualimages.py → sensorsim/visualimages.py} +2 -2
- pyvale/{visualsimanimator.py → sensorsim/visualsimanimator.py} +4 -4
- pyvale/{visualsimplotter.py → sensorsim/visualsimplotter.py} +5 -5
- pyvale/{visualsimsensors.py → sensorsim/visualsimsensors.py} +12 -12
- pyvale/{visualtools.py → sensorsim/visualtools.py} +1 -1
- pyvale/{visualtraceplotter.py → sensorsim/visualtraceplotter.py} +2 -2
- pyvale/simcases/case17.geo +3 -0
- pyvale/simcases/case17.i +4 -4
- pyvale/simcases/run_1case.py +1 -9
- pyvale/simcases/run_all_cases.py +1 -1
- pyvale/simcases/run_build_case.py +1 -1
- pyvale/simcases/run_example_cases.py +1 -1
- pyvale/verif/__init__.py +12 -0
- pyvale/{analyticsimdatafactory.py → verif/analyticsimdatafactory.py} +2 -2
- pyvale/{analyticsimdatagenerator.py → verif/analyticsimdatagenerator.py} +2 -2
- pyvale/verif/psens.py +125 -0
- pyvale/verif/psensconst.py +18 -0
- pyvale/verif/psensmech.py +227 -0
- pyvale/verif/psensmultiphys.py +187 -0
- pyvale/verif/psensscalar.py +347 -0
- pyvale/verif/psenstensor.py +123 -0
- pyvale/verif/psensvector.py +116 -0
- {pyvale-2025.7.1.dist-info → pyvale-2025.8.1.dist-info}/METADATA +6 -7
- pyvale-2025.8.1.dist-info/RECORD +262 -0
- pyvale/dataset.py +0 -415
- pyvale/dic2dcpp.cpython-311-darwin.so +0 -0
- pyvale/dicdataimport.py +0 -247
- pyvale/simtools.py +0 -67
- pyvale-2025.7.1.dist-info/RECORD +0 -213
- /pyvale/{blendercalibrationdata.py → blender/blendercalibrationdata.py} +0 -0
- /pyvale/{dicspecklegenerator.py → dic/dicspecklegenerator.py} +0 -0
- /pyvale/{dicspecklequality.py → dic/dicspecklequality.py} +0 -0
- /pyvale/{dicstrainresults.py → dic/dicstrainresults.py} +0 -0
- /pyvale/{cameradata.py → sensorsim/cameradata.py} +0 -0
- /pyvale/{cameradata2d.py → sensorsim/cameradata2d.py} +0 -0
- /pyvale/{errordriftcalc.py → sensorsim/errordriftcalc.py} +0 -0
- /pyvale/{fieldtransform.py → sensorsim/fieldtransform.py} +0 -0
- /pyvale/{generatorsrandom.py → sensorsim/generatorsrandom.py} +0 -0
- /pyvale/{imagetools.py → sensorsim/imagetools.py} +0 -0
- /pyvale/{integratortype.py → sensorsim/integratortype.py} +0 -0
- /pyvale/{output.py → sensorsim/output.py} +0 -0
- /pyvale/{raster.py → sensorsim/raster.py} +0 -0
- /pyvale/{sensordescriptor.py → sensorsim/sensordescriptor.py} +0 -0
- /pyvale/{visualimagedef.py → sensorsim/visualimagedef.py} +0 -0
- /pyvale/{visualopts.py → sensorsim/visualopts.py} +0 -0
- /pyvale/{analyticmeshgen.py → verif/analyticmeshgen.py} +0 -0
- {pyvale-2025.7.1.dist-info → pyvale-2025.8.1.dist-info}/WHEEL +0 -0
- {pyvale-2025.7.1.dist-info → pyvale-2025.8.1.dist-info}/licenses/LICENSE +0 -0
- {pyvale-2025.7.1.dist-info → pyvale-2025.8.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
#===============================================================================
|
|
2
|
+
# pyvale: the python validation engine
|
|
3
|
+
# License: MIT
|
|
4
|
+
# Copyright (C) 2025 The Computer Aided Validation Team
|
|
5
|
+
#===============================================================================
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
Accesors for data that comes pre-packaged with pyvale for demonstrating its
|
|
9
|
+
functionality. This includes moose simulation outputs as exodus files, input
|
|
10
|
+
files for moose and gmsh for additional simulation cases, and images required
|
|
11
|
+
for testing the image deformation and digital image correlation modules.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from enum import Enum
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from importlib.resources import files
|
|
17
|
+
|
|
18
|
+
SIM_CASE_COUNT = 26
|
|
19
|
+
"""Constant describing the number of simulation test case input files for moose
|
|
20
|
+
and gmsh that come packaged with pyvale.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
class EElemTest(Enum):
|
|
24
|
+
"""Enumeration used to specify different 3D element types for extracting
|
|
25
|
+
specific test simulation datasets.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
TET4 = "TET4"
|
|
29
|
+
"""Tetrahedral element, linear with 4 nodes.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
TET10 = "TET10"
|
|
33
|
+
"""Tetrahedral element, quadratic with 10 nodes.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
TET14 = "TET14"
|
|
37
|
+
"""Tetrahedral element, quadratic with 14 nodes.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
HEX8 = "HEX8"
|
|
41
|
+
"""Hexahedral element, linear with 8 nodes.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
HEX20 = "HEX20"
|
|
45
|
+
"""Hexahedral element, quadratic with 20 nodes.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
HEX27 = "HEX27"
|
|
49
|
+
"""Hexahedral element, quadratic with 27 nodes.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __str__(self):
|
|
53
|
+
return self.value
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class DataSetError(Exception):
|
|
57
|
+
"""Custom error class for file io errors associated with retrieving datasets
|
|
58
|
+
and files packaged with pyvale.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def sim_case_input_file_path(case_num: int) -> Path:
|
|
63
|
+
"""Gets the path to MOOSE input file (*.i) for a particular simulation
|
|
64
|
+
case.
|
|
65
|
+
|
|
66
|
+
Parameters
|
|
67
|
+
----------
|
|
68
|
+
case_num : int
|
|
69
|
+
Integer defining the case number to be retrieved. Must be greater
|
|
70
|
+
than 0 and less than the number of simulation cases.
|
|
71
|
+
|
|
72
|
+
Returns
|
|
73
|
+
-------
|
|
74
|
+
Path
|
|
75
|
+
Path object to the MOOSE *.i file for the selected simulation case.
|
|
76
|
+
|
|
77
|
+
Raises
|
|
78
|
+
------
|
|
79
|
+
DataSetError
|
|
80
|
+
Raised if an invalid simulation case number is specified.
|
|
81
|
+
"""
|
|
82
|
+
if case_num <= 0:
|
|
83
|
+
raise DataSetError("Simulation case number must be greater than 0")
|
|
84
|
+
elif case_num > SIM_CASE_COUNT:
|
|
85
|
+
raise DataSetError("Simulation case number must be less than " \
|
|
86
|
+
+ f"{SIM_CASE_COUNT}")
|
|
87
|
+
|
|
88
|
+
case_num_str = str(case_num).zfill(2)
|
|
89
|
+
case_file = f"case{case_num_str}.i"
|
|
90
|
+
return Path(files("pyvale.simcases").joinpath(case_file))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def sim_case_gmsh_file_path(case_num: int) -> Path | None:
|
|
94
|
+
"""Gets the path to Gmsh input file (*.geo) for a particular simulation
|
|
95
|
+
case. Note that not all simulation cases use Gmsh for geometry and mesh
|
|
96
|
+
generation. If the specified simulation case does not have an associated
|
|
97
|
+
Gmsh *.geo file. In this case 'None' is returned
|
|
98
|
+
|
|
99
|
+
Parameters
|
|
100
|
+
----------
|
|
101
|
+
case_num : int
|
|
102
|
+
Integer defining the case number to be retrieved. Must be greater
|
|
103
|
+
than 0 and less than the number of simulation cases.
|
|
104
|
+
|
|
105
|
+
Returns
|
|
106
|
+
-------
|
|
107
|
+
Path | None
|
|
108
|
+
Path object to the Gmsh *.geo file for the selected simulation case.
|
|
109
|
+
Returns None if there is no *.geo for this simulation case.
|
|
110
|
+
|
|
111
|
+
Raises
|
|
112
|
+
------
|
|
113
|
+
DataSetError
|
|
114
|
+
Raised if an invalid simulation case number is specified.
|
|
115
|
+
"""
|
|
116
|
+
if case_num <= 0:
|
|
117
|
+
raise DataSetError("Simulation case number must be greater than 0")
|
|
118
|
+
elif case_num > SIM_CASE_COUNT:
|
|
119
|
+
raise DataSetError("Simulation case number must be less than " \
|
|
120
|
+
+ f"{SIM_CASE_COUNT}")
|
|
121
|
+
|
|
122
|
+
case_num_str = str(case_num).zfill(2)
|
|
123
|
+
case_file = f"case{case_num_str}.geo"
|
|
124
|
+
case_path = Path(files("pyvale.simcases").joinpath(case_file))
|
|
125
|
+
|
|
126
|
+
if case_path.is_file():
|
|
127
|
+
return case_path
|
|
128
|
+
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def dic_pattern_5mpx_path() -> Path:
|
|
133
|
+
"""Path to a 5 mega-pixel speckle pattern image (2464 x 2056 pixels)
|
|
134
|
+
with 8 bit resolution stored as a *.tiff. Speckles are sampled by
|
|
135
|
+
5 pixels. A gaussian blur has been applied to the image to remove sharp
|
|
136
|
+
transitions from black to white.
|
|
137
|
+
|
|
138
|
+
Path
|
|
139
|
+
Path to the *.tiff file containing the speckle pattern.
|
|
140
|
+
"""
|
|
141
|
+
return Path(files("pyvale.data")
|
|
142
|
+
.joinpath("optspeckle_2464x2056px_spec5px_8bit_gblur1px.tiff"))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def thermal_2d_path() -> Path:
|
|
146
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
147
|
+
thermal problem solving for a scalar temperature field. The geometry is
|
|
148
|
+
a 2D plate (in x,y) with a heat flux applied on one edge and a heat
|
|
149
|
+
transfer coefficient applied on the opposite edge inducing a temperature
|
|
150
|
+
gradient along the x axis of the plate.
|
|
151
|
+
|
|
152
|
+
The simulation parameters can be found in the corresponding MOOSE input
|
|
153
|
+
file: case13.i which can be retrieved using `sim_case_input_file_path`
|
|
154
|
+
in this class.
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
Returns
|
|
158
|
+
-------
|
|
159
|
+
Path
|
|
160
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
161
|
+
"""
|
|
162
|
+
return Path(files("pyvale.data").joinpath("case13_out.e"))
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def thermal_3d_path() -> Path:
|
|
166
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a 3D
|
|
167
|
+
thermal problem solving for a scalar temperature field. The model is a
|
|
168
|
+
divertor armour monoblock composed of a tungsten block bonded to a
|
|
169
|
+
copper-chromium-zirconium pipe with a pure copper interlayer. A heat
|
|
170
|
+
flux is applied to the top surface of the block and a heat transfer
|
|
171
|
+
coefficient for cooling water is applied to the inner surface of the
|
|
172
|
+
pipe inducing a temperature gradient from the top of the block to the
|
|
173
|
+
pipe.
|
|
174
|
+
|
|
175
|
+
The simulation parameters can be found in the corresponding MOOSE input
|
|
176
|
+
file: case16.i which can be retrieved using `sim_case_input_file_path`
|
|
177
|
+
in this class. Note that this case uses a Gmsh *.geo file for geometry
|
|
178
|
+
and mesh creation.
|
|
179
|
+
|
|
180
|
+
Returns
|
|
181
|
+
-------
|
|
182
|
+
Path
|
|
183
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
184
|
+
"""
|
|
185
|
+
return Path(files("pyvale.data").joinpath("case16_out.e"))
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def mechanical_2d_path() -> Path:
|
|
189
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a 2D
|
|
190
|
+
plate with a hole in the center with the bottom edge fixed and a
|
|
191
|
+
displacement applied to the top edge. This is a mechanical problem and
|
|
192
|
+
solves for the displacement vector field and the tensorial strain field.
|
|
193
|
+
|
|
194
|
+
The simulation parameters can be found in the corresponding MOOSE input
|
|
195
|
+
file: case17.i which can be retrieved using `sim_case_input_file_path`
|
|
196
|
+
in this class. Note that this case uses a Gmsh *.geo file for geometry
|
|
197
|
+
and mesh creation.
|
|
198
|
+
|
|
199
|
+
Returns
|
|
200
|
+
-------
|
|
201
|
+
Path
|
|
202
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
203
|
+
"""
|
|
204
|
+
return Path(files("pyvale.data").joinpath("case17_out.e"))
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def thermomechanical_2d_path() -> Path:
|
|
208
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
209
|
+
thermo-mechanical analysis of a 2D plate with a heat flux applied on one
|
|
210
|
+
edge and a heat transfer coefficient applied on the opposing edge. The
|
|
211
|
+
mechanical deformation results from thermal expansion due to the imposed
|
|
212
|
+
temperature gradient. This model is solved for the scalar temperature
|
|
213
|
+
field, vector displacement and tensor strain field.
|
|
214
|
+
|
|
215
|
+
Returns
|
|
216
|
+
-------
|
|
217
|
+
Path
|
|
218
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
219
|
+
"""
|
|
220
|
+
return Path(files("pyvale.data").joinpath("case18_1_out.e"))
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def thermomechanical_3d_path() -> Path:
|
|
224
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
225
|
+
thermo-mechanical analysis of a 3D monoblock divertor armour with a heat
|
|
226
|
+
flux applied on the top surface and a heat transfer coefficient applied
|
|
227
|
+
on the inner surface of the pipe. The mechanical deformation results
|
|
228
|
+
from thermal expansion due to the imposed temperature gradient.
|
|
229
|
+
This model is solved for the scalar temperature field, vector
|
|
230
|
+
displacement and tensor strain field.
|
|
231
|
+
|
|
232
|
+
Returns
|
|
233
|
+
-------
|
|
234
|
+
Path
|
|
235
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
236
|
+
"""
|
|
237
|
+
return Path(files("pyvale.data").joinpath("case16_out.e"))
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def thermomechanical_2d_experiment_paths() -> list[Path]:
|
|
241
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
242
|
+
thermo-mechanical analysis of a 2D plate with a heat flux applied on one
|
|
243
|
+
edge and a heat transfer coefficient applied on the opposing edge. The
|
|
244
|
+
mechanical deformation results from thermal expansion due to the imposed
|
|
245
|
+
temperature gradient. This model is solved for the scalar temperature
|
|
246
|
+
field, vector temperature and tensor strain field.
|
|
247
|
+
|
|
248
|
+
Here we analyse 3 separate experiments where the thermal conductivity of
|
|
249
|
+
the material is perturbed from the nominal case by +/-10%.
|
|
250
|
+
|
|
251
|
+
The simulation parameters can be found in the corresponding MOOSE input
|
|
252
|
+
file: case18.i which can be retrieved using `sim_case_input_file_path`
|
|
253
|
+
in this class.
|
|
254
|
+
|
|
255
|
+
Returns
|
|
256
|
+
-------
|
|
257
|
+
Path
|
|
258
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
259
|
+
"""
|
|
260
|
+
return [Path(files("pyvale.data").joinpath("case18_1_out.e")),
|
|
261
|
+
Path(files("pyvale.data").joinpath("case18_2_out.e")),
|
|
262
|
+
Path(files("pyvale.data").joinpath("case18_3_out.e"))]
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def render_mechanical_3d_path() -> Path:
|
|
266
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
267
|
+
purely mechanical test case in 3D meant for testing image rendering
|
|
268
|
+
algorithms for digital image correlation simulation. The simulation
|
|
269
|
+
consists of a linear elastic thin plate with a hole loaded in tension.
|
|
270
|
+
The simulation uses linear tetrahedral elements for rendering tests.
|
|
271
|
+
|
|
272
|
+
Returns
|
|
273
|
+
-------
|
|
274
|
+
Path
|
|
275
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
276
|
+
"""
|
|
277
|
+
return Path(files("pyvale.data").joinpath("case26_out.e"))
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def render_simple_block_path() -> Path:
|
|
281
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
282
|
+
a simple rectangular block in 3D loaded in tension. It uses a minimum
|
|
283
|
+
number of elements and is intended purely for testing image rendering
|
|
284
|
+
algorithms. This simulation uses linear tetrahedral elements.
|
|
285
|
+
|
|
286
|
+
Returns
|
|
287
|
+
-------
|
|
288
|
+
Path
|
|
289
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
290
|
+
"""
|
|
291
|
+
return Path(files("pyvale.data").joinpath("case25_out.e"))
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def element_case_input_path(elem_type: EElemTest) -> Path:
|
|
295
|
+
"""Path to a MOOSE simulation input file (.i) for a simple test
|
|
296
|
+
case. This case is a 10mm cube undergoing thermo-mechanical loading
|
|
297
|
+
solved for the temperature, displacement and strain fields. This case is
|
|
298
|
+
solved using a variety of tetrahedral and hexahedral elements with
|
|
299
|
+
linear or quadratic shapes functions. These simulation cases are
|
|
300
|
+
intended for testing purposes and contain a minimal number of elements.
|
|
301
|
+
|
|
302
|
+
Parameters
|
|
303
|
+
----------
|
|
304
|
+
elem_type : EElemTest
|
|
305
|
+
Enumeration specifying the element type for this test case.
|
|
306
|
+
|
|
307
|
+
Returns
|
|
308
|
+
-------
|
|
309
|
+
Path
|
|
310
|
+
Path to the moose input file (.i) for this simulation case.
|
|
311
|
+
"""
|
|
312
|
+
return Path(files("pyvale.simcases")
|
|
313
|
+
.joinpath(f"case00_{elem_type.value}.i"))
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def element_case_output_path(elem_type: EElemTest) -> Path:
|
|
318
|
+
"""Path to a MOOSE simulation output in exodus format. This case is a
|
|
319
|
+
10mm cube undergoing thermo-mechanical loading solved for the
|
|
320
|
+
temperature, displacement and strain fields. This case is solved using a
|
|
321
|
+
variety of tetrahedral and hexahedral elements with linear or quadratic
|
|
322
|
+
shapes functions. These simulation cases are intended for testing
|
|
323
|
+
purposes and contain a minimal number of elements.
|
|
324
|
+
|
|
325
|
+
Parameters
|
|
326
|
+
----------
|
|
327
|
+
elem_type : EElemTest
|
|
328
|
+
Enumeration specifying the element type for this test case.
|
|
329
|
+
|
|
330
|
+
Returns
|
|
331
|
+
-------
|
|
332
|
+
Path
|
|
333
|
+
Path to the exodus (*.e) output file for this simulation case.
|
|
334
|
+
"""
|
|
335
|
+
return Path(files("pyvale.data")
|
|
336
|
+
.joinpath(f"case00_{elem_type.value}_out.e"))
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
def dic_plate_with_hole_ref() -> Path:
|
|
340
|
+
"""Path to the reference image for the plate with hole example.
|
|
341
|
+
1040x1540 image in .tiff format.
|
|
342
|
+
|
|
343
|
+
Parameters
|
|
344
|
+
----------
|
|
345
|
+
elem_type : EElemTest
|
|
346
|
+
Enumeration specifying the element type for this test case.
|
|
347
|
+
|
|
348
|
+
Returns
|
|
349
|
+
-------
|
|
350
|
+
Path
|
|
351
|
+
Path to the reference image (*.tiff).
|
|
352
|
+
"""
|
|
353
|
+
return Path(files("pyvale.data")
|
|
354
|
+
.joinpath("plate_hole_ref0000.tiff"))
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def dic_plate_with_hole_def() -> Path:
|
|
358
|
+
"""Path to the deformed images for the plate with hole example.
|
|
359
|
+
1040x1540 image in .tiff format.
|
|
360
|
+
|
|
361
|
+
Parameters
|
|
362
|
+
----------
|
|
363
|
+
elem_type : EElemTest
|
|
364
|
+
Enumeration specifying the element type for this test case.
|
|
365
|
+
|
|
366
|
+
Returns
|
|
367
|
+
-------
|
|
368
|
+
Path
|
|
369
|
+
Path to the reference image (*.tiff).
|
|
370
|
+
"""
|
|
371
|
+
return Path(files("pyvale.data")
|
|
372
|
+
.joinpath("plate_hole_def*.tiff"))
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
def dic_plate_rigid_ref() -> Path:
|
|
376
|
+
"""Path to the reference image for the plate with hole example.
|
|
377
|
+
1040x1540 image in .tiff format.
|
|
378
|
+
|
|
379
|
+
Parameters
|
|
380
|
+
----------
|
|
381
|
+
elem_type : EElemTest
|
|
382
|
+
Enumeration specifying the element type for this test case.
|
|
383
|
+
|
|
384
|
+
Returns
|
|
385
|
+
-------
|
|
386
|
+
Path
|
|
387
|
+
Path to the reference image (*.tiff).
|
|
388
|
+
"""
|
|
389
|
+
return Path(files("pyvale.data")
|
|
390
|
+
.joinpath("plate_rigid_ref0000.tiff"))
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def dic_plate_rigid_def() -> Path:
|
|
394
|
+
"""Path to the deformed images for the plate with hole example.
|
|
395
|
+
1040x1540 image in .tiff format.
|
|
396
|
+
|
|
397
|
+
Returns
|
|
398
|
+
-------
|
|
399
|
+
Path
|
|
400
|
+
Path to the reference image (*.tiff).
|
|
401
|
+
"""
|
|
402
|
+
return Path(files("pyvale.data")
|
|
403
|
+
.joinpath("plate_rigid_def*.tiff"))
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
def dic_challenge_ref() -> Path:
|
|
409
|
+
"""Path to the reference images for the 2D dic challenge.
|
|
410
|
+
|
|
411
|
+
Returns
|
|
412
|
+
-------
|
|
413
|
+
Path
|
|
414
|
+
Path to the reference image (*.tiff).
|
|
415
|
+
"""
|
|
416
|
+
return Path(files("pyvale.data")
|
|
417
|
+
.joinpath("DIC_Challenge_Star_Noise_Ref.tiff"))
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def dic_challenge_def() -> Path:
|
|
421
|
+
"""Path to the reference images for the 2D dic challenge.
|
|
422
|
+
|
|
423
|
+
Returns
|
|
424
|
+
-------
|
|
425
|
+
Path
|
|
426
|
+
Path to the reference image (*.tiff).
|
|
427
|
+
"""
|
|
428
|
+
return Path(files("pyvale.data")
|
|
429
|
+
.joinpath("DIC_Challenge_Star_Noise_Def.tiff"))
|
|
430
|
+
|
|
431
|
+
def cal_target() -> Path:
|
|
432
|
+
"""Path to example calibration target.
|
|
433
|
+
|
|
434
|
+
Returns
|
|
435
|
+
-------
|
|
436
|
+
Path
|
|
437
|
+
Path to the image (*.tiff).
|
|
438
|
+
"""
|
|
439
|
+
return Path(files("pyvale.data")
|
|
440
|
+
.joinpath("cal_target.tiff"))
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
pyvale/dic/__init__.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#===============================================================================
|
|
2
|
+
# pyvale: the python validation engine
|
|
3
|
+
# License: MIT
|
|
4
|
+
# Copyright (C) 2025 The Computer Aided Validation Team
|
|
5
|
+
#===============================================================================
|
|
6
|
+
|
|
7
|
+
from .dic2d import two_dimensional
|
|
8
|
+
from .dicdataimport import data_import
|
|
9
|
+
from .dicregionofinterest import RegionOfInterest
|
|
10
|
+
from .dicresults import Results
|
|
11
|
+
from .dicstrain import strain_two_dimensional, strain_data_import
|
|
12
|
+
from .dicstrainresults import StrainResults
|
|
13
|
+
|
|
14
|
+
__all__ = ["two_dimensional",
|
|
15
|
+
"RegionOfInterest",
|
|
16
|
+
"data_import",
|
|
17
|
+
"Results",
|
|
18
|
+
"strain_two_dimensional",
|
|
19
|
+
"strain_data_import",
|
|
20
|
+
"StrainResults"]
|
pyvale/dic/cpp/dicfourier.cpp
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
#include <cmath>
|
|
13
13
|
#include <algorithm>
|
|
14
14
|
#include <omp.h>
|
|
15
|
+
#include <csignal>
|
|
15
16
|
|
|
16
17
|
// Program Header files
|
|
17
18
|
#include "./defines.hpp"
|
|
18
19
|
#include "./dicutil.hpp"
|
|
19
20
|
#include "./dicfourier.hpp"
|
|
21
|
+
#include "./dicsignalhandler.hpp"
|
|
20
22
|
|
|
21
23
|
namespace fourier {
|
|
22
24
|
|
|
@@ -134,8 +136,10 @@ namespace fourier {
|
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
void mgwd(const std::vector<util::SubsetData> &ssdata,
|
|
137
|
-
const double *img_ref,
|
|
138
|
-
const
|
|
139
|
+
const double *img_ref,
|
|
140
|
+
const double *img_def,
|
|
141
|
+
const Interpolator &interp_def,
|
|
142
|
+
const bool fft_mad,
|
|
139
143
|
const double fft_mad_scale){
|
|
140
144
|
|
|
141
145
|
const int px_hori = interp_def.px_hori;
|
|
@@ -150,11 +154,21 @@ namespace fourier {
|
|
|
150
154
|
//util::Timer timer("FFT windowing for subset size: " + std::to_string(ssdata[i].size));
|
|
151
155
|
|
|
152
156
|
const int ss_size = ssdata[i].size;
|
|
157
|
+
const int num_ss = ssdata[i].num;
|
|
153
158
|
|
|
154
159
|
std::fill(shifts[i].x.begin(), shifts[i].x.end(), 0.0);
|
|
155
160
|
std::fill(shifts[i].y.begin(), shifts[i].y.end(), 0.0);
|
|
156
161
|
|
|
157
|
-
|
|
162
|
+
indicators::ProgressBar bar;
|
|
163
|
+
std::atomic<int> current_progress = 0;
|
|
164
|
+
int prev_pct = 0;
|
|
165
|
+
|
|
166
|
+
if (g_debug_level == 1){
|
|
167
|
+
std::string bar_title = "FFT windowing for size: " + std::to_string(ss_size);
|
|
168
|
+
util::create_progress_bar(bar, bar_title, ssdata[i].num);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
#pragma omp parallel shared(stop_request)
|
|
158
172
|
{
|
|
159
173
|
|
|
160
174
|
|
|
@@ -165,6 +179,11 @@ namespace fourier {
|
|
|
165
179
|
#pragma omp for
|
|
166
180
|
for (int ss = 0; ss < ssdata[i].num; ss++){
|
|
167
181
|
|
|
182
|
+
// exit when ctrl+C
|
|
183
|
+
if (stop_request){
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
|
|
168
187
|
int ss_x = ssdata[i].coords[2*ss];
|
|
169
188
|
int ss_y = ssdata[i].coords[2*ss+1];
|
|
170
189
|
|
|
@@ -213,6 +232,12 @@ namespace fourier {
|
|
|
213
232
|
//util::extract_ss_subpx(fft.ss_def, ss_x+shifts[i].x[ss], ss_y+shifts[i].y[ss], interp_def);
|
|
214
233
|
//shifts[i].cost[ss] = debugcost(fft.ss_ref,fft.ss_def);
|
|
215
234
|
shifts[i].max_val[ss] = max_val;
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
if (g_debug_level == 1){
|
|
238
|
+
int progress = current_progress.fetch_add(1);
|
|
239
|
+
if (omp_get_thread_num()==0) util::update_progress_bar(bar, progress, num_ss, prev_pct);
|
|
240
|
+
}
|
|
216
241
|
}
|
|
217
242
|
}
|
|
218
243
|
|
|
@@ -222,7 +247,6 @@ namespace fourier {
|
|
|
222
247
|
remove_outliers(shifts[i].y, ssdata[i], fft_mad);
|
|
223
248
|
}
|
|
224
249
|
|
|
225
|
-
|
|
226
250
|
//smooth_field(shifts[i].x, ssdata[i], 7.0, 5);
|
|
227
251
|
//smooth_field(shifts[i].y, ssdata[i], 7.0, 5);
|
|
228
252
|
|
|
@@ -233,9 +257,17 @@ namespace fourier {
|
|
|
233
257
|
// std::cout << shifts[i].cost[ss] << std::endl;
|
|
234
258
|
//}
|
|
235
259
|
//std::cout << std::endl;
|
|
260
|
+
|
|
261
|
+
if (g_debug_level == 1){
|
|
262
|
+
int progress = current_progress;
|
|
263
|
+
util::update_progress_bar(bar, progress-1, num_ss, prev_pct);
|
|
264
|
+
bar.mark_as_completed();
|
|
265
|
+
indicators::show_console_cursor(true);
|
|
266
|
+
}
|
|
236
267
|
}
|
|
237
268
|
|
|
238
269
|
|
|
270
|
+
|
|
239
271
|
}
|
|
240
272
|
|
|
241
273
|
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
// Program Header files
|
|
13
13
|
#include "./dicinterpolator.hpp"
|
|
14
|
-
|
|
14
|
+
#include "./dicutil.hpp"
|
|
15
|
+
#include "defines.hpp"
|
|
16
|
+
#include "./dicsignalhandler.hpp"
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
inline int idx_from_2d(const int x, const int y, const int length){
|
|
@@ -49,10 +51,27 @@ Interpolator::Interpolator(double*img, int px_hori, int px_vert){
|
|
|
49
51
|
|
|
50
52
|
//interpolator data
|
|
51
53
|
std::vector<double> data(px_hori,0);
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
indicators::ProgressBar bar;
|
|
57
|
+
std::atomic<int> current_progress = 0;
|
|
58
|
+
int prev_pct = 0;
|
|
59
|
+
int niters = px_vert+px_hori+px_hori;
|
|
60
|
+
|
|
61
|
+
if (g_debug_level == 1){
|
|
62
|
+
std::string bar_title = "Creating Interpolator: ";
|
|
63
|
+
util::create_progress_bar(bar, bar_title, niters);
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
|
|
53
67
|
//#pragma omp parallel for
|
|
54
68
|
for (int j = 0; j < px_vert; j++){
|
|
55
69
|
|
|
70
|
+
// exit if ctrl+C
|
|
71
|
+
if (stop_request){
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
56
75
|
// get 1D data
|
|
57
76
|
for (int i = 0; i < px_hori; i++) {
|
|
58
77
|
data[i] = image[j*px_hori + i];
|
|
@@ -62,6 +81,12 @@ Interpolator::Interpolator(double*img, int px_hori, int px_vert){
|
|
|
62
81
|
for (int i = 0; i < px_hori; i++){
|
|
63
82
|
dx[j*px_hori + i] = cspline_eval_deriv(px_x, data, px_x[i], px_hori);
|
|
64
83
|
}
|
|
84
|
+
|
|
85
|
+
// update progress bar if enabled
|
|
86
|
+
if (g_debug_level == 1){
|
|
87
|
+
int progress = current_progress.fetch_add(1);
|
|
88
|
+
util::update_progress_bar(bar, progress, niters, prev_pct);
|
|
89
|
+
}
|
|
65
90
|
}
|
|
66
91
|
|
|
67
92
|
data.resize(px_vert,0);
|
|
@@ -69,6 +94,11 @@ Interpolator::Interpolator(double*img, int px_hori, int px_vert){
|
|
|
69
94
|
//#pragma omp parallel for
|
|
70
95
|
for (int i = 0; i < px_hori; ++i) {
|
|
71
96
|
|
|
97
|
+
// exit if ctrl+C
|
|
98
|
+
if (stop_request){
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
|
|
72
102
|
// get 1D data
|
|
73
103
|
for (int j = 0; j < px_vert; j++){
|
|
74
104
|
data[j] = image[j*px_hori + i];
|
|
@@ -78,6 +108,12 @@ Interpolator::Interpolator(double*img, int px_hori, int px_vert){
|
|
|
78
108
|
for (int j = 0; j < px_vert; j++){
|
|
79
109
|
dy[j*px_hori + i] = cspline_eval_deriv(px_y, data, px_y[j], px_vert);
|
|
80
110
|
}
|
|
111
|
+
|
|
112
|
+
// update progress bar if enabled
|
|
113
|
+
if (g_debug_level == 1){
|
|
114
|
+
int progress = current_progress.fetch_add(1);
|
|
115
|
+
util::update_progress_bar(bar, progress, niters, prev_pct);
|
|
116
|
+
}
|
|
81
117
|
}
|
|
82
118
|
|
|
83
119
|
|
|
@@ -86,6 +122,11 @@ Interpolator::Interpolator(double*img, int px_hori, int px_vert){
|
|
|
86
122
|
//#pragma omp parallel for
|
|
87
123
|
for (int j = 0; j < px_vert; j++){
|
|
88
124
|
|
|
125
|
+
// exit if ctrl+C
|
|
126
|
+
if (stop_request){
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
|
|
89
130
|
// get 1D data
|
|
90
131
|
for (int i = 0; i < px_hori; i++) {
|
|
91
132
|
data[i] = dy[j*px_hori + i];
|
|
@@ -95,6 +136,20 @@ Interpolator::Interpolator(double*img, int px_hori, int px_vert){
|
|
|
95
136
|
for (int i = 0; i < px_hori; i++){
|
|
96
137
|
dxy[j*px_hori + i] = cspline_eval_deriv(px_x, data, px_x[i], px_hori);
|
|
97
138
|
}
|
|
139
|
+
|
|
140
|
+
// update progress bar if enabled
|
|
141
|
+
if (g_debug_level == 1){
|
|
142
|
+
int progress = current_progress.fetch_add(1);
|
|
143
|
+
util::update_progress_bar(bar, progress, niters, prev_pct);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
if (g_debug_level == 1){
|
|
149
|
+
int progress = current_progress;
|
|
150
|
+
util::update_progress_bar(bar, progress-1, niters, prev_pct);
|
|
151
|
+
bar.mark_as_completed();
|
|
152
|
+
indicators::show_console_cursor(true);
|
|
98
153
|
}
|
|
99
154
|
}
|
|
100
155
|
|