pyvale 2025.5.3__cp311-cp311-musllinux_1_2_aarch64.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 +89 -0
- pyvale/analyticmeshgen.py +102 -0
- pyvale/analyticsimdatafactory.py +91 -0
- pyvale/analyticsimdatagenerator.py +323 -0
- pyvale/blendercalibrationdata.py +15 -0
- pyvale/blenderlightdata.py +26 -0
- pyvale/blendermaterialdata.py +15 -0
- pyvale/blenderrenderdata.py +30 -0
- pyvale/blenderscene.py +488 -0
- pyvale/blendertools.py +420 -0
- pyvale/camera.py +146 -0
- pyvale/cameradata.py +69 -0
- pyvale/cameradata2d.py +84 -0
- pyvale/camerastereo.py +217 -0
- pyvale/cameratools.py +522 -0
- pyvale/cython/rastercyth.c +32211 -0
- pyvale/cython/rastercyth.cpython-311-aarch64-linux-musl.so +0 -0
- pyvale/cython/rastercyth.py +640 -0
- pyvale/data/__init__.py +5 -0
- pyvale/data/cal_target.tiff +0 -0
- pyvale/data/case00_HEX20_out.e +0 -0
- pyvale/data/case00_HEX27_out.e +0 -0
- pyvale/data/case00_HEX8_out.e +0 -0
- pyvale/data/case00_TET10_out.e +0 -0
- pyvale/data/case00_TET14_out.e +0 -0
- pyvale/data/case00_TET4_out.e +0 -0
- pyvale/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/dataset.py +325 -0
- pyvale/errorcalculator.py +109 -0
- pyvale/errordriftcalc.py +146 -0
- pyvale/errorintegrator.py +336 -0
- pyvale/errorrand.py +607 -0
- pyvale/errorsyscalib.py +134 -0
- pyvale/errorsysdep.py +327 -0
- pyvale/errorsysfield.py +414 -0
- pyvale/errorsysindep.py +808 -0
- pyvale/examples/__init__.py +5 -0
- pyvale/examples/basics/ex1_1_basicscalars_therm2d.py +131 -0
- pyvale/examples/basics/ex1_2_sensormodel_therm2d.py +158 -0
- pyvale/examples/basics/ex1_3_customsens_therm3d.py +216 -0
- pyvale/examples/basics/ex1_4_basicerrors_therm3d.py +153 -0
- pyvale/examples/basics/ex1_5_fielderrs_therm3d.py +168 -0
- pyvale/examples/basics/ex1_6_caliberrs_therm2d.py +133 -0
- pyvale/examples/basics/ex1_7_spatavg_therm2d.py +123 -0
- pyvale/examples/basics/ex2_1_basicvectors_disp2d.py +112 -0
- pyvale/examples/basics/ex2_2_vectorsens_disp2d.py +111 -0
- pyvale/examples/basics/ex2_3_sensangle_disp2d.py +139 -0
- pyvale/examples/basics/ex2_4_chainfielderrs_disp2d.py +196 -0
- pyvale/examples/basics/ex2_5_vectorfields3d_disp3d.py +109 -0
- pyvale/examples/basics/ex3_1_basictensors_strain2d.py +114 -0
- pyvale/examples/basics/ex3_2_tensorsens2d_strain2d.py +111 -0
- pyvale/examples/basics/ex3_3_tensorsens3d_strain3d.py +182 -0
- pyvale/examples/basics/ex4_1_expsim2d_thermmech2d.py +171 -0
- pyvale/examples/basics/ex4_2_expsim3d_thermmech3d.py +252 -0
- pyvale/examples/genanalyticdata/ex1_1_scalarvisualisation.py +35 -0
- pyvale/examples/genanalyticdata/ex1_2_scalarcasebuild.py +43 -0
- pyvale/examples/genanalyticdata/ex2_1_analyticsensors.py +80 -0
- pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +79 -0
- pyvale/examples/renderblender/ex1_1_blenderscene.py +121 -0
- pyvale/examples/renderblender/ex1_2_blenderdeformed.py +119 -0
- pyvale/examples/renderblender/ex2_1_stereoscene.py +128 -0
- pyvale/examples/renderblender/ex2_2_stereodeformed.py +131 -0
- pyvale/examples/renderblender/ex3_1_blendercalibration.py +120 -0
- pyvale/examples/renderrasterisation/ex_rastenp.py +153 -0
- pyvale/examples/renderrasterisation/ex_rastercyth_oneframe.py +218 -0
- pyvale/examples/renderrasterisation/ex_rastercyth_static_cypara.py +187 -0
- pyvale/examples/renderrasterisation/ex_rastercyth_static_pypara.py +190 -0
- pyvale/examples/visualisation/ex1_1_plot_traces.py +102 -0
- pyvale/examples/visualisation/ex2_1_animate_sim.py +89 -0
- pyvale/experimentsimulator.py +175 -0
- pyvale/field.py +128 -0
- pyvale/fieldconverter.py +351 -0
- pyvale/fieldsampler.py +111 -0
- pyvale/fieldscalar.py +166 -0
- pyvale/fieldtensor.py +218 -0
- pyvale/fieldtransform.py +388 -0
- pyvale/fieldvector.py +213 -0
- pyvale/generatorsrandom.py +505 -0
- pyvale/imagedef2d.py +569 -0
- pyvale/integratorfactory.py +240 -0
- pyvale/integratorquadrature.py +217 -0
- pyvale/integratorrectangle.py +165 -0
- pyvale/integratorspatial.py +89 -0
- pyvale/integratortype.py +43 -0
- pyvale/output.py +17 -0
- pyvale/pyvaleexceptions.py +11 -0
- pyvale/raster.py +31 -0
- pyvale/rastercy.py +77 -0
- pyvale/rasternp.py +603 -0
- pyvale/rendermesh.py +147 -0
- pyvale/sensorarray.py +178 -0
- pyvale/sensorarrayfactory.py +196 -0
- pyvale/sensorarraypoint.py +278 -0
- pyvale/sensordata.py +71 -0
- pyvale/sensordescriptor.py +213 -0
- pyvale/sensortools.py +142 -0
- pyvale/simcases/case00_HEX20.i +242 -0
- pyvale/simcases/case00_HEX27.i +242 -0
- pyvale/simcases/case00_HEX8.i +242 -0
- pyvale/simcases/case00_TET10.i +242 -0
- pyvale/simcases/case00_TET14.i +242 -0
- pyvale/simcases/case00_TET4.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/simtools.py +67 -0
- pyvale/visualexpplotter.py +191 -0
- pyvale/visualimagedef.py +74 -0
- pyvale/visualimages.py +76 -0
- pyvale/visualopts.py +493 -0
- pyvale/visualsimanimator.py +111 -0
- pyvale/visualsimsensors.py +318 -0
- pyvale/visualtools.py +136 -0
- pyvale/visualtraceplotter.py +142 -0
- pyvale-2025.5.3.dist-info/METADATA +144 -0
- pyvale-2025.5.3.dist-info/RECORD +174 -0
- pyvale-2025.5.3.dist-info/WHEEL +5 -0
- pyvale-2025.5.3.dist-info/licenses/LICENSE +21 -0
- pyvale-2025.5.3.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 = 'case00_HEX27'
|
|
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
|
+
|