Question about dBasisdx

Numerical methods and mathematical models of Elmer
Post Reply
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Question about dBasisdx

Post by Franz Pichler »

Hello deart Elmer community,

i was wondering about the dBasisdx values, that most ElmerSolver get from the ElementInfo function as something like

Code: Select all

          stat = ElementInfo( Element, Nodes, IP % U(t), IP % V(t), IP % W(t), detJ, Basis, dBasisdx )
.

When i call this for a boundary element in a 3d simulation, lets say a triangle, does it represent the gradient of the 3d base function defined on the parent element?
Or does it represent the gradient of the 2d base function on the trianlge?

This difference would be important if i would like to integrate over the boundary gradient. i know that getting the flux along the bcs is not trivial, but still i wonder if i could use this?

best regards,

Franz
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Question about dBasisdx

Post by annier »

Hi Franz,
I also don't know so much about the mathematical interpretation of dBasisdx.
Technically speaking, dBasisdx(nd,3) mentioned in the source code is used to represent nabla/gradient and since it appears before the Basis functions [basis(nd)] during the Galerkin formulation, it is given the name dBasisdx. So, it represents the gradient of the 3d base function when nd =3.
But i don't have ideas regarding parent element or 2D triangle element. Can anyone illustrate more on it?


Yours Sincerely
Anil Kunwar
Last edited by annier on 16 Sep 2015, 13:07, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Question about dBasisdx

Post by raback »

Hi Franz

If you call it for 2D element then your dBasisdx will also be in 2D. So it cannot be used to evaluate the normal gradient, only the tangential ones.

-Peter
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Question about dBasisdx

Post by Franz Pichler »

Thanks for the reply to this.
Can anybody think of a way how i can evaluate the parent element gradients on the boundary elements gauss points?
i can always get teh parent element and evaluate the elementinfo on it but here i have the problem that again the gauss point local coordinates of the bc element are 2d (ip%u(t),...). so i would have to get the coordinates of the bc gauss point wrt the parent element local coordinates. thats a though one if ihave all kinds of elements, right? or is there some functionality magically prepared in elmer allready?

best regards,
Franz
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Question about dBasisdx

Post by raback »

Hi Franz

Yes, you could find this somewhere in the code. But before going into this what are trying to compute? If it is a postprocessing issue that you want to compute over the fluxes then the neat thing is that their nodal value is automatically represented by the nodal load that you can get simply by saying "Calculate Loads = True" in a solver section.

-Peter
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Question about dBasisdx

Post by Franz Pichler »

hi peter,

i actually want to set a constraint to a bc flux that is dependent on some variables
Think of poissons equation. The flux "permittivity \nabla phi" at the boundary is equivalent to the charge at the bc. And in many situations this charge has to be equivalent to the charge in the bulk space in order to fullfill a charge neutrality condition.

this gives a constraint of the form

boundary integral over permittivity \nabla phi + bulk integral over charge =0

this implicitly gives the neumann boundary or the flux at the boundary for the electric field.

so no, it is not a postprocessing issue.

i just found the elementmetric function in elementdescription and put together the following:

Code: Select all

...
the usual foreplay in the boundary assembly where i also find the parent element in the bulk
....

          stat = ElementInfo( Element, Nodes, IP % U(t), IP % V(t), IP % W(t), detJ, Basis, dBasisdx )
          stat_parent = ElementInfo( ParentElement, ParentNodes, IP % U(t), IP % V(t), IP % W(t), parentdetJ, ParentBasis, ParentdBasisdx )
          stat= ElementMetric(nd,Element,Nodes,Metric,DetG,dBasisdx,LtoGMap)
          stat_parent= ElementMetric(nd_parent,ParentElement,ParentNodes,Metric,DetG,parentdBasisdx,parentLtoGMap)
          call InvertMatrix3x3( parentltogmap,parentgtolmap,detG )
          local_bc(1)=ip%u(t)
          local_bc(2)=ip%v(t)
          local_bc(3)=ip%w(t)
          global=MATMUL(ltogmap,local_bc)
          local_parent=matmul(parentgtolmap,global)
...
so what i think i do here is that i get a mapping ltogmap from the boundary element to the global coordinates
with the i calculate the variable "global" that is the global coordinates of the integration point.
with those i take the inverse of the same mapping in the parent element to get the local coordinates in the bulk element.

i guess this has many flaws.
but could it gop into the right direction??
best regards
Franz
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Question about dBasisdx

Post by raback »

Hi

Have you looked at test case ConstantBCTemperature:

Code: Select all

! Solves a Poisson equation with floating potential (zero net charge).
! This problem is like having an well conducting block barried in an
! insulation without knowing its temperature. 
It may be more robust to set the linear constraints implicitely rather than trying to enforce them explicitely.

This feature should be applicable also to StatElecSolver as well.

-Peter
Post Reply