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".
List of commits:
Subject Hash Author Date (UTC)
voronoi: ContactSolver is ready. Ale je to na nic. Pomalá, potvora 28e2442b0101eac2407ed4a69c6f757ffd579cf1 I am 2022-10-13 04:14:59
voronoi: add some preliminary lines of ContactSolver. WIP 6a203b278c9fa6de7da75c402c80f78d40164fdf I am 2022-10-12 23:38:59
voronoi: přídat pár těžkých smyček. WIP 7b0ffb602ae00ab2f12dc98d34c35ec20afa3cc4 I am 2022-10-12 00:13:36
add to repo voronoi module. WIP f43768c22d88fac7c7095be02d8c9b5620153976 I am 2022-10-11 03:29:49
convex_hull.Grick: malý puntičkářský fix v get_r() cfa07257b9ebadc21f2bd295d35978072fac19e9 I am 2022-10-10 07:14:26
qt_gui.qt_plot: add Grick to Ghull widget d90b9a87c3ef0989951a45b2a22346381ce16f02 I am 2022-10-10 03:17:24
convex_hull: implement Grick convex hull aproximation d09ca2e6aca41cfc67f3303eb97b97dd9c6f1fba I am 2022-10-10 03:15:52
qt_gui.qt_gui: distance matrix viewer is ready a532e5259c081a1aff193d3b61e0104c42b08f20 I am 2022-10-08 20:52:14
qt_gui.qt_gui: prepare distance matrix window 4eaea3305643c60c35f0b22421a7e57dbe7a7817 I am 2022-10-08 02:59:01
qt_gui.qt_graph_widgets: set up x limits for all graph widgets 413d114f6a4e4b45c6cd44959cc42588bb7c8008 I am 2022-10-07 22:54:46
qt_gui.qt_plot: set up equal aspect by default 11bfe09b3e96881ef6f7c8202a6723b6e8adc03a I am 2022-10-07 21:41:18
qt_gui.qt_gui: hide "connect/disconnect" button. It wasn't really supported d9f195fe0611d6cf9a8154f0175c6c9506d56247 I am 2022-10-07 21:33:07
qt_gui.qt_plot: fix zero r cirkle (off by one error) 681397de6d075b693897d5f64004c0eb481fd36f I am 2022-10-07 20:34:44
qt_gui: replace globally QtGui by QtWidgets 969a659ae31728e75f587f25f54bab1ae5d6bfff I am 2022-10-07 12:45:34
qt_gui: add radia in Gaussian space (GRaph) widget e3f5be57dcdc6bdd06cda0594ffd795ef5bc8ccc I am 2022-10-07 01:15:38
testcases.testcases_2d: fix natafm_plane pf 75006ccd448c9717c13659e8ceb68800fbda39a7 I am 2022-06-26 12:03:39
misc: add entropy formula 72736d485b4f0fa912a47a49f72954e1ec06c03f I am 2022-06-26 12:02:52
testcases.gaussian_2D: one more product... e835ab15321169c2da085a6bb74e1ed749e67f14 I am 2022-05-11 15:38:24
whitebox: add explicitly solved Gaussian 2D product distribution 23d243baed0b7b71ba887444665420d673dc3fe9 I am 2022-05-11 15:37:19
whitebox: simplify Bessel solutions d097f681f9c96d7f8c6e0c044479681bae110e98 I am 2022-05-08 03:33:44
Commit 28e2442b0101eac2407ed4a69c6f757ffd579cf1 - voronoi: ContactSolver is ready. Ale je to na nic. Pomalá, potvora
Author: I am
Author date (UTC): 2022-10-13 04:14
Committer name: I am
Committer date (UTC): 2022-10-13 04:14
Parent(s): 6a203b278c9fa6de7da75c402c80f78d40164fdf
Signer:
Signing key:
Signing status: N
Tree: ec6a60b79c031f700ee88aca816ddee4c9dc213d
File Lines added Lines deleted
wellmet/voronoi.py 41 54
File wellmet/voronoi.py changed (mode: 100644) (index 73c7f8d..7a39675)
... ... class ContactSolver:
57 57 b = [0, 0] b = [0, 0]
58 58
59 59
60 č Zbytek nechť splnuje nerovnost, tj.
60 č Zbytek musí splňovat nerovnost, tj.
61 61 "Convex hull inequalities of the form Ax + b <= 0" "Convex hull inequalities of the form Ax + b <= 0"
62 62
63 A = [[ x_1i, x_2i, ..., x_ni, 1],
64 [ x_1j, x_2j, ..., x_nj, 1]]
65 b = [0, 0]
66
63 č Neboli Ax <= b v termínech linprog
64 č díky "menší nebo rovno"
65 č nemusíme plnou matici ani maskovat
67 66
67 č ačka hyperroviny zadavají jednotkový vektor normály,
68 č takže leží v mezích -1 < a < 1
69 č bčko lze omezit poloosou
68 70 """ """
69 71 def __init__(self, points): def __init__(self, points):
70 72 nsim, ndim = points.shape nsim, ndim = points.shape
71 # kind of datascience. feature space, quadratic kernel...
72 self.lifted_points = np.empty((nsim, ndim + 1))
73 self.lifted_points[:, :ndim] = points
74 self.lifted_points[:, -1] = np.sum(np.square(points), axis=1)
75
76 #č pro linprog zadáme constrains Ax=b
77 # A = [[ x_1i, x_2i, ..., x_ni, 1],
78 # [ x_1j, x_2j, ..., x_nj, 1]]
79 # b = [0, 0]
80 self.A_eq = np.empty((2, ndim + 2))
81 self.A_eq[:, -1] = 1
82 self.b_eq = np.zeros(2)
83 73
84 self.A_ub = np.empty((nsim, ndim + 2))
85 self.A_ub[:, :ndim] = points
86 self.A_ub[:, -1] = np.sum(np.square(points), axis=1)
74 self.A = A = np.empty((nsim, ndim + 2))
75 A[:, :ndim] = points
76 # kind of datascience. feature space, quadratic kernel...
77 #č dáme to trochu niž (ten "ndim"), abychom se vyhli triviálnímu řešení
78 A[:, -2] = np.sum(np.square(points)-ndim, axis=1)
79 A[:, -1] = 1
80
81 #č žšmaria, alokovat nuly..
82 self.b_ub = np.zeros(nsim)
83 self.c = np.zeros(ndim + 2)
84 self.b_eq = self.c[:2]
85 self.bounds = [(-1, 1) for __ in range(ndim + 1)]
86 #č skoro-nulové b-čko může být legální
87 #č ale musíme vyhnout triviálnímu řešení
88 #č nevím co s tím
89 self.bounds.append((None, -0.3))
87 90
88 91 def is_couple(self, couple_indices): def is_couple(self, couple_indices):
89 92 i, j = couple_indices i, j = couple_indices
 
