Hello LAMMPS users!
I am simulating the collision of different particles on polyimide and hope to get damage results. Now I have a problem that I don’t know how to obtain the maximum height change of the system and the change of damage depth.I have the following ideas, but I don’t know if they are correct.
1、Is there a way to get the maximum height of a certain type of atom?This can indirectly tell the height change of the system.However, the collision process may cause some atoms to be lost and escape from the system.
2、Convert the output file of lammps into Materials Studio and calculate the height manually.This method is very laborious.
Please let me know if you have any better methods. I hope to get methods and useful codes please.
Please have a look at the compute reduce command. It operates on a group, so you need to first define a suitable group containing all relevant atoms, i.e. with the specific type you are interested in.
Hi!Thank you very much for your advice.I’m trying to code it.But I found some problems in the simulation that I couldn’t solve on my own.
My code:
############################################################ damage
Initial moment marking of raw atoms
region quanbu_region block INF INF INF INF INF 38.0
compute zu all property/atom zu # unwrapped coordinate
run 0
group original_atoms dynamic all region quanbu_region every 100 # Dynamic storage of initial atoms
Defining the initial surface
variable initial_surface equal 36.84 # Initial surface z-coordinate
Height calculation (raw atoms only)
compute zmax_original original_atoms reduce max c_zu
compute zmin_original original_atoms reduce min c_zu
variable height_original equal “c_zmax_original - c_zmin_original”
Calculation of damage depth
region damaged_region block INF INF INF INF INF ${initial_surface} units box
group damaged_atoms region damaged_region
group target_atoms intersect original_atoms damaged_atoms
compute zmin_target target_atoms reduce min c_zu
variable damage_depth equal (v_initial_surface - c_zmin_target)
Output settings
thermo_style custom step v_height_original v_damage_depth
fix height_out all ave/time 100 10 1000 v_height_original file original_height.txt
fix damage_out all ave/time 100 10 1000 v_damage_depth file damage_depth.txt
############################################################## damage
The error message is as follows:
ERROR: Cannot intersect groups using a dynamic group (src/group.cpp:469)
Last command: group target_atoms intersect original_atoms damaged_atoms
My question is:
1、The system I simulated is a process where foreign atoms collide with a molecular system, and the product will continue to escape upwards, making it impossible to pinpoint the extent of the system without using a dynamic group.
2、Is it possible to use a static group to become an intermediate group?Does this need to be done within the loop?
3、Are there obvious logic errors within the code?
Thank you very much!If you can answer me that would be appreciated!
The error message is quite clear: you cannot use the intersect command with a dynamic group. Since both groups are determined by a region, you can just get the intersection of the two regions for the dynamic group and you should have the same.
Thank you for your answer! I’m very sorry I still have questions that I don’t understand.
Since I’m not a native English speaker,I don’t know if I’m understanding you correctly.
How to get the damage region by the intersection of two regions?
If a region is divided into upper and lower parts, the lower end of the upper part implies the lowest part of the target region, and the upper end of the lower part implies the uppermost part of the target region.The two boundaries are prematurely fixed and cannot move with system damage.
I have not looked at your input in detail, but the situation is quite clear: you cannot use the group intersect command since one of your groups is dynamic.
Since both groups you have are defined by a region, you could just create a region that is the intersection of the two and then use that for your new group as a dynamic group instead of intersecting the two groups.
Another option is that you use the static region based group as the parent group for a dynamic group to get the intersection of the two groups.
This is all logical and straightforward to do. It should requires studying the manual carefully for the syntax and then applying and testing the result.