Edge degrees of freedom

Discussion about coding and new developments
Post Reply
spanda
Posts: 8
Joined: 19 Feb 2018, 14:24
Antispam: Yes

Edge degrees of freedom

Post by spanda » 22 Feb 2020, 04:11

Hi

Is it possible to use a variable that has more than one degrees of freedom per edge? By this I do not mean edge basic functions of the second degree.

For example, is it possible to use a weak formulation containing E and H vector fields (where E represents the electric field vector and H represents the magnetic field vector) such that both vector fields are approximated by edge elements.

I guess it would then look like this in a SIF file:
----------------------
Solver 1
..
..
Variable = Field[ E re:1 E im:1 H re:1 H im:1] !...harmonic case
Variable DOFs= 4
Element = "n:0 e:1"
..
..
End
-------------------------------

I am trying to develop similar formulation in the 3D case, but the solver does not seem to know that the variable has 4 edge degrees of freedom, i.e. real and imag part for both E and H.

For example:
When I print final solution for an element that is a tetrahedron (so it has 6 edges), by using the GetLocalSolution() subroutine, the solutuion vector SOL has only 14 values ​​instead of 24 values ​​(4 EdgeDofs for each of the 6 edges of the tetrahedron).

It seems to me that it offers me real an imaginary part for each of the 6 edges plus 2 strange values (maybe some unwanted nodal Dofs), from which it follows:
2 * 6Edges + 2dofs = 14 values ​​in SOL.

Thanks and best regards
--Spanda

mika
Posts: 131
Joined: 15 Sep 2009, 07:44

Re: Edge degrees of freedom

Post by mika » 24 Feb 2020, 15:30

Hi,

Elmer should offer pretty much general support for associating degrees of freedom with different geometric entities of a background mesh, so this should be possible to do. Nevertheless the case of approximating two curl-conforming fields simultaneously hasn't been exemplified yet, although I have been having a long-lasting plan to do something similar.

How many DOF values the subroutine GetLocalSolution(X) returns should depend on the return value of the function GetElementDOFs, if the size of the result array X(:,:) doesn't make a restriction. I'd first check that the return value of the function GetElementDOFs corresponds to your specification of DOFs and also check that the two-dimensional array X has sufficient dimensions.

I made some simple experiments with element definitions which could be utilized in this case, but I didn't see anything suspicious outright.

-- Mika

spanda
Posts: 8
Joined: 19 Feb 2018, 14:24
Antispam: Yes

Re: Edge degrees of freedom

Post by spanda » 24 Feb 2020, 20:56

Thanks for the reply Mika!

To be more precise, this is the AT weak formulation shown in the paper by Albertz and Henneberger "Calculation of 3D Eddy Current Fields Using Both Electric and Magnetic Vector Potential in Conducting Regions", IEEE Trans. Magn.
In this paper, both A and T potentials are approximated using edge DOFs.

Do you have any advice on how to properly give instructions to Elmer so that it works with two edgeDOFs on each edge, both with real and imaginary part?

After examining the GetElementDOFs() function, it seems to me that EDOFs = Solver% Mesh% Edges (Element% EdgeIndexes (j))% BDOFs parameter should be equal to 2, or alternatively parameter EdgeDOFs = Solver % Mesh % MaxEdgeDOFs should be equal to 2.
I suppose then the following should be specified in the SIF file:
------------
Solver 1
..
..
Variable = Field[ E re:1 E im:1 H re:1 H im:1] !...harmonic case
Variable DOFs= 2
Element = "n:0 e:2"
..
..
End
--------------------
With this approach parameters EDOFs = Solver% Mesh% Edges (Element% EdgeIndexes (j))% BDOFs and EdgeDOFs = Solver % Mesh % MaxEdgeDOFs are set to 2.

So, Element = "n:0 e:2" command will specify two edgeDOFs for each edge, and Variable DOFs= 2 command is there due to complex values for the DefaultUpdateEquationsC subroutine to correctly assemble the STIFF matrix and the RHS vector.

But, my simulation doesn't converge so maaybe this approach is incorrect

Am I wrong? Is it enough to use only a SIF file as described above or it is necessary to add some unmentioned (and unknown to me) commands in the NewSolver_init (initialization phase) in order to properly set the number of edgeDOFs to 2?

Thank you Mika for the help

--Spanda

mika
Posts: 131
Joined: 15 Sep 2009, 07:44

Re: Edge degrees of freedom

Post by mika » 25 Feb 2020, 11:08

I'd also set "Variable DOFs = 2" so that the two components would represent the real and imaginary parts. This is the way how Elmer has traditionally handled the approximation of complex-valued fields and following this convention offers a better way to utilize general library routines. The element definition Element = "n:0 e:2" should also give the right set of degrees of freedom for tetrahedra.

Using aliases in the variable name definition needs however some care. Now it will be difficult to get an alias which would follow the splitting of the unknown to A and T. When one uses "Variable DOFs = 2", aliases could be defined by setting for example

Variable = AT[AT re:1 AT im:1]

Then "AT re" would refer to a variable which contains values for representing the real part of both A and T. Unfortunately this is rather abstract. A postprocessing routine could be written to create "A Re", "A Im", "T Re" and "T Im" from "AT". A tailored subroutine for setting BCs seems also necessary due to abstract nature of the variable.

When two DOFs per real/imaginary component are defined on an edge, the first DOF could be used for representing A and the second for representing T. The convention may also be something else, but the convention must be followed consistently when writing code.

Best regards,
Mika

mika
Posts: 131
Joined: 15 Sep 2009, 07:44

Re: Edge degrees of freedom

Post by mika » 25 Feb 2020, 13:05

I add that the way to get the right number of DOFs is not unique nevertheless. I think the definitions

Variable DOFs = 4
Element = "n:0 e:1"

should in principle serve as well, with a chance of getting more useful aliases.

-- Mika

Post Reply