ppap4lmp  0.7.2
StaBeads Class Reference

StaBeads sets properties for beads using mapping (coarse-graining) scheme for each molecule. More...

#include <sta_beads.h>

Inheritance diagram for StaBeads:
Collaboration diagram for StaBeads:

Public Member Functions

 StaBeads (const ElPtr &el_mols, const Vec< Json > &scheme)
 Constructor of StaBeads class for molecules all of whose type property are 1, or molecules all of which do not have the property. More...
 
 StaBeads (const ElPtr &el_mols, const Map< int, Vec< Json >> &schemes)
 Constructor of StaBeads class for multiple molecular types. More...
 
- Public Member Functions inherited from Starter
 Updater ()=default
 Constructor of Updater class. More...
 
- Public Member Functions inherited from Updater
 Updater ()=default
 Constructor of Updater class. More...
 
void compute (const ElPtr &elem, const int elementid, Json &data)
 Managing computation to update Element::data. More...
 
void remove_from_skippable_elementids (const int elementid)
 Remove Element::elementid from skippable_elementids. More...
 
const ShPtr< Generator > & get_ext_generator ()
 Get ext_generator of this object. More...
 

Protected Member Functions

virtual void compute_impl (Json &data, JsonToVoidFunc check_required_keys, JsonToBoolFunc check_optional_keys) override
 This method overrides Updater::compute_impl. More...
 
- Protected Member Functions inherited from Starter
virtual void compute_body (const ElPtr &elem, Json &data) override
 Compute or parse properties and set them to Element::data given as a mutable reference. More...
 
- Protected Member Functions inherited from Updater
virtual void compute_common (const ElPtr &elem, Json &data)
 Common part of compute_body. More...
 

Private Member Functions

std::pair< bool, bool > check_mol_type_to_abst_beads ()
 

Private Attributes

Map< int, Vec< Json > > mol_type_to_abst_beads
 

Additional Inherited Members

- Protected Attributes inherited from Updater
ShPtr< Generatorext_generator
 
- Static Protected Attributes inherited from Starter
static const bool do_sorting_by_id = true
 

Detailed Description

StaBeads sets properties for beads using mapping (coarse-graining) scheme for each molecule.

An object of this class owns mapping(s) representing coarse-graining scheme(s). Each mapping describes how atoms in a molecule are allocated to beads. Different mapping schemes are acceptable for different molecular types. For each bead, its type and weighting factors of atoms belonging to the bead can be set.

About usage in Python, please see pybind/starters/py_sta_beads.

Definition at line 27 of file sta_beads.h.

Constructor & Destructor Documentation

◆ StaBeads() [1/2]

StaBeads::StaBeads ( const ElPtr el_mols,
const Vec< Json > &  scheme 
)

Constructor of StaBeads class for molecules all of whose type property are 1, or molecules all of which do not have the property.

Parameters
el_mols

A molecular Element object consisting of beads for which an Element object is created with this constructed object. This parameter is assigned to ext_generator.

Required property
  • atom-ids : array of integers

schemeList of Json (complex of dictionary and list) objects. Each Json object corresponds to each bead in a molecule, and contains three items: indices-in-mol is an array of zero-based index of atoms in the molecule, type is type of the bead, and weights is an array of floats for weighting factors of atoms. This parameter is stored in mol_type_to_abst_beads as a coarse-graining scheme for molecular type 1.

Definition at line 16 of file sta_beads.cpp.

◆ StaBeads() [2/2]

StaBeads::StaBeads ( const ElPtr el_mols,
const Map< int, Vec< Json >> &  schemes 
)

Constructor of StaBeads class for multiple molecular types.

Parameters
el_mols

A molecular Element object consisting of beads for which an Element object is created with this constructed object. This parameter is assigned to ext_generator.

Required property
  • atom-ids : array of integers

schemesDictionary from molecular type to list of Json (complex of dictionary and list) objects. Each Json object corresponds to each bead in a molecule of that type, and contains three items: indices-in-mol is an array of zero-based index of atoms in the molecule, type is type of the bead, and weights is an array of floats for weighting factors of atoms. This parameter is assigned to mol_type_to_abst_beads.

Definition at line 26 of file sta_beads.cpp.

Member Function Documentation

◆ check_mol_type_to_abst_beads()

std::pair< bool, bool > StaBeads::check_mol_type_to_abst_beads ( )
private

Check if mol_type_to_abst_beads correctly describes coarse-grain mapping schemes.

Returns
A pair of booleans: the first is whether type exists or not, the second is whether weights exists or not. Note that if at least one of Json objects in mol_type_to_abst_beads has type (or weights) property, all the other objects must have that property too.

Definition at line 36 of file sta_beads.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_impl()

void StaBeads::compute_impl ( Json data,
JsonToVoidFunc  check_required_keys,
JsonToBoolFunc  check_optional_keys 
)
overrideprotectedvirtual

This method overrides Updater::compute_impl.

Property to be added
  • id : integer
  • mol : integer
  • atom-ids : array of integers
  • type : integer (optional)
  • atom-weights : array of floats (optional)

Implements Updater.

Definition at line 105 of file sta_beads.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ mol_type_to_abst_beads

Map<int,Vec<Json> > StaBeads::mol_type_to_abst_beads
private

Coarse-grain mapping schemes for each molecular type. Description of coarse-graining is stored in a Map (dictionary) object from molecular type to a Vec (list) object of Json objects. Each Json object corresponds to each bead in a molecule of that type, and contains three items: indices-in-mol is an array of zero-based index of atoms in the molecule, type is type of the bead, and weights is an array of floats for weighting factors of atoms. The last two items are optional. Length of the two arrays, indices-in-mol and weights, should be the same with the number of atoms belonging to the bead.

Definition at line 41 of file sta_beads.h.


The documentation for this class was generated from the following files: