Skip to content

add topology optimization tutorial#142

Merged
fverdugo merged 37 commits intogridap:masterfrom
WenjieYao:topopt
May 27, 2022
Merged

add topology optimization tutorial#142
fverdugo merged 37 commits intogridap:masterfrom
WenjieYao:topopt

Conversation

@WenjieYao
Copy link
Copy Markdown
Contributor

Somehow I can't create a preview on my computer, so there might be some small mistakes needed to be fixed. @stevengj @fverdugo

@fverdugo
Copy link
Copy Markdown
Member

Hi @WenjieYao Thanks a lot for writing this!

I have built the html version of the tutorial and it has several minor typos regarding the rendering of equations etc. Try please to generate the pages on your laptop and fix the small issues (see below).

I have also added the new tutorial to the test suite (It is is failing). Try to run it locally to fix the errors. The tutorial is run as any other .jl file.

Steps to generate the html pages locally

Here you have some info. But, to summarise, these are the steps:

$ cd /your/path/to/Tutorials # Replace this with your correct path
$ julia --project=.
(Tutorials) pkg> instantiate
(Tutorials) pkg> build
julia> exit()
$ julia --project=docs
julia> using Revise # I assume that you have Revise in your global environment
(docs) pkg> dev .
julia> include("docs/make.jl")  # Open the generated web in docs/build/index.html and correct errors
julia> include("docs/make.jl") # Refresh you browser and fix more errors 
julia> include("docs/make.jl") # Refresh you browser and fix more errors 

Comment thread src/TopOptEMFocus.jl Outdated

# In this tutorial, we will learn:
#
# * How to apply adjoint method in Gridap
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# * How to apply adjoint method in Gridap
# * How to apply the adjoint method for sensitivity analysis in Gridap

Comment thread src/TopOptEMFocus.jl Outdated
# * How to apply adjoint method in Gridap
# * How to do topology optimization in Gridap
#
# We recommend you first read the [Electromagnetic scattering tutorial](https://gridap.github.io/Tutorials/dev/pages/t012_emscatter/#Tutorial-12:-Electromagnetic-scattering-in-2D-1) to make sure you understand the following points:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# We recommend you first read the [Electromagnetic scattering tutorial](https://gridap.github.io/Tutorials/dev/pages/t012_emscatter/#Tutorial-12:-Electromagnetic-scattering-in-2D-1) to make sure you understand the following points:
# We recommend that you first read the [Electromagnetic scattering tutorial](https://gridap.github.io/Tutorials/dev/pages/t012_emscatter/#Tutorial-12:-Electromagnetic-scattering-in-2D-1) to make sure you understand the following points:

Comment thread src/TopOptEMFocus.jl Outdated
#
# We recommend you first read the [Electromagnetic scattering tutorial](https://gridap.github.io/Tutorials/dev/pages/t012_emscatter/#Tutorial-12:-Electromagnetic-scattering-in-2D-1) to make sure you understand the following points:
#
# * How to formulate the weak form for a scalar time-harmonic electromagnetic problem
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# * How to formulate the weak form for a scalar time-harmonic electromagnetic problem
# * How to formulate the weak form for a 2d time-harmonic electromagnetic problem (a scalar Helmholtz equation)

@WenjieYao
Copy link
Copy Markdown
Contributor Author

I have fixed the typos in equations and also adopted the comments from @stevengj .
@fverdugo @raelch

Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
Comment thread src/TopOptEMFocus.jl Outdated
WenjieYao and others added 20 commits May 12, 2022 21:13
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
@WenjieYao
Copy link
Copy Markdown
Contributor Author

@fverdugo It is failing now mainly because we need to add Zygote, ChainRulesCore and NLopt packages to the environment. I suspect that this should be a few lines added to the Project.toml file but I don't know what I should add exactly...

@fverdugo
Copy link
Copy Markdown
Member

Thanks @WenjieYao @stevengj for this very nice new tutorial!

@fverdugo fverdugo merged commit cff52ab into gridap:master May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants