pyvale 2025.5.3__cp311-cp311-win_amd64.whl → 2025.7.1__cp311-cp311-win_amd64.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 -0
- pyvale/blendercalibrationdata.py +3 -1
- pyvale/blenderscene.py +7 -5
- pyvale/blendertools.py +27 -5
- pyvale/camera.py +1 -0
- pyvale/cameradata.py +3 -0
- pyvale/camerasensor.py +147 -0
- pyvale/camerastereo.py +4 -4
- pyvale/cameratools.py +23 -61
- pyvale/cython/rastercyth.c +1657 -1352
- pyvale/cython/rastercyth.cp311-win_amd64.pyd +0 -0
- pyvale/cython/rastercyth.py +71 -26
- pyvale/data/DIC_Challenge_Star_Noise_Def.tiff +0 -0
- pyvale/data/DIC_Challenge_Star_Noise_Ref.tiff +0 -0
- pyvale/data/plate_hole_def0000.tiff +0 -0
- pyvale/data/plate_hole_def0001.tiff +0 -0
- pyvale/data/plate_hole_ref0000.tiff +0 -0
- pyvale/data/plate_rigid_def0000.tiff +0 -0
- pyvale/data/plate_rigid_def0001.tiff +0 -0
- pyvale/data/plate_rigid_ref0000.tiff +0 -0
- pyvale/dataset.py +96 -6
- pyvale/dic/cpp/dicbruteforce.cpp +370 -0
- pyvale/dic/cpp/dicfourier.cpp +648 -0
- pyvale/dic/cpp/dicinterpolator.cpp +559 -0
- pyvale/dic/cpp/dicmain.cpp +215 -0
- pyvale/dic/cpp/dicoptimizer.cpp +675 -0
- pyvale/dic/cpp/dicrg.cpp +137 -0
- pyvale/dic/cpp/dicscanmethod.cpp +677 -0
- pyvale/dic/cpp/dicsmooth.cpp +138 -0
- pyvale/dic/cpp/dicstrain.cpp +383 -0
- pyvale/dic/cpp/dicutil.cpp +563 -0
- pyvale/dic2d.py +164 -0
- pyvale/dic2dcpp.cp311-win_amd64.pyd +0 -0
- pyvale/dicchecks.py +476 -0
- pyvale/dicdataimport.py +247 -0
- pyvale/dicregionofinterest.py +887 -0
- pyvale/dicresults.py +55 -0
- pyvale/dicspecklegenerator.py +238 -0
- pyvale/dicspecklequality.py +305 -0
- pyvale/dicstrain.py +387 -0
- pyvale/dicstrainresults.py +37 -0
- pyvale/errorintegrator.py +10 -8
- pyvale/examples/basics/ex1_1_basicscalars_therm2d.py +124 -113
- pyvale/examples/basics/ex1_2_sensormodel_therm2d.py +124 -132
- pyvale/examples/basics/ex1_3_customsens_therm3d.py +199 -195
- pyvale/examples/basics/ex1_4_basicerrors_therm3d.py +125 -121
- pyvale/examples/basics/ex1_5_fielderrs_therm3d.py +145 -141
- pyvale/examples/basics/ex1_6_caliberrs_therm2d.py +96 -101
- pyvale/examples/basics/ex1_7_spatavg_therm2d.py +109 -105
- pyvale/examples/basics/ex2_1_basicvectors_disp2d.py +92 -91
- pyvale/examples/basics/ex2_2_vectorsens_disp2d.py +96 -90
- pyvale/examples/basics/ex2_3_sensangle_disp2d.py +88 -89
- pyvale/examples/basics/ex2_4_chainfielderrs_disp2d.py +172 -171
- pyvale/examples/basics/ex2_5_vectorfields3d_disp3d.py +88 -86
- pyvale/examples/basics/ex3_1_basictensors_strain2d.py +90 -90
- pyvale/examples/basics/ex3_2_tensorsens2d_strain2d.py +93 -91
- pyvale/examples/basics/ex3_3_tensorsens3d_strain3d.py +172 -160
- pyvale/examples/basics/ex4_1_expsim2d_thermmech2d.py +154 -148
- pyvale/examples/basics/ex4_2_expsim3d_thermmech3d.py +249 -231
- pyvale/examples/dic/ex1_region_of_interest.py +98 -0
- pyvale/examples/dic/ex2_plate_with_hole.py +149 -0
- pyvale/examples/dic/ex3_plate_with_hole_strain.py +93 -0
- pyvale/examples/dic/ex4_dic_blender.py +95 -0
- pyvale/examples/dic/ex5_dic_challenge.py +102 -0
- pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +4 -2
- pyvale/examples/renderblender/ex1_1_blenderscene.py +152 -105
- pyvale/examples/renderblender/ex1_2_blenderdeformed.py +151 -100
- pyvale/examples/renderblender/ex2_1_stereoscene.py +183 -116
- pyvale/examples/renderblender/ex2_2_stereodeformed.py +185 -112
- pyvale/examples/renderblender/ex3_1_blendercalibration.py +164 -109
- pyvale/examples/renderrasterisation/ex_rastenp.py +74 -35
- pyvale/examples/renderrasterisation/ex_rastercyth_oneframe.py +6 -13
- pyvale/examples/renderrasterisation/ex_rastercyth_static_cypara.py +2 -2
- pyvale/examples/renderrasterisation/ex_rastercyth_static_pypara.py +2 -4
- pyvale/imagedef2d.py +3 -2
- pyvale/imagetools.py +137 -0
- pyvale/rastercy.py +34 -4
- pyvale/rasternp.py +300 -276
- pyvale/rasteropts.py +58 -0
- pyvale/renderer.py +47 -0
- pyvale/rendermesh.py +52 -62
- pyvale/renderscene.py +51 -0
- pyvale/sensorarrayfactory.py +2 -2
- pyvale/sensortools.py +19 -35
- pyvale/simcases/case21.i +1 -1
- pyvale/simcases/run_1case.py +8 -0
- pyvale/simtools.py +2 -2
- pyvale/visualsimplotter.py +180 -0
- {pyvale-2025.5.3.dist-info → pyvale-2025.7.1.dist-info}/METADATA +11 -57
- {pyvale-2025.5.3.dist-info → pyvale-2025.7.1.dist-info}/RECORD +93 -56
- {pyvale-2025.5.3.dist-info → pyvale-2025.7.1.dist-info}/WHEEL +1 -1
- pyvale/examples/visualisation/ex1_1_plot_traces.py +0 -102
- pyvale/examples/visualisation/ex2_1_animate_sim.py +0 -89
- {pyvale-2025.5.3.dist-info → pyvale-2025.7.1.dist-info}/licenses/LICENSE +0 -0
- {pyvale-2025.5.3.dist-info → pyvale-2025.7.1.dist-info}/top_level.txt +0 -0
pyvale/dic/cpp/dicrg.cpp
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// ================================================================================
|
|
2
|
+
// pyvale: the python validation engine
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Copyright (C) 2025 The Computer Aided Validation Team
|
|
5
|
+
// ================================================================================
|
|
6
|
+
|
|
7
|
+
// STD library Header files
|
|
8
|
+
#include <csignal>
|
|
9
|
+
#include <cstdlib>
|
|
10
|
+
#include <vector>
|
|
11
|
+
#include <iostream>
|
|
12
|
+
#include <omp.h>
|
|
13
|
+
#include <memory>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// Program Header files
|
|
18
|
+
#include "./dicutil.hpp"
|
|
19
|
+
#include "./defines.hpp"
|
|
20
|
+
#include "./dicrg.hpp"
|
|
21
|
+
#include "./dicfourier.hpp"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
namespace rg {
|
|
25
|
+
|
|
26
|
+
int next_pow2(int n) {
|
|
27
|
+
if (n <= 0){
|
|
28
|
+
std::cerr << __FILE__ << " " << __LINE__ << std::endl;
|
|
29
|
+
std::cerr << "Expected a positive integer to calculate next power of 2 " << std::endl;
|
|
30
|
+
std::cerr << "n = " << n << std::endl;
|
|
31
|
+
exit(EXIT_FAILURE);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// If already a power of 2, return as-is
|
|
35
|
+
if ((n & (n - 1)) == 0) return n;
|
|
36
|
+
|
|
37
|
+
n--;
|
|
38
|
+
n |= n >> 1;
|
|
39
|
+
n |= n >> 2;
|
|
40
|
+
n |= n >> 4;
|
|
41
|
+
n |= n >> 8;
|
|
42
|
+
n |= n >> 16;
|
|
43
|
+
n++;
|
|
44
|
+
|
|
45
|
+
// Handle possible overflow
|
|
46
|
+
if (n < 0) return std::numeric_limits<int>::max();
|
|
47
|
+
|
|
48
|
+
return n;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
std::vector<int> pow2_between(int n, int x) {
|
|
53
|
+
std::vector<int> result;
|
|
54
|
+
int power = next_pow2(n);
|
|
55
|
+
while (power >= x) {
|
|
56
|
+
result.push_back(power);
|
|
57
|
+
power /= 2;
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
bool is_valid_point(const int ss_x, const int ss_y, const util::SubsetData &ssdata) {
|
|
63
|
+
|
|
64
|
+
int x = ss_x / ssdata.step;
|
|
65
|
+
int y = ss_y / ssdata.step;
|
|
66
|
+
|
|
67
|
+
int idx = y * ssdata.num_ss_x + x;
|
|
68
|
+
|
|
69
|
+
if ((ss_x % ssdata.step) || (ss_y % ssdata.step)){
|
|
70
|
+
std::cerr << "Subset coordinates (" << ss_x << ", " << ss_y << ") are not a valid subset location." << std::endl;
|
|
71
|
+
std::cerr << "Subset ss_step size: " << ssdata.step << std::endl;
|
|
72
|
+
return false;
|
|
73
|
+
exit(EXIT_FAILURE);
|
|
74
|
+
}
|
|
75
|
+
else if (ssdata.mask[idx] == -1){
|
|
76
|
+
std::cerr << "Subset coordinates (" << ss_x << ", " << ss_y << ") are not a valid subset location." << std::endl;
|
|
77
|
+
std::cerr << "subset mask index: " << idx << std::endl;
|
|
78
|
+
return false;
|
|
79
|
+
exit(EXIT_FAILURE);
|
|
80
|
+
}
|
|
81
|
+
else return true;
|
|
82
|
+
|
|
83
|
+
//auto it = ssdata.coords_to_idx.find({ss_x, ss_y});
|
|
84
|
+
|
|
85
|
+
//// check if coordinates are in the coordinate list
|
|
86
|
+
//if (it == ssdata.coords_to_idx.end()) {
|
|
87
|
+
// std::cerr << "Error: coordinates not found in the coordinate list." << std::endl;
|
|
88
|
+
// std::cerr << "Coordinates: " << ss_x << ", " << ss_y << std::endl;
|
|
89
|
+
// exit(EXIT_FAILURE);
|
|
90
|
+
//}
|
|
91
|
+
//else return true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
void get_rigid_shift(double &shift_x, double &shift_y,
|
|
96
|
+
const int ss_x, const int ss_y,
|
|
97
|
+
std::vector<std::unique_ptr<fourier::FFT>>& fft_windows,
|
|
98
|
+
const Interpolator &interp_ref,
|
|
99
|
+
const double *img_def){
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
const int px_hori = interp_ref.px_hori;
|
|
103
|
+
const int px_vert = interp_ref.px_vert;
|
|
104
|
+
|
|
105
|
+
double prev_x = 0, prev_y = 0;
|
|
106
|
+
|
|
107
|
+
// loop over window sizes
|
|
108
|
+
for (size_t w = 0; w < fft_windows.size(); w++){
|
|
109
|
+
|
|
110
|
+
// get the deformed subset values
|
|
111
|
+
util::extract_ss(fft_windows[w]->ss_def, ss_x, ss_y, px_hori, px_vert, img_def);
|
|
112
|
+
|
|
113
|
+
// add shift from previous window size;
|
|
114
|
+
double ss_x_shft = ss_x-prev_x;
|
|
115
|
+
double ss_y_shft = ss_y-prev_y;
|
|
116
|
+
|
|
117
|
+
// get the reference subset values from interpolator
|
|
118
|
+
util::extract_ss_subpx(fft_windows[w]->ss_ref, ss_x_shft, ss_y_shft, interp_ref);
|
|
119
|
+
|
|
120
|
+
// zero normalise the subsets
|
|
121
|
+
fourier::zero_norm_subsets(fft_windows[w]->ss_def.vals, fft_windows[w]->ss_ref.vals, fft_windows[w]->ss_def.size);
|
|
122
|
+
|
|
123
|
+
// get peaks from the cross correlation
|
|
124
|
+
double peak_x = 0, peak_y = 0, max_val = 0.0;
|
|
125
|
+
fft_windows[w]->correlate();
|
|
126
|
+
fft_windows[w]->find_peak(peak_x, peak_y, max_val, true, "GAUSSIAN_2D");
|
|
127
|
+
prev_x += peak_x;
|
|
128
|
+
prev_y += peak_y;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// return the shift once we've reached smallest window size
|
|
132
|
+
shift_x = prev_x;
|
|
133
|
+
shift_y = prev_y;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|