pyvale 2025.4.0__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 +75 -0
- pyvale/core/__init__.py +7 -0
- pyvale/core/analyticmeshgen.py +59 -0
- pyvale/core/analyticsimdatafactory.py +63 -0
- pyvale/core/analyticsimdatagenerator.py +160 -0
- pyvale/core/camera.py +146 -0
- pyvale/core/cameradata.py +64 -0
- pyvale/core/cameradata2d.py +82 -0
- pyvale/core/cameratools.py +328 -0
- pyvale/core/cython/rastercyth.c +32267 -0
- pyvale/core/cython/rastercyth.py +636 -0
- pyvale/core/dataset.py +250 -0
- pyvale/core/errorcalculator.py +112 -0
- pyvale/core/errordriftcalc.py +146 -0
- pyvale/core/errorintegrator.py +339 -0
- pyvale/core/errorrand.py +614 -0
- pyvale/core/errorsysdep.py +331 -0
- pyvale/core/errorsysfield.py +407 -0
- pyvale/core/errorsysindep.py +905 -0
- pyvale/core/experimentsimulator.py +99 -0
- pyvale/core/field.py +136 -0
- pyvale/core/fieldconverter.py +154 -0
- pyvale/core/fieldsampler.py +112 -0
- pyvale/core/fieldscalar.py +167 -0
- pyvale/core/fieldtensor.py +221 -0
- pyvale/core/fieldtransform.py +384 -0
- pyvale/core/fieldvector.py +215 -0
- pyvale/core/generatorsrandom.py +528 -0
- pyvale/core/imagedef2d.py +566 -0
- pyvale/core/integratorfactory.py +241 -0
- pyvale/core/integratorquadrature.py +192 -0
- pyvale/core/integratorrectangle.py +88 -0
- pyvale/core/integratorspatial.py +90 -0
- pyvale/core/integratortype.py +44 -0
- pyvale/core/optimcheckfuncs.py +153 -0
- pyvale/core/raster.py +31 -0
- pyvale/core/rastercy.py +76 -0
- pyvale/core/rasternp.py +604 -0
- pyvale/core/rendermesh.py +156 -0
- pyvale/core/sensorarray.py +179 -0
- pyvale/core/sensorarrayfactory.py +210 -0
- pyvale/core/sensorarraypoint.py +280 -0
- pyvale/core/sensordata.py +72 -0
- pyvale/core/sensordescriptor.py +101 -0
- pyvale/core/sensortools.py +143 -0
- pyvale/core/visualexpplotter.py +151 -0
- pyvale/core/visualimagedef.py +71 -0
- pyvale/core/visualimages.py +75 -0
- pyvale/core/visualopts.py +180 -0
- pyvale/core/visualsimanimator.py +83 -0
- pyvale/core/visualsimplotter.py +182 -0
- pyvale/core/visualtools.py +81 -0
- pyvale/core/visualtraceplotter.py +256 -0
- pyvale/data/__init__.py +7 -0
- pyvale/data/case13_out.e +0 -0
- pyvale/data/case16_out.e +0 -0
- pyvale/data/case17_out.e +0 -0
- pyvale/data/case18_1_out.e +0 -0
- pyvale/data/case18_2_out.e +0 -0
- pyvale/data/case18_3_out.e +0 -0
- pyvale/data/case25_out.e +0 -0
- pyvale/data/case26_out.e +0 -0
- pyvale/data/optspeckle_2464x2056px_spec5px_8bit_gblur1px.tiff +0 -0
- pyvale/examples/__init__.py +7 -0
- pyvale/examples/analyticdatagen/__init__.py +7 -0
- pyvale/examples/analyticdatagen/ex1_1_scalarvisualisation.py +38 -0
- pyvale/examples/analyticdatagen/ex1_2_scalarcasebuild.py +46 -0
- pyvale/examples/analyticdatagen/ex2_1_analyticsensors.py +83 -0
- pyvale/examples/ex1_1_thermal2d.py +89 -0
- pyvale/examples/ex1_2_thermal2d.py +111 -0
- pyvale/examples/ex1_3_thermal2d.py +113 -0
- pyvale/examples/ex1_4_thermal2d.py +89 -0
- pyvale/examples/ex1_5_thermal2d.py +105 -0
- pyvale/examples/ex2_1_thermal3d .py +87 -0
- pyvale/examples/ex2_2_thermal3d.py +51 -0
- pyvale/examples/ex2_3_thermal3d.py +109 -0
- pyvale/examples/ex3_1_displacement2d.py +47 -0
- pyvale/examples/ex3_2_displacement2d.py +79 -0
- pyvale/examples/ex3_3_displacement2d.py +104 -0
- pyvale/examples/ex3_4_displacement2d.py +105 -0
- pyvale/examples/ex4_1_strain2d.py +57 -0
- pyvale/examples/ex4_2_strain2d.py +79 -0
- pyvale/examples/ex4_3_strain2d.py +100 -0
- pyvale/examples/ex5_1_multiphysics2d.py +78 -0
- pyvale/examples/ex6_1_multiphysics2d_expsim.py +118 -0
- pyvale/examples/ex6_2_multiphysics3d_expsim.py +158 -0
- pyvale/examples/features/__init__.py +7 -0
- pyvale/examples/features/ex_animation_tools_3dmonoblock.py +83 -0
- pyvale/examples/features/ex_area_avg.py +89 -0
- pyvale/examples/features/ex_calibration_error.py +108 -0
- pyvale/examples/features/ex_chain_field_errs.py +141 -0
- pyvale/examples/features/ex_field_errs.py +78 -0
- pyvale/examples/features/ex_sensor_single_angle_batch.py +110 -0
- pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +86 -0
- pyvale/examples/rasterisation/ex_rastenp.py +154 -0
- pyvale/examples/rasterisation/ex_rastercyth_oneframe.py +220 -0
- pyvale/examples/rasterisation/ex_rastercyth_static_cypara.py +194 -0
- pyvale/examples/rasterisation/ex_rastercyth_static_pypara.py +193 -0
- pyvale/simcases/case00_HEX20.i +242 -0
- pyvale/simcases/case00_HEX27.i +242 -0
- pyvale/simcases/case00_TET10.i +242 -0
- pyvale/simcases/case00_TET14.i +242 -0
- pyvale/simcases/case01.i +101 -0
- pyvale/simcases/case02.i +156 -0
- pyvale/simcases/case03.i +136 -0
- pyvale/simcases/case04.i +181 -0
- pyvale/simcases/case05.i +234 -0
- pyvale/simcases/case06.i +305 -0
- pyvale/simcases/case07.geo +135 -0
- pyvale/simcases/case07.i +87 -0
- pyvale/simcases/case08.geo +144 -0
- pyvale/simcases/case08.i +153 -0
- pyvale/simcases/case09.geo +204 -0
- pyvale/simcases/case09.i +87 -0
- pyvale/simcases/case10.geo +204 -0
- pyvale/simcases/case10.i +257 -0
- pyvale/simcases/case11.geo +337 -0
- pyvale/simcases/case11.i +147 -0
- pyvale/simcases/case12.geo +388 -0
- pyvale/simcases/case12.i +329 -0
- pyvale/simcases/case13.i +140 -0
- pyvale/simcases/case14.i +159 -0
- pyvale/simcases/case15.geo +337 -0
- pyvale/simcases/case15.i +150 -0
- pyvale/simcases/case16.geo +391 -0
- pyvale/simcases/case16.i +357 -0
- pyvale/simcases/case17.geo +135 -0
- pyvale/simcases/case17.i +144 -0
- pyvale/simcases/case18.i +254 -0
- pyvale/simcases/case18_1.i +254 -0
- pyvale/simcases/case18_2.i +254 -0
- pyvale/simcases/case18_3.i +254 -0
- pyvale/simcases/case19.geo +252 -0
- pyvale/simcases/case19.i +99 -0
- pyvale/simcases/case20.geo +252 -0
- pyvale/simcases/case20.i +250 -0
- pyvale/simcases/case21.geo +74 -0
- pyvale/simcases/case21.i +155 -0
- pyvale/simcases/case22.geo +82 -0
- pyvale/simcases/case22.i +140 -0
- pyvale/simcases/case23.geo +164 -0
- pyvale/simcases/case23.i +140 -0
- pyvale/simcases/case24.geo +79 -0
- pyvale/simcases/case24.i +123 -0
- pyvale/simcases/case25.geo +82 -0
- pyvale/simcases/case25.i +140 -0
- pyvale/simcases/case26.geo +166 -0
- pyvale/simcases/case26.i +140 -0
- pyvale/simcases/run_1case.py +61 -0
- pyvale/simcases/run_all_cases.py +69 -0
- pyvale/simcases/run_build_case.py +64 -0
- pyvale/simcases/run_example_cases.py +69 -0
- pyvale-2025.4.0.dist-info/METADATA +140 -0
- pyvale-2025.4.0.dist-info/RECORD +157 -0
- pyvale-2025.4.0.dist-info/WHEEL +5 -0
- pyvale-2025.4.0.dist-info/licenses/LICENSE +21 -0
- pyvale-2025.4.0.dist-info/top_level.txt +1 -0
pyvale/simcases/case25.i
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#-------------------------------------------------------------------------
|
|
2
|
+
# pyvale: gmsh,mechanical,transient
|
|
3
|
+
#-------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
#-------------------------------------------------------------------------
|
|
6
|
+
#_* MOOSEHERDER VARIABLES - START
|
|
7
|
+
|
|
8
|
+
endTime = 8
|
|
9
|
+
timeStep = 1
|
|
10
|
+
|
|
11
|
+
# Mechanical Loads/BCs
|
|
12
|
+
topDispRate = ${fparse -3.0e-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 = 'case25.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 = SECOND # CONSTANT, FIRST, SECOND,
|
|
37
|
+
generate_output = 'strain_xx strain_yy strain_zz strain_xy strain_yz strain_xz'
|
|
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 = 'NEWTON'
|
|
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
|
+
[]
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
//==============================================================================
|
|
2
|
+
// Gmsh 3D parametric plate with hole mesh
|
|
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 = 0;
|
|
13
|
+
Geometry.CurveLabels = 0;
|
|
14
|
+
Geometry.SurfaceLabels = 1;
|
|
15
|
+
Geometry.VolumeLabels = 0;
|
|
16
|
+
|
|
17
|
+
//------------------------------------------------------------------------------
|
|
18
|
+
// Variables
|
|
19
|
+
file_name = "case26.msh";
|
|
20
|
+
|
|
21
|
+
// Geometric variables
|
|
22
|
+
plate_width = 100e-3;
|
|
23
|
+
plate_height = plate_width+50e-3; // Must be greater than plate width
|
|
24
|
+
plate_diff = plate_height-plate_width;
|
|
25
|
+
plate_thick = 5e-3;
|
|
26
|
+
|
|
27
|
+
hole_rad = 25e-3/2;
|
|
28
|
+
hole_loc_x = plate_width/2;
|
|
29
|
+
hole_loc_y = plate_height/2;
|
|
30
|
+
hole_circ = 2*Pi*hole_rad;
|
|
31
|
+
|
|
32
|
+
// Mesh variables
|
|
33
|
+
elem_order = 1;
|
|
34
|
+
|
|
35
|
+
plate_thick_layers = 1;
|
|
36
|
+
hole_sect_nodes = 5; // Must be odd
|
|
37
|
+
plate_rad_nodes = 5;
|
|
38
|
+
plate_diff_nodes = 3; // numbers of nodes along the rectangular extension
|
|
39
|
+
|
|
40
|
+
plate_edge_nodes = Floor((hole_sect_nodes-1)/2)+1;
|
|
41
|
+
elem_size = hole_circ/(4*(hole_sect_nodes-1));
|
|
42
|
+
|
|
43
|
+
tol = elem_size; // Used for bounding box selection tolerance
|
|
44
|
+
tol_thick = plate_thick/(4*plate_thick_layers);
|
|
45
|
+
|
|
46
|
+
//------------------------------------------------------------------------------
|
|
47
|
+
// Geometry Definition
|
|
48
|
+
|
|
49
|
+
// Split plate into eight pieces with a square around the hole to allow spider
|
|
50
|
+
// web meshing around the hole
|
|
51
|
+
s1 = news;
|
|
52
|
+
Rectangle(s1) = {0.0,0.0,0.0,
|
|
53
|
+
plate_width/2,plate_diff/2};
|
|
54
|
+
s2 = news;
|
|
55
|
+
Rectangle(s2) = {plate_width/2,0.0,0.0,
|
|
56
|
+
plate_width/2,plate_diff/2};
|
|
57
|
+
|
|
58
|
+
s3 = news;
|
|
59
|
+
Rectangle(s3) = {0.0,plate_diff/2,0.0,
|
|
60
|
+
plate_width/2,plate_width/2};
|
|
61
|
+
s4 = news;
|
|
62
|
+
Rectangle(s4) = {plate_width/2,plate_diff/2,0.0,
|
|
63
|
+
plate_width/2,plate_width/2};
|
|
64
|
+
|
|
65
|
+
s5 = news;
|
|
66
|
+
Rectangle(s5) = {0.0,plate_width/2+plate_diff/2,0.0,
|
|
67
|
+
plate_width/2,plate_width/2};
|
|
68
|
+
s6 = news;
|
|
69
|
+
Rectangle(s6) = {plate_width/2,plate_width/2+plate_diff/2,0.0,
|
|
70
|
+
plate_width/2,plate_width/2};
|
|
71
|
+
|
|
72
|
+
s7 = news;
|
|
73
|
+
Rectangle(s7) = {0.0,plate_height-plate_diff/2,0.0,
|
|
74
|
+
plate_width/2,plate_diff/2};
|
|
75
|
+
s8 = news;
|
|
76
|
+
Rectangle(s8) = {plate_width/2,plate_height-plate_diff/2,0.0,
|
|
77
|
+
plate_width/2,plate_diff/2};
|
|
78
|
+
|
|
79
|
+
// Merge coincicent edges of the four overlapping squares
|
|
80
|
+
BooleanFragments{ Surface{s1}; Delete; }
|
|
81
|
+
{ Surface{s2,s3,s4,s5,s6,s7,s8}; Delete; }
|
|
82
|
+
|
|
83
|
+
// Create the hole surface
|
|
84
|
+
c2 = newc; Circle(c2) = {hole_loc_x,hole_loc_y,0.0,hole_rad};
|
|
85
|
+
cl2 = newcl; Curve Loop(cl2) = {c2};
|
|
86
|
+
s9 = news; Plane Surface(s9) = {cl2};
|
|
87
|
+
// Bore out the hole from the quarters of the plate
|
|
88
|
+
BooleanDifference{ Surface{s3,s4,s5,s6}; Delete; }{ Surface{s9}; Delete; }
|
|
89
|
+
|
|
90
|
+
//------------------------------------------------------------------------------
|
|
91
|
+
// Transfinite meshing (line element sizes and mapped meshing)
|
|
92
|
+
Transfinite Curve{31,24,26,28} = plate_rad_nodes;
|
|
93
|
+
Transfinite Curve{1,5,3,7,23,29,30,34,14,17,19,22} = plate_edge_nodes;
|
|
94
|
+
Transfinite Curve{32,33,25,27} = hole_sect_nodes;
|
|
95
|
+
Transfinite Curve{4,2,6,20,18,21} = plate_diff_nodes;
|
|
96
|
+
|
|
97
|
+
// NOTE: recombine surface turns default triangles into quads
|
|
98
|
+
|
|
99
|
+
Transfinite Surface{s1} = {1,2,3,4};
|
|
100
|
+
//Recombine Surface{s1};
|
|
101
|
+
Transfinite Surface{s2} = {2,5,6,3};
|
|
102
|
+
//Recombine Surface{s2};
|
|
103
|
+
|
|
104
|
+
Transfinite Surface{s3} = {17,18,3,16};
|
|
105
|
+
//Recombine Surface{s3};
|
|
106
|
+
Transfinite Surface{s4} = {18,19,20,3};
|
|
107
|
+
//Recombine Surface{s4};
|
|
108
|
+
Transfinite Surface{s5} = {17,21,10,16};
|
|
109
|
+
//Recombine Surface{s5};
|
|
110
|
+
Transfinite Surface{s6} = {19,21,10,20};
|
|
111
|
+
//Recombine Surface{s6};
|
|
112
|
+
|
|
113
|
+
Transfinite Surface{s7} = {11,10,13,14};
|
|
114
|
+
//Recombine Surface{s7};
|
|
115
|
+
Transfinite Surface{s8} = {10,12,15,13};
|
|
116
|
+
//Recombine Surface{s8};
|
|
117
|
+
|
|
118
|
+
Extrude{0.0,0.0,plate_thick}{
|
|
119
|
+
Surface{:}; Layers{plate_thick_layers}; //Recombine;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//------------------------------------------------------------------------------
|
|
123
|
+
// Physical lines and surfaces for export/BCs
|
|
124
|
+
Physical Volume("plate-vol") = {Volume{:}};
|
|
125
|
+
|
|
126
|
+
ps1() = Surface In BoundingBox{
|
|
127
|
+
0.0-tol,plate_height-tol,0.0-tol,
|
|
128
|
+
plate_width+tol,plate_height+tol,plate_thick+tol};
|
|
129
|
+
Physical Surface("bc-top-disp") = {ps1(0),ps1(1)};
|
|
130
|
+
|
|
131
|
+
ps2() = Surface In BoundingBox{
|
|
132
|
+
0.0-tol,0.0-tol,0.0-tol,
|
|
133
|
+
plate_width+tol,0.0+tol,plate_thick+tol};
|
|
134
|
+
Physical Surface("bc-base-disp") = {ps2(0),ps2(1)};
|
|
135
|
+
|
|
136
|
+
ps3() = Surface In BoundingBox{
|
|
137
|
+
0.0-tol,0.0-tol,plate_thick-tol_thick,
|
|
138
|
+
plate_width+tol,plate_height+tol,plate_thick+tol_thick};
|
|
139
|
+
Physical Surface("plate-surf-vis-front") = {ps3(0),ps3(1),ps3(2),ps3(3),
|
|
140
|
+
ps3(4),ps3(5),ps3(6),ps3(7)};
|
|
141
|
+
|
|
142
|
+
ps4() = Surface In BoundingBox{
|
|
143
|
+
0.0-tol,0.0-tol,0.0-tol_thick,
|
|
144
|
+
plate_width+tol,plate_height+tol,0.0+tol_thick};
|
|
145
|
+
Physical Surface("plate-surf-vis-back") = {ps4(0),ps4(1),ps4(2),ps4(3),
|
|
146
|
+
ps4(4),ps4(5),ps4(6),ps4(7)};
|
|
147
|
+
|
|
148
|
+
//------------------------------------------------------------------------------
|
|
149
|
+
// Global meshing
|
|
150
|
+
num_threads = 4;
|
|
151
|
+
|
|
152
|
+
Mesh.Algorithm = 6;
|
|
153
|
+
Mesh.Algorithm3D = 10;
|
|
154
|
+
|
|
155
|
+
General.NumThreads = num_threads;
|
|
156
|
+
Mesh.MaxNumThreads1D = num_threads;
|
|
157
|
+
Mesh.MaxNumThreads2D = num_threads;
|
|
158
|
+
Mesh.MaxNumThreads3D = num_threads;
|
|
159
|
+
|
|
160
|
+
Mesh.ElementOrder = elem_order;
|
|
161
|
+
Mesh 3;
|
|
162
|
+
|
|
163
|
+
//------------------------------------------------------------------------------
|
|
164
|
+
// Save and exit
|
|
165
|
+
Save Str(file_name);
|
|
166
|
+
Exit;
|
pyvale/simcases/case26.i
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#-------------------------------------------------------------------------
|
|
2
|
+
# pyvale: gmsh,mechanical,transient
|
|
3
|
+
#-------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
#-------------------------------------------------------------------------
|
|
6
|
+
#_* MOOSEHERDER VARIABLES - START
|
|
7
|
+
|
|
8
|
+
endTime = 80
|
|
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 = 'case26.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 = SECOND # CONSTANT, FIRST, SECOND,
|
|
37
|
+
generate_output = 'strain_xx strain_yy strain_zz strain_xy strain_yz strain_xz'
|
|
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 = 'NEWTON'
|
|
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
|
+
[]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'''
|
|
2
|
+
================================================================================
|
|
3
|
+
pyvale: the python computer aided validation engine
|
|
4
|
+
|
|
5
|
+
License: MIT
|
|
6
|
+
Copyright (C) 2025 The Computer Aided Validation Team
|
|
7
|
+
================================================================================
|
|
8
|
+
'''
|
|
9
|
+
import time
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from importlib.resources import files
|
|
12
|
+
from mooseherder import (MooseConfig,
|
|
13
|
+
MooseRunner,
|
|
14
|
+
GmshRunner)
|
|
15
|
+
|
|
16
|
+
#===============================================================================
|
|
17
|
+
# Change this to run a different case
|
|
18
|
+
CASE_STR = 'case16'
|
|
19
|
+
#===============================================================================
|
|
20
|
+
|
|
21
|
+
CASE_FILES = (CASE_STR+'.geo',CASE_STR+'.i')
|
|
22
|
+
CASE_DIR = Path(files("pyvale.simcases").joinpath(CASE_FILES[1])).parent
|
|
23
|
+
|
|
24
|
+
USER_DIR = Path.home()
|
|
25
|
+
|
|
26
|
+
def main() -> None:
|
|
27
|
+
gmsh_run_time = 0.0
|
|
28
|
+
if (CASE_DIR / CASE_FILES[0]).is_file():
|
|
29
|
+
gmsh_runner = GmshRunner(USER_DIR / 'gmsh/bin/gmsh')
|
|
30
|
+
|
|
31
|
+
gmsh_start = time.perf_counter()
|
|
32
|
+
gmsh_runner.run(CASE_DIR / CASE_FILES[0],parse_only=False)
|
|
33
|
+
gmsh_run_time = time.perf_counter()-gmsh_start
|
|
34
|
+
|
|
35
|
+
config = {'main_path': USER_DIR / 'moose',
|
|
36
|
+
'app_path': USER_DIR / 'proteus',
|
|
37
|
+
'app_name': 'proteus-opt'}
|
|
38
|
+
|
|
39
|
+
print(config['main_path'])
|
|
40
|
+
|
|
41
|
+
moose_config = MooseConfig(config)
|
|
42
|
+
moose_runner = MooseRunner(moose_config)
|
|
43
|
+
|
|
44
|
+
moose_runner.set_run_opts(n_tasks = 1,
|
|
45
|
+
n_threads = 8,
|
|
46
|
+
redirect_out = False)
|
|
47
|
+
|
|
48
|
+
moose_start_time = time.perf_counter()
|
|
49
|
+
moose_runner.run(CASE_DIR / CASE_FILES[1])
|
|
50
|
+
moose_run_time = time.perf_counter() - moose_start_time
|
|
51
|
+
|
|
52
|
+
print()
|
|
53
|
+
print("="*80)
|
|
54
|
+
print(f'Gmsh run time = {gmsh_run_time:.2f} seconds')
|
|
55
|
+
print(f'MOOSE run time = {moose_run_time:.3f} seconds')
|
|
56
|
+
print("="*80)
|
|
57
|
+
print()
|
|
58
|
+
|
|
59
|
+
if __name__ == '__main__':
|
|
60
|
+
main()
|
|
61
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'''
|
|
2
|
+
================================================================================
|
|
3
|
+
pyvale: the python computer aided validation engine
|
|
4
|
+
|
|
5
|
+
License: MIT
|
|
6
|
+
Copyright (C) 2025 The Computer Aided Validation Team
|
|
7
|
+
================================================================================
|
|
8
|
+
'''
|
|
9
|
+
import time
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from mooseherder import (MooseConfig,
|
|
12
|
+
MooseRunner,
|
|
13
|
+
GmshRunner)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
NUM_CASES = 23
|
|
17
|
+
USER_DIR = Path.home()
|
|
18
|
+
FORCE_GMSH = False
|
|
19
|
+
CASES_DIR = Path('src/simcases/')
|
|
20
|
+
|
|
21
|
+
def run_one_case(case_str: str) -> None:
|
|
22
|
+
print(80*'=')
|
|
23
|
+
print(f'Running: {case_str}')
|
|
24
|
+
print(80*'=')
|
|
25
|
+
|
|
26
|
+
case_files = (case_str+'.geo',case_str+'.i')
|
|
27
|
+
case_dir = CASES_DIR / case_str
|
|
28
|
+
|
|
29
|
+
gmsh_run_time = 0.0
|
|
30
|
+
if (case_dir / case_files[0]).is_file():
|
|
31
|
+
gmsh_runner = GmshRunner(USER_DIR / 'gmsh/bin/gmsh')
|
|
32
|
+
|
|
33
|
+
gmsh_start = time.perf_counter()
|
|
34
|
+
gmsh_runner.run(case_dir / case_files[0])
|
|
35
|
+
gmsh_run_time = time.perf_counter()-gmsh_start
|
|
36
|
+
|
|
37
|
+
config = {'main_path': USER_DIR / 'moose',
|
|
38
|
+
'app_path': USER_DIR / 'proteus',
|
|
39
|
+
'app_name': 'proteus-opt'}
|
|
40
|
+
|
|
41
|
+
moose_config = MooseConfig(config)
|
|
42
|
+
moose_runner = MooseRunner(moose_config)
|
|
43
|
+
|
|
44
|
+
moose_runner.set_run_opts(n_tasks = 1,
|
|
45
|
+
n_threads = 8,
|
|
46
|
+
redirect_out = False)
|
|
47
|
+
|
|
48
|
+
moose_start_time = time.perf_counter()
|
|
49
|
+
moose_runner.run(case_dir / case_files[1])
|
|
50
|
+
moose_run_time = time.perf_counter() - moose_start_time
|
|
51
|
+
|
|
52
|
+
print()
|
|
53
|
+
print("="*80)
|
|
54
|
+
print(f'CASE: {case_str}')
|
|
55
|
+
print(f'Gmsh run time = {gmsh_run_time:.2f} seconds')
|
|
56
|
+
print(f'MOOSE run time = {moose_run_time:.3f} seconds')
|
|
57
|
+
print("="*80)
|
|
58
|
+
print()
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def main() -> None:
|
|
62
|
+
for ss in range(NUM_CASES):
|
|
63
|
+
case_str = 'case' + str(ss+1).zfill(2)
|
|
64
|
+
run_one_case(case_str)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == '__main__':
|
|
68
|
+
main()
|
|
69
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'''
|
|
2
|
+
================================================================================
|
|
3
|
+
pyvale: the python computer aided validation engine
|
|
4
|
+
|
|
5
|
+
License: MIT
|
|
6
|
+
Copyright (C) 2025 The Computer Aided Validation Team
|
|
7
|
+
================================================================================
|
|
8
|
+
'''
|
|
9
|
+
import time
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from importlib.resources import files
|
|
12
|
+
from mooseherder import (MooseConfig,
|
|
13
|
+
MooseRunner,
|
|
14
|
+
GmshRunner)
|
|
15
|
+
|
|
16
|
+
#===============================================================================
|
|
17
|
+
# Change this to run a different case
|
|
18
|
+
CASE_STR = 'case24'
|
|
19
|
+
#===============================================================================
|
|
20
|
+
|
|
21
|
+
CASE_FILES = (CASE_STR+'.geo',CASE_STR+'.i')
|
|
22
|
+
CASE_DIR = Path(files("pyvale.simcases").joinpath(CASE_FILES[1])).parent
|
|
23
|
+
|
|
24
|
+
USER_DIR = Path.home()
|
|
25
|
+
|
|
26
|
+
FORCE_GMSH = True
|
|
27
|
+
|
|
28
|
+
def main() -> None:
|
|
29
|
+
gmsh_run_time = 0.0
|
|
30
|
+
if (CASE_DIR / CASE_FILES[0]).is_file():
|
|
31
|
+
gmsh_runner = GmshRunner(USER_DIR / 'gmsh/bin/gmsh')
|
|
32
|
+
|
|
33
|
+
gmsh_start = time.perf_counter()
|
|
34
|
+
gmsh_runner.run(CASE_DIR / CASE_FILES[0],parse_only=False)
|
|
35
|
+
gmsh_run_time = time.perf_counter()-gmsh_start
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
config = {'main_path': USER_DIR / 'moose',
|
|
39
|
+
'app_path': USER_DIR / 'proteus',
|
|
40
|
+
'app_name': 'proteus-opt'}
|
|
41
|
+
|
|
42
|
+
print(config['main_path'])
|
|
43
|
+
|
|
44
|
+
moose_config = MooseConfig(config)
|
|
45
|
+
moose_runner = MooseRunner(moose_config)
|
|
46
|
+
|
|
47
|
+
moose_runner.set_run_opts(n_tasks = 1,
|
|
48
|
+
n_threads = 8,
|
|
49
|
+
redirect_out = False)
|
|
50
|
+
|
|
51
|
+
moose_start_time = time.perf_counter()
|
|
52
|
+
moose_runner.run(CASE_DIR / CASE_FILES[1])
|
|
53
|
+
moose_run_time = time.perf_counter() - moose_start_time
|
|
54
|
+
|
|
55
|
+
print()
|
|
56
|
+
print("="*80)
|
|
57
|
+
print(f'Gmsh run time = {gmsh_run_time:.2f} seconds')
|
|
58
|
+
print(f'MOOSE run time = {moose_run_time:.3f} seconds')
|
|
59
|
+
print("="*80)
|
|
60
|
+
print()
|
|
61
|
+
|
|
62
|
+
if __name__ == '__main__':
|
|
63
|
+
main()
|
|
64
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'''
|
|
2
|
+
================================================================================
|
|
3
|
+
pyvale: the python computer aided validation engine
|
|
4
|
+
|
|
5
|
+
License: MIT
|
|
6
|
+
Copyright (C) 2025 The Computer Aided Validation Team
|
|
7
|
+
================================================================================
|
|
8
|
+
'''
|
|
9
|
+
import time
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from mooseherder import (MooseConfig,
|
|
12
|
+
MooseRunner,
|
|
13
|
+
GmshRunner)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
EXAMPLE_CASES = [13,16,17]
|
|
17
|
+
USER_DIR = Path.home()
|
|
18
|
+
FORCE_GMSH = False
|
|
19
|
+
CASES_DIR = Path('src/simcases/')
|
|
20
|
+
|
|
21
|
+
def run_one_case(case_str: str) -> None:
|
|
22
|
+
print(80*'=')
|
|
23
|
+
print(f'Running: {case_str}')
|
|
24
|
+
print(80*'=')
|
|
25
|
+
|
|
26
|
+
case_files = (case_str+'.geo',case_str+'.i')
|
|
27
|
+
case_dir = CASES_DIR / case_str
|
|
28
|
+
|
|
29
|
+
gmsh_run_time = 0.0
|
|
30
|
+
if (case_dir / case_files[0]).is_file():
|
|
31
|
+
gmsh_runner = GmshRunner(USER_DIR / 'gmsh/bin/gmsh')
|
|
32
|
+
|
|
33
|
+
gmsh_start = time.perf_counter()
|
|
34
|
+
gmsh_runner.run(case_dir / case_files[0])
|
|
35
|
+
gmsh_run_time = time.perf_counter()-gmsh_start
|
|
36
|
+
|
|
37
|
+
config = {'main_path': USER_DIR / 'moose',
|
|
38
|
+
'app_path': USER_DIR / 'proteus',
|
|
39
|
+
'app_name': 'proteus-opt'}
|
|
40
|
+
|
|
41
|
+
moose_config = MooseConfig(config)
|
|
42
|
+
moose_runner = MooseRunner(moose_config)
|
|
43
|
+
|
|
44
|
+
moose_runner.set_run_opts(n_tasks = 1,
|
|
45
|
+
n_threads = 8,
|
|
46
|
+
redirect_out = False)
|
|
47
|
+
|
|
48
|
+
moose_start_time = time.perf_counter()
|
|
49
|
+
moose_runner.run(case_dir / case_files[1])
|
|
50
|
+
moose_run_time = time.perf_counter() - moose_start_time
|
|
51
|
+
|
|
52
|
+
print()
|
|
53
|
+
print("="*80)
|
|
54
|
+
print(f'CASE: {case_str}')
|
|
55
|
+
print(f'Gmsh run time = {gmsh_run_time:.2f} seconds')
|
|
56
|
+
print(f'MOOSE run time = {moose_run_time:.3f} seconds')
|
|
57
|
+
print("="*80)
|
|
58
|
+
print()
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def main() -> None:
|
|
62
|
+
for ss in EXAMPLE_CASES:
|
|
63
|
+
case_str = 'case' + str(ss).zfill(2)
|
|
64
|
+
run_one_case(case_str)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == '__main__':
|
|
68
|
+
main()
|
|
69
|
+
|