ppap4lmp  0.7.2
ProThicknessProfile Class Reference

ProThicknessProfile computes thickness profile of a film consisting of particles (can be atoms, beads, molecules...). More...

#include <pro_thickness_profile.h>

Inheritance diagram for ProThicknessProfile:
Collaboration diagram for ProThicknessProfile:

Public Member Functions

 ProThicknessProfile (const ElPtr &atoms, const ElPtr &box)
 Constructor of ProThicknessProfile class for a snapshot of simulation. More...
 
 ProThicknessProfile (const Vec< std::pair< ElPtr, ElPtr >> &pairs)
 Constructor of ProThicknessProfile class for multiple snapshots of simulation. More...
 
virtual void prepare () override
 Resize conditions and profiles. More...
 
void set_grid (int nx_, int ny_)
 Specify the number of grids in the x and y directions. More...
 
void set_offset (double offset_)
 Specify the offset for thickness (height). More...
 
void shift_half_delta (bool shift_half_=true)
 Increment coordinates of the grid points by half the grid width. By default, grids in the x direction are set as x_0, x_0+dx, x_0+2*dx, ... , where x_0 is the minimum x coordinate in the simulation box and dx is the grid width. If this method is called without a parameter, the grids are set as x_0+0.5*dx, x_0+1.5*dx, x_0+2.5*dx, ... . More...
 
const Vec< Json > & get_conditions ()
 Get computation conditions (origin of computed area, grid width and the number of grads) used by this object as list of dictionary. More...
 
const Vec< ArrayXXd > & get_profiles ()
 Get a sequence of two-dimensional profile of film thickness as list of two-dimensional arrays. Row and column of each array is for the x and y direction, respectively. More...
 
- Public Member Functions inherited from Processor
 Processor ()=default
 Constructor of Processor class (default).
 
virtual void finish ()
 Finish analysis. More...
 
virtual bool run ()
 Run analysis using i th Generator object in generators, where i = i_generator. More...
 
void startup ()
 Startup this Processor object. More...
 

Protected Member Functions

virtual void run_impl (const int index) override
 Implementation of analysis using an element of generators. More...
 
- Protected Member Functions inherited from Processor
template<class GEN >
void register_generator (const ShPtr< GEN > &gen)
 
template<class GEN >
void register_generators (const Vec< ShPtr< GEN >> &gens)
 
virtual void use_generator_at (const int i)
 Call Generator::generate_data of i th Generator object in generators. More...
 
virtual void finish_using_generator_at (const int i)
 Call Generator::finish_using_generated_data of i* th Generator object in generators. More...
 

Private Attributes

int nx = 1
 
int ny = 1
 
bool shift_half = false
 
double offset = 0.0
 
Vec< Jsonconditions
 
Vec< ArrayXXdprofiles
 

Additional Inherited Members

- Protected Attributes inherited from Processor
int n_generators
 
Vec< ShPtr< Generator > > generators
 

Detailed Description

ProThicknessProfile computes thickness profile of a film consisting of particles (can be atoms, beads, molecules...).

An object of this class makes list of two-dimensional arrays: each array is a two-dimensional profile of film thickness for each snapshot of the simulation. Row and column of each array is for the x and y direction, respectively. The thickness is measured in the z direction.

Note that each particle is assumed to have a radius, and an excluded volume defined by the radius. Film thickness at point of (x, y) is defined as the highest z* coordinate inside excluded volume of any of the particles.

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

Definition at line 32 of file pro_thickness_profile.h.

Constructor & Destructor Documentation

◆ ProThicknessProfile() [1/2]

ProThicknessProfile::ProThicknessProfile ( const ElPtr atoms,
const ElPtr box 
)

Constructor of ProThicknessProfile class for a snapshot of simulation.

Parameters
atoms

An Element object for particles (can be atoms, beads, molecules...) forming a film.

Required property
  • x : float
  • y : float
  • z : float
  • radius : float

boxAn Element object for a simulation box.
Required property
  • lo_x : float
  • lo_y : float
  • hi_x : float
  • hi_y : float

A GenDict object is constructed taking the atoms and box, and then put into generators by register_generator.

Definition at line 13 of file pro_thickness_profile.cpp.

Here is the call graph for this function:

◆ ProThicknessProfile() [2/2]

ProThicknessProfile::ProThicknessProfile ( const Vec< std::pair< ElPtr, ElPtr >> &  pairs)

Constructor of ProThicknessProfile class for multiple snapshots of simulation.

Parameters
pairsList of pairs of two Element objects: the first object is for particles forming a film and the second object is for a simulation box. If each Element object has an array data, all the array should have the same length.
Required property (first)
  • x : float
  • y : float
  • z : float
  • radius : float
