The ds(4) is indicating that the integral should be over the subdomain labeled “4”. The integer labels are arbitrary, but the cylinder is marked as “4” in cylinder().mark(bc, 4). But if you just use ds() I think it will integrate over all boundaries.
So the boundaries are handled slightly different from the tutorial, but I think the full steps (which are all in the code from ria01) should be
- Define the cylinder and other boundaries using
SubDomain(rather thanExpressionas in the tutorial) - Define a
MeshFunctionand mark boundaries with integers (maybe helpful to name these, likeCYLINDER=4) - Define BCs using the
SubDomainobjects - Define the measure
dsusing yourMeshFunctionas thesubdomain_data
Then it’s just the form and assembly, which it sounds like you have figured out already.