Giter VIP home page Giter VIP logo

Comments (9)

halbmy avatar halbmy commented on September 25, 2024

Dear colleague,
when raising an issue, there is a template that should be filled describing some background, what you did, what you expected and what actually happened. You are copying your code (not even into the part where it should go) along with chinese symbols, no images, but an error message that is clear: You do not have a region with marker 1.

from gimli.

halbmy avatar halbmy commented on September 25, 2024

You should use only one call of mt.createWorld(). There you can specify layers by the layers argument, see
https://www.pygimli.org/pygimliapi/_generated/pygimli.meshtools.html#pygimli.meshtools.createWorld
and the below linked examples (mostly 2D) using this function.

from gimli.

zhichaoluan avatar zhichaoluan commented on September 25, 2024

"Sorry, my explanation was not very clear."
image

"I want to generate a 3D layered model and set an anomaly in it to depict the vertical membrane structures in a landfill. During inversion, I want to keep the resistivity of the background model constant and only invert the central vertical membrane area. However, I'm not sure how to set up the 3D layered model, as it seems the 'layer' parameter can't be used in three dimensions. I'm encountering the following error messages in my code."
image

from gimli.

halbmy avatar halbmy commented on September 25, 2024

Have you tried mt.createWorld(start=[-10, -10, -40], end=[140, 10, 0], layers=[-10, -30])?

Note that you will need a much larger mesh for accurate simulations.

from gimli.

zhichaoluan avatar zhichaoluan commented on September 25, 2024

"It displays an error like this,"
HV8$UH1{KFA{CS1@_SWWK3F

from gimli.

halbmy avatar halbmy commented on September 25, 2024

Yes, I am sorry, obviously this feature does not exist yet. I would suggest the following:

  • creating a world as written but without layers (marker 1)
  • adding a cube as a middle layer (marker 2)
  • setting a region marker (marker 3) into the first layer

from gimli.

zhichaoluan avatar zhichaoluan commented on September 25, 2024

from pygimli.physics import ert
import pygimli as pg
import numpy as np
import matplotlib.pyplot as plt
import pygimli.meshtools as mt
world=mt.createWorld(start=[-10, -10,-40], end=[140, 10,0],worldMarker=True,marker=1)
cube3=mt.createCube(size=[128, 0.4, 40], pos=[128/2, 0, -40/2],marker=4)
start_model = world +cube3
pg.show(start_model,alpha=0.3,markers=True)

filename = "cc.shm"
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)
mgr=ert.ERTManager()
mgr.setData(data)
mgr.setMesh(inversion_mesh)
mgr.inv.setRegularization(1, background=True)
mgr.inv.setRegularization(1,fix=200)
mgr.inv.setRegularization(2,startModel=1e4,limits=[100,1e4+20])
mgr.invert(lam=10,zWeight=0.1,verbose=True)
mgr.saveResult()
mgr.showMisfit()

I have created a model that includes an anomaly. In the inversion process, I want to constrain the resistivity of the background to remain constant, optimizing only the resistivity of the anomalous cube. Now, I want to change the uniform background model to a layered model, assigning different resistivities to each layer, and similarly constrain the resistivities of the layered background to remain unchanged during inversion

When I haven't established a layered structure, my forward modeling mesh is correct, as shown below
1713496542290

1713496513170

1713496481079

However, when I try to use a layered model, there is a problem with establishing the mesh; the mesh is not divided correctly
1713496372534

1713496279327
1713496309510

from gimli.

zhichaoluan avatar zhichaoluan commented on September 25, 2024

cc.zip

from gimli.

halbmy avatar halbmy commented on September 25, 2024

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.

from gimli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.