![]() |
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>
Include dependency graph for polymer.cpp:Go to the source code of this file.
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 is_valid_position(), Random::mt19937(), random_position(), random_unit_vector(), stream, 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 comm_cart, BoxGeometry::folded_position(), BoxGeometry::get_mi_vector(), and stream.
Referenced by draw_polymer_positions().
|
static |
Definition at line 55 of file polymer.cpp.
References BoxGeometry::length(), and stream.
Referenced by draw_polymer_positions().
|
static |
Definition at line 62 of file polymer.cpp.
References Utils::Vector< T, N >::norm(), and stream.
Referenced by draw_polymer_positions().