38 double partArea = 0.0;
40 double VOL_partVol = 0.;
42 cs.
bond_loop([&partArea, &VOL_partVol, &box_geo,
45 if (p1.
mol_id() != molType)
60 auto const VOL_dn = VOL_norm.norm();
61 auto const VOL_hz = 1.0 / 3.0 * (p11[2] + p22[2] + p33[2]);
62 VOL_partVol -= VOL_A * VOL_norm[2] / VOL_dn * VOL_hz;
68 return {{partArea, VOL_partVol}};
74 double area = area_volume[0];
75 double VOL_volume = area_volume[1];
80 if (p1.
mol_id() != molType)
83 if (
auto const *iaparams = boost::get<OifGlobalForcesBond>(
93 auto const VOL_vv = (VOL_volume - iaparams->V0) / iaparams->V0;
95 auto const VOL_force =
96 (1.0 / 3.0) * iaparams->kv * VOL_vv * VOL_A * VOL_norm;
98 auto const h = (1. / 3.) * (p11 + p22 + p33);
100 auto const deltaA = (area - iaparams->A0_g) / iaparams->A0_g;
102 auto const m1 =
h - p11;
103 auto const m2 =
h - p22;
104 auto const m3 =
h - p33;
106 auto const m1_length = m1.norm();
107 auto const m2_length = m2.norm();
108 auto const m3_length = m3.norm();
110 auto const fac = iaparams->ka_g * VOL_A * deltaA /
111 (m1_length * m1_length + m2_length * m2_length +
112 m3_length * m3_length);
114 p1.
force() += fac * m1 + VOL_force;
115 partners[0]->force() += fac * m2 + VOL_force;
116 partners[1]->force() += fac * m3 + VOL_force;
Vector implementation and trait types for boost qvm interoperability.
__shared__ int pos[MAXDEPTH *THREADS5/WARPSIZE]
BondedInteractionsMap bonded_ia_params
Field containing the parameters of the bonded ia types.
Data structures for bonded interactions.
mapped_type at(key_type const &key) const
auto unfolded_position(Utils::Vector3d const &pos, Utils::Vector3i const &image_box) const
Unfold particle coordinates to image box.
Utils::Vector< T, 3 > get_mi_vector(const Utils::Vector< T, 3 > &a, const Utils::Vector< T, 3 > &b) const
Get the minimum-image vector between two coordinates.
A stripped-down version of std::span from C++17.
double area_triangle(const Vector3d &P1, const Vector3d &P2, const Vector3d &P3)
Computes the area of triangle between vectors P1,P2,P3, by computing the cross product P1P2 x P1P3 an...
Vector3d get_n_triangle(const Vector3d &P1, const Vector3d &P2, const Vector3d &P3)
Computes the normal vector of a triangle.
void add_oif_global_forces(Utils::Vector2d const &area_volume, int molType, BoxGeometry const &box_geo, CellStructure &cs)
Distribute the OIF global forces to all particles in the mesh.
Utils::Vector2d calc_oif_global(int molType, BoxGeometry const &box_geo, CellStructure &cs)
Calculate the OIF global force.
Routines to calculate the OIF global forces energy or/and and force for a particle triple (triangle f...
Describes a cell structure / cell system.
void bond_loop(BondKernel const &bond_kernel)
Bonded pair loop.
Struct holding all information for one particle.
auto const & image_box() const
auto const & mol_id() const
auto const & force() const