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") 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")