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)
mplot: add rbf_density_plot() 62ce990cb9418418879d0f5e084a26043b5bfdeb I am 2022-03-04 03:00:32
misc: little changes to the rbf class 058a0401db09f4e9e68af72c987c3b879077864d I am 2022-03-03 22:53:48
mplot.maxes: rbf, one more try 8303470585507772e8170504989835f04a7828b9 I am 2022-03-02 22:13:08
mplot.maxes: add rbf_plot 3485da2191b2f64fac76813d072a6b6f6e2fba71 I am 2022-03-02 03:35:27
mplot.maxes: add rbf plot bd5055adced9e0d8887fa213baa0ff9f9e038ba4 I am 2022-03-02 02:17:18
misc: add small class for rbf surrogate model f8beecf63302ceae6d3462ed279b796b54149bdf I am 2022-03-02 02:16:01
testcases: pf_exact fix for suspension 3d case 0f3318cac398c9195e0b21a6f13edc9475156b0d I am 2022-03-02 02:14:55
g_models.CosExp2D: add pf_expression() method 3ebf3098bcff1a73a649059b1539d622d58b7439 I am 2022-02-06 19:38:37
mplot.mfigs.double_diagram(): do not share x axis. User can set up limits itself after all e74145928c028479070af2fe766d55f180828cdf I am 2022-02-06 05:02:59
testcases: add reference solution bounds to the whitebox 3358b3ff7903417f6484a875abb154d3a7c04a06 I am 2022-02-06 05:00:50
mplot: we need more rasterization! 46df5af418dcab84e8e7e7e23724a74e86575806 I am 2022-02-05 02:20:22
testcases: provide more presice pf for vehicle suspension example e2c4bd1c7f2278b4d94b6f7515785528267c18bb I am 2022-02-05 02:18:45
g_models.PassiveSuspensionVehicle: reformulation and clean up 6e0f9ea7b97f12a2554d895be0b2b8a3f39a536d I am 2022-02-04 03:50:03
mplot: add beta diagram 5e346bdd2c5f06a41726e2ff264776dcc60eac19 I am 2022-02-01 04:08:34
mplot.maxes3d: rasterization of risges is absolutely needed 87c3235b8313ade07ca5b4d72b1f8fec339d621d I am 2022-01-31 03:15:31
testcases: add pf_exact for suspension example 9f903986699b97bfc0eb7c8d4bcad78d3e018450 I am 2022-01-30 23:14:42
mplot: polish 3d b78a192b0ce5c4f5f9e3a94e271bcde3f3c03fac I am 2022-01-30 23:14:16
qt_gui.gl_plot: oprašit gl_plotové prvky d4336e94b262d11db3b6a110527689a9ab101a60 Aleksei Gerasimov 2022-01-30 04:00:40
add vehicle suspension problem 1546923576c59fa15e97c082b4a9c39cdadcf690 I am 2022-01-30 10:39:08
mplot: add 3D triangulation plot addec9ba2a5a9cdfbbfea2eaf660847ea814d387 I am 2022-01-30 05:15:22
Commit 62ce990cb9418418879d0f5e084a26043b5bfdeb - mplot: add rbf_density_plot()
Author: I am
Author date (UTC): 2022-03-04 03:00
Committer name: I am
Committer date (UTC): 2022-03-04 03:00
Parent(s): 058a0401db09f4e9e68af72c987c3b879077864d
Signer:
Signing key:
Signing status: N
Tree: 34b0b5c5c9f4a7df5fce0658435bc378ab1b49ff
File Lines added Lines deleted
mplot/mart.py 64 2
mplot/maxes.py 9 9
File mplot/mart.py changed (mode: 100644) (index 621ae2f..b690239)
... ... import matplotlib.path as mpath
11 11 import matplotlib.colors as mcolor import matplotlib.colors as mcolor
12 12 import matplotlib.patches as mpatches import matplotlib.patches as mpatches
13 13
14 from .. import misc
14 from .. import misc as wmisc
15 15
16 16 #č Tahlensta blbost je použita funkcí tripcolor() #č Tahlensta blbost je použita funkcí tripcolor()
17 17 #č Je třeba jú překopat na Triangulation třidu, #č Je třeba jú překopat na Triangulation třidu,
 
