pyvale 2025.5.3__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.

Files changed (174) hide show
  1. pyvale/__init__.py +89 -0
  2. pyvale/analyticmeshgen.py +102 -0
  3. pyvale/analyticsimdatafactory.py +91 -0
  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/camera.py +146 -0
  12. pyvale/cameradata.py +69 -0
  13. pyvale/cameradata2d.py +84 -0
  14. pyvale/camerastereo.py +217 -0
  15. pyvale/cameratools.py +522 -0
  16. pyvale/cython/rastercyth.c +32211 -0
  17. pyvale/cython/rastercyth.cp311-win_amd64.pyd +0 -0
  18. pyvale/cython/rastercyth.py +640 -0
  19. pyvale/data/__init__.py +5 -0
  20. pyvale/data/cal_target.tiff +0 -0
  21. pyvale/data/case00_HEX20_out.e +0 -0
  22. pyvale/data/case00_HEX27_out.e +0 -0
  23. pyvale/data/case00_HEX8_out.e +0 -0
  24. pyvale/data/case00_TET10_out.e +0 -0
  25. pyvale/data/case00_TET14_out.e +0 -0
  26. pyvale/data/case00_TET4_out.e +0 -0
  27. pyvale/data/case13_out.e +0 -0
  28. pyvale/data/case16_out.e +0 -0
  29. pyvale/data/case17_out.e +0 -0
  30. pyvale/data/case18_1_out.e +0 -0
  31. pyvale/data/case18_2_out.e +0 -0
  32. pyvale/data/case18_3_out.e +0 -0
  33. pyvale/data/case25_out.e +0 -0
  34. pyvale/data/case26_out.e +0 -0
  35. pyvale/data/optspeckle_2464x2056px_spec5px_8bit_gblur1px.tiff +0 -0
  36. pyvale/dataset.py +325 -0
  37. pyvale/errorcalculator.py +109 -0
  38. pyvale/errordriftcalc.py +146 -0
  39. pyvale/errorintegrator.py +336 -0
  40. pyvale/errorrand.py +607 -0
  41. pyvale/errorsyscalib.py +134 -0
  42. pyvale/errorsysdep.py +327 -0
  43. pyvale/errorsysfield.py +414 -0
  44. pyvale/errorsysindep.py +808 -0
  45. pyvale/examples/__init__.py +5 -0
  46. pyvale/examples/basics/ex1_1_basicscalars_therm2d.py +131 -0
  47. pyvale/examples/basics/ex1_2_sensormodel_therm2d.py +158 -0
  48. pyvale/examples/basics/ex1_3_customsens_therm3d.py +216 -0
  49. pyvale/examples/basics/ex1_4_basicerrors_therm3d.py +153 -0
  50. pyvale/examples/basics/ex1_5_fielderrs_therm3d.py +168 -0
  51. pyvale/examples/basics/ex1_6_caliberrs_therm2d.py +133 -0
  52. pyvale/examples/basics/ex1_7_spatavg_therm2d.py +123 -0
  53. pyvale/examples/basics/ex2_1_basicvectors_disp2d.py +112 -0
  54. pyvale/examples/basics/ex2_2_vectorsens_disp2d.py +111 -0
  55. pyvale/examples/basics/ex2_3_sensangle_disp2d.py +139 -0
  56. pyvale/examples/basics/ex2_4_chainfielderrs_disp2d.py +196 -0
  57. pyvale/examples/basics/ex2_5_vectorfields3d_disp3d.py +109 -0
  58. pyvale/examples/basics/ex3_1_basictensors_strain2d.py +114 -0
  59. pyvale/examples/basics/ex3_2_tensorsens2d_strain2d.py +111 -0
  60. pyvale/examples/basics/ex3_3_tensorsens3d_strain3d.py +182 -0
  61. pyvale/examples/basics/ex4_1_expsim2d_thermmech2d.py +171 -0
  62. pyvale/examples/basics/ex4_2_expsim3d_thermmech3d.py +252 -0
  63. pyvale/examples/genanalyticdata/ex1_1_scalarvisualisation.py +35 -0
  64. pyvale/examples/genanalyticdata/ex1_2_scalarcasebuild.py +43 -0
  65. pyvale/examples/genanalyticdata/ex2_1_analyticsensors.py +80 -0
  66. pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +79 -0
  67. pyvale/examples/renderblender/ex1_1_blenderscene.py +121 -0
  68. pyvale/examples/renderblender/ex1_2_blenderdeformed.py +119 -0
  69. pyvale/examples/renderblender/ex2_1_stereoscene.py +128 -0
  70. pyvale/examples/renderblender/ex2_2_stereodeformed.py +131 -0
  71. pyvale/examples/renderblender/ex3_1_blendercalibration.py +120 -0
  72. pyvale/examples/renderrasterisation/ex_rastenp.py +153 -0
  73. pyvale/examples/renderrasterisation/ex_rastercyth_oneframe.py +218 -0
  74. pyvale/examples/renderrasterisation/ex_rastercyth_static_cypara.py +187 -0
  75. pyvale/examples/renderrasterisation/ex_rastercyth_static_pypara.py +190 -0
  76. pyvale/examples/visualisation/ex1_1_plot_traces.py +102 -0
  77. pyvale/examples/visualisation/ex2_1_animate_sim.py +89 -0
  78. pyvale/experimentsimulator.py +175 -0
  79. pyvale/field.py +128 -0
  80. pyvale/fieldconverter.py +351 -0
  81. pyvale/fieldsampler.py +111 -0
  82. pyvale/fieldscalar.py +166 -0
  83. pyvale/fieldtensor.py +218 -0
  84. pyvale/fieldtransform.py +388 -0
  85. pyvale/fieldvector.py +213 -0
  86. pyvale/generatorsrandom.py +505 -0
  87. pyvale/imagedef2d.py +569 -0
  88. pyvale/integratorfactory.py +240 -0
  89. pyvale/integratorquadrature.py +217 -0
  90. pyvale/integratorrectangle.py +165 -0
  91. pyvale/integratorspatial.py +89 -0
  92. pyvale/integratortype.py +43 -0
  93. pyvale/output.py +17 -0
  94. pyvale/pyvaleexceptions.py +11 -0
  95. pyvale/raster.py +31 -0
  96. pyvale/rastercy.py +77 -0
  97. pyvale/rasternp.py +603 -0
  98. pyvale/rendermesh.py +147 -0
  99. pyvale/sensorarray.py +178 -0
  100. pyvale/sensorarrayfactory.py +196 -0
  101. pyvale/sensorarraypoint.py +278 -0
  102. pyvale/sensordata.py +71 -0
  103. pyvale/sensordescriptor.py +213 -0
  104. pyvale/sensortools.py +142 -0
  105. pyvale/simcases/case00_HEX20.i +242 -0
  106. pyvale/simcases/case00_HEX27.i +242 -0
  107. pyvale/simcases/case00_HEX8.i +242 -0
  108. pyvale/simcases/case00_TET10.i +242 -0
  109. pyvale/simcases/case00_TET14.i +242 -0
  110. pyvale/simcases/case00_TET4.i +242 -0
  111. pyvale/simcases/case01.i +101 -0
  112. pyvale/simcases/case02.i +156 -0
  113. pyvale/simcases/case03.i +136 -0
  114. pyvale/simcases/case04.i +181 -0
  115. pyvale/simcases/case05.i +234 -0
  116. pyvale/simcases/case06.i +305 -0
  117. pyvale/simcases/case07.geo +135 -0
  118. pyvale/simcases/case07.i +87 -0
  119. pyvale/simcases/case08.geo +144 -0
  120. pyvale/simcases/case08.i +153 -0
  121. pyvale/simcases/case09.geo +204 -0
  122. pyvale/simcases/case09.i +87 -0
  123. pyvale/simcases/case10.geo +204 -0
  124. pyvale/simcases/case10.i +257 -0
  125. pyvale/simcases/case11.geo +337 -0
  126. pyvale/simcases/case11.i +147 -0
  127. pyvale/simcases/case12.geo +388 -0
  128. pyvale/simcases/case12.i +329 -0
  129. pyvale/simcases/case13.i +140 -0
  130. pyvale/simcases/case14.i +159 -0
  131. pyvale/simcases/case15.geo +337 -0
  132. pyvale/simcases/case15.i +150 -0
  133. pyvale/simcases/case16.geo +391 -0
  134. pyvale/simcases/case16.i +357 -0
  135. pyvale/simcases/case17.geo +135 -0
  136. pyvale/simcases/case17.i +144 -0
  137. pyvale/simcases/case18.i +254 -0
  138. pyvale/simcases/case18_1.i +254 -0
  139. pyvale/simcases/case18_2.i +254 -0
  140. pyvale/simcases/case18_3.i +254 -0
  141. pyvale/simcases/case19.geo +252 -0
  142. pyvale/simcases/case19.i +99 -0
  143. pyvale/simcases/case20.geo +252 -0
  144. pyvale/simcases/case20.i +250 -0
  145. pyvale/simcases/case21.geo +74 -0
  146. pyvale/simcases/case21.i +155 -0
  147. pyvale/simcases/case22.geo +82 -0
  148. pyvale/simcases/case22.i +140 -0
  149. pyvale/simcases/case23.geo +164 -0
  150. pyvale/simcases/case23.i +140 -0
  151. pyvale/simcases/case24.geo +79 -0
  152. pyvale/simcases/case24.i +123 -0
  153. pyvale/simcases/case25.geo +82 -0
  154. pyvale/simcases/case25.i +140 -0
  155. pyvale/simcases/case26.geo +166 -0
  156. pyvale/simcases/case26.i +140 -0
  157. pyvale/simcases/run_1case.py +61 -0
  158. pyvale/simcases/run_all_cases.py +69 -0
  159. pyvale/simcases/run_build_case.py +64 -0
  160. pyvale/simcases/run_example_cases.py +69 -0
  161. pyvale/simtools.py +67 -0
  162. pyvale/visualexpplotter.py +191 -0
  163. pyvale/visualimagedef.py +74 -0
  164. pyvale/visualimages.py +76 -0
  165. pyvale/visualopts.py +493 -0
  166. pyvale/visualsimanimator.py +111 -0
  167. pyvale/visualsimsensors.py +318 -0
  168. pyvale/visualtools.py +136 -0
  169. pyvale/visualtraceplotter.py +142 -0
  170. pyvale-2025.5.3.dist-info/METADATA +144 -0
  171. pyvale-2025.5.3.dist-info/RECORD +174 -0
  172. pyvale-2025.5.3.dist-info/WHEEL +5 -0
  173. pyvale-2025.5.3.dist-info/licenses/LICENSE +21 -0
  174. pyvale-2025.5.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,250 @@