... ... class ContactSolver:
91 94 #č pro linprog zadáme constrains Ax=b #č pro linprog zadáme constrains Ax=b
92 95 # A = [[ x_1i, x_2i, ..., x_ni, 1], # A = [[ x_1i, x_2i, ..., x_ni, 1],
93 96 # [ x_1j, x_2j, ..., x_nj, 1]] # [ x_1j, x_2j, ..., x_nj, 1]]
94 self.A_eq[:, :ndim] = self.lifted_points[[i, j]]
95 #self.A_eq[:, -1] = 1
96
97
98
99 # Ax + b < 0
97 A_eq = self.A[[i, j]]
100 98
101 # Ax + b = 0
99 #č nevím, zda omezení (bounds) zrychlí, nebo zpomalí běh řešiče
100 result = linprog(self.c, A_ub=self.A, b_ub=self.b_ub, A_eq=A_eq,\
101 b_eq=self.b_eq, bounds=self.bounds)
102 102
103 # Ax < b
104
105 c = np.array([-29.0, -45.0, 0.0, 0.0])
106 >>> A_ub = np.array([[1.0, -1.0, -3.0, 0.0],
107 ... [-2.0, 3.0, 7.0, -3.0]])
108 >>> b_ub = np.array([5.0, -10.0])
109 >>> A_eq = np.array([[2.0, 8.0, 1.0, 0.0],
110 ... [4.0, 4.0, 0.0, 1.0]])
111 >>> b_eq = np.array([60.0, 60.0])
112 >>> x0_bounds = (0, None)
113 >>> x1_bounds = (0, 5.0)
114 >>> x2_bounds = (-np.inf, 0.5) # +/- np.inf can be used instead of None
115 >>> x3_bounds = (-3.0, None)
116 >>> bounds = [x0_bounds, x1_bounds, x2_bounds, x3_bounds]
117 >>> result = linprog(c, A_ub=A_ub, b_ub=b_ub, A_eq=A_eq, b_eq=b_eq, bounds=bounds)
103 return result.success
104
118 105
119 106
120 107 #оӵ кык точкаен Вороной #оӵ кык точкаен Вороной
 