... ... def shull_plot(ax, hull, **kwargs):
372 372
373 373
374 374
375 def rbf_density_colormesh(ax, ngrid=500, **kwargs):
376 xmin, xmax = ax.get_xlim()
377 ymin, ymax = ax.get_ylim()
378
379 x = np.linspace(xmin, xmax, ngrid, endpoint=True)
380 y = np.linspace(ymin, ymax, ngrid, endpoint=True)
381 X, Y = np.meshgrid(x, y)
382
383 XY = np.vstack((X.flatten(), Y.flatten())).T
384 z = ax.sample_box.sample_pdf(XY, ax.space)
385 Z = z.reshape(ngrid, ngrid)
386
387 #č s tou alphou mně to nějak nepovedlo
388 #č matplotlib ji nějak ignoruje
389 #č a podle toho, co vidím v kódu
390 #č není to problém kolormapy LinearSegmentedColormap
391 # cdict = {'red':[[0.0, 253/255, 253/255],
392 # [0.9999, 253/255, 167/255],
393 # [1.0, 167/255, 167/255]],
394 # 'green': [[0.0, 193/255, 193/255],
395 # [0.9999, 193/255, 1.0],
396 # [1.0, 1.0, 1.0]],
397 # 'blue': [[0.0, 197/255, 197/255],
398 # [0.9999, 197/255, 181/255],
399 # [1.0, 181/255, 181/255]],
400 # 'alpha': [[0.0, 1.0, 1.0],
401 # [0.9999, 1.0, 0.2],
402 # [1.0, 0.2, 0.2]]}
403
404 cdict = {'red':[[0.0, 1.0, 1.0],
405 [0.99999, 253/255, 167/255],
406 [1.0, 167/255, 167/255]],
407 'green': [[0.0, 1.0, 1.0],
408 [0.99999, 0/255, 1],
409 [1.0, 1.0, 1.0]],
410 'blue': [[0.0, 1.0, 1.0],
411 [0.99999, 17/255, 181/255],
412 [1.0, 181/255, 181/255]]}
413
414
415 cmap = mcolor.LinearSegmentedColormap('red_density', segmentdata=cdict, N=2560)
416 #cmap = mcolors.ListedColormap(['#A7FFB5', '#FDC1C5'])
417 rbf_values = wmisc.RBF_surrogate(ax.sample_box, ax.space).rbf(X, Y)
418 #Z = np.log(Z/np.max(Z[rbf_values <= 0]))
419 #C = -Z/np.min(Z) * (rbf_values <= 0) + 1/250 * (rbf_values > 0)
420 Z = Z / np.max(Z[rbf_values <= 0])
421 C = (np.sqrt(Z)-1) * (rbf_values <= 0) + 1/250 * (rbf_values > 0)
422 return ax.pcolormesh(X, Y, C, cmap=cmap, shading='nearest', edgecolors='face',
423 zorder=-100, rasterized=True, **kwargs)
424
425
426 def rbf_colormesh(ax, ngrid=500, **kwargs):
427 xmin, xmax = ax.get_xlim()
428 ymin, ymax = ax.get_ylim()
429
430 x = np.linspace(xmin, xmax, ngrid, endpoint=True)
431 y = np.linspace(ymin, ymax, ngrid, endpoint=True)
432 X, Y = np.meshgrid(x, y)
375 433
434 cmap = mcolor.ListedColormap(['#A7FFB5', '#FDC1C5'])
435 rbf_values = wmisc.RBF_surrogate(ax.sample_box, ax.space).rbf(X, Y)
436 C = rbf_values < 0
437 return ax.pcolormesh(X, Y, C, cmap=cmap, shading='nearest', zorder=-100, rasterized=True, **kwargs)
376 438
377 439
378 440 def gcircle(ax, r=1, nrod=200, **kwargs): def gcircle(ax, r=1, nrod=200, **kwargs):
 
... ... def isocurves(ax, ngrid=200, limits=None, ncurves=5, **kwargs):
427 489
428 490 const = 1 / (xmax - xmin) / (ymax - ymin) const = 1 / (xmax - xmin) / (ymax - ymin)
429 491 r_levels = np.arange(ncurves) + 1 r_levels = np.arange(ncurves) + 1
430 levels = misc.isolevels_2d(Z, const, np.flip(r_levels), from_top=False)
492 levels = wmisc.isolevels_2d(Z, const, np.flip(r_levels), from_top=False)
431 493 return ax.contour(X, Y, Z.reshape(ngrid, ngrid), levels, **kwargs) return ax.contour(X, Y, Z.reshape(ngrid, ngrid), levels, **kwargs)
432 494
433 495
File mplot/maxes.py changed (mode: 100644) (index 6617c09..7cd68b1)
... ... from matplotlib import lines as mlines
24 24
25 25 # it is mostly for qt_plot, it offers availiable options to user # it is mostly for qt_plot, it offers availiable options to user
26 26 __all__ = [ __all__ = [
27 'rbf_plot', 'rbf_diagram',
27 'rbf_plot', 'rbf_density_plot', 'rbf_diagram',
28 28 'candidates_plot', 'rejection_sampling_plot', 'candidates_plot', 'rejection_sampling_plot',
29 29 'candidates_sampling_plot', 'candidates_sampling_plot',
30 30 'convex_hull_plot', 'tri_plot', 'tri_nodes_plot', 'convex_hull_plot', 'tri_plot', 'tri_nodes_plot',
 
... ... def rbf_diagram(ax):
57 57
58 58
59 59 def rbf_plot(ax, nrid=500): def rbf_plot(ax, nrid=500):
60 from .. import misc as wmisc
61 60 tri_plot(ax) tri_plot(ax)
62 61 x_bound = ax.get_xbound() x_bound = ax.get_xbound()
63 62 y_bound = ax.get_ybound() y_bound = ax.get_ybound()
64
65 x = np.linspace(*x_bound, nrid, endpoint=True)
66 y = np.linspace(*y_bound, nrid, endpoint=True)
67 X, Y = np.meshgrid(x, y)
68 cmap = mcolors.ListedColormap(['#A7FFB5', '#FDC1C5'])
69 rbf_values = wmisc.RBF_surrogate(ax.sample_box, ax.space).rbf(X, Y)
70 ax.pcolor(X, Y, rbf_values<0, cmap=cmap, alpha=0.2 , zorder = -100)
63 mart.rbf_colormesh(ax, nrid)
71 64 ax.set_xbound(x_bound) ax.set_xbound(x_bound)
72 65 ax.set_ybound(y_bound) ax.set_ybound(y_bound)
73 66
67 def rbf_density_plot(ax, nrid=500):
68 tri_plot(ax)
69 x_bound = ax.get_xbound()
70 y_bound = ax.get_ybound()
71 mart.rbf_density_colormesh(ax, nrid)
72 ax.set_xbound(x_bound)
73 ax.set_ybound(y_bound)
74 74
75 75 def rejection_sampling_plot(ax, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1]): def rejection_sampling_plot(ax, linewidths=[0.7, 0.5, 0.4, 0.3, 0.2, 0.1]):
76 76 from .. import simplex as six from .. import simplex as six
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