Skip to content

Commit

Permalink
Update Solvers.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
IlianPihlajamaa authored Oct 3, 2024
1 parent 6433d66 commit e72e6a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Right now, the implemented exact methods are
Construct using
```Exact(; M=2^10, dr = sqrt(π/(M+1))/(2π))```
```Exact(; M=1000, dr = 10.0/M)```
Here, `M` is the number of points that the exact solution is evaluated on, and `dr` is the grid spacing.
These are used to perform Fourier transformations.
Expand All @@ -42,7 +42,7 @@ struct Exact <: Method
dr::Float64
end

function Exact(; M=2^10, dr = sqrt/(M+1))/(2π))
function Exact(; M=1000, dr = 10.0/M)
return Exact(M, dr)
end

Expand All @@ -68,7 +68,7 @@ Arguments:
- `tolerance::Float64`: tolerance to be reached
- `verbose::Bool`: whether or not to print convergence information
Default: `FourierIteration(; mixing_parameter=0.5, max_iterations=10^5, tolerance=10^-6, verbose=true, M=2^10, dr=sqrt(π/(M+1))/(2π))`
Default: `FourierIteration(; mixing_parameter=0.5, max_iterations=10^5, tolerance=10^-6, verbose=true, M=1000, dr=10.0/M)`
"""
struct FourierIteration <: Method
M::Int
Expand All @@ -79,7 +79,7 @@ struct FourierIteration <: Method
verbose::Bool
end

function FourierIteration(; mixing_parameter=0.5, max_iterations=10^5, tolerance=10^-10, verbose=true, M=2^10, dr=sqrt/(M+1))/(2π))
function FourierIteration(; mixing_parameter=0.5, max_iterations=10^5, tolerance=10^-10, verbose=true, M=1000, dr=10.0/M)
@assert max_iterations > 0
@assert tolerance > 0
@assert 0 <= mixing_parameter <= 1
Expand Down

0 comments on commit e72e6a3

Please sign in to comment.