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)
simplex: implement sensitivities 65056319c51fd93deb76ce14e52c08869dfc04a2 I am 2023-01-13 11:27:46
mplot.maxes: prepare GRaph plot 68774535915af3deaf6104a0bbe9b3c4d24c0cec I am 2023-01-12 02:43:20
mplot.mgraph.tri_estimation_plot: use planar vertex estimator 1d300fa56248be9cdab5a4e5b0d4372f68fd5255 I am 2023-01-11 15:48:28
mplot.mart: implement lsf_boundary() contouring 8642d2f0c043f4e71af1cc45b9e25da326afd3ca I am 2023-01-11 05:20:00
mplot.mart.setup_labels: make labels more adaptive 60cd0b34a67b38df1c730dddc9e0771139818f33 I am 2023-01-11 04:35:47
simplex._SamplingTriangulation: self reference fix 79204ff15cba7c5ca24bb5b48e2073058acf00ae I am 2023-01-11 03:21:34
testcases.testcases_2D: add pf for rastrigin 4f3b35fe18496fcb9f59860174c876cb7a82749a I am 2023-01-10 23:39:45
dicebox.circumtri: fix initialization on ED loading. Use simple potential for space filling c02656e588a164685c4a750ce865c4b50f716563 I am 2023-01-10 23:37:30
simplex.FullCubatureIntegration.get_failure_moments: negative probabilities fix 27dd6bb1e5bb0eb1e28eef88e28913d1eca461da I am 2023-01-10 20:16:09
add more nD problems from literature 2380cdbdcf17dd5e0af19506c6f7bb1e838de03b I am 2023-01-10 06:13:56
f_models: implement Norm class 698c3216b1c8a0e2d57bfb33340a7ea8758d4e63 I am 2023-01-09 23:13:48
simplex.FullCabatureIntegration: implement get_failure_moments() 0742ee3d3932d7c3c0b6bbe6e327c92ced04aedd I am 2023-01-09 19:53:55
simplex._Triangulation: add get_failure_moments() method 3e362970b67a50643c1e486729efbf554cacf03f I am 2023-01-08 03:26:02
simplex: use advanced indexing instead of isin function 568c8623ad4cfaa343df05ae880d099556037cf0 I am 2023-01-06 13:41:00
dicebox.circumtri: fill in global simplex index only in case of full integration 065668f1810396f55be0860416f1c6ad507a9573 I am 2023-01-04 21:44:57
dicebox.circumtri: implement "holyday", breaks the greatest safe simplex 14f067d43cde14f990e7a4136b61c548f3acde92 I am 2023-01-04 16:28:51
simplex: implement FullCubatureIntegration 072927115a8a641f89b39265085eb6cac27aa492 I am 2023-01-04 16:27:39
dicebox.circumtri: use mixed facet outside nodes as candidates only. 03c1c974dafa8ff041f032c89149da7fc5b90b39 I am 2023-01-03 15:55:57
shell: use query() method of the convex hull 321a3fab33684cb9bef3c2344200c6519b595bb0 I am 2023-01-03 15:54:45
convex_hull.QHull: implement query() method. Use myshovskych sheme as fallback bc79a6fbee4d488211bf55c88702f39a0126be1b I am 2023-01-03 15:53:00
Commit 65056319c51fd93deb76ce14e52c08869dfc04a2 - simplex: implement sensitivities
Author: I am
Author date (UTC): 2023-01-13 11:27
Committer name: I am
Committer date (UTC): 2023-01-13 11:27
Parent(s): 68774535915af3deaf6104a0bbe9b3c4d24c0cec
Signer:
Signing key:
Signing status: N
Tree: 5efdb6a974642e586dbabdf477e377f1dd4657a9
File Lines added Lines deleted
wellmet/simplex.py 62 0
File wellmet/simplex.py changed (mode: 100644) (index 8a4ebdf..3cda360)
... ... class _Triangulation:
399 399 return np.logical_xor(has_failure, all_failure) return np.logical_xor(has_failure, all_failure)
400 400
401 401
402 def get_mixed_normals(sx):
403 simplices = sx.tri.simplices[sx.is_mixed(sx.tri.simplices)]
404 nvar = sx.sample_box.nvar
405 failsi = sx.sample_box.failsi
406
407 X = np.empty((sx.sample_box.nsim, nvar + 1))
408 X[:, :-1] = getattr(sx.sample_box, sx.tri_space)
409 X[:, -1] = failsi
410
411 # X = np.empty((nvar + 1, sx.sample_box.nsim))
412 # X[:-1] = getattr(sx.sample_box, sx.tri_space).T
413 # X[-1] = failsi
414
415
416 vectors = X[simplices[:, 1:]] - X[simplices[:, :1]]
417 basises, __ = np.linalg.qr(vectors.transpose(0, 2, 1), mode='complete')
418
419 normals = basises[:, :, -1]
420
421 #č ujistit se, že normály směrovany nahoru,
422 #č tj. směrem k bezpečným vzorkám
423 normals = normals * (1 - 2 * (normals[:,-1:] < 0))
424
425 return normals, simplices
426
427
428 def get_gradients(sx):
429 normals, simplices = sx.get_mixed_normals()
430
431 gradients = normals[:, :-1]
432
433 lengths = np.sum(np.square(gradients), axis=1)
434 lengths = np.sqrt(lengths, out=lengths) #lengths of each radius-vector
435
436 # scale all radii-vectors to unit length
437 # use [:,None] to get an transposed 2D array
438 np.divide(gradients, lengths[:,None], out=gradients)
439
440 return gradients, simplices
441
442
402 443 def get_failure_moments(sx): def get_failure_moments(sx):
403 444 simplices = sx.tri.simplices simplices = sx.tri.simplices
404 445
 
... ... class FullCubatureIntegration(_Triangulation):
1358 1399 #č odhady jsou ve slovníku, posíláme jen to, co tam není #č odhady jsou ve slovníku, posíláme jen to, co tam není
1359 1400 sx.on_failure_added(simplex, indices, vertices_model, nodes, vol) sx.on_failure_added(simplex, indices, vertices_model, nodes, vol)
1360 1401
1402 def get_sensitivities(sx):
1403 gradients, simplices = sx.get_gradients()
1404
1405 p_mix = 0
1406 global_gradient = np.zeros(sx.sample_box.nvar)
1407 sensitivities = np.zeros(sx.sample_box.nvar)
1408
1409 for gradient, simplex in zip(gradients, simplices):
1410 # p_mixed, pfv, pfw, pf
1411 p_mixed, pfv, pfw, pf = sx.mixed_simplices[tuple(simplex)]
1412 p_mix += p_mixed
1413 global_gradient += gradient * p_mixed
1414 sensitivities += gradient**2 * p_mixed
1415
1416 length = np.sqrt(np.inner(global_gradient, global_gradient))
1417 global_gradient = global_gradient / length
1418
1419 sensitivities = sensitivities / p_mix
1420
1421 return p_mix, global_gradient, sensitivities
1422
1361 1423
1362 1424 def get_failure_moments(sx): def get_failure_moments(sx):
1363 1425 simplices = sx.tri.simplices[sx.is_mixed()] simplices = sx.tri.simplices[sx.is_mixed()]
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