Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

on the discretization constructors, UpwindDifference and CenteredDifference #413

Open
hurricane007 opened this issue Jun 24, 2021 · 1 comment

Comments

@hurricane007
Copy link

serval months ago @mjsheikh replied me on the use of UpwindDifference and RobinBC, thanks first.

In the documentation:

CenteredDifference{N}(derivative_order::Int,
approximation_order::Int,
dx, len::Int,
coeff_func=nothing)

dx: the spacing of the discretization. If dx is a Number, the operator is a uniform discretization. If dx is an array, then the operator is a non-uniform discretization. Its type needs to match the one from the Array to be differentiated.
len: the length of the discretization in the direction of the operator.

However, this usage is relatively counterintuitive. When we have n points, we have n-1 intervals. But the constructor needs a dx including the intervals to the ghost points. But who knows the spacing between the first point and the left ghost point? So usually it is generated by:
dx = [x;(x[end]-x[end-1] - [-(x[[2]-x[1]);x]
then why don't we let the constructor do it? And does the distance between the ghost points and the first/last points matter?

@ChrisRackauckas
Copy link
Member

It's just the spacing from the first/last interior point to the boundary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants