# Space-time with ngsxfem

Hello,

I have been looking at unit 8.4 and I would like to test the same problem, but using DG in space as well as in time. The biggest issue I have is how to define the differential symbols for integrals over faces that are not on the time levels. For the time levels, in the example we have

dxt = delta_t * dxtref(mesh, time_order=2)
dxold = dmesh(mesh, tref=0)
dxnew = dmesh(mesh, tref=1)

So I thought I could define something like

dw = dxt(skeleton=True)

And then, when adding the actual integrator, figure out of the face is on the time level or not (for example, using the time component of the normal). However, this does not work. Any suggestions on how to do this? I saw that for CutFEM there are ways to integrate over different faces, but this seems like way more elaborate than what I need.

Giselle

Hi Giselle,

You should define the facet integral as

dft = delta_t * dxtref(mesh, time_order=..., skeleton=True)


which corresponds to the following integral:

\displaystyle \sum_{F\in\mathcal{F}_h} \Delta t \int_{0}^{1} \int_{F} \cdots ds \ d\hat{t}

where \mathcal{F}_h is the set of interior facets in the spacial mesh. This allows you to integrate over the non-temporal facets. You will not have to check for the space-time normal. The logic with skeleton=True refers to the spacial skeleton. In time there is only one time slab so that the temporal facets or only \hat{t} \in \{0,1\} and on those you can integrate via the dmesh(..,tref=..) DiffSymbol.

Best,
Christoph

Hi Christoph,

Thank you for your reply! I tried this but I get the following error message:

netgen.libngpy._meshing.NgException: SparseMatrixTM::AddElementMatrix: illegal dnumsin Assemble BilinearForm ‘biform_from_py’

When I try to assemble the bilinear form. Any idea of what could be going wrong?

Thank you once more!

Giselle

Hi,

You need to turn on the ‘dgjumps’-flag on your spatial FESpace. sfes = L2(mesh,...,dgjumps=True)

Otherwise there is no memory reserved for the necessary couplings of DG within the sparsity pattern of the matrix .

Best,
Christoph