... ... class ContactVoronoi:
154 141 č a mezi "c" a "b", tak přídaní "c" nemohlo kontakt mezi "a" a "b" ovlivnit č a mezi "c" a "b", tak přídaní "c" nemohlo kontakt mezi "a" a "b" ovlivnit
155 142 """ """
156 143 def __init__(self, sample_box, hull, model_space='G', \ def __init__(self, sample_box, hull, model_space='G', \
157 p_norm=2, p_base=0.5, ns=1000, auto_update=True,
158 sample_callback=None)
144 p_norm=2, p_base=0.5, ns=1000, auto_update=True, \
145 sample_callback=None):
159 146 self.sample_box = sample_box self.sample_box = sample_box
160 147 self.hull = hull self.hull = hull
161 148 self.model_space = model_space self.model_space = model_space
 
... ... class ContactVoronoi:
247 234 #č u prvního indexu musíme dodržovat pořadí procházky #č u prvního indexu musíme dodržovat pořadí procházky
248 235 for i in range(self._nsim - 1, 0, -1): for i in range(self._nsim - 1, 0, -1):
249 236 if i in self._indices_to_update: if i in self._indices_to_update:
250 self._indices_to_update.remove(i)�
237 self._indices_to_update.remove(i)
251 238 for j in self._indices_to_update: for j in self._indices_to_update:
252 239 if ((i, j) in self.mixed_couples) or ((i, j) in self.red_couples): if ((i, j) in self.mixed_couples) or ((i, j) in self.red_couples):
253 240 self.update_couple((i, j)) self.update_couple((i, j))
 
... ... class ContactVoronoi:
273 260 np.divide(contact_node_model, 2, out=contact_node_model) np.divide(contact_node_model, 2, out=contact_node_model)
274 261
275 262
276 self.direct_contacts[(i, j)] = None
277 self.nodes[(i, j)] = None
263 # self.direct_contacts[(i, j)] = None
264 # self.nodes[(i, j)] = None
278 265
279 266
280 267 dd, ii = tree.query(h_plan_model_part, k=1, p=p_norm) dd, ii = tree.query(h_plan_model_part, k=1, p=p_norm)
 
... ... class ContactVoronoi:
287 274
288 275
289 276 #č není znamená, že nikdy ani nebylo #č není znamená, že nikdy ani nebylo
290 if ((i, j) in self.nodes) or ((i, j) in self.direct_contacts):
291 #č None znamená, že kontakt je pro nás pase
292 if self.nodes[(i, j)] is not None:
293 self.update_couple((i, j))
294
295 else: #č (i, j)? poprvé ta čísla vidíme
296 self.onboard_couple((i, j))
277 # if ((i, j) in self.nodes) or ((i, j) in self.direct_contacts):
278 # #č None znamená, že kontakt je pro nás pase
279 # if self.nodes[(i, j)] is not None:
280 # self.update_couple((i, j))
281 #
282 # else: #č (i, j)? poprvé ta čísla vidíme
283 # self.onboard_couple((i, j))
297 284
298 285
299 286 #č i-té indexy jsou ty čerstvé, přes ně iterujeme #č i-té indexy jsou ty čerstvé, přes ně iterujeme
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