def test_element_number_FDI():
    model = GeologicalModel([0, 0, 0], [5, 5, 5])
    interpolator = model.get_interpolator(interpolatortype="FDI",
                                          nelements=1e5,
                                          buffer=0.2)
    assert np.log10(interpolator.support.n_nodes) - 5 < 1
    interpolator = model.get_interpolator(interpolatortype="FDI",
                                          nelements=1e6,
                                          buffer=0.2)
    assert np.log10(interpolator.support.n_nodes) - 6 < 1
    interpolator = model.get_interpolator(interpolatortype="FDI",
                                          nelements=3e4,
                                          buffer=0.2)
    assert np.log10(interpolator.support.n_nodes) - 4 < 1
Exemple #2
0
def test_element_number_FDI():
    model = GeologicalModel([0, 0, 0], [5, 5, 5])
    interpolator = model.get_interpolator(interpolatortype='FDI',
                                          nelements=1e5,
                                          buffer=0.2)
    assert interpolator.support.n_elements - 1e5 < 1e3
    interpolator = model.get_interpolator(interpolatortype='FDI',
                                          nelements=1e6,
                                          buffer=0.2)
    assert interpolator.support.n_elements - 1e6 < 1e3
    interpolator = model.get_interpolator(interpolatortype='FDI',
                                          nelements=3e4,
                                          buffer=0.2)
    assert interpolator.support.n_elements - 3e4 < 1e3
Exemple #3
0
def test_buffer():
    model = GeologicalModel([0, 0, 0], [5, 5, 5])
    interpolator = model.get_interpolator(interpolatortype='FDI',
                                          nelements=1e5,
                                          buffer=0.2)
    print(interpolator.support.origin)
    assert np.sum(interpolator.support.origin + .2) == 0
Exemple #4
0
def test_intrusion_builder():

    model = GeologicalModel(boundary_points[0, :], boundary_points[1, :])
    model.data = data
    model.nsteps = [10, 10, 10]

    intrusion_data = data[data['feature_name'] == 'tabular_intrusion']
    frame_data = model.data[model.data["feature_name"] ==
                            'tabular_intrusion_frame'].copy()

    conformable_feature = model.create_and_add_foliation('stratigraphy')

    intrusion_network_parameters = {'type': 'interpolated', 'contact': 'roof'}
    interpolator = model.get_interpolator(interpolatortype='FDI')

    intrusion_frame_builder = IntrusionFrameBuilder(
        interpolator, name='tabular_intrusion_frame', model=model)

    # -- create intrusion network

    intrusion_frame_builder.set_intrusion_network_parameters(
        intrusion_data, intrusion_network_parameters)
    intrusion_network_geometry = intrusion_frame_builder.create_intrusion_network(
    )

    # -- create intrusion frame using intrusion network points and flow/inflation measurements
    intrusion_frame_builder.set_intrusion_frame_data(
        frame_data, intrusion_network_geometry)

    ## -- create intrusion frame
    intrusion_frame_builder.setup()
    intrusion_frame = intrusion_frame_builder.frame

    # -- create intrusion builder to simulate distance thresholds along frame coordinates
    intrusion_builder = IntrusionBuilder(intrusion_frame,
                                         model=model,
                                         name="tabular intrusion")
    intrusion_builder.lateral_extent_model = rectangle_function  #intrusion_lateral_extent_model
    intrusion_builder.vertical_extent_model = parallelepiped_function  #intrusion_vertical_extent_model

    intrusion_builder.set_data_for_extent_simulation(intrusion_data)
    intrusion_builder.build_arguments = {
        "lateral_extent_sgs_parameters": {},
        "vertical_extent_sgs_parameters": {}
    }

    intrusion_feature = intrusion_builder.feature
    intrusion_builder.update()

    assert len(intrusion_feature._lateral_simulated_thresholds) > 0
    assert len(intrusion_feature._growth_simulated_thresholds) > 0
Exemple #5
0
def test_intrusion_freame_builder():
    model = GeologicalModel(boundary_points[0, :], boundary_points[1, :])
    model.data = data
    model.nsteps = [10, 10, 10]

    intrusion_data = data[data['feature_name'] == 'tabular_intrusion']
    frame_data = model.data[model.data["feature_name"] ==
                            'tabular_intrusion_frame'].copy()

    conformable_feature = model.create_and_add_foliation('stratigraphy')

    intrusion_network_parameters = {
        'type': 'shortest path',
        'contact': 'roof',
        'delta_c': [2],
        'contact_anisotropies': [conformable_feature],
        'shortest_path_sequence': [conformable_feature],
        'shortest_path_axis': 'X'
    }
    delta_c = intrusion_network_parameters.get('delta_c')[0]
    # -- get variables for intrusion frame interpolation
    interpolatortype = "FDI"
    nelements = 1e2
    weights = [0, 0, 0]
    interpolator = model.get_interpolator(interpolatortype=interpolatortype)

    intrusion_frame_builder = IntrusionFrameBuilder(
        interpolator, name='tabular_intrusion_frame', model=model)

    # -- create intrusion network

    intrusion_frame_builder.set_intrusion_network_parameters(
        intrusion_data, intrusion_network_parameters)
    intrusion_network_geometry = intrusion_frame_builder.create_intrusion_network(
    )

    keys = list(intrusion_frame_builder.anisotropies_series_parameters.keys())
    # #test if points lie in the contact of interest
    mean = intrusion_frame_builder.anisotropies_series_parameters[keys[0]][1]
    # mean = -10
    stdv = intrusion_frame_builder.anisotropies_series_parameters[keys[0]][2]
    evaluated_inet_points = conformable_feature.evaluate_value(
        model.scale(intrusion_network_geometry[:, :3]))

    assert np.all(
        np.logical_and((mean - stdv * delta_c) <= evaluated_inet_points,
                       (mean + stdv * delta_c) >= evaluated_inet_points))

    # -- create intrusion frame using intrusion network points and flow/inflation measurements
    intrusion_frame_builder.set_intrusion_frame_data(
        frame_data, intrusion_network_geometry)

    ## -- create intrusion frame
    intrusion_frame_builder.setup(
        nelements=nelements,
        w2=weights[0],
        w1=weights[1],
        gxygz=weights[2],
    )

    intrusion_frame = intrusion_frame_builder.frame

    assert isinstance(intrusion_frame, StructuralFrame)
def test_buffer():
    model = GeologicalModel([0, 0, 0], [5, 5, 5], rescale=True)
    interpolator = model.get_interpolator(interpolatortype="FDI",
                                          nelements=1e5,
                                          buffer=0.2)
    assert np.sum(interpolator.support.origin + 0.2) == 0
def test_get_interpolator():
    model = GeologicalModel([0, 0, 0], [5, 5, 5])
    interpolator = model.get_interpolator(interpolatortype="PLI",
                                          nelements=1e5,
                                          buffer=0.2)
    assert type(interpolator) == PiecewiseLinearInterpolator