From bcfb6734f3aaee1a1e5c81e87af1492da4c8a405 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 7 May 2022 16:27:03 -0400 Subject: [PATCH] use average vertex distance from center as particle radius --- src/create_atoms.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 506b718ae6..084e746a54 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -856,6 +856,7 @@ int CreateAtoms::add_tricenter(const double vert[3][3], tagint molid, double rad const double r3 = MathExtra::len3(temp); const double rmin = MIN(MIN(r1, r2), r3); const double rmax = MAX(MAX(r1, r2), r3); + const double ravg = 1.0 / 3.0 * (r1 + r2 + r3); // if the triangle is too large, split it in half along the longest side and recurse // @@ -910,7 +911,7 @@ int CreateAtoms::add_tricenter(const double vert[3][3], tagint molid, double rad (center[1] < subhi[1]) && (center[2] >= sublo[2]) && (center[2] < subhi[2])) { atom->avec->create_atom(ntype, center); - if (atom->radius_flag) atom->radius[ilocal] = xlat * radiusscale; + if (atom->radius_flag) atom->radius[ilocal] = ravg * radiusscale; if (atom->molecule_flag) atom->molecule[ilocal] = molid; ++ilocal; }