BondAnalysisModifier - set pairwise cutoff

Hello,
I have the following question.

I am trying to use this script to create bonds between particles type 3 and with a cut-off of 5 and analyze them with OVITO.

create_bonds_modifier = CreateBondsModifier(mode=CreateBondsModifier.Mode.Pairwise)
create_bonds_modifier.set_pairwise_cutoff(3, 3, 5)
bonding.modifiers.append(create_bonds_modifier)
pipeline.modifiers.append(BondAnalysisModifier(bins = 500))

And when I export the data I get a histogram that goes from 0 to 4. Is there some maximum cutoff value that is included in the CreateBondsModifier and should be modified?

In the documentation, it is said “Maximum bond length at which the bond length distribution gets truncated.” and the Default value is 4.0.

However, when I use the application , I see that bonds are formed that meet the condition.

Any comments that can help me understand why I am not being able to make the bonds?

Thanks

Hi,

Your script suggests that you are working with two different pipelines, called bonding and pipeline, so please make sure that you are applying the modifiers and exporting data from the specific pipeline you intend to use.

But in general, you’ll need to specify a length_cutoff value, otherwise the default value of 4.0 is used, e.g. like this

BondAnalysisModifier(bins = 500, length_cutoff = 5.0)

In this context, you might find the Python Generator function of OVITO Pro helpful, which can convert the pipeline you set up in the Desktop application into the corresponding sequence of Python script statements.

Thanks a lot
I probably misinterpreted the sequence.