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
I am trying to define an IPDG (interior penalty discontinuous Galerkin) version of time-harmonic Maxwell's equations using Nedelec reference elements. The setup I wanted to test it on is just a cube with a (tangential vector) Dirichlet excitation on one side of the cube (I know it doesn't make much sense but I wanted to keep it simple).
This is the setup of the geometry, the definition of the measures and the volume bilinear form:
using Gridap
using Gridap.Geometry
L = 1.0
domain = (0.0, 1.0, 0.0, 1.0, 0.0, 1.0)
partition = (4,4,4)
model = CartesianDiscreteModel(domain,partition)
labels = get_face_labeling(model)
add_tag_from_tags!(labels,"S_x_pos",[1,3,5,7,13,15,17,19,25])
order = 2
V = TestFESpace(model, ReferenceFE(nedelec, Float64, order), conformity=:L2, dirichlet_tags="S_x_pos", vector_type=Vector{ComplexF64})
U = TrialFESpace(V, VectorValue(0.0+0.0im, 0.0+0.0im, 1.0+0.0im))
Ω = Triangulation(model)
Γ = BoundaryTriangulation(model)
Λ = SkeletonTriangulation(model)
degree = 2*order
dΩ = Measure(Ω,degree)
dΓ = Measure(Γ,degree)
dΛ = Measure(Λ,degree)
n_Γ = get_normal_vector(Γ)
n_Λ = get_normal_vector(Λ)
a_Ω(u,v) = ∫( curl(v) ⋅ curl(u) )dΩ - ∫( v ⋅ u )dΩ
However, I am running into a few problems, which I hope, are just due to my inability to define them properly :)
When using the mean and jump operators (which are involving a cross product in this space) , defined as
ERROR: MethodError: no method matching cross(::SkeletonPair{Gridap.CellData.GenericCellField{ReferenceDomain}, Gridap.CellData.GenericCellField{ReferenceDomain}},
::Gridap.FESpaces.SingleFieldFEBasis{Gridap.FESpaces.TestBasis, ReferenceDomain})
Then I found this issue #793 and I guess I can define the operators on my own - so the cross product should not be an issue. Then I defined a very simple integral on the interior facets to see if it works in principle
ERROR: MethodError: Cannot `convert` an object of type
Gridap.Fields.ArrayBlock{Array{ComplexF64,1},1} to an object of type
Gridap.Fields.ArrayBlock{Array{Float64,1},1}
Can anyone see an issue in my definitions or is this functionality currently not implemented?
When skipping the interior facets bilinear form and just solving a continuous time-harmonic curl-curl problem, I get a solution without running into an error but then writing it to a vtk file is cumbersome.
writevtk(Ω,"results",cellfields=["uh"=>uh])
# results in
# ERROR: ArgumentError: data type not supported by VTK: ComplexF64
and
writevtk(Ω,"results",cellfields=["uh_r"=>real(uh)])
# results in
# ERROR: MethodError: no method matching real(::VectorValue{3, ComplexF64})
Is there any way to write a complex vector-valued result to a vtk file?
Sorry for the long question but I would be very grateful if someone here could help me out. I have also attached the script as a txt file, maybe this is easier to handle than the code snippets above. IPDG.txt
The text was updated successfully, but these errors were encountered:
I recently had the same problem with writing complex VectorValues to .vtk-files. I made a pull request (#934) to fix this.
Until it's merged you can add
Base.real(x::VectorValue{D,ComplexF64}) where {D} =VectorValue(real.(x.data))
Base.imag(x::VectorValue{D,ComplexF64}) where {D} =VectorValue(imag.(x.data))
Dear all,
I am trying to define an IPDG (interior penalty discontinuous Galerkin) version of time-harmonic Maxwell's equations using Nedelec reference elements. The setup I wanted to test it on is just a cube with a (tangential vector) Dirichlet excitation on one side of the cube (I know it doesn't make much sense but I wanted to keep it simple).
This is the setup of the geometry, the definition of the measures and the volume bilinear form:
However, I am running into a few problems, which I hope, are just due to my inability to define them properly :)
mean
andjump
operators (which are involving a cross product in this space) , defined asI get the error message:
Then I found this issue #793 and I guess I can define the operators on my own - so the cross product should not be an issue. Then I defined a very simple integral on the interior facets to see if it works in principle
but then I get the following error:
Can anyone see an issue in my definitions or is this functionality currently not implemented?
and
Is there any way to write a complex vector-valued result to a vtk file?
Sorry for the long question but I would be very grateful if someone here could help me out. I have also attached the script as a txt file, maybe this is easier to handle than the code snippets above.
IPDG.txt
The text was updated successfully, but these errors were encountered: