-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
66 lines (38 loc) · 1.13 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import numpy as np
from mesh import Mesh
from specfem3d import SPECFEM3D
# from PSEM file
ngllx = 3
nglly = 3
ngllz = 3
ngnode = 8
num_materials = 1 # should be loaded from file.
input_path = 'dummy_input/input'
fname = 'block'
print()
print("*******************************************************************************************************")
print(" CREATING MESH FOR SPECFEMX (PYTHON TEMP) ")
print("*******************************************************************************************************")
# Read input:
m = Mesh(input_path, fname, ngllx, nglly, ngllz, ngnode,
ISPOT_DOF=False)
m.read_input()
m.calc_model_coord_extents()
m._calc_gll1D()
m.hex2spec()
m.initialise_dof()
m.set_element_dof()
m.prepare_hex()
m.prepare_hexface()
m.prepare_integration()
m.prepare_integration2d()
m.set_model_properties()
m.set_nondimensional_params()
m.calc_nondimensionalisation_vals()
m.prepare_free_surface()
m.apply_nondimensionalisation()
m.compute_max_elementsize()
m.determine_solver()
print("Create SPECFEM3D object")
s = SPECFEM3D(m)
s.initialise()