Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bar1d-python/PrePost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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():
Expand Down Expand Up @@ -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")
tikzplotlib.save("fe_plot.tex")
6 changes: 3 additions & 3 deletions beam1d-python/PrePost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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():
Expand Down Expand Up @@ -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")
tikzplotlib.save("fe_plot.tex")