Skip to content

Commit 152f901

Browse files
committed
Thermomechanical in work
1 parent f41b2b7 commit 152f901

File tree

4 files changed

+55
-8
lines changed

4 files changed

+55
-8
lines changed

demo/thermomechanical_dlrbnicsx/dlrbnicsx_thermal.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,10 @@ def norm_error(self, u, v):
257257
mu_ref = [0.6438, 0.4313, 1., 0.5] # reference geometry
258258
mu = [0.8, 0.55, 0.8, 0.4] # Parametric geometry
259259

260-
pod_samples = [3, 4, 3, 4]
261-
ann_samples = [4, 3, 4, 3]
262-
error_analysis_samples = [2, 2, 2, 2]
260+
para_dim = 4
261+
mechanical_ann_input_samples_num = 640
262+
mechanical_error_analysis_samples_num = 144
263+
num_snapshots = 700
263264

264265
# FEM solve
265266
thermal_problem_parametric = \
@@ -290,7 +291,7 @@ def generate_training_set(num_samples, para_dim):
290291
training_set[:, 3] = (0.60 - 0.40) * training_set[:, 3] + 0.40
291292
return training_set
292293

293-
thermal_training_set = rbnicsx.io.on_rank_zero(mesh.comm, generate_training_set)
294+
thermal_training_set = generate_training_set(num_snapshots, para_dim)
294295

295296
Nmax = 30
296297

@@ -379,7 +380,7 @@ def generate_ann_output_set(problem, reduced_problem,
379380

380381

381382
# Training dataset
382-
thermal_ann_input_set = generate_ann_input_set(samples=ann_samples)
383+
thermal_ann_input_set = generate_ann_input_set(mechanical_ann_input_samples_num)
383384
# np.random.shuffle(thermal_ann_input_set)
384385
thermal_ann_output_set = \
385386
generate_ann_output_set(thermal_problem_parametric,
@@ -469,7 +470,7 @@ def generate_ann_output_set(problem, reduced_problem,
469470
print("\n")
470471
print("Generating error analysis (only input/parameters) dataset")
471472
print("\n")
472-
thermal_error_analysis_set = generate_ann_input_set(samples=error_analysis_samples)
473+
thermal_error_analysis_set = generate_ann_input_set(mechanical_error_analysis_samples_num)
473474
thermal_error_numpy = np.zeros(thermal_error_analysis_set.shape[0])
474475

475476
for i in range(thermal_error_analysis_set.shape[0]):

demo/thermomechanical_dlrbnicsx/mesh_data/mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import dolfinx
12
import gmsh
23
from mpi4py import MPI
3-
import dolfinx
44

55
gmsh.initialize('', False)
66
gdim = 2
@@ -146,7 +146,7 @@
146146

147147
gmsh.write("mesh.msh")
148148

149-
gmsh.fltk.run()
149+
# gmsh.fltk.run()
150150

151151
gmsh.finalize()
152152

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#SBATCH -J test_job
3+
#SBATCH -A WELLS-SL3-CPU
4+
#SBATCH --output=test_job_%A_%a.out
5+
#SBATCH --error=test_job_%A_%a.err
6+
7+
#SBATCH --nodes=1
8+
#SBATCH --ntasks=1
9+
#SBATCH --time=01:00:00
10+
#SBATCH --mem=3420mb
11+
12+
#SBATCH -p icelake
13+
#SBATCH --mail-type=ALL
14+
15+
module purge
16+
source ../fenics_branch/share/spack/setup-env.sh
17+
spack env activate fenicsx-env
18+
spack env status
19+
20+
cd mesh_data
21+
mpiexec -n 1 python3 mesh.py
22+
cd ..
23+
mpiexec -n 1 python3 dlrbnicsx_thermal.py
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#SBATCH -J test_job
3+
#SBATCH -A WELLS-SL3-CPU
4+
#SBATCH --output=test_job_%A_%a.out
5+
#SBATCH --error=test_job_%A_%a.err
6+
7+
#SBATCH --nodes=1
8+
#SBATCH --ntasks=1
9+
#SBATCH --time=2:00:00
10+
#SBATCH --mem=3420mb
11+
12+
#SBATCH -p icelake
13+
#SBATCH --mail-type=ALL
14+
15+
module purge
16+
source ../fenics_branch/share/spack/setup-env.sh
17+
spack env activate fenicsx-env
18+
spack env status
19+
20+
cd mesh_data
21+
mpiexec -n 1 python3 mesh.py
22+
cd ..
23+
mpiexec -n 1 python3 dlrbnicsx_thermomechanical.py

0 commit comments

Comments
 (0)