-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a 3D layer model #695
Comments
Dear colleague, |
You should use only one call of |
Have you tried Note that you will need a much larger mesh for accurate simulations. |
Yes, I am sorry, obviously this feature does not exist yet. I would suggest the following:
|
Please paste code and messages as text instead of screenshots. In your case the layers (cubes) intersect with the vertical sheet. Whereas such things are automatically resolved in 2D, in 3D this needs to be solved by splitting every cube into two, one on either side of the sheet. |
Any news or comments on that? |
from pygimli.physics import ert
import pygimli as pg
import numpy as np
import matplotlib.pyplot as plt
import pygimli.meshtools as mt
定义模型层和标记
top_layer = mt.createWorld(start=[-10, -10, 0], end=[140, 10, -10], marker=1)
middle_layer = mt.createWorld(start=[-10, -10, -10], end=[140, 10, -20], marker=2)
bottom_layer = mt.createWorld(start=[-10, -10, -20], end=[140, 10, -40], marker=3)
cube_region = mt.createCube(size=[128, 0.4, 40], pos=[128/2, 0, -20], marker=4)
合并模型区域
start_model = mt.merge([top_layer, middle_layer, bottom_layer, cube_region])
展示初始模型
pg.show(start_model, alpha=0.3, markers=True)
加载数据
filename = "cc.shm"
cc.zip
shm = pg.DataContainerERT(filename)
data = ert.load(filename)
data['k'] = ert.geometricFactors(data)
计算视电阻率
data['rhoa'] = data['k'] * data['u'] / data['i'] * 1000
data.remove(data['rhoa'] < 0)
data['err'] = ert.estimateError(data, relativeError=0.02)
在模型中添加传感器位置
for s in shm.sensors():
start_model.createNode(s)
for s in shm.sensorPositions():
start_model.createNode(s - [0, 0, 1e-2 / 2])
创建反演网格
inversion_mesh = mt.createMesh(start_model, quality=1.4)
pg.show(inversion_mesh, markers=True, showMesh=True)
配置ERT管理器
mgr = ert.ERTManager()
mgr.setData(data)
mgr.setMesh(inversion_mesh)
设置正则化参数
mgr.inv.setRegularization(1, fix=100) # 顶层
mgr.inv.setRegularization(2, fix=200) # 中层
mgr.inv.setRegularization(3, fix=300) # 底层
mgr.inv.setRegularization(4, startModel=1e4, limits=[100, 1e4 + 20]) # 立方体区域
执行反演
mgr.invert(lam=10, zWeight=0.1, verbose=True)
保存结果并展示误差
mgr.saveResult()
mgr.showMisfit()
I want to create a layer model and assign different resistivity values to each for constraint inversion, but I have some problems to help me solve.
Traceback (most recent call last):
File "D:/wangkangbo/test/11111.py", line 36, in
mgr.invert(lam=10,zWeight=0.1,verbose=True)
File "D:\Anaconda3\envs\pg1\lib\site-packages\pygimli\frameworks\methodManager.py", line 777, in invert
if self.fop.mesh() is None:
File "D:\Anaconda3\envs\pg1\lib\site-packages\pygimli\frameworks\modelling.py", line 665, in mesh
self._applyRegionProperties()
File "D:\Anaconda3\envs\pg1\lib\site-packages\pygimli\frameworks\modelling.py", line 325, in _applyRegionProperties
if rMgr.region(rID).fixValue() != vals['fix']:
RuntimeError: C:/msys64/home/halbm/gimli/gimli/core/src/regionManager.cpp:593 GIMLI::Region* GIMLI::RegionManager::region(GIMLI::SIndex) no region with marker 1
The text was updated successfully, but these errors were encountered: