Tabulation of function space V

I borrowed include methodology from:

Hermite functionspace with unitinterval mesh - FEniCS Project

from mpi4py import MPI
from dolfinx import mesh,fem
from dolfinx.fem import FunctionSpace
import ufl
from petsc4py.PETSc import ScalarType
import numpy as np
import matplotlib.pyplot as plt

domain = mesh.create_unit_interval(MPI.COMM_WORLD, 8)

V = FunctionSpace(domain, ("Lagrange", 3))
T = FunctionSpace(domain, ("Lagrange",3))

u = ufl.TrialFunction(V)
v = ufl.TestFunction(T)

So as I take it so far function space V consists of all nodes of “domain” and or all the points in between.

Is there a way from python “V” or from trial function in python “u” to get output of domain points as they start to get modified?

For instance I might light to see output in terms of node points how or if they get modified from a new test function f_n = u * v? (As far as what the end resulting expressions look like…)

Yes, you can get both mesh coordinates and dof coordinates after modifications. See for instance How to find the coordinate where a vector function is max?.

EDIT : Just found some related posts, thought of sharing them Extract coordinates of the nodes of a subboundary and Mapping from mesh.coordinates() to u.vector().

1 Like

f_n = u *v is just a symbolic expression, no computation or modification of dof coordinates has happened yet.

When you call
dolfinx.fem.form(f_n*ufl.dx) C++ code is generated for assembly of the local element tensor.

Calling assemble_matrix on this object assembles the contributions into a global tensor.

If you want to control the integration points, you can set “quadrature_degree” in ufl.Measure, see for instance:

To inspect these coordinates you should look at Crash when trying to obtain coordinates of quadrature points - #2 by dokken
Mapped quadrature points, weights and solution at these quadrature points - #2 by dokken

2 Likes