Pre-processing commands
Pre-processing commands are keywords of the conf-file that act on the system once it has been read, rather than describing it. They are the way to glue bodies together, to randomise velocities, or to duplicate a group of particles, without having to generate all of it explicitly.
Important
They act on a system that is already set, so they belong at the end of
the input file, after Particles and, when relevant, after
Interactions. A command placed before the particles are read would find
nothing to work on.
Note
A pre-processing command is executed once, when the file is read, and it is never written back into the conf-files that the computation saves. The dumps hold the result of the command: the interfaces it created, or the velocities it set. Restarting from a dump therefore does not re-run it, which is what you want.
Creating glued interfaces
These commands build the Interfaces of the sample. Two bodies are glued when
they are closer than a distance Epsilon, and the resulting bonds are what a
breakable force law (StickedLinks, BCM) acts on.
A bond is said to be inner when the two bodies share the same cluster
number, and outer otherwise. This is what selects the *InnerBond or
*OuterBond parameters.
stickVerticesInClusters(double) EpsilonGlue the bodies that have the same cluster identifier. Only vertex-vertex bonds (sphere to sphere) are created, when the distance is less than Epsilon.
stickVerticesInClustersMoments(double) EpsilonSame as above, with the transmission of moments enabled at the bonds. Use this one when the assembly has to resist bending rather than only traction.
stickClusters(double) EpsilonGlue bodies belonging to different clusters. All the bond types are created, not only vertex-vertex, when the distance is less than Epsilon.
stickBCM(double) EpsilonBuild the interfaces required by the
BCMforce law. Beyond creating the bonds, it computes the area of each interface, which is what the energy-based rupture criterion needs, and copiesknInnerBond,ktInnerBondandgcInnerBondinto each interface. All the interfaces it creates are flagged as inner.
Tip
glue_with_walls yes, placed before these commands, extends them to the
driven bodies, so that a sample can be glued to its container.
Note
Choosing Epsilon is a geometric matter: it must be large enough to catch the neighbours that should be bonded, and small enough not to bond bodies that merely pass close to each other. A value of the order of the Minkowski radius is a reasonable starting point.
Tuning the interfaces
These commands modify interfaces that already exist, so they must come after one of the sticking commands.
copyParamsToInterfaces(string) inner|outerCopy the parameters of the group-pair table into each interface, so that every interface then carries its own copy. Only the interfaces of the selected kind are touched:
innervisits the interfaces whose two bodies share a cluster,outerthe others.This command sets
ParamsInInterfacesto 1 by itself, so the copied values are saved in the conf-files and read back on a restart.Warning
The two branches do not copy the same set.
outercopies \(k_n, k_t, k_r, f_n^0, f_t^0, M_0\) and the exponent, whereasinnercopies only \(k_n, k_t, f_n^0, f_t^0\) and the exponent: the rolling stiffness and the moment threshold are not copied for inner bonds, and keep whatever the interface already held. Set them explicitly if your model relies on them.setStiffnessRatioInterfaces(double) ratioSet \(k_t = \text{ratio} \times k_n\) in every interface.
setVariableStickParams(string) paramName (string) inner|outer (double) lambda (int) m (int) timeSeededDraw one interface parameter from a Weibull distribution of scale
lambdaand modulusm, independently for each interface. This is the usual way of introducing a controlled scatter of strength, and hence a progressive rather than simultaneous failure.timeSeededset to 1 seeds the random generator on the clock, so that two runs differ; set to 0, the same sample is reproduced exactly.
Important
These commands write into the interfaces themselves, and the force laws only
read what an interface carries when ParamsInInterfaces is 1.
copyParamsToInterfaces sets that flag on its own; the two others do not,
so set ParamsInInterfaces 1 in the conf-file if you use them alone.
Setting the kinematics
The velocities of the driven bodies are never modified by these commands.
setAllVelocities(vec3r) velocitySet the velocity vector of all the free particles to the prescribed vector.
randomlyOrientedVelocities(double) velocityMagnitudeGive every free particle a velocity of the prescribed magnitude, in a direction drawn uniformly at random. Each particle gets its own direction.
randomlyOrientedVelocitiesClusters(double) velocityMagnitude (int) optSame, but a single direction is drawn per cluster, so that the bodies of a cluster keep moving together instead of being torn apart at the first step.
optset to 1 forces the vertical component downwards (\(v_y \leftarrow -|v_y|\)), which is what a release of blocks above a slope needs; set to 0, the direction stays uniform over the sphere.
Populating the sample
homothetyRange(int) ifirst (int) ilast (double) hmin (double) hmax (int) timeSeededGive the particles from
ifirsttoilasta homothety drawn uniformly in \([h_\text{min}, h_\text{max}]\). This is how a size dispersion is introduced without defining one shape per size.timeSeededbehaves as insetVariableStickParams.Note
The command recomputes the mass and the inertia of each particle it touches, from the new homothety, the volume of its shape and the density of its group. The
densityof every group concerned must therefore already be defined when the command is executed, which is the case as long as it sits at the end of the file.particlesClonage(int) ifirst (int) ilast (vec3r) translationDuplicate the particles from
ifirsttoilast, translated by the given vector. Useful to build a periodic-looking pattern, or to stack several copies of a prepared block.The clones are appended at the end of the particle list, and they are given new cluster numbers, continuing after the highest one in use. A cloned block is therefore a separate cluster: bonds inside a clone stay inner, while the clone is not glued to its original.
Note
The clones are appended after the file has been read, so the particle count of the input file no longer matches the number of bodies in memory. The next conf-file written by the computation records the new count, and is a consistent input on its own.
A typical bonded sample
...
ParamsInInterfaces 1
Particles 512
...
stickVerticesInClusters 0.05
copyParamsToInterfaces inner
setVariableStickParams fn0InnerBond inner 1.0e4 5 0
The sample is glued cluster by cluster, each interface then receives its own copy of the parameters, and the tensile strength of the bonds is finally scattered with a Weibull law of modulus 5.