ppap4lmp
0.7.2
|
ProThicknessProfile computes thickness profile of a film consisting of particles (can be atoms, beads, molecules...). More...
#include <pro_thickness_profile.h>
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... | |
![]() | |
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... | |
![]() | |
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< Json > | conditions |
Vec< ArrayXXd > | profiles |
Additional Inherited Members | |
![]() | |
int | n_generators |
Vec< ShPtr< Generator > > | generators |
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 of ProThicknessProfile class for a snapshot of simulation.
atoms | An Element object for particles (can be atoms, beads, molecules...) forming a film.
|
box | An Element object for a simulation box.
|
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.
Constructor of ProThicknessProfile class for multiple snapshots of simulation.
pairs | List 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.
|
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.
Get computation conditions (origin of computed area, grid width and the number of grads) used by this object as list of dictionary.
Definition at line 174 of file pro_thickness_profile.cpp.
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.
Definition at line 181 of file pro_thickness_profile.cpp.
|
overridevirtual |
Resize conditions and profiles.
Reimplemented from Processor.
Definition at line 140 of file pro_thickness_profile.cpp.
|
overrideprotectedvirtual |
Implementation of analysis using an element of generators.
index | An index in generators for a Generator object to be analyzed. |
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.
void ProThicknessProfile::set_grid | ( | int | nx_, |
int | ny_ | ||
) |
Specify the number of grids in the x and y directions.
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. |
Definition at line 148 of file pro_thickness_profile.cpp.
void ProThicknessProfile::set_offset | ( | double | offset_ | ) |
Specify the offset for thickness (height).
offset_ | Film thickness is calculated after subtracting this value from z coordinate of particles. This parameter is assigned to offset. |
Definition at line 158 of file pro_thickness_profile.cpp.
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, ... .
shift_half_ | A boolean, whether to shift the grid points or not (default is true ). This parameter is assigned to shift_half. |
Definition at line 166 of file pro_thickness_profile.cpp.
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.
|
private |
The number of grids in x direction.
Definition at line 36 of file pro_thickness_profile.h.
|
private |
The number of grids in y direction.
Definition at line 40 of file pro_thickness_profile.h.
|
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.
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.
|
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.