Detect and extract disjoint portions of the dataset

I have a 3D surface mesh (unstructured grid) with periodic boundary conditions as shown below:

I clipped it using the scalar values and got four separated domains:

In this pictures there are four domains in 4 corners but sometimes there may be only 2 and it may not be at the corners. Is there a general way to extract disjoint domains from a dataset?

My goal is to translate 3 of the 4 domains and combine them into a single domain across the periodic boundary.


Look at vtkPolyDataConnectivity. See:

You can extract specified regions. See: