getting started with dofs, quadrature points, and etc.... #808
Replies: 6 comments 50 replies
-
Thanks for this. The docs (scikit-fem.readthedocs.io) definitely need more information on these things under
There are some options:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
They should be if you use |
Beta Was this translation helpful? Give feedback.
-
Inside Here the dual basis is only conceptual and not used in practice. However, some elements are defined through the DOF functionals, e.g., Not all elements are defined as subclasses of It would technically be possible to build the local basis dynamically in Python using the DOF functionals and still have it computationally efficient. Trying this out is on my loooong TODO list. |
Beta Was this translation helpful? Give feedback.
-
When defining the forms you could use any names, e.g., @BilinearForm
def mass(p, q, _):
return p * q At the linear algebra level However, using strings like |
Beta Was this translation helpful? Give feedback.
-
Related question: what details should we add to https://scikit-fem.readthedocs.io/en/latest/advanced.html#dofindexing to make it more useful? |
Beta Was this translation helpful? Give feedback.
-
(I've been following this FEM tutorial and this extremely thorough pdf to get myself up to speed on both FEM in general and how it is implemented in
skfem
. They are quite handy but the nomenclature does sometimes differ fromsfkem
and the entire FEniCS code base in currently in shambles while they refactor with an intense focus on parallelization. If you're new here, in comparison to FEniCS and SfePy,skfem
is extremely lightweight and the source code is (relatively) approachable.)I feel like
skfem
is lacking in some of the fundamental documentation, especially for newbies. So I'm working on that and @kinnala and @gdmcbain please correct anything I've got wrong below!First up is DoFs vs quadrature points... and clearly they are different.
So lots of things to digest here... first, the quadrature points are in local coordinates for one "reference" cell, as seen in the plot on the right. Next up is the various categories of DoF in
skfem
as drawn on the left, which are clearly in 'global' or 'physical' coordinates:basis.nodal_dofs
in redbasis.facet_dofs
in greenbasis.interior_dofs
in blueAnd then there's
basis.element_dofs
which is all of the above1d and 3d meshes use slightly different labeling as shown below. Any DoF not fitting one of the labelled locations is an
interior_dof
.Now to recap so far, there is an element order to consider, the * in
skfem.ElementTriP*()
, which changes the DoFs per element.P1
is special because thedoflocs
are right on the mesh vertexes. All of the others (includingP0
) move the DoF locations around. There is also an integration order to consider (theintorder
argument toskfem.CellBasis
) that controls the number of quadrature points. (As best I can tell,skfem
exclusively uses equispaced Lagrange quadrature.)We can use what we have to far to compute fun integrals...
But here is where I start to get really lost.
(1) What if I have a functional form of sigma, e.g.
sigma = np.sin(x) + np.exp(-(y**2))
?(2) I used
sigma=basis.zeros()
making sigma shaped like DoFS, but then i didn't need.interpolate()
to get it interpolated to the quadrature points... why?(3) Are gradients of
sigma
readily available in the Functional?...
(4) I also have similar questions about
FacetBasis
but I'll have to expand this tomorrow....
(5) And I'm also trying to verify that the 'nodes' (in terms of the dual basis) used by
skfem
are always point evaluation nodes and that's not something that can be changed for e.g.ElementTriP1
....
(6) Some other random confusion comes from using
x
to hold the solution in the examples, even thoughu
is the variable used in the forms. Thenu
seems to get used again as a name of various dofs, but this doesn't make any sense to me at all.Beta Was this translation helpful? Give feedback.
All reactions