iam-git / WellMet (public) (License: MIT) (since 2021-08-31) (hash sha1)
WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain".

/schemes.py (0b6f1878277910356c460674c04d35abd80acf13) (6739 bytes) (mode 100644) (type blob)

#!/usr/bin/env python
# coding: utf-8

import quadpy

un_spheres = [
    "dobrodeev_1978",
    "mysovskikh_1",
    "mysovskikh_2",
    "stroud_un_3_1",
    "stroud_un_3_2",
    "stroud_un_5_1",
    "stroud_un_5_2",
    "stroud_un_5_3",
    "stroud_un_5_4",
    "stroud_un_7_2",
    "stroud_un_7_1",
    "stroud_un_11_1",
#    "stroud_1967", # dup of "stroud_un_7_1"
#    "stroud_1969", # dup of "stroud_un_11_1"
]

#č Bacha! Lidstvo nemusí nutně dočkat 
#č ukončení výpočtu této funkce
def get_all_un_sphere_schemes(dim):
    schemes = dict()
    for item in un_spheres:
        Scheme = getattr(quadpy.un, item)
        try:
            scheme = Scheme(dim)
            schemes[scheme.name] = scheme
        except:
            pass
            
    return schemes



# up to degree 7. Ought to be enough for anybody
#č 7 stupňů musí stačit každému
def get_all_tn_simplex_schemes(dim):
    #č současný qt_plot vytahuje schemata ze slovníku
    #č aspoň netřeba v dlouhém seznamu dohledávat 
    schemes = dict()
    # Grundmann, Möller
    for i in range(8):
        scheme = quadpy.tn.grundmann_moeller(dim, i)
        schemes[scheme.name] = scheme
    # Silvester
    for i in range(7):
        scheme = quadpy.tn.silvester(dim, variant="open", n=i+1, symbolic=False)
        schemes[scheme.name] = scheme
        scheme = quadpy.tn.silvester(dim, variant="closed", n=i+1, symbolic=False)
        schemes[scheme.name] = scheme
    
    # Laufer, Hammer and Stroud
    for item in tn_simplices:
        Scheme = getattr(quadpy.tn, item)
        try:
            scheme = Scheme(dim)
            schemes[scheme.name] = scheme
        except:
            print(item, "Excluded")
        
    return schemes
    
    # v - has points at vertices
    # i - scheme has not integration points at vertices
    #
    # p - positive, all weights are positive
    # n - scheme has negative weights as well
tn_simplices = [
                'stroud_tn_1_1', # i p # single centroid point
                'stroud_tn_1_2', # v p # vertices only # laufer_1
                'stroud_tn_2_1a', # i p, positive, stejné váhy # ndim + 1 points # Hammer-Stround 1a # umísuje bodíky s odstupem od středu směrem k vrcholům
                'stroud_tn_2_1b', # i p, positive, stejné váhy # ndim + 1 points # Hammer-Stround 1b # umísuje bodíky na stěny simplexu 
                'stroud_tn_2_2', # negative # laufer_2
                'stroud_tn_3_1', # i negative
                'stroud_tn_3_2', # v negative
                'stroud_tn_3_3', # v negative pro ndim >=4
                'stroud_tn_3_4', # i p, positive # 45 points at 8D # Stroud 1966-II
                'stroud_tn_3_5', # v negative pro ndim >=7
                'stroud_tn_3_6a', # i p, positive, stejné váhy # 72 points at 8D # Stroud 1964a # obecně ndim <= 9 
                'stroud_tn_3_6b', # i p, positive, stejné váhy # 72 points at 8D # Stroud 1964b
                'stroud_tn_3_7', # v, positive pro ndim <= 9 # 94 points at 8D
                'stroud_tn_3_8', # v, positive pro ndim <= 9 # 102 points at 8D
                'stroud_tn_3_9', # v n # laufer_3
                'stroud_tn_3_10', # i n (depends on dimension)
                'stroud_tn_3_11', # v n (depends on dimension)
                'stroud_tn_4_1', # v negative # laufer_4 n>=3
                'stroud_tn_5_1', # i n
                'stroud_tn_5_2', # v negative # laufer_5 n>=4
                'walkington_1', # i p # single centroid point
                'walkington_2', # bůhvíco, positive # I have strong suspicious, that it places points outside the simplex
                'walkington_3', # i negative
                'walkington_5', #owntest n=2,3 
                'walkington_7' #owntest n=3
                ]

tn_simplices_2d = [
                'stroud_tn_1_1', 
                'stroud_tn_1_2', # laufer_1
                'stroud_tn_2_1a', 
                'stroud_tn_2_1b', 
                'stroud_tn_2_2', # laufer_2
                'stroud_tn_3_1', 
                'stroud_tn_3_2', 
                'stroud_tn_3_3', 
                'stroud_tn_3_4', 
                'stroud_tn_3_6a', 
                'stroud_tn_3_6b',
                'stroud_tn_3_8', 
                'stroud_tn_3_9', # laufer_3 
                'walkington_1', 
                'walkington_2', 
                'walkington_3', 
                'walkington_5', #owntest n=2,3 
                ]
                
def get_t2_keys():
    return list(quadpy.t2.schemes.keys()).extend(tn_simplices_2d)
    
def get_t3_keys():
    return list(quadpy.t3.schemes.keys()).extend(tn_simplices)
    
def get_t2_scheme(key):
    try:
        return quadpy.t2.schemes[key]()
    except KeyError:
        Scheme = getattr(quadpy.tn, key)
        return Scheme(2)