1
+ #-------------------------------------------------------------------------
2
+ # pyvale: gmsh,3Dstcgmsh,1mat,thermomechanical,steady,
3
+ #-------------------------------------------------------------------------
4
+
5
+ #-------------------------------------------------------------------------
6
+ #_* MOOSEHERDER VARIABLES - START
7
+
8
+ # Thermal Loads/BCs
9
+ coolantTemp = 150.0 # degC
10
+ heatTransCoeff = 125.0e3 # W.m^-2.K^-1
11
+
12
+ surfHeatPower = 0.25e3 # W
13
+ blockLeng = 49.5e-3
14
+ blockWidth = 37e-3
15
+ surfArea = ${fparse blockLeng*blockWidth} # m^2
16
+ surfHeatFlux = ${fparse surfHeatPower/surfArea} # W.m^-2
17
+
18
+ # Material Properties:
19
+ # Thermal Props: SS316L @ 400degC
20
+ ss316LDensity = 7770.0 # kg.m^-3
21
+ ss316LThermCond = 19.99 # W.m^-1.K^-1
22
+ ss316LSpecHeat = 556.0 # J.kg^-1.K^-1
23
+
24
+ # Mechanical Props: SS316L @ 400degC
25
+ ss316LEMod = 168e9 # Pa
26
+ ss316LPRatio = 0.3 # -
27
+
28
+ # Thermo-mechanical coupling
29
+ stressFreeTemp = 150 # degC
30
+ ss316LThermExp = 17.8e-6 # 1/degC
31
+
32
+ # Element properties
33
+ elem_order = 'SECOND'
34
+
35
+ #** MOOSEHERDER VARIABLES - END
36
+ #-------------------------------------------------------------------------
37
+
38
+
39
+ [GlobalParams]
40
+ displacements = 'disp_x disp_y disp_z'
41
+ []
42
+
43
+ [Mesh]
44
+ type = FileMesh
45
+ file = 'case20.msh'
46
+ []
47
+
48
+ [Variables]
49
+ [temperature]
50
+ family = LAGRANGE
51
+ order = ${elem_order}
52
+ initial_condition = ${coolantTemp}
53
+ []
54
+ []
55
+
56
+ [Kernels]
57
+ [heat_conduction]
58
+ type = HeatConduction
59
+ variable = temperature
60
+ []
61
+ []
62
+
63
+ [Modules/TensorMechanics/Master]
64
+ [all]
65
+ strain = SMALL # SMALL or FINITE
66
+ incremental = true
67
+ add_variables = true
68
+ material_output_family = MONOMIAL # MONOMIAL, LAGRANGE
69
+ material_output_order = FIRST # CONSTANT, FIRST, SECOND,
70
+ automatic_eigenstrain_names = true
71
+ generate_output = 'vonmises_stress strain_xx strain_xy strain_xz strain_yx strain_yy strain_yz strain_zx strain_zy strain_zz stress_xx stress_xy stress_xz stress_yx stress_yy stress_yz stress_zx stress_zy stress_zz max_principal_strain mid_principal_strain min_principal_strain'
72
+ []
73
+ []
74
+
75
+ [Materials]
76
+ [copper_thermal]
77
+ type = HeatConductionMaterial
78
+ thermal_conductivity = ${ss316LThermCond}
79
+ specific_heat = ${ss316LSpecHeat}
80
+ []
81
+ [copper_density]
82
+ type = GenericConstantMaterial
83
+ prop_names = 'density'
84
+ prop_values = ${ss316LDensity}
85
+ []
86
+ [copper_elasticity]
87
+ type = ComputeIsotropicElasticityTensor
88
+ youngs_modulus = ${ss316LEMod}
89
+ poissons_ratio = ${ss316LPRatio}
90
+ []
91
+ [copper_expansion]
92
+ type = ComputeThermalExpansionEigenstrain
93
+ temperature = temperature
94
+ stress_free_temperature = ${stressFreeTemp}
95
+ thermal_expansion_coeff = ${ss316LThermExp}
96
+ eigenstrain_name = thermal_expansion_eigenstrain
97
+ []
98
+
99
+ [stress]
100
+ type = ComputeFiniteStrainElasticStress # ComputeLinearElasticStress or ComputeFiniteStrainElasticStress
101
+ []
102
+ []
103
+
104
+ [BCs]
105
+ [heat_flux_out]
106
+ type = ConvectiveHeatFluxBC
107
+ variable = temperature
108
+ boundary = 'bc-pipe-htc'
109
+ T_infinity = ${coolantTemp}
110
+ heat_transfer_coefficient = ${heatTransCoeff}
111
+ []
112
+ [heat_flux_in]
113
+ type = NeumannBC
114
+ variable = temperature
115
+ boundary = 'bc-top-heatflux'
116
+ value = ${surfHeatFlux}
117
+ []
118
+
119
+ # Lock disp_y for whole base
120
+ [mech_bc_c_dispy]
121
+ type = DirichletBC
122
+ variable = disp_y
123
+ boundary = 'bc-base-disp'
124
+ value = 0.0
125
+ []
126
+
127
+ # Lock all disp DOFs at the center of the block
128
+ [mech_bc_c_dispx]
129
+ type = DirichletBC
130
+ variable = disp_x
131
+ boundary = 'bc-base-c-loc-xyz'
132
+ value = 0.0
133
+ []
134
+ [mech_bc_c_dispz]
135
+ type = DirichletBC
136
+ variable = disp_z
137
+ boundary = 'bc-base-c-loc-xyz'
138
+ value = 0.0
139
+ []
140
+
141
+ # Lock z dof along x axis
142
+ [mech_bc_px_dispz]
143
+ type = DirichletBC
144
+ variable = disp_z
145
+ boundary = 'bc-base-nx-loc-z'
146
+ value = 0.0
147
+ []
148
+
149
+ # Lock x dof along z
150
+ [mech_bc_pz_dispx]
151
+ type = DirichletBC
152
+ variable = disp_x
153
+ boundary = 'bc-base-pz-loc-x'
154
+ value = 0.0
155
+ []
156
+ [mech_bc_nz_dispx]
157
+ type = DirichletBC
158
+ variable = disp_x
159
+ boundary = 'bc-base-nz-loc-x'
160
+ value = 0.0
161
+ []
162
+ []
163
+
164
+ [Preconditioning]
165
+ [smp]
166
+ type = SMP
167
+ full = true
168
+ []
169
+ []
170
+
171
+ # LF-PersonalLaptop AMD 8 core / 8 thread
172
+ # Trans, Precon=ON, NEWTON, pctype=lu, solve time with 7 mpi tasks = 229.18s
173
+ # Trans, Precon=OFF, NEWTON, pctype=lu, solve time with 7 mpi tasks = 226.52s
174
+ # Steady, Precon=OFF, NEWTON, pctype=lu, solve time with 7 mpi tasks = 226.52s
175
+
176
+ # LF-WorkLaptop AMD 8 core/ 16 threads
177
+ # Steady, Precon=OFF, NEWTON, pctype=lu, solve time with 8 mpi tasks = 275s
178
+ # Steady, Precon=OFF, NEWTON, pctype=lu, solve time with 6 mpi tasks = ~350s
179
+ # Steady, Precon=OFF, NEWTON, pctype=lu, solve time with 4 mpi tasks = 458s
180
+
181
+ [Executioner]
182
+ type = Steady
183
+ #---------------------------------------------------------------------------
184
+ solve_type = PJFNK # PJNFK or NEWTON
185
+ l_max_its = 100 # default = 1000
186
+ nl_max_its = 100
187
+ l_tol = 1e-5 # default = 1e-5
188
+ nl_abs_tol = 1e-6 # default = 1e-50, set 1e-6
189
+ nl_rel_tol = 1e-6 # default = 1e-8, set 1e-6
190
+
191
+ line_search = none
192
+ petsc_options_iname = '-pc_type -pc_hypre_type'
193
+ petsc_options_value = 'hypre boomeramg'
194
+
195
+ #---------------------------------------------------------------------------
196
+ # solve_type = 'NEWTON' # NEWTON or PJNFK
197
+ # petsc_options_iname = '-pc_type'
198
+ # petsc_options_value = 'lu'
199
+
200
+ # l_max_its = 100
201
+ # nl_max_its = 100
202
+ # nl_rel_tol = 1e-6
203
+ # nl_abs_tol = 1e-6
204
+ # l_tol = 1e-5
205
+
206
+ #---------------------------------------------------------------------------
207
+ #end_time= ${endTime}
208
+ #dt = ${timeStep}
209
+ []
210
+
211
+ [Postprocessors]
212
+ [temp_max]
213
+ type = NodalExtremeValue
214
+ variable = temperature
215
+ []
216
+ [temp_avg]
217
+ type = AverageNodalVariableValue
218
+ variable = temperature
219
+ []
220
+
221
+ [disp_x_max]
222
+ type = NodalExtremeValue
223
+ variable = disp_x
224
+ []
225
+ [disp_y_max]
226
+ type = NodalExtremeValue
227
+ variable = disp_y
228
+ []
229
+ [disp_z_max]
230
+ type = NodalExtremeValue
231
+ variable = disp_z
232
+ []
233
+
234
+ [strain_xx_max]
235
+ type = ElementExtremeValue
236
+ variable = strain_xx
237
+ []
238
+ [strain_yy_max]
239
+ type = ElementExtremeValue
240
+ variable = strain_yy
241
+ []
242
+ [strain_zz_max]
243
+ type = ElementExtremeValue
244
+ variable = strain_zz
245
+ []
246
+ []
247
+
248
+ [Outputs]
249
+ exodus = true
250
+ []
@@ -0,0 +1,74 @@
1
+ //==============================================================================
2
+ // Gmsh 3D cylinder imaging test case
3
+ // author: Lloyd Fletcher (scepticalrabbit)
4
+ //==============================================================================
5
+ // Always set to OpenCASCADE - circles and boolean opts are much easier!
6
+ SetFactory("OpenCASCADE");
7
+
8
+ // Allows gmsh to print to terminal in vscode - easier debugging
9
+ General.Terminal = 1;
10
+
11
+ // View options - not required when
12
+ Geometry.PointLabels = 1;
13
+ Geometry.CurveLabels = 1;
14
+ Geometry.SurfaceLabels = 1;
15
+ Geometry.VolumeLabels = 0;
16
+
17
+ //-------------------------------------------------------------------------
18
+ //_* MOOSEHERDER VARIABLES - START
19
+ file_name = "case21.msh";
20
+
21
+ // Geometric variables
22
+ cyl_height = 25e-3;
23
+ cyl_diam = 25e-3;
24
+
25
+ // Must be an integer
26
+ elem_order = 1;
27
+ mesh_ref = 4;
28
+ mesh_size = 2.5e-3/mesh_ref;
29
+ num_threads = 4;
30
+ //** MOOSEHERDER VARIABLES - END
31
+ //------------------------------------------------------------------------------
32
+
33
+ //------------------------------------------------------------------------------
34
+ // Calculated / Fixed Variables
35
+ cyl_rad = cyl_diam/2;
36
+ tol = mesh_size/4; // Used for bounding box selection tolerance
37
+
38
+ //------------------------------------------------------------------------------
39
+ // Geometry Definition
40
+ v1 = newv;
41
+ Cylinder(v1) = {0.0,0.0,0.0, // center location of first face
42
+ 0.0,cyl_height,0.0, // vector defining direction
43
+ cyl_rad,2*Pi};
44
+
45
+ //------------------------------------------------------------------------------
46
+ // Mesh Sizing
47
+ MeshSize{ PointsOf{ Volume{:}; } } = mesh_size;
48
+
49
+ //------------------------------------------------------------------------------
50
+ // Physical Volumes and Surfaces
51
+ Physical Volume("cyl-vol") = {Volume{:}};
52
+
53
+ // Physical surface for mechanical BC for disp_y
54
+ Physical Surface("cyl-surf-vis") = {1};
55
+ Physical Surface("bc-top-disp") = {2};
56
+ Physical Surface("bc-base-disp") = {3};
57
+
58
+ //------------------------------------------------------------------------------
59
+ // Global meshing
60
+ Mesh.Algorithm = 6;
61
+ Mesh.Algorithm3D = 10;
62
+
63
+ General.NumThreads = num_threads;
64
+ Mesh.MaxNumThreads1D = num_threads;
65
+ Mesh.MaxNumThreads2D = num_threads;
66
+ Mesh.MaxNumThreads3D = num_threads;
67
+
68
+ Mesh.ElementOrder = elem_order;
69
+ Mesh 3;
70
+
71
+ //------------------------------------------------------------------------------
72
+ // Save and exit
73
+ Save Str(file_name);
74
+ Exit;
@@ -0,0 +1,155 @@
1
+ #-------------------------------------------------------------------------
2
+ # pyvale: gmsh,mechanical,transient
3
+ #-------------------------------------------------------------------------
4
+
5
+ #-------------------------------------------------------------------------
6
+ #_* MOOSEHERDER VARIABLES - START
7
+
8
+ endTime = 10
9
+ timeStep = 1
10
+
11
+ # Mechanical Loads/BCs
12
+ topDispRate = ${fparse -1.5e-3 / endTime} # m/s
13
+
14
+ # Mechanical Props: SS316L @ 20degC
15
+ ss316LEMod = 200e9 # Pa
16
+ ss316LPRatio = 0.3 # -
17
+
18
+ #** MOOSEHERDER VARIABLES - END
19
+ #-------------------------------------------------------------------------
20
+
21
+ [GlobalParams]
22
+ displacements = 'disp_x disp_y disp_z'
23
+ []
24
+
25
+ [Mesh]
26
+ type = FileMesh
27
+ file = 'case21.msh'
28
+ []
29
+
30
+ [Modules/TensorMechanics/Master]
31
+ [all]
32
+ strain = SMALL
33
+ incremental = true
34
+ add_variables = true
35
+ material_output_family = MONOMIAL # MONOMIAL, LAGRANGE
36
+ material_output_order = FIRST # CONSTANT, FIRST, SECOND,
37
+ generate_output = 'vonmises_stress strain_xx strain_xy strain_xz strain_yx strain_yy strain_yz strain_zx strain_zy strain_zz stress_xx stress_xy stress_xz stress_yx stress_yy stress_yz stress_zx stress_zy stress_zz max_principal_strain mid_principal_strain min_principal_strain'
38
+ []
39
+ []
40
+
41
+ [BCs]
42
+ [bottom_x]
43
+ type = DirichletBC
44
+ variable = disp_x
45
+ boundary = 'bc-base-disp'
46
+ value = 0.0
47
+ []
48
+ [bottom_y]
49
+ type = DirichletBC
50
+ variable = disp_y
51
+ boundary = 'bc-base-disp'
52
+ value = 0.0
53
+ []
54
+ [bottom_z]
55
+ type = DirichletBC
56
+ variable = disp_z
57
+ boundary = 'bc-base-disp'
58
+ value = 0.0
59
+ []
60
+
61
+
62
+ [top_x]
63
+ type = DirichletBC
64
+ variable = disp_x
65
+ boundary = 'bc-top-disp'
66
+ value = 0.0
67
+ []
68
+ [top_y]
69
+ type = FunctionDirichletBC
70
+ variable = disp_y
71
+ boundary = 'bc-top-disp'
72
+ function = '${topDispRate}*t'
73
+ []
74
+ [top_z]
75
+ type = DirichletBC
76
+ variable = disp_z
77
+ boundary = 'bc-top-disp'
78
+ value = 0.0
79
+ []
80
+ []
81
+
82
+ [Materials]
83
+ [elasticity]
84
+ type = ComputeIsotropicElasticityTensor
85
+ youngs_modulus = ${ss316LEMod}
86
+ poissons_ratio = ${ss316LPRatio}
87
+ []
88
+ [stress]
89
+ type = ComputeFiniteStrainElasticStress
90
+ []
91
+ []
92
+
93
+ [Preconditioning]
94
+ [SMP]
95
+ type = SMP
96
+ full = true
97
+ []
98
+ []
99
+
100
+ [Executioner]
101
+ type = Transient
102
+
103
+ solve_type = 'NEWTON'
104
+ petsc_options = '-snes_converged_reason'
105
+ petsc_options_iname = '-pc_type -pc_hypre_type'
106
+ petsc_options_value = 'hypre boomeramg'
107
+
108
+ l_max_its = 500
109
+ l_tol = 1e-6
110
+
111
+ nl_max_its = 100
112
+ nl_rel_tol = 1e-6
113
+ nl_abs_tol = 1e-6
114
+
115
+ end_time= ${endTime}
116
+ dt = ${timeStep}
117
+
118
+ [Predictor]
119
+ type = SimplePredictor
120
+ scale = 1
121
+ []
122
+ []
123
+
124
+
125
+ [Postprocessors]
126
+ [react_y_bot]
127
+ type = SidesetReaction
128
+ direction = '0 1 0'
129
+ stress_tensor = stress
130
+ boundary = 'bc-base-disp'
131
+ []
132
+ [react_y_top]
133
+ type = SidesetReaction
134
+ direction = '0 1 0'
135
+ stress_tensor = stress
136
+ boundary = 'bc-top-disp'
137
+ []
138
+
139
+ [disp_y_max]
140
+ type = NodalExtremeValue
141
+ variable = disp_y
142
+ []
143
+ [disp_x_max]
144
+ type = NodalExtremeValue
145
+ variable = disp_x
146
+ []
147
+ [disp_z_max]
148
+ type = NodalExtremeValue
149
+ variable = disp_x
150
+ []
151
+ []
152
+
153
+ [Outputs]
154
+ exodus = true
155
+ []
@@ -0,0 +1,82 @@
1
+ //==============================================================================
2
+ // Gmsh 3D plate imaging test case
3
+ // author: Lloyd Fletcher (scepticalrabbit)
4
+ //==============================================================================
5
+ // Always set to OpenCASCADE - circles and boolean opts are much easier!
6
+ SetFactory("OpenCASCADE");
7
+
8
+ // Allows gmsh to print to terminal in vscode - easier debugging
9
+ General.Terminal = 1;
10
+
11
+ // View options - not required when
12
+ Geometry.PointLabels = 1;
13
+ Geometry.CurveLabels = 1;
14
+ Geometry.SurfaceLabels = 1;
15
+ Geometry.VolumeLabels = 0;
16
+
17
+ //-------------------------------------------------------------------------
18
+ //_* MOOSEHERDER VARIABLES - START
19
+ file_name = "case22.msh";
20
+
21
+ // Geometric variables
22
+ plate_thick = 2e-3;
23
+ plate_height = 40e-3;
24
+ plate_width = 30e-3;
25
+
26
+ plate_thick_layers = 2;
27
+
28
+ // Must be an integer
29
+ elem_order = 1;
30
+ mesh_ref = 1;
31
+ mesh_size = 1e-3/mesh_ref;
32
+ num_threads = 4;
33
+ //** MOOSEHERDER VARIABLES - END
34
+ //------------------------------------------------------------------------------
35
+
36
+ //------------------------------------------------------------------------------
37
+ // Calculated / Fixed Variables
38
+ tol = mesh_size/4; // Used for bounding box selection tolerance
39
+
40
+ //------------------------------------------------------------------------------
41
+ // Geometry Definition
42
+ s1 = news;
43
+ Rectangle(s1) =
44
+ {-plate_width/2,0.0,0.0,
45
+ plate_width,plate_height};
46
+
47
+ //------------------------------------------------------------------------------
48
+ // Mesh Sizing
49
+ MeshSize{ PointsOf{ Surface{:}; } } = mesh_size;
50
+ Transfinite Surface{Surface{:}};
51
+ Recombine Surface{Surface{:}};
52
+
53
+ Extrude{0.0,0.0,plate_thick}{
54
+ Surface{:}; Layers{plate_thick_layers}; Recombine;
55
+ }
56
+
57
+ //------------------------------------------------------------------------------
58
+ // Physical Volumes and Surfaces
59
+ Physical Volume("plate-vol") = {Volume{:}};
60
+
61
+ Physical Surface("plate-surf-vis-front") = {6};
62
+ Physical Surface("plate-surf-vis-back") = {1};
63
+ Physical Surface("bc-top-disp") = {4};
64
+ Physical Surface("bc-base-disp") = {2};
65
+
66
+ //------------------------------------------------------------------------------
67
+ // Global meshing
68
+ Mesh.Algorithm = 6;
69
+ Mesh.Algorithm3D = 10;
70
+
71
+ General.NumThreads = num_threads;
72
+ Mesh.MaxNumThreads1D = num_threads;
73
+ Mesh.MaxNumThreads2D = num_threads;
74
+ Mesh.MaxNumThreads3D = num_threads;
75
+
76
+ Mesh.ElementOrder = elem_order;
77
+ Mesh 3;
78
+
79
+ //------------------------------------------------------------------------------
80
+ // Save and exit
81
+ Save Str(file_name);
82
+ Exit;
@@ -0,0 +1,140 @@
1
+ #-------------------------------------------------------------------------
2
+ # pyvale: gmsh,mechanical,transient
3
+ #-------------------------------------------------------------------------
4
+
5
+ #-------------------------------------------------------------------------
6
+ #_* MOOSEHERDER VARIABLES - START
7
+
8
+ endTime = 10
9
+ timeStep = 1
10
+
11
+ # Mechanical Loads/BCs
12
+ topDispRate = ${fparse 1e-3 / endTime} # m/s
13
+
14
+ # Mechanical Props: SS316L @ 20degC
15
+ ss316LEMod = 200e9 # Pa
16
+ ss316LPRatio = 0.3 # -
17
+
18
+ #** MOOSEHERDER VARIABLES - END
19
+ #-------------------------------------------------------------------------
20
+
21
+ [GlobalParams]
22
+ displacements = 'disp_x disp_y disp_z'
23
+ []
24
+
25
+ [Mesh]
26
+ type = FileMesh
27
+ file = 'case22.msh'
28
+ []
29
+
30
+ [Modules/TensorMechanics/Master]
31
+ [all]
32
+ strain = SMALL
33
+ incremental = true
34
+ add_variables = true
35
+ material_output_family = MONOMIAL # MONOMIAL, LAGRANGE
36
+ material_output_order = FIRST # CONSTANT, FIRST, SECOND,
37
+ generate_output = 'vonmises_stress strain_xx strain_xy strain_xz strain_yx strain_yy strain_yz strain_zx strain_zy strain_zz stress_xx stress_xy stress_xz stress_yx stress_yy stress_yz stress_zx stress_zy stress_zz max_principal_strain mid_principal_strain min_principal_strain'
38
+ []
39
+ []
40
+
41
+ [BCs]
42
+ [bottom_x]
43
+ type = DirichletBC
44
+ variable = disp_x
45
+ boundary = 'bc-base-disp'
46
+ value = 0.0
47
+ []
48
+ [bottom_y]
49
+ type = DirichletBC
50
+ variable = disp_y
51
+ boundary = 'bc-base-disp'
52
+ value = 0.0
53
+ []
54
+ [bottom_z]
55
+ type = DirichletBC
56
+ variable = disp_z
57
+ boundary = 'bc-base-disp'
58
+ value = 0.0
59
+ []
60
+
61
+
62
+ [top_x]
63
+ type = DirichletBC
64
+ variable = disp_x
65
+ boundary = 'bc-top-disp'
66
+ value = 0.0
67
+ []
68
+ [top_y]
69
+ type = FunctionDirichletBC
70
+ variable = disp_y
71
+ boundary = 'bc-top-disp'
72
+ function = '${topDispRate}*t'
73
+ []
74
+ [top_z]
75
+ type = DirichletBC
76
+ variable = disp_z
77
+ boundary = 'bc-top-disp'
78
+ value = 0.0
79
+ []
80
+ []
81
+
82
+ [Materials]
83
+ [elasticity]
84
+ type = ComputeIsotropicElasticityTensor
85
+ youngs_modulus = ${ss316LEMod}
86
+ poissons_ratio = ${ss316LPRatio}
87
+ []
88
+ [stress]
89
+ type = ComputeFiniteStrainElasticStress
90
+ []
91
+ []
92
+
93
+ [Preconditioning]
94
+ [SMP]
95
+ type = SMP
96
+ full = true
97
+ []
98
+ []
99
+
100
+ [Executioner]
101
+ type = Transient
102
+ solve_type = 'PJFNK'
103
+ petsc_options_iname = '-pc_type -pc_hypre_type'
104
+ petsc_options_value = 'hypre boomeramg'
105
+ end_time= ${endTime}
106
+ dt = ${timeStep}
107
+ []
108
+
109
+
110
+ [Postprocessors]
111
+ [react_y_bot]
112
+ type = SidesetReaction
113
+ direction = '0 1 0'
114
+ stress_tensor = stress
115
+ boundary = 'bc-base-disp'
116
+ []
117
+ [react_y_top]
118
+ type = SidesetReaction
119
+ direction = '0 1 0'
120
+ stress_tensor = stress
121
+ boundary = 'bc-top-disp'
122
+ []
123
+
124
+ [disp_y_max]
125
+ type = NodalExtremeValue
126
+ variable = disp_y
127
+ []
128
+ [disp_x_max]
129
+ type = NodalExtremeValue
130
+ variable = disp_x
131
+ []
132
+ [disp_z_max]
133
+ type = NodalExtremeValue
134
+ variable = disp_x
135
+ []
136
+ []
137
+
138
+ [Outputs]
139
+ exodus = true
140
+ []