Now, I want to calculate the following term of a weak form:

\[\int E \nabla (Et)\]

.When I naively try the following for my bilinear form, I get a dimensional mismatch error:

but, the following seems to work:

Is this the correct thing to do? I am still learning NGSolve. Thank you all for your hard work.

I saw a different post [1] saying that VectorH1 spaces will allow all div and curl and grad to be used simultaneously, but I wanted to make sure my attempt makes sense too.

[1] /forum/ngspy-forum/781-fe-space-with-curl-and-div]]>

First, in installing ngsolve on jupyter on my ubuntu system, I needed to install jupyter-notebook as well, and the install command did not work but needed to use enable, as copied below.

sudo apt install jupyter-notebook

jupyter nbextension enable ngsolve --user --py

Second, I found about 6 or so examples in the notebooks that did not run, the first of which was the notebook on Maxwells equations. I can provide a longer list if need be.

I presume these are known but wanted to try and contribute in case they aren't.]]>

I have the following code (working) to calculate forces using the Maxwell Stress Tensor. Is there a more elegant way to write the tensor?

]]>

Is the spline approximated by the initial polygon or there is some more accurate interpolation of the boundary going on?

geo = SplineGeometry()

p1 = geo.AppendPoint(0,0,hpref=1)

p2 = geo.AppendPoint(1.0,0,hpref=1)

p3 = geo.AppendPoint(1.0,1.0)

p4 = geo.AppendPoint(0,1,hpref=1)

geo.Append(["line",p1,p2],hpref=1)

geo.Append (["spline3", p2, p3, p4],hpref=1)

geo.Append(["line",p4,p1],hpref=1)

mesh = Mesh(geo.GenerateMesh(maxh=0.25, quad_dominated=True))

mesh.RefineHP(L, factor=sgm)]]>

I have two questions. It would be very helpful if anyone can answer any of them. Thank you.

1. I have a mesh with two materials ("inner" and "outer" ) and I have an L2 GridFunction defined on the inner material. I'd like to define an L2 Facet GridFunction on the outer material and then set the values on the interface ("interior boundary") based on the L2 GridFunction.

I tried the following code but it doesn't work. The dofs of the L2 Facet GridFunction are still all zeros. I wonder what's the right way to do this.

2. Another question I have is how I can set

Thanks.

Oliver]]>

I want to calculate the pressure values on specific parts of the boundary.

does anyone know how I can compute the

pressure on the boundary but in an increasing order

with respect to the coordinate x?

the data are going to be further used for making plots.

best regards

it]]>

I recently updated NGSolve to git revision baa43 and found that my older code

for loading a grid function from NGSolve's binary format doesn't work anymore.

Below is a minimal working example (the code files and binary function are attached):

At git revision 6f862 the vtk files show the right function (a phase field with the shape of a u,

somehow I cannot get the corresponding image attached).

At baa43, however, the result is

In non-MPI mode everything is still fine.

I couldn't find a hint in the documentation. Am I using something wrong?

All the best,

Philipp]]>

Im currently working on solving the TEAM 7 problem in NGSolve ( Compumag ).

That problem describes an aluminum plate with eccentrically placed hole. This plate is set asymmetrically inside a magnetic field which is produced by a coil. That coil is

As of now I used:

which results not the correct results for that geometry.

I also have access to a working solution in FEniCS. There the impressed current vector potential (T0) is created in a separate file saved to .xml and read again in the main code. I currently don't know if there is an equivalent method in NGSolve.

I read about BSpline and VoxelCoefficientFunctions, but I don't completely understand how to implement them as well as if they would be an appropriate approach to the solution.

TLDR: How can I correctly implement the impressed current vector potential for a not perfectly cylindrically shaped coil in NGSolve.

I attached the volume and my current code.

Any help is appreciated.

Best

I am trying to implement an HDG+ method. I am having trouble with a term involving the L^2projection of an unknown.

For example, for an element K

\[u_h \in \mathcal P_{p+1}(K),\quad\mu\in \Pi_{F\in \partial K}\mathcal P_p(F)\]

. I would like to compute\[\int_{\partial K} P_{M} uh \mu ds\]

where P_M is the L^2 projection onto the space

\[\mathcal P_{p+1}(K)\]

.Is possible to implement L^2 projection as operators?

I would appreciate any help.

Thanks.]]>

I attached a simple example: (no PML and only 2 materials) to show what I'm doing. Should I be using a different solver or preconditioner?

Any help is appreciated!]]>

is there a possibility to receive the energy of each element in an elegant way?

For the global energy, I know the a.Energy(gfu) function which is very handy.

Thanks in advance!]]>

is there a way to retrieve the element jacobian matrix G of the transformation from local (u,v,w) to global (x,y,z) coordinates in a Pythonic way?

I would like to compute the forces via the direct virtual work approach on element level. Therefore, I need the determinant of the jacobian and the derivative of the jacobian along the direction s.

I would be glad about any hint!]]>

I'm currently working on a 3D eddy current problem regarding a conducting cube in homogenous magnetic field in the time domain. While doing this some questions arose about the correct implementation of non-homogeneous Dirichlet boundary conditions.

I tried the following so far:

with the entries in the list being the different surfaces (1: bottom, 2: top, 3: left, 4: right, 5: front, 6: back). Drawing these onto the mesh shows in the GUI that the values are set to the correct surfaces.

Even though there is a lot of well written documentation I don't fully understand how to mark the boundaries correctly as the keyword

Note the attached code. Any help is very much appreciated as I'm pretty new to FEM-Simulation in general.

Best