Surface integral over a boundary point

Dear all,

I know how to do a surface integral over a boundary face, but I don’t know how to do a surface integral over a boundary point (it is a node). Does anyone know how to do it? I searched it in this forum but didn’t find any useful info. Thank you very much in advance.

Do you mean that your domain is 1D and its boundary is 2 points? Then the code is the same as if your problem had a higher dimension. Or do you mean something else? Could you provide a MWE with your domain and the boundary you want to integrate over?

Thank you for your reply. My domain is a 2D domain (rectangle). I want to integrate over the middle point of its top boundary. Below is my MWE:

from dolfin import *

mesh = RectangleMesh(Point(0, 0), Point(2, 1), 4, 2)

class Top_Boundary(SubDomain):
    def inside(self, x, on_boundary):
        tol=1e-14
        if( near(x[1], 1, tol) and on_boundary ):
            return True
        else:
            return False

top_boundary = Top_Boundary()

func_1 = MeshFunction("size_t", mesh, 1)
func_1.set_all(0)
top_boundary.mark(func_1, 1) 
ds = Measure("ds", domain=mesh, subdomain_data=func_1)  

V = VectorFunctionSpace(mesh, "CG", 1) 
u = Function(V)
q = Function(V)

# intergral over the top boundary:
intergral_1 = ( dot(u, q) )*ds(1)

# question: how to integrate over the middle point of the top boundary?

Integrating over a point is a point evaluation if that point is not matching a vertex, you can use PointSource to get that integral.

Thank you for your reply. In my case, the point over which I want to integrate is a vertex (a node), and it is on boundaries.

Then the integral is just a point evaluation at the node (no integration needed).

But do you want to put this in a matrix or vector? Then you need to use the point source class

This integral is a part of my weak form. I think I need to use the point source class. I will go to learn it. Thank you very much.