Unlike many other CSG implementations, MesoRD supports periodic boundary conditions, or PBC:s, for boxes and cylinders. For a box, PBC:s mean that a pair of opposing sides are topologically equivalent: if a molecule diffuses out one side, it will reappear at the other. For a cylinder^{[14]}, periodic boundary conditions, or toroidal boundaries, mean that molecules leaving through one circular cap will reappear at the other. Periodic boundary conditions have an important history in the sort of simulations MesoRD deals with, since they allow the creation of "infinite" geometries.
A subvolume on the boundary of a primitive need not be a boundary subvolume of the total geometry: if the geometry in Figure 4.1, “ A Simple TwoDimensional Object ” is defined by the union of two crossed boxes and a sphere, the boxes have "virtual boundaries" inside the sphere. These boundaries are not true boundaries of the total geometry, since they are contained within the sphere. Periodic boundary conditions on virtual boundaries are pathological cases: it makes little sense to define an object with PBC, only to subsequently hide the periodic boundaries within a bigger volume. Such situations should generally be avoided; periodic boundaries should also be true boundaries.
In the case of boxes there can be three separate boundary
conditions along the x
, y

and z
axes. The example below shows how to
define boundary conditions for the box along the
z
axis. Molecules diffusing out the negative
z
end of the box will reappear at the positive
z
end and vice
versa.
Example 4.16. Box Periodic Boundary Condition
<compartment id="box_pbc"> <annotation> <MesoRD:csg xmlns:MesoRD="http://www.icm.uu.se"> <MesoRD:box MesoRD:x="5" MesoRD:y="5" MesoRD:z="5" MesoRD:units="um"> <MesoRD:pbc MesoRD:x="false" MesoRD:y="false" MesoRD:z="true"/> </MesoRD:box> </MesoRD:csg> </annotation> </compartment>
Cylinders can have periodic boundary conditions only along the
y
axis. A cylinder with boundary conditions is
topologically equivalent to a torus. For instance:
Example 4.17. Cylinder Periodic Boundary Condition, or toroidal boundary condition
<compartment id="cylinder_pbc" units="um"> <annotation> <MesoRD:csg xmlns:MesoRD="http://www.icm.uu.se"> <MesoRD:cylinder MesoRD:height="5" MesoRD:radius="2" MesoRD:units="um"> <MesoRD:pbc MesoRD:y="true"/> </MesoRD:cylinder> </MesoRD:csg> </annotation> </compartment>
If the MesoRD:pbc
tags are
omitted, there will not be any boundary conditions active.
^{[14] }Periodic boundary conditions are the reason why MesoRD uses separate primitives for cones and cylinders. Cones could more generally be described by their height, the radius of the bottom cap, and the radius of the top cap. A "proper" cone would have its top cap radius equal to zero, and a cylinder would be defined by the special case when both radii are equal. Since PBC:s require topologically equivalent sides to be exactly the same size, they would not be applicable to generalised cones.