ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
This file contains everything needed to create a start-up configuration of (possibly charged) polymer chains with counterions and salt molecules, assigning velocities to the particles and cross-linking the polymers if necessary. More...
#include "polymer.hpp"
#include "BoxGeometry.hpp"
#include "cell_system/CellStructure.hpp"
#include "communication.hpp"
#include "constraints/Constraints.hpp"
#include "constraints/ShapeBasedConstraint.hpp"
#include "random.hpp"
#include "system/System.hpp"
#include <utils/Vector.hpp>
#include <utils/math/vec_rotate.hpp>
#include <boost/mpi/collectives/all_reduce.hpp>
#include <cmath>
#include <cstddef>
#include <functional>
#include <memory>
#include <numbers>
#include <optional>
#include <stdexcept>
#include <vector>
Go to the source code of this file.
Functions | |
template<class RNG > | |
static Utils::Vector3d | random_position (BoxGeometry const &box_geo, RNG &rng) |
template<class RNG > | |
static Utils::Vector3d | random_unit_vector (RNG &rng) |
static bool | is_valid_position (System::System const &system, Utils::Vector3d const &pos, std::vector< std::vector< Utils::Vector3d > > const &positions, BoxGeometry const &box_geo, double const min_distance, int const respect_constraints) |
Determines whether a given position pos is valid, i.e., it doesn't collide with existing or buffered particles, nor with existing constraints (if respect_constraints ). | |
std::vector< std::vector< Utils::Vector3d > > | draw_polymer_positions (System::System const &system, int const n_polymers, int const beads_per_chain, double const bond_length, std::vector< Utils::Vector3d > const &start_positions, double const min_distance, int const max_tries, int const use_bond_angle, double const bond_angle, int const respect_constraints, int const seed) |
Determines valid polymer positions and returns them. | |
This file contains everything needed to create a start-up configuration of (possibly charged) polymer chains with counterions and salt molecules, assigning velocities to the particles and cross-linking the polymers if necessary.
The corresponding header file is polymer.hpp.
Definition in file polymer.cpp.
std::vector< std::vector< Utils::Vector3d > > draw_polymer_positions | ( | System::System const & | system, |
int | n_polymers, | ||
int | beads_per_chain, | ||
double | bond_length, | ||
std::vector< Utils::Vector3d > const & | start_positions, | ||
double | min_distance, | ||
int | max_tries, | ||
int | use_bond_angle, | ||
double | bond_angle, | ||
int | respect_constraints, | ||
int | seed | ||
) |
Determines valid polymer positions and returns them.
system | particle system |
n_polymers | how many polymers to create |
beads_per_chain | monomers per chain |
bond_length | length of the bonds between two monomers |
start_positions | starting positions of each polymers |
min_distance | minimum distance between all particles |
max_tries | how often a monomer/polymer should be reset if current position collides with a previous particle |
use_bond_angle | whether to use the bond_angle argument |
bond_angle | desired bond-angle to be fixed |
respect_constraints | whether to respect constraints |
seed | seed for RNG |
Definition at line 143 of file polymer.cpp.
References System::System::box_geo, is_valid_position(), Random::mt19937(), random_position(), random_unit_vector(), Utils::vec_rotate(), and vector_product().
Referenced by ScriptInterface::Particles::Polymer::do_call_method().
|
static |
Determines whether a given position pos
is valid, i.e., it doesn't collide with existing or buffered particles, nor with existing constraints (if respect_constraints
).
system | the system containing the particles |
pos | the trial position in question |
positions | buffered positions to respect |
box_geo | Box geometry |
min_distance | threshold for the minimum distance between trial position and buffered/existing particles |
respect_constraints | whether to respect constraints |
Definition at line 86 of file polymer.cpp.
References System::System::cell_structure, comm_cart, System::System::constraints, BoxGeometry::folded_position(), and BoxGeometry::get_mi_vector().
Referenced by draw_polymer_positions().
|
static |
Definition at line 55 of file polymer.cpp.
References BoxGeometry::length().
Referenced by draw_polymer_positions().
|
static |
Definition at line 62 of file polymer.cpp.
References Utils::Vector< T, N >::norm().
Referenced by draw_polymer_positions().