{"id":13388,"date":"2021-08-25T06:50:50","date_gmt":"2021-08-24T21:50:50","guid":{"rendered":"https:\/\/ocse2.com\/?p=13388"},"modified":"2021-08-25T14:45:57","modified_gmt":"2021-08-25T05:45:57","slug":"dexcs%e3%83%a9%e3%83%b3%e3%83%81%e3%83%a3%e3%83%bc-v2-5-%e8%a3%bd%e4%bd%9c%e3%83%a1%e3%83%a2-5","status":"publish","type":"post","link":"https:\/\/ocse2.com\/?p=13388","title":{"rendered":"DEXCS\u30e9\u30f3\u30c1\u30e3\u30fc v2.5 \u88fd\u4f5c\u30e1\u30e2 \/ 5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">5. Plot \u30ef\u30fc\u30af\u30d9\u30f3\u30c1\u3092\u4f7f\u3063\u305f post \u51e6\u7406<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">5.1. \u5358\u30b0\u30e9\u30d5\u306e\u81ea\u52d5\u4f5c\u6210<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"887\" height=\"446\" src=\"https:\/\/ocse2.com\/wp-content\/uploads\/2021\/08\/22da8f1108fd416e9a38e5f6f7de74c3.png\" alt=\"\" class=\"wp-image-13391\"\/><figcaption>\u56f354.\u3000postProcessing\u30d5\u30a1\u30a4\u30eb\u306e\u30d7\u30ed\u30c3\u30c8\u65b9\u6cd5<\/figcaption><\/figure><\/div>\n\n\n<p><!-- admax --><br \/>\n<script src=\"\/\/adm.shinobi.jp\/s\/f441a8efe75e3127b36ac8c4fda493f7\"><\/script><br \/>\n<!-- admax --><\/p>\n\n\n\n<p>\u65e2\u306b<a href=\"https:\/\/ocse2.com\/?p=13166\">3-1<\/a>.\u3067\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u5bfe\u8c61\u306b\u6b8b\u6e23\u56f3\u3092\u63cf\u3051\u3066\u3044\u308b\u306e\u3067\u3001\u307e\u305a\u306f\u3053\u308c\u3092\u30d9\u30fc\u30b9\u306b\u30d7\u30ed\u30c3\u30c8\u5bfe\u8c61\u3092\u3001\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3067\u306a\u304f\u3001postProcessing\u30d5\u30a9\u30eb\u30c0\u4e2d\u306e\u5f8c\u51e6\u7406\u30c7\u30fc\u30bf\u3092\u5bfe\u8c61\u306b\u5358\u30b0\u30e9\u30d5\uff08\u6a2a\u8ef8\u306b\u6700\u521d\u306e\u6570\u5024\u30ab\u30e9\u30e0\u3001\u7e26\u8ef8\u306b2\u756a\u76ee\u306e\u6570\u5024\u30ab\u30e9\u30e0\uff09\u4f5c\u6210\u7528\u306e\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3068\u3057\u305f\u3002\u4f55\u306f\u3068\u3082\u3042\u308c\u3001\u3053\u308c\u304c\u51fa\u6765\u306a\u3044\u3053\u3068\u306b\u306f\u3001\u73fe\u884c\u306eDEXCS\u30e9\u30f3\u30c1\u30e3\u30fc\u3067\u3001JGP\u3092\u4f7f\u3063\u3066\u4f5c\u6210\u3067\u304d\u3066\u3044\u308b\u8907\u5408\u30b0\u30e9\u30d5\u306e\u4f5c\u6210\u3082\u899a\u675f\u306a\u3044\u3053\u3068\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3002<\/p>\n\n\n\n<p>\u307b\u307c1\u65e5\u9593\u306e\u8a66\u884c\u932f\u8aa4\u3092\u7d4c\u3066\u3001\u56f354.\u306b\u793a\u3059\u3088\u3046\u306a\u624b\u9806\u3067\u3001postProcessing\u30d5\u30a9\u30eb\u30c0\u4e2d\u3001set\u30d5\u30a9\u30eb\u30c0\uff08vtk\u30d5\u30a1\u30a4\u30eb\u304c\u53ce\u7d0d\u3055\u308c\u3066\u3044\u308b\uff09\u3092\u9664\u304f\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u3001\u5358\u306b<img decoding=\"async\" width=\"24\" height=\"27\" class=\"wp-image-13129\" style=\"width: 24px;\" src=\"https:\/\/ocse2.com\/wp-content\/uploads\/2021\/07\/num1.png\" alt=\"\">\u301c<img decoding=\"async\" width=\"24\" height=\"27\" class=\"wp-image-13132\" style=\"width: 24px;\" src=\"https:\/\/ocse2.com\/wp-content\/uploads\/2021\/07\/num4.png\" alt=\"\">\u306e\u30de\u30a6\u30b9\u64cd\u4f5c\u3067\u3001\u30d7\u30ed\u30c3\u30c8\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3059\u308b\u3060\u3051\u3067\u3001\u305d\u308c\u306a\u308a\u306e\u30d7\u30ed\u30c3\u30c8\u56f3\u3092\u63cf\u3051\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u305f\u3002postProcessing\u30d5\u30a9\u30eb\u30c0\u306e\u30d5\u30a1\u30a4\u30eb\u5185\u5bb9\u306f\u3001\u305d\u308c\u305e\u308c\u7570\u306a\u308a\u3001\u7279\u306b\u30c7\u30fc\u30bf\u7cfb\u5217\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u5834\u5408\u3001\u7cfb\u5217\u3092\u9078\u629e\u3057\u3066\u30d7\u30ed\u30c3\u30c8\u3057\u305f\u3044\u3068\u3053\u308d\u3067\u3042\u308b\u304c\u3001\u4eca\u306e\u6240\u3001\u7b2c\uff11\u5217\u3092X\u8ef8\u306b\u3001\u6b21\u306b\u73fe\u308c\u308b\u6570\u5024\u5217\u3092Y\u8ef8\u306b\u30d7\u30ed\u30c3\u30c8\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3060\u3051\u3067\u3042\u308b\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u306b\u8a18\u3057\u3066\u3042\u308b\u30b3\u30e1\u30f3\u30c8\u884c\u8aad\u307f\u53d6\u3063\u3066\u305d\u308c\u305e\u308c\u306e\u5217\u306b\u76f8\u5fdc\u3059\u308b\u30b3\u30e1\u30f3\u30c8\u3092X\u8ef8\u30e9\u30d9\u30eb\u3068\u51e1\u4f8b\u306e\u540d\u524d\u3068\u3057\u3066\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u7b2c\uff11\u5217\u3092X\u8ef8\u306b\u3059\u308b\u306e\u306f\u3088\u3044\u3068\u3057\u3066\u3001\u5358\u7d14\u306bY\u8ef8\u3092\u7b2c\uff12\u5217\u3068\u3057\u306a\u304b\u3063\u305f\u306e\u306f\u3001\u305f\u3068\u3048\u3070\u3001function\u306e\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>type        fieldMinMax;<\/code><\/pre>\n\n\n\n<p>\u3067\u4f5c\u6210\u3055\u308c\u308b\u30dd\u30b9\u30c8\u30c7\u30fc\u30bf\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Field minima and maxima\n# Time        \tfield         \tmin           \tlocation(min) \tprocessor     \tmax           \tlocation(max) \tprocessor     \n1             \tp             \t0.000000e+00\t(1.000000e+00 -5.103853e+00 -1.403853e+00)\t1\t4.345071e+00\t(-6.866991e+00 -3.964603e+00 4.443966e-02)\t0\n2             \tp             \t0.000000e+00\t(1.000000e+00 -5.103853e+00 -1.403853e+00)\t1\t9.219603e+02\t(-6.867227e+00 -2.440362e+00 -2.634384e-01)\t0\n3             \tp             \t-5.074832e+01\t(-3.359984e+00 -3.414010e+00 6.110496e-01)\t1\t1.860776e+02\t(-4.972372e+00 -3.691786e+00 1.827246e-01)\t0\n<\/code><\/pre>\n\n\n\n<p>\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u7b2c\uff12\u5217\u304c\u6570\u5b57\u3067\u306a\u3044\u3053\u3068\u3082\u3042\u308b\u304b\u3089\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001type probes: \u3067\u4f5c\u6210\u3055\u308c\u308b\u30c7\u30fc\u30bf\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Probe 0 (0 -3.5 0.2)\n#       Probe             0\n#        Time\n            1      0.369279\n            2       129.815\n            3      -6.30889<\/code><\/pre>\n\n\n\n<p>\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u3053\u306e\u5834\u5408\u306f\u51e1\u4f8b\u540d\u3092\u4e0a\u8a18\u30ed\u30b8\u30c3\u30af\u3067\u306f\u8aad\u307f\u53d6\u308c\u306a\u3044\u3068\u3044\u3046\u82e5\u5e72\u306e\u554f\u984c\u306f\u6b8b\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u521d\u671f<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">\u6b8b\u6e23\u3092\u8868\u793a\u3059\u308b\u306e\u306b\u4f7f\u3063\u305f\u30de\u30af\u30ed\u306f\u3001runPlotWather.py\u3067\u3042\u3063\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u96db\u5f62\u306brunPlotPost.py\u3092\u4f5c\u6210\u3057\u305f\u3002\u3053\u306e\u30de\u30af\u30ed\uff08\u30d7\u30ed\u30b0\u30e9\u30e0\uff09\u306e\u57fa\u672c\u7684\u306a\u51e6\u7406\u306e\u6d41\u308c\u306f\u3001<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u30d7\u30ed\u30c3\u30c8\u5bfe\u8c61\u30c7\u30fc\u30bf\u306e\u53d6\u5f97<\/li><li>\u4f5c\u753b\u7528\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210<\/li><li>\u30d7\u30ed\u30c3\u30c8\u7528\u306e\u30c7\u30fc\u30bf\u62bd\u51fa\u51e6\u7406<\/li><li>\u4f5c\u753b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u62bd\u51fa\u30c7\u30fc\u30bf\u3092\u6e21\u3059<\/li><li>\u4f5c\u753b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u66f4\u65b0\uff08refresh\uff09<\/li><\/ol>\n\n\n\n<p>\u3067\u3042\u308a\u3001<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\"><a href=\"https:\/\/ocse2.com\/?p=13166\">3-1<\/a>.\u3067\u8a18\u3057\u305f\u3088\u3046\u306b\u3001\u4f5c\u753b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u81ea\u52d5\u66f4\u65b0\u306e\u4ed5\u7d44\u307f\u3092\u6709\u3057\u3066\u3044\u308b\u304c\u3001\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u66f4\u65b0\u3092\u76e3\u8996\u3059\u308b\u4ed5\u7d44\u307f\u304c\uff08\u4eca\u306e\u6240\uff09\u5b58\u5728\u3057\u306a\u3044\u306e\u3067\u6a5f\u80fd\u3057\u306a\u3044\u3002\u3068\u3044\u3046\u304b\u3001\u3053\u306e\u6a5f\u80fd\u3092\u6b8b\u3057\u305f\u307e\u307e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6539\u5909\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30c7\u30d0\u30c3\u30b0\u304c\u306a\u304b\u306a\u304b\u306b\u56f0\u96e3\u3067\u3042\u3063\u305f\u3002\u305d\u3053\u3067\u3053\u3053\u3067\u306f\u3001\u4f5c\u753b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u306f\u81ea\u52d5\u66f4\u65b0\u3055\u305b\u306a\u3044\u4ed5\u7d44\u307f\u306b\u6539\u5909\u3057\u3001\u66f4\u65b0\uff08\u51e6\u7406\u306e\u6d41\u308c\u306e\u7b2c5\u9805\u76ee\uff09\u306f\u3001\u30de\u30af\u30ed\u672c\u4f53\u306b\u3066\u5b9f\u65bd\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002\u307e\u305f\u3001\u3053\u308c\u306f\u3001<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\"><a href=\"https:\/\/ocse2.com\/?p=13166\">3-1<\/a>.\u3067\u4f5c\u6210\u3057\u305f\u521d\u671f\u6b8b\u6e23\u8868\u793a\u30de\u30af\u30ed\u306b\u3064\u3044\u3066\u3082\u540c\u3058\u4e8b\u304c\u8a00\u3048\u308b\u306e\u3067\u3001\u3053\u3061\u3089\u3082\u540c\u69d8\u306b\u5909\u66f4\u3057\u3066\u304a\u3044\u305f\u3002\u3064\u307e\u308a\u3001dexcsCfdResidualPlot.py\u3000\u306b\u3066\u3001\u4ee5\u4e0b\u306e3\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#self.Timer = QtCore.QTimer()\n#self.Timer.timeout.connect(self.refresh)\n#self.Timer.start(2000)<\/code><\/pre>\n\n\n\n<p>\u4e00\u65b9\u3001\u547c\u3073\u51fa\u3059\u5074\u306e\u3001runPlotWatcher.py \u3067\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def _plotResidual(logFile, niter):\n        print(\"log=\",logFile)\n        f=open(modelDir+\"\/\"+logFile)\n        loglines = f.readlines()\n        #f.close()\n        process_output(loglines, niter)\n        #<span class=\"has-inline-color has-vivid-green-cyan-color\">residualPlot.updateResiduals<\/span>\n        <span class=\"has-inline-color has-vivid-red-color\">residualPlot.updated = True\n        residualPlot.refresh()<\/span><\/code><\/pre>\n\n\n\n<p>\u7dd1\u5b57\u90e8\u5206\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u6731\u5b57\u90e8\u5206\u3092\u8ffd\u52a0\u3057\u305f\u3002\u306a\u304a\u3001\u3053\u308c\u306b\u3088\u308a\u3001\u30b0\u30e9\u30d5\u304c\u8868\u793a\u3055\u308c\u308b\u307e\u3067\u306e\u5f85\u3061\u6642\u9593\u304c\u5c11\u306a\u304f\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u521d\u671f\u6b8b\u6e23\u3092\u8868\u793a\u3059\u308b\u306e\u306b\u4f7f\u3063\u305f dexcsCfdResidualPlot.py \u3092\u96db\u5f62\u306b\u3001dexcsCfdPostPlot.py \u306b\u3066\u3001\u307e\u305aPlot\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u4f5c\u753b\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">dexcsCfdPostPlot.py\u306e\u5185\u5bb9\u306f\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import FreeCAD\nfrom freecad.plot import Plot\n\nclass PostPlot:\n    def __init__(self):\n        self.fig = Plot.figure(FreeCAD.ActiveDocument.Name + \"<span class=\"has-inline-color has-vivid-red-color\">PostProcessing<\/span>\")\n\n        self.updated = False\n        <span class=\"has-inline-color has-vivid-red-color\">self.postX = &#91;]<\/span>\n        <span class=\"has-inline-color has-vivid-cyan-blue-color\">self.postY = {}\n<\/span>\n    def updatePosts(self, <span class=\"has-inline-color has-vivid-red-color\">labelX, postX,<\/span> <span class=\"has-inline-color has-vivid-cyan-blue-color\">postY<\/span>):\n        self.updated = True\n        <span class=\"has-inline-color has-vivid-red-color\">self.labelX = labelX\n        self.postX = postX\n        <\/span><span class=\"has-inline-color has-vivid-cyan-blue-color\">self.postY = postY<\/span>\n\n    def refresh(self):\n        if self.updated:\n            self.updated = False\n            ax = self.fig.axes\n            ax.cla()\n            ax.set_title(\"Simulation postProcessing\")\n            ax.set_xlabel(<span class=\"has-inline-color has-vivid-red-color\">self.labelX)<\/span>\n            ax.set_ylabel(\"postData\")\n\n            for k in self.postY:\n                if self.postY&#91;k]:\n                    <span class=\"has-inline-color has-vivid-red-color\">x = self.postX\n                    <\/span><span class=\"has-inline-color has-vivid-cyan-blue-color\">y = self.postY&#91;k]<\/span><span class=\"has-inline-color has-vivid-red-color\">\n<\/span>                    ax.plot(<span class=\"has-inline-color has-vivid-red-color\">x, <\/span><span class=\"has-inline-color has-vivid-cyan-blue-color\">y<\/span>, label=k, linewidth=1)\n\n            ax.grid()\n            ax.legend(loc='lower <span class=\"has-inline-color has-vivid-red-color\">right<\/span>')\n\n            self.fig.canvas.draw()<\/code><\/pre>\n\n\n\n<p>\u6b8b\u6e23\u30d7\u30ed\u30c3\u30c8\u306e\u5834\u5408\u306f\u3001\u30b0\u30e9\u30d5\u306b\u30c7\u30fc\u30bf\u3092\u6e21\u3059\u90e8\u5206\u3067\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>            ax.plot(self.residuals&#91;k], label=k, linewidth=1)<\/code><\/pre>\n\n\n\n<p>\u3068\u306a\u3063\u3066\u3044\u305f\u3002\u3053\u306e\u5834\u5408\u3001<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">\u6a2a\u8ef8\u306e\u6307\u5b9a\u306f\u7279\u306b\u306a\u304b\u3063\u305f\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u308b\u3002\u7121\u3051\u308c\u3070\u3001\u5358\u7d14\u306b1\u304b\u3089\u5897\u3048\u308b\u81ea\u7136\u6570\u3067\u88dc\u5b8c\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u308d\u3046\u3002\u3053\u308c\u3092\u30b9\u30c6\u30c3\u30d7\u6570\u3067\u8aad\u307f\u66ff\u3048\u308c\u3070\u6e08\u3093\u3060\u306e\u3067\u3042\u3063\u305f\u3002\u3053\u3053\u3067\u8003\u3048\u3066\u3044\u308b\u30dd\u30b9\u30c8\u51e6\u7406\u306f\u3001\u6a2a\u8ef8\u304c\u30b9\u30c6\u30c3\u30d7\u6570\u4ee5\u5916\u306e\u3082\u306e\uff08\u305f\u3068\u3048\u3070\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bf\uff09\u306b\u3082\u5bfe\u5fdc\u3057\u305f\u3044\u306e\u3067\u3001\u6a2a\u8ef8\u3092\u4efb\u610f\u306b\u5909\u66f4\u3057\u305f\u304b\u3063\u305f\u3002\u6a2a\u8ef8\u3092\u8ffd\u52a0\u3057\u3066\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u8a66\u884c\u932f\u8aa4\u306e\u7d50\u679c\u3001\u5358\u7d14\u306b\u5f15\u6570\u3092\u8ffd\u52a0\u3057\u3066\u3084\u308c\u3070\u826f\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u7d50\u5c40\u3001<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">dexcsCfdResidualPlot.py\u3067\u4f7f\u3063\u3066\u3044\u305fresiduals\u3068\u3044\u3046\u5909\u6570\u3092\u3001<span class=\"has-inline-color has-vivid-cyan-blue-color\">postY<\/span>\u306b\u5909\u66f4\u3002\u6a2a\u8ef8\u3092\u8ffd\u52a0\u3059\u308b\u306b\u969b\u3057\u3066\u3001<span class=\"has-inline-color has-vivid-red-color\">\u6731\u5b57<\/span>\u90e8\u5206\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3068\u3044\u3046\u898b\u65b9\u3092\u3057\u3066\u3082\u3089\u3048\u308c\u3070\u3088\u3044\u3002\u307e\u305f\u3001<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">dexcsCfdResidualPlot.py\u3067\u306f\u3001\u5bfe\u6570\u8ef8\u8868\u793a\u306b\u95a2\u9023\u3057\u3066\u3001\u7d30\u3005\u3068\u3057\u305f\u8a2d\u5b9a\u304c\u968f\u6240\u306b\u3042\u3063\u305f\u304c\u3001\u305d\u308c\u3089\u306e\u90e8\u5206\u306f\u5168\u3066\u524a\u9664\u3057\u3001\u3044\u308f\u3070Plot\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u6e21\u3057\u3066\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u30b0\u30e9\u30d5\u3092\u63cf\u304b\u305b\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u6709\u308a\u96e3\u3044\u3053\u3068\u306b\u3001\u3053\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u3001\u901a\u5e38\u306eGNUPLOT\u306b\u6bd4\u3079\u308c\u3070\u5341\u5206\u306b\u7f8e\u3057\u3044\u3068\u601d\u3048\u308b\u306e\u3060\u304c\u3001\u3044\u304b\u304c\u3067\u3042\u308d\u3046\uff1f\uff08\u56f355\uff09<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"906\" height=\"498\" src=\"https:\/\/ocse2.com\/wp-content\/uploads\/2021\/08\/4d0ef591646a67f302a20f36078914a4.png\" alt=\"\" class=\"wp-image-13398\"\/><figcaption>\u56f355.\u3000\u4f5c\u753b\u4f8b\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\uff09<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u4e00\u65b9\u3001\u3053\u308c\u3092\u547c\u3073\u51fa\u3059\u5074\uff08<meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">runPlotPost.py\uff09\u3082\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u3063\u305f\u3002\u30e1\u30a4\u30f3\u30eb\u30fc\u30c1\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(fileName, selectedFilter) = QtGui.QFileDialog.getOpenFileName( None, _(\"Select a postProcess file\"),modelDir + \"\/postProcessing\")\n\nname = os.path.splitext(fileName)&#91;0]\n\nif name != \"\":\n\n    f = open(fileName,\"r\")\n    lines = f.readlines()\n    f.close()\n    print(\"postProcessing=\",f.name)\n\n    PlotValue = &#91;]\n\n    postPlot = PostPlot()\n\n    _plotPost(lines)<\/code><\/pre>\n\n\n\n<p>\u30dd\u30b9\u30c8\u51e6\u7406\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u4e00\u6c17\u306b\u8aad\u307f\u3068\u3063\u3066\u3001\u4e0b\u304b\u30892\u884c\u76ee\u3067\u4f5c\u753b\u7528\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u3001\u6700\u5f8c\u306e\u4e00\u884c\u3067\u30c7\u30fc\u30bf\u3092\u6e21\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3042\u308b\u3002def _plotPost(postlines)\u306e\u5185\u5bb9\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def _plotPost(postlines):\n        process_output(postlines)\n        postPlot.updated = True\n        postPlot.refresh()<\/code><\/pre>\n\n\n\n<p>\u30c7\u30fc\u30bf\u3092process_output(postlines) \u7d4c\u7531\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u6e21\u3059\u306e\u3068\u3001\u753b\u9762\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u66f4\u65b0\u3057\u3066\u3044\u308b\u3060\u3051\u3002\u30c7\u30fc\u30bf\u3092\u6e21\u3059\u672c\u4f53\u306f\u3001postProcessing\u30c7\u30fc\u30bf\u3092\u30ab\u30e9\u30e0\u51e6\u7406\u3057\u3066\u3001\u30d7\u30ed\u30c3\u30c8\u51fa\u529b\u7528\u306b\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def process_output(text):\n    # \u5358\u30b0\u30e9\u30d5\u306e\u81ea\u52d5\u8868\u793a\n    # \u6700\u521d\u306b\u898b\u3064\u304b\u3063\u305f\u6570\u5024\u5217\u3092X\u8ef8\u306b\u3001\u6b21\u306b\u898b\u3064\u304b\u3063\u305f\u6570\u5024\u5217\u3092Y\u8ef8\u8868\u793a    \n    for line in text:\n        line = line.replace('(','')\n        line = line.replace(')','')\n    # \u6700\u7d42\u884c\u3067\u6570\u5024\u30ab\u30e9\u30e0\u3092\u63a2\u3059\n    split = line.split()\n    key=&#91;]\n    ikey=0\n    for index in split:\n        if is_num(index):\n            key.append(ikey) \n        ikey = ikey + 1\n\n    niter = 0\n    postX = &#91;]\n    #print(key)\n    for line in text:\n        split = line.split()\n        #print(split)\n        if split&#91;0] != \"#\" :\n            postX.append(float((split&#91;key&#91;0]].replace('(','')).replace('),','')))\n            PlotValue.append(float((split&#91;key&#91;1]].replace('(','')).replace('),','')))\n            niter = niter +1\n        else:\n            #\u6570\u5024\u884c\u3067\u306a\u3044\u884c\u306e\u3001\u6700\u7d42\u884c\u3092\u53d6\u5f97\u3057\u3066\u304a\u304f\n            # \u3053\u308c\u3092\u30e9\u30d9\u30eb\u3084\u51e1\u4f8b\u306b\u3059\u308b\uff08\u306e\u5834\u5408\u304c\u591a\u3044\uff09\n            splitTitle = split\n\n    #\u975e\u6570\u5024\u6700\u7d42\u884c\u304b\u3089\u3001X\u8ef8\u30e9\u30d9\u30eb\u3084\u51e1\u4f8b\u540d\u3092\u5207\u308a\u51fa\u3059\n    #key&#91;1]\u5217\u76ee\u21d2X\u8ef8\u30bf\u30a4\u30c8\u30eb\n    #key&#91;2]\u5217\u76ee\u21d2\u51e1\u4f8b\u540d\n    #\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u3089 \"unknown\"\n    try:\n        labelX = splitTitle&#91;key&#91;1]]\n    except:\n        labelX = \"unknownX\"\n    try:\n        legend = splitTitle&#91;key&#91;2]]\n    except:\n        legend = \"unknownY\"\n\n    if legend == \"unknownY\":\n        try:\n            legend = splitTitle&#91;key&#91;1]+1]\n        except:\n            legend = \"unknownY\"\n\n    if niter &gt; 1:\n        postPlot.updatePosts<span class=\"has-inline-color has-vivid-red-color\">(labelX, postX, OrderedDict(&#91;\n            (legend, PlotValue)]<\/span>))\n    else:\n        message = (_(\"there in no data for plotting.\"))\n        ans = QtGui.QMessageBox.critical(None, _(\"check postProcessing data\"), message, QtGui.QMessageBox.Yes)<\/code><\/pre>\n\n\n\n<p>labelX, postX, OrderedDict([(legend, PlotValue)]\u3068\u3044\u3046\uff13\u3064\u306e\u30d1\u30e9\u30e1\u30bf\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3002\u3053\u3053\u3067\u3001\u30ab\u30e9\u30e0\u51e6\u7406\u306e\u57fa\u672c\u306f\u3001\u884c\u5358\u4f4d\u3067\u898b\u3066\u5148\u982d\u306b#\u306e\u3042\u308b\u884c\u306f\u30b3\u30e1\u30f3\u30c8\u884c\u3067\u3001\u305d\u3046\u3067\u306a\u3044\u884c\u304c\u30c7\u30fc\u30bf\u884c\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30c7\u30fc\u30bf\u884c\u306f\u30b9\u30d7\u30ea\u30c3\u30c8\u95a2\u6570\u3067\u30ab\u30e9\u30e0\u6bce\u306b\u5206\u5272\u3067\u304d\u308b\u306e\u3060\u304c\u3001\u30dd\u30b9\u30c8\u51e6\u7406\u30c7\u30fc\u30bf\u306b\u3088\u3063\u3066\u306f\u66f8\u5f0f\u304c\u5fae\u5999\u306b\u7570\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u5b9f\u969b\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3059\u308b\u969b\u306b\u3044\u304f\u3064\u304b\u4f8b\u5916\u51e6\u7406\u304c\u5fc5\u8981\u3067\u3042\u3063\u305f\u3002\u305d\u306e\u4ed6\u6ce8\u610f\u70b9\u3082\u3042\u3063\u3066\u3001\u8981\u70b9\u3092\u4ee5\u4e0b\u306b\u53d6\u308a\u7e8f\u3081\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u30dd\u30b9\u30c8\u51e6\u7406\u30c7\u30fc\u30bf\u306f\u57fa\u672c\u7684\u306b\u6570\u5024\u5217\u3060\u304c\u3001\u30d9\u30af\u30c8\u30eb\u30c7\u30fc\u30bf\u306f\u62ec\u5f27\u4ed8\u304d\u3067\u3001\u3057\u304b\u3082\u6570\u5024\u3068\u306e\u9593\u306e\u30b9\u30da\u30fc\u30b9\u7121\u3057\u3067\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u30b9\u30d7\u30ea\u30c3\u30c8\u51e6\u7406\u3057\u305f\u3060\u3051\u3067\u306f\u6570\u5024\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u306a\u3044\u3002<\/li><li>\u4e0a\u8a18\u62ec\u5f27\u3092\u53d6\u308a\u9664\u3044\u305f\u3068\u3057\u3066\u3082\u3001\u305d\u308c\u304c\u6570\u5024\u306a\u306e\u304b\u3069\u3046\u304b\u3092\u9069\u5207\u306b\u5224\u65ad\u3067\u304d\u308b\u6a19\u6e96\u95a2\u6570\uff08\u305f\u3068\u3048\u3070\u3001isNum\u306a\u3069\uff09\u306f\u5b58\u5728\u3057\u306a\u3044\u306e\u3067\u3001\u6570\u5024\u306b\u5909\u63db\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u308b\u95a2\u6570\uff08is_num\uff09\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002\u3068\u3044\u3063\u3066\u3082\u3001\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u501f\u7528\u3057\u305f\u3060\u3051\u3067\u3042\u308b\u304c\uff08\u4ee5\u4e0b\u306e\u95a2\u6570\uff09\u3002<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>def is_num(s):\n    #\u6587\u5b57\u5217\u304c\u6570\u5024\u306b\u5909\u63db\u3067\u304d\u308b\u304b\u5224\u5b9a\u3000https:\/\/note.nkmk.me\/python-str-num-determine\/\n    try:\n        float(s)\n    except :\n        return False\n    else:\n        return True<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>\u30b9\u30d7\u30ea\u30c3\u30c8\u51e6\u7406\u3057\u305f\u3060\u3051\u3067\u306e\u72b6\u614b\u306f\u6587\u5b57\u5217\u3067\u3001\u3053\u308c\u3092\u5358\u7d14\u306b\u30d7\u30ed\u30c3\u30c8\u7528\u306e\u30c7\u30fc\u30bf\u7cfb\u5217\uff08postX,postValue\uff09\u306bappend\u3059\u308b\u3060\u3051\u3067\u3082\u3001\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u308b\u304c\u3001\u5358\u7d14\u306b\u52fe\u914d\uff11\u306e\u76f4\u7dda\u306b\u3057\u304b\u306a\u3089\u306a\u3044\u3002\u6570\u5024\u5316\uff08float\uff09\u3057\u3066append\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002<\/li><li>\u6a2a\u8ef8\u30c7\u30fc\u30bf\u306f\u3001\u30e9\u30d9\u30eb\uff08labelX\uff09\u3068\u6570\u5024\u5217\uff08postX\uff09\u3092\u5225\u5909\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u304c\u3001\u7e26\u8ef8\u306f\u8f9e\u66f8\u914d\u5217\uff08OrderedDict\uff09\u3068\u3057\u3066\u3001\u5909\u6570\u306e\u4e00\u7cfb\u5217\u3068\u3057\u3066\u53ce\u7d0d\u3057\u3066\u3044\u308b\u3002\u3053\u308c\u306f\u591a\u30b0\u30e9\u30d5\u3078\u306e\u62e1\u5f35\u3082\u60f3\u5b9a\u3057\u3066\u3044\u308b\u70ba\u3067\u3042\u308b\u3002<\/li><\/ul>\n\n\n\n<p>\u306a\u304a\u3001\u672c\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3053\u306e\u307e\u307e\u3067\u306f\u3001\u30dd\u30b9\u30c8\u51e6\u7406\u30c7\u30fc\u30bf\u3068\u3057\u3066\u610f\u5473\u306e\u3042\u308b\u5185\u5bb9\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u7a0b\u5ea6\u306e\u7528\u9014\u306b\u3057\u304b\u4f7f\u3048\u306a\u3044\u3067\u3042\u308d\u3046\u3002\u6700\u4f4e\u9650\u3067\u3082\u30ab\u30e9\u30e0\u3092\u6307\u5b9a\u3057\u3066\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u306f\u3042\u308b\u3002\u307e\u305f\u5148\u306b\u8a18\u3057\u305f\u51e1\u4f8b\u540d\u306e\u8aad\u307f\u53d6\u308a\u4e0d\u5168\u306e\u554f\u984c\u3082\u3042\u308b\u3002\u305d\u3053\u307e\u3067\u4f5c\u308a\u8fbc\u3093\u3067\u304b\u3089\u516c\u958b\u3068\u3057\u306a\u3044\u3067\u3001\u3042\u308b\u610f\u5473\u4e2d\u9014\u534a\u7aef\u306a\u72b6\u614b\u3067\u516c\u958b\u3057\u3066\u3044\u308b\u306e\u306f\u3001\u307e\u305a\u306f\u53ef\u80fd\u6027\u306f\u3042\u308a\u305d\u3046\u3060\u3068\u306e\u611f\u89e6\u304c\u5f97\u3089\u308c\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3053\u3053\u307e\u3067\u306e\u30ce\u30a6\u30cf\u30a6\u3092\u53d6\u308a\u7e8f\u3081\u3066\u304a\u3044\u305f\u65b9\u304c\u826f\u3044\u3067\u3042\u308d\u3046\u3068\u3044\u3046\u70b9\u3068\u3001\u5f53\u9762\u306e\u30ea\u30ea\u30fc\u30b9\u3042\u308b\u3044\u306f\u6700\u7d42\u30b4\u30fc\u30eb\u3068\u3057\u3066\u3001\u3069\u3053\u307e\u3067\u4f5c\u308a\u8fbc\u3080\u304b\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u660e\u3089\u304b\u306b\u3057\u3066\u304b\u3089\u53d6\u308a\u7d44\u3093\u3060\u65b9\u304c\u826f\u3044\u3067\u3042\u308d\u3046\u3068\u306e\u5224\u65ad\u304c\u3042\u3063\u305f\u304b\u3089\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">\u3000<a href=\"https:\/\/ocse2.com\/?p=13349\">\u524d\u3078<\/a>\u3000<a href=\"https:\/\/ocse2.com\/?p=13115\">\u76ee\u6b21<\/a>\u3000<a href=\"https:\/\/ocse2.com\/?p=13401\">\u6b21\u3078<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>5. Plot \u30ef\u30fc\u30af\u30d9\u30f3\u30c1\u3092\u4f7f\u3063\u305f post \u51e6\u7406 5.1. \u5358\u30b0\u30e9\u30d5\u306e\u81ea\u52d5\u4f5c\u6210 \u65e2\u306b3-1.\u3067\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u5bfe\u8c61\u306b\u6b8b\u6e23\u56f3\u3092\u63cf\u3051\u3066\u3044\u308b\u306e\u3067\u3001\u307e\u305a\u306f\u3053\u308c\u3092\u30d9\u30fc\u30b9\u306b\u30d7\u30ed\u30c3\u30c8\u5bfe\u8c61\u3092\u3001\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u3067\u306a\u304f\u3001postProcess [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17],"tags":[48,28,23,13],"class_list":["post-13388","post","type-post","status-publish","format-standard","hentry","category-toolstips","tag-cfmesh","tag-dexcs","tag-freecad","tag-openfoam"],"views":239,"_links":{"self":[{"href":"https:\/\/ocse2.com\/index.php?rest_route=\/wp\/v2\/posts\/13388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ocse2.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ocse2.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ocse2.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ocse2.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13388"}],"version-history":[{"count":6,"href":"https:\/\/ocse2.com\/index.php?rest_route=\/wp\/v2\/posts\/13388\/revisions"}],"predecessor-version":[{"id":13407,"href":"https:\/\/ocse2.com\/index.php?rest_route=\/wp\/v2\/posts\/13388\/revisions\/13407"}],"wp:attachment":[{"href":"https:\/\/ocse2.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ocse2.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ocse2.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}