espresso icon indicating copy to clipboard operation
espresso copied to clipboard

Create StressTensor/Pressure/Energy observables

Open jngrad opened this issue 4 years ago • 2 comments

Follow-up to #3712.

Next step is to convert the Observable_stat globals into Observable classes. Here is the plan:

  • StressTensorKinetic: NxN matrix
  • StressTensorVirtualSites: NxN matrix
  • StressTensorExternalFields: NxN matrix
  • StressTensorCoulomb: NxN matrix, there doesn't seem to be a need for 2 or 3 matrices
  • StressTensorDipolar: skip it: not implemented
  • for interactions, if we want to preserve the way they have always been output:
    • StressTensorBonded: NxN matrix
    • StressTensorNonBonded: NxN matrix
    • StressTensorBondedContributions: ZxZxNxN with Z the number of bonded IAs
    • StressTensorNonBondedContributions: ZxZxNxN? if Z is max_seen_particle_type, we'll have a large matrix with reaction ensemble algorithms (the core base class ReactionAlgorithm sets the non-interacting type to 100)
    • StressTensorNonBondedIntra: skip it: just get the diagonal terms of StressTensorNonBondedContributions
    • StressTensorNonBondedInter: skip it, just get the off-diagonal terms of StressTensorNonBondedContributions
  • simpler alternative for interactions:
    • StressTensorBonded(bonds=[bond1, bond2] or ['FENE', 'AngleCosine'] or 'all'): NxN matrix
    • StressTensorNonBonded(types1=[0, 1] or 'all', types2=[3, 5] or 'all', interactions=['wca', 'hertzian'] or 'all'): NxN matrix

Same strategy for Pressure* and Energy* observables. EnergyDipolar will be implemented.

That's going to be a lot of files. Should we create a new subfolder src/core/observables/impl to move those and all the already existing final classes, so that src/core/observables only contains virtual base classes, e.g. PidObservable, ProfileObservable, PidProfileObservable, etc.?

jngrad avatar May 15 '20 16:05 jngrad

offline discussion: rename StressTensor to PressureTensor, create Energy and Pressure for the total energy and total scalar pressure, remove state tracking from the global observables, leave the analysis module as it is now until a better solution is found (it's helpful to print all contributions when debugging simulations).

jngrad avatar May 18 '20 13:05 jngrad

the core base class ReactionAlgorithm sets the non-interacting type to 100

Particles of this type are non-physical (just for algorithmic reasons in the MC code) and exist only temporarily (i.e. at times where no observable can be called by the user). These temporary types should not be considered in any observable calculation.

jonaslandsgesell avatar May 29 '20 06:05 jonaslandsgesell