Пример #1
0
model.set_model_data(data)

vals = [0,60,250,330,600]
strat_column = {'strati':{}}
for i in range(len(vals)-1):
    strat_column['strati']['unit_{}'.format(i)] = {'min':vals[i],'max':vals[i+1],'id':i}
model.set_stratigraphic_column(strat_column)
strati = model.create_and_add_foliation("strati",
                                           interpolatortype="FDI", # try changing this to 'PLI'
                                           nelements=1e4, # try changing between 1e3 and 5e4
                                           buffer=0.3,
                                           solver='pyamg',
                                           damp=True
                                          )
viewer = LavaVuModelViewer(model,background="white")
viewer.add_model_surfaces()
viewer.rotate([-85.18760681152344, 42.93233871459961, 0.8641873002052307])
viewer.display()
#################################################################################################
# Looking at the log file
# ~~~~~~~~~~~~~~~~~~~~~~~
# Here are the first 10 lines of the log file. 
# Most operations in loopstructural are recorded and this will allow you to identify whether 
# an operation is not occuring as you would expect.

from itertools import islice
# with open('logging_demo_log.log') as inf:
#     for line in islice(inf, 0, 11):
#         print(line)

        'max': vals[i + 1],
        'id': i
    }

model.set_stratigraphic_column(strat_column)

strati = model.create_and_add_foliation(
    "strati",
    interpolatortype="FDI",  # try changing this to 'PLI'
    nelements=1e4,  # try changing between 1e3 and 5e4
    buffer=0.3,
    solver='pyamg',
    damp=True)
######################################################################
# Plot the surfaces
# ------------------------------------

viewer = LavaVuModelViewer(model)
viewer.add_model_surfaces(cmap='tab20')
viewer.rotate([-85.18760681152344, 42.93233871459961, 0.8641873002052307])
viewer.display()

######################################################################
# Plot block diagram
# -------------------

viewer = LavaVuModelViewer(model)
viewer.add_model(cmap='tab20')
viewer.rotate([-85.18760681152344, 42.93233871459961, 0.8641873002052307])
viewer.display()
model.update()

##############################
# Or build directly from the dataframe and processor attributes.

model2 = GeologicalModel(processor.origin, processor.maximum)
model2.data = processor.data
model2.create_and_add_foliation("supergroup_0")
model2.update()

##############################
# Visualising model
# ~~~~~~~~~~~~~~~~~

view = LavaVuModelViewer(model)
view.add_model_surfaces()
view.rotation = [-37.965614318847656, 13.706363677978516, 3.110347032546997]
view.display()

##############################
# Adding faults
# ~~~~~~~~~~~~~

fault_orientations

fault_edges

fault_properties

processor = ProcessInputData(
    contacts=contacts,
    #    evaluate=False,
    fault_params=fault_params,
    rescale=False,
    foliation_params=foliation_params,
)
#model.to_file(output_path + "/model.pickle")
model.update()
view = LavaVuModelViewer(model, vertical_exaggeration=1)
view.nsteps = np.array([200, 200, 200])
view.nsteps = np.array([50, 50, 50])

for sg in model.feature_name_index:
    if ('super' in sg):
        view.add_data(model.features[model.feature_name_index[sg]])
view.nelements = 1e5
view.add_model_surfaces(function=function, filename=filename, faults=False)
view.nelements = 1e6
view.add_model_surfaces(function=function,
                        filename=filename,
                        strati=False,
                        displacement_cmap='rainbow')
view.lv.webgl(vtk_path + model_name)
view.nsteps = np.array([200, 200, 200])

view.add_model()

view.lv.control.Range('alpha', label="Global Opacity")
view.lv.control.DualRange(['xmin', 'xmax'],
                          label="x clip",
                          step=0.01,
                          values=[0.0, 1.0])