Documentation | Build Status |
---|---|
This package provides some tools to do large-scale homogenization of elliptic PDEs in 2D and 3D.
Features include:
- Support for very fine grids for finite elements without storing the grid / matrix explicitly -- should just work on a laptop or workstation computer.
- A geometric multigrid solver
- An algorithm to approximate the homogenized coefficients of an elliptic operator with piece-wise continuous coefficients
A recommended way to work with the package now is to clone the package via the package manager in a development mode.
- Open Julia 1.0+ in a terminal
- Hit
]
to open the package manager - Enter
dev https://github.com/haampie/Homogenization.jl
ordev git@github.com:haampie/Homogenization.jl.git
This will copy the latest version of the code to ~/.julia/dev/Homogenization.jl
.
To verify things work, run the tests via ] test Homogenization
.
Editor. An editor tailored for Julia is Juno. Also Visual Studio Code with a Julia extension is good.
Development. It is very convenient to install Revise.jl
to get a better development
and testing experience in Julia. This package will do the minimal recompilation when a
function in the package is changed.
- Install it via
] add Revise
. - Then in a standard Julia terminal run
using Revise
- Only then write
using Homogenization
.
Threading. To make use of threading and some more optimized code, one can start Julia in the terminal as follows:
JULIA_NUM_THREADS=N julia -O3
here N
is the number of threads avaiable -- it is best to set it to the number of cores
on the machine.
The package uses WriteVTK.jl to output visualizations that can be viewed in Paraview.
To run the 2D or 3D checkerboard example, try
using Homogenization
# 2D
checkerboard_homogenization(3, Tri64, refinements = 4, tolerance = 1e-3, save = 1)
# 3D
checkerboard_homogenization(1, Tet64, refinements = 4, tolerance = 1e-3, save = 1)
This will output a lot of data about the intermediate steps of multigrid and will save the
intermediate approximate solutions of the recurrence v₀
, v₁
, ... to separate
files ahom_0.vtu
, ahom_1.vtu
, ... in the current working directory. It also creates a
file checkerboard.vtu
with the coefficient field. To not save these files use
save = nothing
. Open the files in Paraview for a visualization.