From 53d51a94d03027b9fd11d4c4191f91cc93511af5 Mon Sep 17 00:00:00 2001 From: JiashengLi12 <104476559+JiashengLi12@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:27:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=BD=E5=8A=A0=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=97=B6=E7=9A=84=E7=BC=96=E5=8F=B7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 施加本质和自然边界条件时的编号count和node有误,进行修正 --- bar1d-python/PrePost.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bar1d-python/PrePost.py b/bar1d-python/PrePost.py index 6cef401..851c1ab 100755 --- a/bar1d-python/PrePost.py +++ b/bar1d-python/PrePost.py @@ -97,7 +97,7 @@ def setup_ID_LM(): if model.flags[i] == 2: # Essential boundary node count = count + 1 model.ID[i] = count # The reordered number of essential B.C - model.d[count] = model.e_bc[i] + model.d[count-1] = model.e_bc[i] else: count1 = count1 + 1 model.ID[i] = model.nd + count1 @@ -112,7 +112,7 @@ def naturalBC(): for i in range(model.neq): if model.flags[i] == 1: node = model.ID[i]-1 - model.f[node] += model.CArea[node]*model.n_bc[node] + model.f[node] += model.CArea[i]*model.n_bc[i] def plotbar(): @@ -251,4 +251,4 @@ def postprocessor(): # Convert matplotlib figures into PGFPlots figures stored in a Tikz file, # which can be added into your LaTex source code by "\input{fe_plot.tex}" if model.plot_tex == "yes": - tikzplotlib.save("fe_plot.tex") \ No newline at end of file + tikzplotlib.save("fe_plot.tex") From 5193f5cad71eabbde8668e736346fe385d83b456 Mon Sep 17 00:00:00 2001 From: JiashengLi12 <104476559+JiashengLi12@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:31:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=BD=E5=8A=A0=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=97=B6=E7=9A=84=E7=BC=96=E5=8F=B7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3beam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 施加本质和自然边界条件时的编号count和node有误,进行修正 --- beam1d-python/PrePost.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beam1d-python/PrePost.py b/beam1d-python/PrePost.py index 296d1cf..7302696 100644 --- a/beam1d-python/PrePost.py +++ b/beam1d-python/PrePost.py @@ -95,7 +95,7 @@ def setup_ID_LM(): if model.flags[i] == 2: # Essential boundary node count += 1 model.ID[i] = count # The reordered number of essential B.C - model.d[count] = model.e_bc[i] + model.d[count-1] = model.e_bc[i] else: count1 += 1 model.ID[i] = model.nd + count1 @@ -112,7 +112,7 @@ def naturalBC(): for i in range(model.neq): if model.flags[i] == 1: dof = model.ID[i] - 1 - model.f[dof] += model.n_bc[dof] + model.f[dof] += model.n_bc[i] def plotbeam(): @@ -249,4 +249,4 @@ def postprocessor(): # Convert matplotlib figures into PGFPlots figures stored in a Tikz file, # which can be added into your LaTex source code by "\input{fe_plot.tex}" if model.plot_tex == "yes": - tikzplotlib.save("fe_plot.tex") \ No newline at end of file + tikzplotlib.save("fe_plot.tex")