question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Projecting on ElementDG

See original GitHub issue

Regarding https://github.com/kinnala/scikit-fem/discussions/895#discussioncomment-4044517 : I’ve made a minimal example showing a problem projecting on ElementDG:

import numpy as np
import matplotlib.pyplot as plt

from skfem import *

fig, axs = plt.subplots(1, 3, subplot_kw={'aspect': 1})

mesh = MeshTri().refined(4)

basis = Basis(mesh, ElementVector(ElementTriP1()))
x = basis.project(lambda x: np.array((x[1], -x[0])))
basis.plot(x, ax=axs[0])

basis2 = basis.with_element(ElementVector(ElementTriP1()))
x2 = basis2.project(basis.interpolate(x))
(x2_x, basis2_x), (x2_y, basis2_y) = basis2.split(x2)
basis2_x.plot(x2_x, ax=axs[1], shading='gouraud')

basis3 = basis.with_element(ElementVector(ElementDG(ElementTriP1())))
x3 = basis3.project(basis.interpolate(x))
(x3_x, basis3_x), (x3_y, basis3_y) = basis3.split(x3)
basis3_x.plot(x3_x, ax=axs[2], shading='gouraud')

plt.show()

image

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:23 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
kinnalacommented, Nov 11, 2022

This looks better: Figure_1

0reactions
HelgeGehringcommented, Nov 14, 2022

Okay, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Element Design Group – Architecture Design & Structural ...
In conjunction with our Clients, Element Design Group produces design solutions with efficient and consistent results. We are customer focused, ...
Read more >
DG local equation, how to interpret mean-averaged test function
The test funcion over which the PDE is projected, is defined as any test function (dependent of the coordinates, as you understand it)...
Read more >
Discontinuous Galerkin - an overview | ScienceDirect Topics
The discontinuous Galerkin (DG) method is a robust and compact finite element projection method that provides a practical framework for the development of ......
Read more >
Hybridizable discontinuous Galerkin projection methods for ...
Our high-order HDG projection schemes are implemented for arbitrary, mixed-element unstructured grids, with both straight-sided and curved meshes. In particular ...
Read more >
Detailed API description - scikit-fem - Read the Docs
Elements defined implicitly through global degrees-of-freedom. skfem.element.ElementDG (elem), Turn a finite element discontinuous by cutting connectivity.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found