-
Notifications
You must be signed in to change notification settings - Fork 0
/
geofem_v6.py
107 lines (71 loc) · 2.44 KB
/
geofem_v6.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env python3
# -*- coding: utf-8 -*--------------------------------------------------------
"""
Created on Wed Mar 31 17:14:28 2021
@author: akel
"""
import sys
import time
import numpy as np
import matplotlib.pyplot as plt
from SimPEG import utils
from scipy.constants import mu_0
from SimPEG.electromagnetics import natural_source as NSEM
from discretize.utils import sdiag, mkvc
import NMT3D_v6 as model
import loadgeofemv2 as load
try:
from pymatsolver import Pardiso as Solver
except:
from SimPEG import Solver
from scipy.constants import mu_0, epsilon_0 as eps_0
from discretize import TreeMesh
from discretize.utils import mkvc, refine_tree_xyz
#============================================================================
plt.close('all')
plt.style.use('ggplot')
t = time.time()
print('start : ', time.ctime())
#out=load.inputfiles('MT3D_input_ex0.in') #Leitura dos dados
out=load.inputfiles('MT3D_input_ex0_topo.in')
#out=model.modelmesh(out,level=1)
#Leitura dos dados
#M,sig,sigBG=model.modelmesh(out,level=1)
#M,sig,sigBG,sigBG1d=model.modelmesh(out,level=1) #Criação do Mesh e modelo
M,sig,sigBG,sigBG1d=model.modelmesh(out,level=1) #Criação do Mesh e modelo
t = time.time()
print('start : ', time.ctime())
#ver malha modelo
fig, a1 = plt.subplots()
fig.canvas.set_window_title('topo file Slice Y')
M.plotSlice(np.log10(sig),grid=True, normal='y',ax=a1)
plt.xlim((M.nodes_x[0],M.nodes_x[-1]))
plt.ylim((M.nodes_z[0],M.nodes_z[-1]))
plt.show()
fig, a2 = plt.subplots()
fig.canvas.set_window_title('topo file Slice X')
M.plotSlice(np.log10(sig),grid=True, normal='x',ax=a2)
plt.xlim((M.nodes_x[0],M.nodes_x[-1]))
plt.ylim((M.nodes_z[0],M.nodes_z[-1]))
plt.show()
print("\n the mesh has {} cells".format(M))
print('terminado em: ', time.ctime())
print("\n Elapsed Time = {:1.2f} s".format(time.time() - t))
#simulação começa abaixo
# f, rho_app,phs=model.runMT(M,sig,sigBG,sigBG1d,out['freq']) #Run simulacao
# print("\n the mesh has {} cells".format(M))
# print('terminado em: ', time.ctime())
# print("\n Elapsed Time = {:1.2f} s".format(time.time() - t))
# plt.figure()
# plt.plot(f,rho_app)
# plt.yscale('log')
# plt.xscale('log')
# plt.grid(which = 'minor',axis = 'both')
# #plt.ylim((1, 500))
# # plt.xlim((-3000, 3000))
# plt.xlabel('frequency (Hz)')
# plt.ylabel('Resistividade Aparente (Ohm.m)')
# plt.title('octree')
# #plt.plot(x,np.real(hx_py),x,np.imag(hx_py))
# plt.legend(('geofem'))
# plt.gca().invert_xaxis()