Skip to content

Commit

Permalink
Re-ran raw string changer. Unchecked.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagelt committed Oct 31, 2024
1 parent d4694d9 commit bc1cd28
Show file tree
Hide file tree
Showing 17 changed files with 1,207 additions and 1,180 deletions.
1,059 changes: 538 additions & 521 deletions 00_ODEs.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions 06_soil_column_FEM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"source": [
"plt.xlabel(r'$z$')\n",
"plt.ylabel(r'element ID')\n",
"plt.title('Finite element mesh')\n",
"plt.title(r'Finite element mesh')\n",
"for i,elem in enumerate(elements):\n",
" if (i==0):\n",
" plt.plot(elem._line_element__coords,[i]*elem._line_element__nnodes, 'bs-', label=r'elements')\n",
Expand Down Expand Up @@ -673,7 +673,7 @@
"source": [
"K, f = global_assembler(nodes,elements,solution)\n",
"plt.spy(K,marker='.')\n",
"plt.title('sparsity pattern')\n",
"plt.title(r'sparsity pattern')\n",
"plt.tight_layout()"
]
},
Expand Down Expand Up @@ -733,7 +733,7 @@
"source": [
"plt.ylabel(r'$z$ / m')\n",
"plt.xlabel(r'$-u_z$ / mm')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(-solution*1e3, nodes, 'ro-', label=r'FEM')\n",
"plt.plot(reference_solution*1e3, reference_z, ls='--', color='black', label=r'analytical')\n",
"plt.legend();"
Expand Down Expand Up @@ -767,7 +767,7 @@
"source": [
"plt.ylabel(r'$z$ / m')\n",
"plt.xlabel(r'$-u_z$ / mm')\n",
"plt.title('Mesh convergence')\n",
"plt.title(r'Mesh convergence')\n",
"for i in [3,5,11]:\n",
" number_of_elements = i\n",
" nodes_per_element = 2\n",
Expand Down
6 changes: 3 additions & 3 deletions 06_soil_column_FEM_HM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
"source": [
"plt.xlabel(r'$z$')\n",
"plt.ylabel(r'element ID')\n",
"plt.title('Finite element mesh for $u$')\n",
"plt.title(r'Finite element mesh for $u$')\n",
"for i,elem in enumerate(elements_u):\n",
" if (i==0):\n",
" plt.plot(elem._line_element__coords,[i]*elem._line_element__nnodes, 'bs-', label=r'elements')\n",
Expand Down Expand Up @@ -383,7 +383,7 @@
"source": [
"plt.xlabel(r'$z$')\n",
"plt.ylabel(r'element ID')\n",
"plt.title('Finite element mesh for $p$')\n",
"plt.title(r'Finite element mesh for $p$')\n",
"for i,elem in enumerate(elements_p):\n",
" if (i==0):\n",
" plt.plot(elem._line_element__coords,[i]*elem._line_element__nnodes, 'bs-', label=r'elements')\n",
Expand Down Expand Up @@ -1006,7 +1006,7 @@
"K, f = global_assembler(elements_u,elements_p,solution,solution*1.1,0.5)\n",
"plt.imshow(K, cmap='turbo',alpha=np.where(K==0,0.,1.))\n",
"plt.colorbar()\n",
"plt.title('sparsity pattern')\n",
"plt.title(r'sparsity pattern')\n",
"plt.tight_layout()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion 06_soil_column_FEM_LD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"source": [
"plt.ylabel(r'$z$ / m')\n",
"plt.xlabel(r'$u_z$ / mm')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(solution*1e3, nodes, 'ro-', label=r'FEM')\n",
"#plt.plot(reference_solution*1e3, reference_z, ls='--', color='black', label=r'load-free, small strain')\n",
"plt.legend();"
Expand Down
6 changes: 3 additions & 3 deletions 07_Terzaghi_1D_consolidation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
"source": [
"plt.xlabel(r'$z$ / m')\n",
"plt.ylabel(r'$p$ / kPa')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(nodes, sols[0]/1.e3, marker='o', label=r'$t = %i$ d' %(times[0]/60/60))\n",
"plt.plot(nodes, sols[1]/1.e3, marker='o', label=r'$t = %i$ d' %(times[1]/60/60/24))\n",
"plt.plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ d' %(times[10]/60/60/24))\n",
Expand Down Expand Up @@ -589,7 +589,7 @@
" ax[i][j].plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ d' %(times[10]/60/60/24))\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('$\\mathrm{d}t = %i$ h, $n_\\mathrm{el} = %i$, $\\mathrm{Ne} = %.1f$' %(dt/3600,nel,(H/nel)**2/(2*dt*ConsolidationCoeff(0))))\n",
" ax[i][j].set_title(r'$\\mathrm{d}t = %i$ h, $n_\\mathrm{el} = %i$, $\\mathrm{Ne} = %.1f$' %(dt/3600,nel,(H/nel)**2/(2*dt*ConsolidationCoeff(0))))\n",
" ax[i][j].legend(fontsize=10)\n",
"fig.tight_layout()"
]
Expand Down Expand Up @@ -635,7 +635,7 @@
" ax[i-2][k].plot(nodes, sols[0]/1.e3, ls = '--', color='black', label=r'$t = %i$ d' %(times[0]/60/60/24))\n",
" ax[i-2][k].set_xlabel(r'$z$ / m')\n",
" ax[i-2][k].set_ylabel(r'$p$ / kPa')\n",
" ax[i-2][k].set_title('%i nodes per element, $\\mathrm{Ne} = %.1f$' %(i,(H/number_of_elements)**2/(2*dt*ConsolidationCoeff(0))))\n",
" ax[i-2][k].set_title(r'%i nodes per element, $\\mathrm{Ne} = %.1f$' %(i,(H/number_of_elements)**2/(2*dt*ConsolidationCoeff(0))))\n",
" ax[i-2][k].legend(fontsize=10)\n",
" ax[i-2][1].set_xlim(7,10)\n",
" ax[i-2][1].set_ylim(bottom=150)\n",
Expand Down
4 changes: 2 additions & 2 deletions 07b_Terzaghi_1D_consolidation_explicit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@
"source": [
"plt.xlabel(r'$z$ / m')\n",
"plt.ylabel(r'$p$ / kPa')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(nodes, sols[0]/1.e3, marker='o', label=r'$t = %i$ h' %(times[0]/60/60))\n",
"plt.plot(nodes, sols[1]/1.e3, marker='o', label=r'$t = %i$ h' %(times[1]/60/60))\n",
"plt.plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ h' %(times[10]/60/60))\n",
Expand Down Expand Up @@ -578,7 +578,7 @@
" ax[i][j].plot(nodes, sols[-1]/1.e3, marker='o', label=r'$t = %i$ d' %(times[10]/60/60/24))\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].legend(fontsize=10)\n",
"fig.tight_layout()"
]
Expand Down
4 changes: 2 additions & 2 deletions 07c_Terzaghi_1D_consolidation_CN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
"source": [
"plt.xlabel(r'$z$ / m')\n",
"plt.ylabel(r'$p$ / kPa')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(nodes, sols[0]/1.e3, marker='o', label=r'$t = %i$ h' %(times[0]/60/60))\n",
"plt.plot(nodes, sols[1]/1.e3, marker='o', label=r'$t = %i$ h' %(times[1]/60/60))\n",
"plt.plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ h' %(times[10]/60/60))\n",
Expand Down Expand Up @@ -556,7 +556,7 @@
" ax[i][j].plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ d' %(times[10]/60/60/24))\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].legend(fontsize=10)\n",
"fig.tight_layout()"
]
Expand Down
6 changes: 3 additions & 3 deletions 07d_Terzaghi_1D_consolidation_mass_lumping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
"source": [
"plt.xlabel(r'$z$ / m')\n",
"plt.ylabel(r'$p$ / kPa')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(nodes, sols[0]/1.e3, marker='o', label=r'$t = %i$ d' %(times[0]/60/60))\n",
"plt.plot(nodes, sols[1]/1.e3, marker='o', label=r'$t = %i$ d' %(times[1]/60/60/24))\n",
"plt.plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ d' %(times[10]/60/60/24))\n",
Expand Down Expand Up @@ -633,7 +633,7 @@
" #\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].legend(fontsize=10)\n",
"fig.tight_layout()"
]
Expand Down Expand Up @@ -718,7 +718,7 @@
" #\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].text(1.5,100,'$C_\\mathrm{V} = %.2e$ m/s²' %ConsolidationCoeff(1.5))\n",
" ax[i][j].text(6.5,100,'$C_\\mathrm{V} = %.2e$ m/s²' %ConsolidationCoeff(6.5))\n",
" ax[i][j].legend(fontsize=10)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
"source": [
"plt.xlabel(r'$z$ / m')\n",
"plt.ylabel(r'$p$ / kPa')\n",
"plt.title('Finite element solution')\n",
"plt.title(r'Finite element solution')\n",
"plt.plot(nodes, sols[0]/1.e3, marker='o', label=r'$t = %i$ d' %(times[0]/60/60))\n",
"plt.plot(nodes, sols[1]/1.e3, marker='o', label=r'$t = %i$ d' %(times[1]/60/60/24))\n",
"plt.plot(nodes, sols[10]/1.e3, marker='o', label=r'$t = %i$ d' %(times[10]/60/60/24))\n",
Expand Down Expand Up @@ -670,7 +670,7 @@
" #\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].legend(fontsize=10)\n",
"fig.tight_layout()"
]
Expand Down Expand Up @@ -728,7 +728,7 @@
" #\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].legend(fontsize=10)\n",
"fig.tight_layout()"
]
Expand Down Expand Up @@ -813,7 +813,7 @@
" #\n",
" ax[i][j].set_xlabel(r'$z$ / m')\n",
" ax[i][j].set_ylabel(r'$p$ / kPa')\n",
" ax[i][j].set_title('dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].set_title(r'dt = %i h, nel = %i' %(dt/3600,nel))\n",
" ax[i][j].text(1.5,100,'$C_\\mathrm{V} = %.2e$ m/s²' %ConsolidationCoeff(1.5))\n",
" ax[i][j].text(6.5,100,'$C_\\mathrm{V} = %.2e$ m/s²' %ConsolidationCoeff(6.5))\n",
" ax[i][j].legend(fontsize=10)\n",
Expand Down
2 changes: 1 addition & 1 deletion 08_coupled_problems.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
" ax[1][0].set_xlabel(r'time step')\n",
" ax[1][0].set_ylabel(r'number of iterations')\n",
" ax[1][1].legend()\n",
" ax[1][1].set_title('monolithic --; staggered __')\n",
" ax[1][1].set_title(r'monolithic --; staggered __')\n",
" plt.show()"
]
},
Expand Down
Loading

0 comments on commit bc1cd28

Please sign in to comment.