basis.get_elements() #786
Replies: 1 comment 7 replies
-
I feel zero_w is not really needed anymore. Same applies to the proposed zeros_like. You can initialize another Basis with ElementTriP0 (piecewise constant function) and then zeros will give you the correct shape. This is how we should think about piecewise constant functions: FE functions defined by piecewise constant basis. There is Mesh.elements_satisfying so the second step also exists. If you want to use sigma inside a form, then you make sure both Basis objects have the same number of integration points so they are compatible. Easiest way is to initialize the P0 basis like basis0=basis.with_element(ElementTriP0()). Then you can call basis0.interpolate(sigma) and pass the resulting object to assemble as a kwarg. |
Beta Was this translation helpful? Give feedback.
-
Now that
basis.get_dofs()
is coming along.... can we addbasis.get_elements()
The use case is
scikit-fem/docs/examples/ex17.py
Lines 56 to 58 in 08a695d
But what if I don't have labeled subdomains?
I propose that we could
with a function very similar to
get_dofs
.This
sigma
is easily plotted withmatplotlib.pyplot.tripcolor(..., facecolors=sigma)
, but can it be passed to theForms
? Is it easy to use as the coefficient for Laplace equation?Beta Was this translation helpful? Give feedback.
All reactions