File tree Expand file tree Collapse file tree 3 files changed +5
-89
lines changed Expand file tree Collapse file tree 3 files changed +5
-89
lines changed Original file line number Diff line number Diff line change 133133 "metadata" : {},
134134 "outputs" : [],
135135 "source" : [
136+ " import os\n " ,
137+ " if not os.path.isfile(\" stokes-control.msh\" ):\n " ,
138+ " # If the mesh is not available locally, we download it.\n " ,
139+ " !curl -O https://raw.githubusercontent.com/firedrakeproject/notebooks/refs/heads/main/stokes-control.msh\n " ,
136140 " mesh = Mesh(\" stokes-control.msh\" )"
137141 ]
138142 },
Original file line number Diff line number Diff line change 393393 " axs[0, 0].set_title('Forward solution');\n " ,
394394 " axs[0, 1].set_title('Adjoint solution');"
395395 ]
396- },
397- {
398- "cell_type" : " code" ,
399- "execution_count" : null ,
400- "metadata" : {},
401- "outputs" : [],
402- "source" : [
403- " type(solve_blocks[6].get_dependencies()[0].adj_value)"
404- ]
405- },
406- {
407- "cell_type" : " code" ,
408- "execution_count" : null ,
409- "metadata" : {},
410- "outputs" : [],
411- "source" : [
412- " [type(sol.get_dependencies()[0].adj_value) for sol in solve_blocks]"
413- ]
414- },
415- {
416- "cell_type" : " code" ,
417- "execution_count" : null ,
418- "metadata" : {},
419- "outputs" : [],
420- "source" : [
421- " len(forward_solutions)"
422- ]
423- },
424- {
425- "cell_type" : " code" ,
426- "execution_count" : null ,
427- "metadata" : {},
428- "outputs" : [],
429- "source" : [
430- " get_working_tape().visualise(\" foo.pdf\" )"
431- ]
432- },
433- {
434- "cell_type" : " code" ,
435- "execution_count" : null ,
436- "metadata" : {},
437- "outputs" : [],
438- "source" : [
439- " adjoint_solution"
440- ]
441- },
442- {
443- "cell_type" : " code" ,
444- "execution_count" : null ,
445- "metadata" : {},
446- "outputs" : [],
447- "source" : [
448- " Jhat = ReducedFunctional(J, Control(nu))"
449- ]
450- },
451- {
452- "cell_type" : " code" ,
453- "execution_count" : null ,
454- "metadata" : {},
455- "outputs" : [],
456- "source" : [
457- " Jhat.derivative()"
458- ]
459- },
460- {
461- "cell_type" : " code" ,
462- "execution_count" : null ,
463- "metadata" : {},
464- "outputs" : [],
465- "source" : [
466- " taylor_test?"
467- ]
468- },
469- {
470- "cell_type" : " code" ,
471- "execution_count" : null ,
472- "metadata" : {},
473- "outputs" : [],
474- "source" : [
475- " taylor_test(Jhat, nu, Function(nu).assign(1.0))"
476- ]
477- },
478- {
479- "cell_type" : " code" ,
480- "execution_count" : null ,
481- "metadata" : {},
482- "outputs" : [],
483- "source" : []
484396 }
485397 ],
486398 "metadata" : {
Original file line number Diff line number Diff line change 33 {
44 "cell_type" : " code" ,
55 "execution_count" : null ,
6- "id" : " 9aa45217 " ,
6+ "id" : " 6aaadb71 " ,
77 "metadata" : {},
88 "outputs" : [],
99 "source" : [
You can’t perform that action at this time.
0 commit comments