You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PeriodicDirichletBC for integrating periodic ODEs #4
Create a new PeriodicDirichletBC <: AbstractBoundaryCondition to modify how periodic boundary conditions are treated for integration. See #3. In #3 we set both constants in the domain as with a normal Dirichlet boundary condition, but because the system is periodic, the value of these constants must be identical. In a future implementation we could set the first row of the 1D matrix to be
(1, 0, 0, ..., 0, -1)
and set the last row to be
(0, 0, ...., 0, 0, 1)
so that the above code would be modified to
# form the weak RHS
mul!(weak_rhs,mass_matrix,f)
# impose the PeriodicDirichlet BC to fix the constant offset
weak_rhs[1] = 0.0
weak_rhs[end] = exact_phi[end]
# solve the system
ldiv!(phi, lu_Laplacian, weak_rhs)
In this modified version, there is clearly only one available constant to set when integrating ODEs with periodic boundary conditions. However, we still require the same number of lines of code, and the need for an additional boundary condition type means that we defer the implementation of the feature this way to a future PR where it is explicitly required.
Activity