ppap4lmp  0.7.2
AddChildPositions Class Reference

AddChildPositions adds relative positions of a child Element object to a parent Element object. More...

#include <add_child_positions.h>

Inheritance diagram for AddChildPositions:
Collaboration diagram for AddChildPositions:

Public Member Functions

 AddChildPositions (const ElPtr &elem, const Str &child_name_)
 Constructor of AddChildPositions class. More...
 
- Public Member Functions inherited from Adder
 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 Adder
virtual void compute_body (const ElPtr &elem, Json &data) override
 Compute properties and add 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 Attributes

Str child_name
 

Additional Inherited Members

- Protected Attributes inherited from Updater
ShPtr< Generatorext_generator
 

Detailed Description

AddChildPositions adds relative positions of a child Element object to a parent Element object.

An object of this class owns a child object as ext_generator, and is appended to a parent object using its Element::append_updater. The object of this class computes positions for the child object relative to a position for the parent object, and tehn appends them to an array belonging to the parent object. An example of child is an Element object containing data for atoms, and an example of parent* is an Element object containing data for molecules.

The terms child and parent are used because a parent object consists of a child object. In terms of time series, however, the child is created earlier than the parent.

About usage in Python, please see pybind::py_add_child_positions.

Definition at line 34 of file add_child_positions.h.

Constructor & Destructor Documentation

◆ AddChildPositions()

AddChildPositions::AddChildPositions ( const ElPtr elem,
const Str child_name_ 
)

Constructor of AddChildPositions class.

Parameters
elem

A child Element object. This parameter is assigned to ext_generator.

Required property
  • id : integer
  • xu : float
  • yu : float
  • zu : float

child_name_A string for naming the child object. This parameter is assigned to child_name.

Definition at line 17 of file add_child_positions.cpp.

Member Function Documentation

◆ compute_impl()

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

This method overrides Updater::compute_impl.

Property to be added
  • [child_name]-xs : array of floats
  • [child_name]-ys : array of floats
  • [child_name]-zs : array of floats
Required property
  • [child_name]-ids : array of integers
  • xu : float
  • yu : float
  • zu : float

Implements Updater.

Definition at line 27 of file add_child_positions.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ child_name

Str AddChildPositions::child_name
private

Name of child object stored as ext_generator. Key for property added to a parent object by this class is named as [child_name]-xs, [child_name]-ys and [child_name]-zs. The parent object is also required to have [child_name]-ids property.

Definition at line 42 of file add_child_positions.h.


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