Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarified implementation of breaction #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions examples/Example121_PoissonPointCharge1D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

Solve a Poisson equation
```math
- \Delta u = 0
- \Delta u = 0,
```

in $\Omega=(-1,1)$
with a point charge $Q$ at $x=0$.
in $\Omega=(-1,0)\cup (0,1)$ and
```math
u'_+(0) - u'_-(0) + Q = 0
```
at $x=0$. Unknown ``u`` corresponds to the electrostatic potential of a point charge $Q$ located at ``x=0``.
The subscripts ``+`` and ``-`` denote the one-sided limits ``u'_+(0):=\lim_{x\to 0, x > 0} u(x)`` and ``u'_-(0):=\lim_{x\to 0, x < 0} u(x)``, respectively.
=#

module Example121_PoissonPointCharge1D
Expand Down Expand Up @@ -48,7 +52,7 @@ function main(;nref=0,Plotter=nothing, verbose=false, unknown_storage=:sparse, b
end

## Define boundary reaction defining charge
## Note that the term is written on the left hand side, therefore the - sign
## Note that the breaction is implemented as a right hand side, therefore the - sign
function breaction!(f,u,node)
if node.region==3
f[1]=-Q
Expand Down
10 changes: 1 addition & 9 deletions examples/Example151_Impedance1D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function main(;nref=0,Plotter=nothing,verbose=false, unknown_storage=:sparse,

X=VoronoiFVM.geomspace(0,L,h0,h1)

# Create discretitzation grid
# Create discretization grid
grid=VoronoiFVM.Grid(X)

# Create and fill data
Expand All @@ -67,7 +67,6 @@ function main(;nref=0,Plotter=nothing,verbose=false, unknown_storage=:sparse,


excited_bc=1
excited_bcval=1.0
excited_spec=1
meas_bc=2

Expand Down Expand Up @@ -122,21 +121,14 @@ function main(;nref=0,Plotter=nothing,verbose=false, unknown_storage=:sparse,
allomega=zeros(0)

# for calculated data
allI0=zeros(Complex{Float64},0)
allIL=zeros(Complex{Float64},0)

# for exact data
allIx0=zeros(Complex{Float64},0)
allIxL=zeros(Complex{Float64},0)

ω=ω0

UZ=unknowns(isys)
while ω<ω1

# solve impedance system
solve!(UZ,isys,ω)

# calculate aproximate solution
# obtain measurement in frequency domain
IL=impedance(isys,ω,steadystate, dmeas_stdy, dmeas_tran)
Expand Down