Skip to content

Commit 45b029c

Browse files
committed
NB 01a
1 parent 5d4ac0f commit 45b029c

11 files changed

+1084
-223
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
toolkit.py
77
moose-toolkit.py
88
engy_5310
9-
01a*
10-
homework-05*
119
*solution*
1210
*.swp
1311
p*moose*

notebooks/00-syllabus.ipynb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@
164164
"| 9 | Fr |29Oct21| - | - | [UML Linux Club mtg](https://github.com/UML-Linux-Club) |"
165165
]
166166
},
167+
{
168+
"cell_type": "markdown",
169+
"metadata": {},
170+
"source": [
171+
"|**Week**|Day| **Date** |**Notebook**|**Assessment**|**Note**|\n",
172+
"|:-------|:-:|:---------:|:-----------|:-------------|:------:|\n",
173+
"|- |- | <span style=\"color:blue\"><b>November</b>|- |- |- |\n",
174+
"| **10** | **Tu** |**02Nov21**| [01a](https://nbviewer.jupyter.org/github/dpploy/engy-5310/blob/main/notebooks/01a-python-fem-basis-func.ipynb) | [Homework-05](https://nbviewer.jupyter.org/github/dpploy/engy-5310/blob/main/notebooks/homework-5.ipynb) due 16Nov21 BB submission | Cubic Lagrange basis, FEM basis func. implementation (Notes/NB) |\n",
175+
"| 10 | Thu |04Nov21| - | - | Matrix assembly/Gauss quadrature (Notes/NB) |\n",
176+
"| 10 | Fr |05Nov21| - | - | [UML Linux Club mtg](https://github.com/UML-Linux-Club) |"
177+
]
178+
},
167179
{
168180
"cell_type": "markdown",
169181
"metadata": {},

notebooks/01-introduction.ipynb

Lines changed: 70 additions & 110 deletions
Large diffs are not rendered by default.

notebooks/01a-python-fem-basis-func.ipynb

Lines changed: 680 additions & 0 deletions
Large diffs are not rendered by default.

notebooks/04a-fem-lagrange-lsq-residual.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@
180180
"x_max = shape_pts[-1][0]\n",
181181
"\n",
182182
"try: \n",
183-
" from engy_5310.toolkit import FEMBasis \n",
183+
" from engy_5310.toolkit import LagrangeFEMBasis \n",
184184
"except ModuleNotFoundError:\n",
185185
" assert False, 'You need to provide your own code here. Bailing out.'\n",
186186
" \n",
187-
"femlb = FEMBasis(degree=[3,1,2], n_elem=[2,1,2], x_partition=[x_min, 3, 5, x_max])\n",
187+
"femlb = LagrangeFEMBasis(degree=[3,1,2], n_elem=[2,1,2], x_partition=[x_min, 3, 5, x_max])\n",
188188
"femlb.plot(n_plot_pts=300)"
189189
]
190190
},
@@ -208,7 +208,7 @@
208208
"source": [
209209
"'''Mesh artifact'''\n",
210210
"\n",
211-
"for e_id, partition in enumerate(femlb.mesh):\n",
211+
"for e_id, partition in enumerate(femlb.patches):\n",
212212
" printout = list()\n",
213213
" gnode_ids = femlb.local_to_global_node_map[e_id]\n",
214214
" printout.append('element #%i:'%e_id)\n",
@@ -1480,11 +1480,11 @@
14801480
"x_max = shape_pts[-1][0]\n",
14811481
"\n",
14821482
"try: \n",
1483-
" from engy_5310.toolkit import FEMBasis \n",
1483+
" from engy_5310.toolkit import LagrangeFEMBasis \n",
14841484
"except ModuleNotFoundError:\n",
14851485
" assert False, 'You need to provide your own code here. Bailing out.'\n",
14861486
" \n",
1487-
"femlb = FEMBasis(degree=[2,2,3], n_elem=[2,3,2], x_partition=[x_min, -2, 7, x_max])\n",
1487+
"femlb = LagrangeFEMBasis(degree=[2,2,3], n_elem=[2,3,2], x_partition=[x_min, -2, 7, x_max])\n",
14881488
"femlb.plot(n_plot_pts=800)"
14891489
]
14901490
},

notebooks/05a-rayleigh-ritz-fem-verification.ipynb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@
522522
},
523523
{
524524
"cell_type": "code",
525-
"execution_count": 17,
525+
"execution_count": 18,
526526
"metadata": {},
527527
"outputs": [
528528
{
@@ -542,17 +542,17 @@
542542
"degree = 1\n",
543543
"\n",
544544
"try: \n",
545-
" from engy_5310.toolkit import FEMBasis \n",
545+
" from engy_5310.toolkit import LagrangeFEMBasis \n",
546546
"except ModuleNotFoundError:\n",
547547
" assert False, 'You need to provide your own code here. Bailing out.'\n",
548548
"\n",
549-
"lift_basis = FEMBasis(degree=degree, n_elem=1, x_partition=[x_a, x_b])\n",
549+
"lift_basis = LagrangeFEMBasis(degree=degree, n_elem=1, x_partition=[x_a, x_b])\n",
550550
"lift_basis.plot(n_plot_pts=300)"
551551
]
552552
},
553553
{
554554
"cell_type": "code",
555-
"execution_count": 18,
555+
"execution_count": 19,
556556
"metadata": {},
557557
"outputs": [],
558558
"source": [
@@ -568,7 +568,7 @@
568568
},
569569
{
570570
"cell_type": "code",
571-
"execution_count": 19,
571+
"execution_count": 20,
572572
"metadata": {},
573573
"outputs": [],
574574
"source": [
@@ -580,7 +580,7 @@
580580
},
581581
{
582582
"cell_type": "code",
583-
"execution_count": 20,
583+
"execution_count": 21,
584584
"metadata": {},
585585
"outputs": [],
586586
"source": [
@@ -592,7 +592,7 @@
592592
},
593593
{
594594
"cell_type": "code",
595-
"execution_count": 21,
595+
"execution_count": 22,
596596
"metadata": {},
597597
"outputs": [
598598
{
@@ -611,7 +611,7 @@
611611
},
612612
{
613613
"cell_type": "code",
614-
"execution_count": 22,
614+
"execution_count": 23,
615615
"metadata": {},
616616
"outputs": [
617617
{
@@ -658,7 +658,7 @@
658658
},
659659
{
660660
"cell_type": "code",
661-
"execution_count": 23,
661+
"execution_count": 25,
662662
"metadata": {},
663663
"outputs": [
664664
{
@@ -682,17 +682,17 @@
682682
"n_elem = [3,8,3]\n",
683683
"\n",
684684
"try: \n",
685-
" from engy_5310.toolkit import FEMBasis \n",
685+
" from engy_5310.toolkit import LagrangeFEMBasis \n",
686686
"except ModuleNotFoundError:\n",
687687
" assert False, 'You need to provide your own code here. Bailing out.'\n",
688688
" \n",
689-
"femlb = FEMBasis(degree=degree, n_elem=n_elem, x_partition=[x_a, x_a+1.5, x_b-1.5, x_b], bc_x_min='dirichlet', bc_x_max='dirichlet')\n",
689+
"femlb = LagrangeFEMBasis(degree=degree, n_elem=n_elem, x_partition=[x_a, x_a+1.5, x_b-1.5, x_b], bc_x_min='dirichlet', bc_x_max='dirichlet')\n",
690690
"femlb.plot(n_plot_pts=800)"
691691
]
692692
},
693693
{
694694
"cell_type": "code",
695-
"execution_count": 24,
695+
"execution_count": 26,
696696
"metadata": {},
697697
"outputs": [],
698698
"source": [
@@ -716,7 +716,7 @@
716716
},
717717
{
718718
"cell_type": "code",
719-
"execution_count": 25,
719+
"execution_count": 27,
720720
"metadata": {},
721721
"outputs": [
722722
{
@@ -741,7 +741,7 @@
741741
},
742742
{
743743
"cell_type": "code",
744-
"execution_count": 26,
744+
"execution_count": 28,
745745
"metadata": {},
746746
"outputs": [],
747747
"source": [
@@ -761,7 +761,7 @@
761761
},
762762
{
763763
"cell_type": "code",
764-
"execution_count": 27,
764+
"execution_count": 29,
765765
"metadata": {},
766766
"outputs": [],
767767
"source": [
@@ -779,7 +779,7 @@
779779
},
780780
{
781781
"cell_type": "code",
782-
"execution_count": 28,
782+
"execution_count": 30,
783783
"metadata": {},
784784
"outputs": [],
785785
"source": [
@@ -793,7 +793,7 @@
793793
},
794794
{
795795
"cell_type": "code",
796-
"execution_count": 29,
796+
"execution_count": 31,
797797
"metadata": {},
798798
"outputs": [],
799799
"source": [
@@ -807,7 +807,7 @@
807807
},
808808
{
809809
"cell_type": "code",
810-
"execution_count": 30,
810+
"execution_count": 32,
811811
"metadata": {},
812812
"outputs": [],
813813
"source": [
@@ -817,7 +817,7 @@
817817
},
818818
{
819819
"cell_type": "code",
820-
"execution_count": 31,
820+
"execution_count": 33,
821821
"metadata": {},
822822
"outputs": [
823823
{
@@ -859,7 +859,7 @@
859859
},
860860
{
861861
"cell_type": "code",
862-
"execution_count": 32,
862+
"execution_count": 34,
863863
"metadata": {},
864864
"outputs": [
865865
{
@@ -905,7 +905,7 @@
905905
},
906906
{
907907
"cell_type": "code",
908-
"execution_count": 33,
908+
"execution_count": 35,
909909
"metadata": {},
910910
"outputs": [
911911
{
@@ -929,7 +929,7 @@
929929
},
930930
{
931931
"cell_type": "code",
932-
"execution_count": 34,
932+
"execution_count": 36,
933933
"metadata": {},
934934
"outputs": [
935935
{
@@ -949,7 +949,7 @@
949949
},
950950
{
951951
"cell_type": "code",
952-
"execution_count": 35,
952+
"execution_count": 37,
953953
"metadata": {},
954954
"outputs": [
955955
{
@@ -991,7 +991,7 @@
991991
},
992992
{
993993
"cell_type": "code",
994-
"execution_count": 36,
994+
"execution_count": 38,
995995
"metadata": {},
996996
"outputs": [
997997
{
@@ -1037,7 +1037,7 @@
10371037
},
10381038
{
10391039
"cell_type": "code",
1040-
"execution_count": 37,
1040+
"execution_count": 39,
10411041
"metadata": {},
10421042
"outputs": [
10431043
{

notebooks/05a-rayleigh-ritz-fourier-dirichlet.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
},
166166
{
167167
"cell_type": "code",
168-
"execution_count": 5,
168+
"execution_count": 3,
169169
"metadata": {},
170170
"outputs": [
171171
{
@@ -210,7 +210,7 @@
210210
},
211211
{
212212
"cell_type": "code",
213-
"execution_count": 6,
213+
"execution_count": 4,
214214
"metadata": {},
215215
"outputs": [
216216
{
@@ -260,7 +260,7 @@
260260
},
261261
{
262262
"cell_type": "code",
263-
"execution_count": 7,
263+
"execution_count": 5,
264264
"metadata": {},
265265
"outputs": [
266266
{
@@ -295,7 +295,7 @@
295295
},
296296
{
297297
"cell_type": "code",
298-
"execution_count": 8,
298+
"execution_count": 6,
299299
"metadata": {},
300300
"outputs": [],
301301
"source": [
@@ -312,7 +312,7 @@
312312
" \n",
313313
"for i,phi_i in enumerate(fb.basis_func_list):\n",
314314
" for j,phi_j in enumerate(fb.basis_func_list):\n",
315-
" s_x_phi_j = lambda x: source_slope.values(x) * phi_j(x)\n",
315+
" s_x_phi_j = lambda x: source_slope(x) * phi_j(x)\n",
316316
" (a_ij, _) = fb.inner_product(s_x_phi_j, phi_i)\n",
317317
" a_mtrx[i,j] -= a_ij\n",
318318
" \n",
@@ -329,7 +329,7 @@
329329
},
330330
{
331331
"cell_type": "code",
332-
"execution_count": 9,
332+
"execution_count": 7,
333333
"metadata": {},
334334
"outputs": [
335335
{
@@ -354,7 +354,7 @@
354354
},
355355
{
356356
"cell_type": "code",
357-
"execution_count": 10,
357+
"execution_count": 8,
358358
"metadata": {},
359359
"outputs": [],
360360
"source": [
@@ -369,7 +369,7 @@
369369
},
370370
{
371371
"cell_type": "code",
372-
"execution_count": 11,
372+
"execution_count": 9,
373373
"metadata": {},
374374
"outputs": [],
375375
"source": [
@@ -380,7 +380,7 @@
380380
},
381381
{
382382
"cell_type": "code",
383-
"execution_count": 12,
383+
"execution_count": 10,
384384
"metadata": {},
385385
"outputs": [],
386386
"source": [
@@ -400,7 +400,7 @@
400400
},
401401
{
402402
"cell_type": "code",
403-
"execution_count": 13,
403+
"execution_count": 11,
404404
"metadata": {},
405405
"outputs": [
406406
{
@@ -440,7 +440,7 @@
440440
},
441441
{
442442
"cell_type": "code",
443-
"execution_count": 14,
443+
"execution_count": 12,
444444
"metadata": {},
445445
"outputs": [
446446
{

0 commit comments

Comments
 (0)