-
Notifications
You must be signed in to change notification settings - Fork 95
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
about complex-valued Dirichlet boundary condition #1171
Comments
I think the problem is that we currently assume that the geometric shape functions have the same type as the unknowns in the ConstraintHandler, Ferrite.jl/src/Dofs/ConstraintHandler.jl Lines 84 to 99 in b03a6fe
This makes sense for floats with different precisions, but not for complex unknowns I guess. So probably, we would need something like -mutable struct ConstraintHandler{DH <: AbstractDofHandler, T}
+mutable struct ConstraintHandler{DH <: AbstractDofHandler, T, N_t}
const dbcs::Vector{Dirichlet}
const prescribed_dofs::Vector{Int}
const free_dofs::Vector{Int}
const inhomogeneities::Vector{T}
# Store the original constant inhomogeneities for affine constraints used to compute
# "effective" inhomogeneities in `update!` and then stored in .inhomogeneities.
const affine_inhomogeneities::Vector{Union{Nothing, T}}
# `nothing` for pure DBC constraint, otherwise affine constraint
const dofcoefficients::Vector{Union{Nothing, DofCoefficients{T}}}
# global dof -> index into dofs and inhomogeneities and dofcoefficients
const dofmapping::Dict{Int, Int}
- const bcvalues::Vector{BCValues{T}}
+ const bcvalues::Vector{BCValues{N_t}}
const dh::DH
closed::Bool
end There was some attempts in #451, but the code base has been updated a bit since then, so a new take on that might be interesting. It sounds like (if I understand you correctly), that the above would be sufficient to make this work, with the addition of specifying this type |
Thanks for your suggestion! It helps me a lot. Implementing a new |
Hello, I am working on a surface scattering problem by PML method. So my matrix and boundary conditions should be complexd-valued.
When I set up the boundary conditions, I get the following error:
The reason is that
BCValues()
inadd!(ch::ConstraintHandler, dbc::Dirichlet)
takesFloat64
as a default type. To fix this problem, I have to changeBCValues()
inadd!(ch::ConstraintHandler, dbc::Dirichlet)
as belowSo my question is: Is it possible to find a more elegant way to fix this problem?
Below is my code
The text was updated successfully, but these errors were encountered: