faunus
Classes | Enumerations | Functions
Faunus::Region Namespace Reference

Subspaces around particles, molecules etc. More...

Classes

class  MovingEllipsoid
 An ellipsoid defined by two (moving) particles. More...
 
class  SphereAroundParticle
 Spherical region centered on a particle. More...
 
class  WithinMoleculeType
 Within a spherical cutoff distance from a molecule type. More...
 

Enumerations

enum  RegionType { WITHIN_MOLID, WITHIN_PARTICLE, WITHIN_ELLIPSOID, INVALID }
 

Functions

std::unique_ptr< RegionBase > createRegion (const Space &spc, const json &j)
 Expects an object where KEY is an arbitrary, user-defined name and the VALUE is another object defining rhe region type and other required properties. More...
 
void to_json (json &j, const RegionBase &region)
 
 TEST_CASE ("[Faunus] Region::MovingEllipsoid")
 
 NLOHMANN_JSON_SERIALIZE_ENUM (RegionType, {{RegionType::INVALID, nullptr}, {RegionType::WITHIN_MOLID, "within_molid"}, {RegionType::WITHIN_PARTICLE, "around_particle"}, {RegionType::WITHIN_ELLIPSOID, "ellipsoid"}}) class RegionBase
 Base class for defining sub-spaces of a simulation. More...
 

Detailed Description

Subspaces around particles, molecules etc.

Function Documentation

◆ createRegion()

std::unique_ptr< RegionBase > Faunus::Region::createRegion ( const Space spc,
const json j 
)

Expects an object where KEY is an arbitrary, user-defined name and the VALUE is another object defining rhe region type and other required properties.

Factory function to generate all known regions from json.

Example:

mysubspace:
policy: within_molecule_type
molecule: water
threshold: 7
com: true

◆ NLOHMANN_JSON_SERIALIZE_ENUM()

Faunus::Region::NLOHMANN_JSON_SERIALIZE_ENUM ( RegionType  ,
{{RegionType::INVALID, nullptr}, {RegionType::WITHIN_MOLID, "within_molid"}, {RegionType::WITHIN_PARTICLE, "around_particle"}, {RegionType::WITHIN_ELLIPSOID, "ellipsoid"}}   
)

Base class for defining sub-spaces of a simulation.

A region is a sub-space of the system, for example a sphere, cuboid, or other more complex shapes. The class can determine if a point is inside the region. A region need not be static and can follow molecules. A region may or may not have a well-defined volume.

< true if point is inside region

< Use group mass-center to check if inside region

< Volume of region if applicable

< Determines if particle is inside region

< Determines of groups is inside region

Selects particles within the region