Required property (second)
  • lo_x : float
  • lo_y : float
  • hi_x : float
  • hi_y : float

GenDict objects are constructed taking each element of the pairs, and then put into generators by register_generators.

Definition at line 23 of file pro_thickness_profile.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ get_conditions()

const Vec< Json > & ProThicknessProfile::get_conditions ( )

Get computation conditions (origin of computed area, grid width and the number of grads) used by this object as list of dictionary.

Returns
conditions.

Definition at line 174 of file pro_thickness_profile.cpp.

Here is the caller graph for this function:

◆ get_profiles()

const Vec< ArrayXXd > & ProThicknessProfile::get_profiles ( )

Get a sequence of two-dimensional profile of film thickness as list of two-dimensional arrays. Row and column of each array is for the x and y direction, respectively.

Returns
profiles.

Definition at line 181 of file pro_thickness_profile.cpp.

Here is the caller graph for this function:

◆ prepare()

void ProThicknessProfile::prepare ( )
overridevirtual

Resize conditions and profiles.

Returns
None.

Reimplemented from Processor.

Definition at line 140 of file pro_thickness_profile.cpp.

◆ run_impl()

void ProThicknessProfile::run_impl ( const int  index)
overrideprotectedvirtual

Implementation of analysis using an element of generators.

Parameters
indexAn index in generators for a Generator object to be analyzed.
Returns
None.

To be compatible with multithreading computation, class members should not be modified in this method. If modification of some members is necessary, please consider defining them as Vec, and modifying only their i th element, where i = index.

I am sorry to say that the best documentation for this method is its source code...

Implements Processor.

Definition at line 39 of file pro_thickness_profile.cpp.

◆ set_grid()

void ProThicknessProfile::set_grid ( int  nx_,
int  ny_ 
)

Specify the number of grids in the x and y directions.

Parameters
nx_The number of grids in the x direction. This parameter is assigned to nx.
ny_The number of grids in the y direction. This parameter is assigned to ny.
Returns
None.

Definition at line 148 of file pro_thickness_profile.cpp.

Here is the caller graph for this function:

◆ set_offset()

void ProThicknessProfile::set_offset ( double  offset_)

Specify the offset for thickness (height).

Parameters
offset_Film thickness is calculated after subtracting this value from z coordinate of particles. This parameter is assigned to offset.
Returns
None.

Definition at line 158 of file pro_thickness_profile.cpp.

Here is the caller graph for this function:

◆ shift_half_delta()

void ProThicknessProfile::shift_half_delta ( bool  shift_half_ = true)

Increment coordinates of the grid points by half the grid width. By default, grids in the x direction are set as x_0, x_0+dx, x_0+2*dx, ... , where x_0 is the minimum x coordinate in the simulation box and dx is the grid width. If this method is called without a parameter, the grids are set as x_0+0.5*dx, x_0+1.5*dx, x_0+2.5*dx, ... .

Parameters
shift_half_A boolean, whether to shift the grid points or not (default is true). This parameter is assigned to shift_half.
Returns
None.

Definition at line 166 of file pro_thickness_profile.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ conditions

Vec<Json> ProThicknessProfile::conditions
private

Computation conditions (origin of computed area, grid width and the number of grads) used by this object are stored here. If the simulation box is unchanged during the simulation, every element of this member is identical.

Definition at line 63 of file pro_thickness_profile.h.

◆ nx

int ProThicknessProfile::nx = 1
private

The number of grids in x direction.

Definition at line 36 of file pro_thickness_profile.h.

◆ ny

int ProThicknessProfile::ny = 1
private

The number of grids in y direction.

Definition at line 40 of file pro_thickness_profile.h.

◆ offset

double ProThicknessProfile::offset = 0.0
private

Calculate film thickness after subtracting a value of this member from z coordinate of the particles. Default is 0.

Definition at line 56 of file pro_thickness_profile.h.

◆ profiles

Vec<ArrayXXd> ProThicknessProfile::profiles
private

Time series (if a simulation trajectory is used as an input) of two-dimensional profile of film thickness. Indices in this list corresponds those in generators.

Definition at line 69 of file pro_thickness_profile.h.

◆ shift_half

bool ProThicknessProfile::shift_half = false
private

Whether to shift grids at which film thickness is computed. If this member is false, grids in the x direction are set as x_0, x_0+dx, x_0+2*dx, ..., x_0+(nx-1)*dx, where x_0 is the minimum x coordinate in the simulation box and dx is the grid width. If this member is true, grids in the x direction are set as x_0+0.5*dx, x_0+1.5*dx, x_0+2.5*dx, ..., x_0+(nx-0.5)*dx. Default is false.

Definition at line 51 of file pro_thickness_profile.h.


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