Constructor vs post_constructor?

whats the difference in purpose for doing initializations in a constructor vs post_constructor ? i searched the docs nothing, fix.h nothing, matsci not much except one where a fix needs to create another fix cant be done in constructor.

when im looking at examples of post_constructor() in the lammps sources it seems like most of it could be done in constructor also since atom->nmax already exist.

so what are reasons for post_constructor() ? and when should i put something in there instead of constructor ?

You cannot call virtual functions inside the constructor, only post_constructor.

2 Likes