faunus
Classes | Functions | Variables
Faunus::analysis Namespace Reference

Adding a new analysis requires the following steps: More...

Classes

struct  _analyse
 Example analysis. More...
 
struct  _analyse< T, std::enable_if< std::is_base_of< Dipole, T >::value >::type >
 Example analysis. More...
 
class  Analysis
 Base class for all analysis functions. More...
 
class  AtomDensity
 Analysis of single atom densities. More...
 
class  AtomDipDipCorr
 Dipole-dipole correlation function, <{}(0){}(r)> More...
 
class  AtomicDisplacement
 Tracks displacements of particle positions. More...
 
class  AtomicPolicy
 SASA sampling policy which samples individually atoms selected by atom type name. More...
 
class  AtomInertia
 
class  AtomRDF
 Atomic radial distribution function, g(r) More...
 
class  AtomsInMoleculePolicy
 SASA sampling policy which samples as a whole atom in a selected molecule if multiple atoms are selected (either by atom names or by indices in a selected molecule) it samples sum of their SASAs in a given molecule if single atom name is selected, it samples just the selected atom SASA in a selected molecule. More...
 
class  ChargeFluctuations
 
class  CombinedAnalysis
 Aggregator class for storing and selecting multiple analysis instances. More...
 
class  Density
 Abstract base class for analysing atomic and molecular densities. More...
 
class  ElectricPotential
 Samples the electric potential at arbitrary positions in the simulation box. More...
 
class  FileReactionCoordinate
 Sample and save reaction coordinates to a file. More...
 
class  GroupMatrixAnalysis
 Samples a matrix of group properties. More...
 
class  InertiaTensor
 Sample and save the eigenvalues of the inertia tensor for a range of indexes within a molecule. More...
 
class  MassCenterDisplacement
 Tracks displacements of molecular group mass centers. More...
 
class  MolecularConformationID
 Create histogram of molecule conformation id. More...
 
class  MolecularPolicy
 SASA sampling policy which samples individually molecules selected by molecules name. More...
 
class  MoleculeDensity
 Analysis of molecular group densities. More...
 
class  MoleculeRDF
 Same as AtomRDF but for molecules. More...
 
class  Multipole
 Molecular multipole moments and their fluctuations. More...
 
class  MultipoleDistribution
 Multipolar decomposition between groups as a function of separation. More...
 
class  MultipoleMoments
 
class  PairAngleFunction
 
class  PairFunction
 Base class for distribution functions etc. More...
 
class  PairMatrixAnalysis
 Base class for streaming pair properties to a sparse matrix. More...
 
class  PatchySpheroCylinderTrajectory
 Generate PSCs text trajectory containing. More...
 
class  PerturbationAnalysis
 Base class for perturbation analysis. More...
 
class  PolymerShape
 Analysis of polymer shape - radius of gyration, shape etc. More...
 
class  PotentialCorrelation
 Samples the electric potential correlation as a function of distance, < Φ₁Φ₂>="">(r) More...
 
class  QRtraj
 Trajectory with charge and radius, only, for all (active, inactive) particles. More...
 
class  SanityCheck
 Checks if system is sane. More...
 
class  SASAAnalysis
 Analysis class for sasa calculations. More...
 
class  SavePenaltyEnergy
 
class  SaveState
 Save simulation state and particle coordinates to disk. More...
 
class  ScatteringFunction
 Sample scattering intensity. More...
 
class  SlicedDensity
 Density of atom along axis. More...
 
class  SystemEnergy
 Save system energy to disk. More...
 
class  VirtualTranslate
 Virtual translation move to calculate force. More...
 
class  VirtualVolumeMove
 Excess pressure using virtual volume move. More...
 
class  Voronota
 Analysis of Vorononoi tessellation using the Voronota-LT library. More...
 
class  WidomInsertion
 Excess chemical potential of molecules. More...
 
class  XTCtraj
 Write XTC trajectory file. More...
 

Functions

void to_json (json &j, const Analysis &base)
 
std::unique_ptr< AnalysiscreateAnalysis (const std::string &name, const json &j, Space &spc, Energy::Hamiltonian &pot)
 Factory function for generating analysis based on name. More...
 
std::function< double(const Group &, const Group &)> createGroupGroupProperty (const json &j, const Space &spc, Energy::Hamiltonian &hamiltonian)
 Returns a lambda function that calculates a scalar property for a pair of groups. More...
 
std::function< bool(double)> createValueFilter (const std::string &name, const json &j, bool throw_on_error)
 Generate lambda to filter values. More...
 
 NLOHMANN_JSON_SERIALIZE_ENUM (SASAAnalysis::Policies, {{SASAAnalysis::Policies::ATOMIC, "atomic"}, {SASAAnalysis::Policies::MOLECULAR, "molecular"}, {SASAAnalysis::Policies::ATOMS_IN_MOLECULE, "atoms_in_molecule"}, {SASAAnalysis::Policies::INVALID, nullptr}}) class AreaSamplingPolicy
 abstract base class for different SASA sampling policies
 
voronotalt::PeriodicBox get_periodic_box_from_space (const Faunus::Space &spc)
 
Voronota::Modes get_voronota_mode_from_name (const std::string &name)
 
std::string get_name_from_voronota_mode (const Voronota::Modes mode)
 

Variables

std::function< double(const Group &, const Group &)> createGroupGroupProperty (const json &j, const Space &spc, Energy::Hamiltonian &hamiltonian)
 Generates lambda to calculate properties between groups. More...
 

Detailed Description

Adding a new analysis requires the following steps:

  1. Write an analysis class derived from Analysis::Analysisbase
  2. Add the new class to the factory function Analysis::createAnalysis(), see below
  3. Recommended: add the required json input format to docs/schema.yml
  4. Recommended: add documentation to docs/_docs/analysis.md

Function Documentation

◆ createAnalysis()

std::unique_ptr< Analysis > Faunus::analysis::createAnalysis ( const std::string &  name,
const json j,
Space spc,
Energy::Hamiltonian pot 
)

Factory function for generating analysis based on name.

Function to create an instance of an analysis based on it's name

Parameters
namename of analysis to create
jconfiguration for analysis
spcspace to operate on
potHamiltonian
Returns
shared pointer to created analysis base class
Parameters
nameName of analysis to create
jJSON input for analysis
spcSpace the analysis should operate on
potHamiltonian representing the system
Returns
Shared pointer to analysis

After writing a new analysis, it must be added to this function in order to be controlled from the main faunus input.

◆ createGroupGroupProperty()

std::function<double(const Group&, const Group&)> Faunus::analysis::createGroupGroupProperty ( const json j,
const Space spc,
Energy::Hamiltonian hamiltonian 
)

Returns a lambda function that calculates a scalar property for a pair of groups.

This can be their interaction energy; mass-center distance etc.

◆ createValueFilter()

std::function< bool(double)> Faunus::analysis::createValueFilter ( const std::string &  name,
const json j,
bool  throw_on_error 
)

Generate lambda to filter values.

Parameters
namethe policy to use: all, smaller_than, function, ...
jjson object with data matching policy
throw_on_errorThrow if key is an unknown criterion
Returns
Unary predicate to determine if a value is selected or not; nullptr or throw if unknown name.
Exceptions
ifunknown name and throw_on_error is true

Variable Documentation

◆ createGroupGroupProperty

std::function<double(const Group&, const Group&)> Faunus::analysis::createGroupGroupProperty(const json &j, const Space &spc, Energy::Hamiltonian &hamiltonian)

Generates lambda to calculate properties between groups.

This looks for the property key in the json object. Supported names are energy, com_distance