def get_t3_scheme(key):
    try:
        return quadpy.t3.schemes[key]()
    except KeyError:
        Scheme = getattr(quadpy.tn, key)
        return Scheme(3)
        
        
def get_tn_keys(ndim):
    keys = ['Grundmann-Möller', 'Silvester open', 'Silvester closed']
    if ndim == 2:
        keys.extend(quadpy.t2.schemes.keys())
        keys.extend(tn_simplices_2d)
    elif ndim == 3:
        keys.extend(quadpy.t3.schemes.keys())
        keys.extend(tn_simplices)
        keys.remove('stroud_tn_5_2')
    elif ndim == 4:
        keys.extend(tn_simplices)
        keys.remove('walkington_5')
        keys.remove('walkington_7')
    elif ndim == 5:
        keys.extend(tn_simplices)
        keys.remove('stroud_tn_3_10')
        keys.remove('stroud_tn_3_11')
        keys.remove('walkington_5')
        keys.remove('walkington_7')
        
    else:
        keys.extend(tn_simplices)
        keys.remove('walkington_5')
        keys.remove('walkington_7')
    return keys


def get_tn_scheme(key, ndim, degree=5):
    if key == 'Grundmann-Möller': #č husté, ale záporné schema. 
        #č n=0 odpovidá jednomu bodíku v těžišti
        #č n=1 odpovidá ndim+1 bodům (šíkmě rovině)
        return quadpy.tn.grundmann_moeller(ndim, degree)
    elif key == 'Silvester open': #č husté positivní (pro degree 1) schema. 
        #č n=1 odpovidá odpovidá ndim+1 bodům (šíkmě rovině). Positivní.
        return quadpy.tn.silvester(ndim, variant="open", n=degree, symbolic=False)
    elif key == 'Silvester closed': #č na hranici, nic dovnitř nedává
        #č n=1 odpovídá bodíkům jen ve vrcholech
        return quadpy.tn.silvester(ndim, variant="closed", n=degree, symbolic=False)
    elif ndim == 2:
        return get_t2_scheme(key)
    elif ndim == 3:
        return get_t3_scheme(key)
    else:
        Scheme = getattr(quadpy.tn, key)
        return Scheme(ndim)
    
    
    
    
            


Mode Type Size Ref File
100644 blob 28117 0907e38499eeca10471c7d104d4b4db30b8b7084 IS_stat.py
100644 blob 6 0916b75b752887809bac2330f3de246c42c245cd __init__.py
100644 blob 72 458b7e2ca46acd9ec0d2caf3cc4d72e515bb73dc __main__.py
100644 blob 73368 3d245b8568158ac63c80fa0847631776a140db0f blackbox.py
100644 blob 11243 10c424c2ce5e8cdd0da97a5aba74c54d1ca71e0d candybox.py
100644 blob 29927 066a2d10ea1d21daa6feb79fa067e87941299ec4 convex_hull.py
100644 blob 102798 059ae717e71c651975673420cd8230fbef171e5e dicebox.py
100644 blob 36930 a775d1114bc205bbd1da0a10879297283cca0d4c estimation.py
100644 blob 34394 3f0ab9294a9352a071de18553aa687c2a9e6917a f_models.py
100644 blob 33191 b3bd1d03f27a238f9de7175b6400971d16e4094b g_models.py
100644 blob 20908 457329fe567f1c0a9950c21c7c494cccf38193cc ghull.py
100644 blob 2718 5d721d117448dbb96c554ea8f0e4651ffe9ac457 gp_plot.py
100644 blob 29393 96162a5d181b8307507ba2f44bafe984aa939163 lukiskon.py
100644 blob 2004 6ea8dc8f50a656c48f786d5a00bd6398276c9741 misc.py
040000 tree - de8bd2f224a5aeca788c8910ad6b1b0ed221dd8d mplot
100644 blob 1462 437b0d372b6544c74fea0d2c480bb9fd218e1854 plot.py
100644 blob 2807 1feb1d43e90e027f35bbd0a6730ab18501cef63a plotly_plot.py
040000 tree - 4b9d4fe1369f57364e208e028556fdda64573e69 qt_gui
100644 blob 8566 5c8f8cc2a34798a0f25cb9bf50b5da8e86becf64 reader.py
100644 blob 4284 a0e0b4e593204ff6254f23a67652804db07800a6 samplebox.py
100644 blob 6558 df0e88ea13c95cd1463a8ba1391e27766b95c3a5 sball.py
100644 blob 6739 0b6f1878277910356c460674c04d35abd80acf13 schemes.py
100644 blob 76 11b2fde4aa744a1bc9fa1b419bdfd29a25c4d3e8 shapeshare.py
100644 blob 54884 fbe116dab4fc19bb7568102de21f53f15a8fc6bf simplex.py
100644 blob 13090 2b9681eed730ecfadc6c61b234d2fb19db95d87d spring.py
100644 blob 10953 da8a8aaa8cac328ec0d1320e83cb802b562864e2 stm_df.py
040000 tree - 00108112e121bd0f670c91b8144616f5a808b1f4 testcases
100644 blob 2465 d829bff1dd721bdb8bbbed9a53db73efac471dac welford.py
100644 blob 25318 fcdabd880bf7199783cdb9c0c0ec88c9813a5b18 whitebox.py
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/WellMet

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/WellMet

Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/WellMet

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main