Hello all,
First of all excuse me if this question seems too trivial, I have done a good deal of reading and thinking and I have not found where I am failing, so perhaps my understanding of the fix ave/time is not as good as I thought. I want to get the stress in certain region of an atomic system. For that I am using this little fragment of LAMMPS code:
Stress in Analisys Section (ASec)
Per atom stress. [(stress)(volume) per (atom)] = [barA3/atom]
compute strAS1 ASec stress/atom
Per region stress. [Stress * volume)] = [bar*A3].
compute strAS2 ASec reduce sum c_strAS1[1] c_strAS1[2] c_strAS1[3] c_strAS1[4] c_strAS1[5] c_strAS1[6]
Stress tensor [GPa]. Volume of the ASec was calculated before
variable Sxx equal (c_strAS2[1]/Volume/(-10000))
variable Syy equal (c_strAS2[2]/Volume/(-10000))
variable Szz equal (c_strAS2[3]/Volume/(-10000))
variable Sxy equal (c_strAS2[4]/Volume/(-10000))
variable Sxz equal (c_strAS2[5]/Volume/(-10000))
variable Syz equal (c_strAS2[6]/Volume/(-10000))
Printing out results
fix strAS2 ASec ave/time 1 1 10000 c_strAS2[1] c_strAS2[2] c_strAS2[3] c_strAS2[4] c_strAS2[5] c_strAS2[6] title1 " Units: step [fs] - Stress*volume [bar*A^3]" title2 " TimeStep Sxx Syy Szz Sxy Sxz Syz" file strAS2.txt
fix strAS ASec ave/time 1 1 10000 v_Sxx v_Syy v_Szz v_Sxy v_Sxz v_Syz title1 " Units: step [fs] - Stress [GPa]" title2 " TimeStep Sxx Syy Szz Sxy Sxz Syz" file strAS.txt
There are four segments here:
i) a compute to calculate the stress per atom in the region. I understand that this command will generate a 6-element vector for each atom in the region
ii) a compute to add up the stress in the region. I understand that this command will reduce the N stress vectors (one per atom) to one 6-element vector (the stress tensor * volume of the region)
iii) fragment three simply divides by the volume of the region and convert the units
iv) It is intended to save the instantaneous values every 10’000 time steps. I want to create two files so I used two fix ave/time commands.
My problems are these:
-
I would like to have confirmation on my understanding of the compute command. I do not wish the results to mean what I think but I would like to be certain.
-
The fix ave/time commands does create the files I request but those files remain empty after the simulation has runs for 99’000 timesteps. It should write an output every 10’000 but it does not and I can’t see why.
-
The simulation runs until the timeteps is to change from 99’000 to 100’000 then this error message appears:
ERROR: Per-atom virial was not tallied on needed timestep (compute_stress_atom.cpp:98)
and the run stops taking the air out of me and leaving jaded. I know this error is associated with the fix ave/time commands because the runs continues without errors when I comment those two lines; but I don’t see where I am introducing the error.
So, could you please help me to clarify this three issues?
I thank you a lot for taking time to help.
Regards,