Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
246f27e
update MeshBonds
Mar 10, 2025
d5304be
remove group_size_half
Mar 11, 2025
306cb3f
creat neighbor lists
Mar 12, 2025
c5be9bd
first backbone of MeshUpdater
Mar 12, 2025
f6968b1
update parts of the mesh updater
Mar 13, 2025
e2c90bb
conseptualize edge flip
Mar 14, 2025
5da031a
first version of MeshUpdater
Mar 25, 2025
0fbaf1c
creat MeshForceCompute class
Mar 25, 2025
ac7defb
reverse MeshForceCmpute
Mar 25, 2025
855b9cb
rename precomputeParameters
Mar 25, 2025
8b062cb
add precomputeParameter to ForceCompute
Mar 25, 2025
80883ac
add all necesarry functions to Helfrich
Mar 26, 2025
fc1fb5b
prepare TriangleArea
Mar 26, 2025
b086575
prepare AreaConservationMeshForceCompute
Mar 26, 2025
85d2e83
update ForceCompute
Mar 26, 2025
fbdebfd
update BendingRigidity
Mar 26, 2025
d8b3488
compiling version
Mar 26, 2025
5a13772
write python updater object
Mar 26, 2025
0edc574
working Updater without forces list
Mar 28, 2025
8028ce4
working with force though integrator
Mar 30, 2025
ac36c12
add reorder group
Mar 31, 2025
51f616f
no write out
Mar 31, 2025
55df2db
fix dublicating edges when fliping
Apr 16, 2025
b50b713
working mesh dynamic updater with write out
Apr 21, 2025
ed7b4c1
fix another bug in mesh updater with write outs
Apr 21, 2025
60901ba
remove writers
Jun 19, 2025
5410ab2
force list in Meshupdater works
Jun 24, 2025
79030a5
random order
Jun 25, 2025
b332b14
allow to attach mesh forces to intefrator and meshupdater
Jun 25, 2025
a23c727
only one time in list for all syced lists except for mesh updater
Jun 25, 2025
779478d
Merge branch 'trunk-minor' into mesh_dynamic_bonding_v5
Jun 26, 2025
1728d1d
Merge branch 'trunk-minor' into mesh_dynamic_bonding_v5
Jun 28, 2025
3d22521
do not change if triangle area = 0
Jun 28, 2025
43d3294
add pytest
Jul 1, 2025
8b07e74
fix BendingRigidity
Jul 1, 2025
aff4a40
fix pytest
Jul 1, 2025
4557b23
fix BendingRigidity for small systems
Jul 1, 2025
8b3ef93
don't allow to flip to long edges
Jul 2, 2025
c91d6f8
add MeshUpdater to docs
Jul 2, 2025
deccd5d
improve pytests
Jul 2, 2025
551e5f9
update documentation and tests
Jul 3, 2025
cc4012f
add create_dynamical_bonding_updater
Jul 3, 2025
578bd54
fix docs
Jul 3, 2025
930307e
add meshdynamicalbonding.rst
Jul 3, 2025
873dedf
pre-commit
Jul 3, 2025
5997097
fix for loop
Jul 3, 2025
8e80bf5
turn off mesh updater pytests for mpi
Jul 3, 2025
522aa76
no MPI for mesh updater
Jul 7, 2025
6c5c825
improve already changed
Jul 7, 2025
9479b05
fix pickling test
Jul 7, 2025
53077bb
Merge branch 'trunk-minor' into mesh_dynamic_bonding_v5
Jul 21, 2025
365b27a
Merge branch 'trunk-minor' into mesh_dynamic_bonding_v5
Aug 25, 2025
e8b2185
establish MeshForceCompute class
Aug 25, 2025
dfe5361
change to MeshForceCompute
Aug 26, 2025
bd16220
change PotentialBond to MeshForceCompute
Aug 26, 2025
347b0d2
run pre-commit
Aug 26, 2025
7fb65c0
change all virtuals to override
Aug 26, 2025
9495dbd
change m_inv_T to m_inv_kT to make it more obvious that it is the tem…
Aug 26, 2025
cae3cd4
fix virtaul vs override
Aug 26, 2025
b7b80bc
rephrase attach exception for force list in updater
Aug 26, 2025
e86f5c5
override getRequestedCommFlags
Aug 26, 2025
5a1595e
remove wrong file
Aug 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions hoomd/BondedGroupData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ unsigned int BondedGroupData<group_size, Group, name, has_type_mapping>::addBond
m_nglobal++;

// notify observers
m_group_num_change_signal.emit();
notifyGroupReorder();
groupReorder();

return tag;
}
Expand Down Expand Up @@ -669,8 +668,7 @@ void BondedGroupData<group_size, Group, name, has_type_mapping>::removeBondedGro
m_nglobal--;

// notify observers
m_group_num_change_signal.emit();
notifyGroupReorder();
groupReorder();
}

/*! \param name Type name
Expand Down Expand Up @@ -1299,8 +1297,7 @@ void BondedGroupData<group_size, Group, name, has_type_mapping>::moveParticleGro
}

// notify observers
m_group_num_change_signal.emit();
notifyGroupReorder();
groupReorder();
}
#endif

Expand Down
6 changes: 6 additions & 0 deletions hoomd/BondedGroupData.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@ class BondedGroupData
m_groups_dirty = true;
}

virtual void groupReorder()
{
m_group_num_change_signal.emit();
notifyGroupReorder();
}

#ifdef ENABLE_MPI
//! Helper function to transfer bonded groups connected to a single particle
/*! \param tag Tag of particle that moves between domains
Expand Down
5 changes: 5 additions & 0 deletions hoomd/ForceCompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ class PYBIND11_EXPORT ForceCompute : public Compute
//! Computes the forces
virtual void compute(uint64_t timestep);

virtual bool checkSurrounding()
{
return false;
}

//! Total the potential energy
Scalar calcEnergySum();

Expand Down
93 changes: 93 additions & 0 deletions hoomd/MeshDefinition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,97 @@ void MeshDefinition::setTriangulationData(pybind11::dict triangulation)
#endif
}

void MeshDefinition::createMeshNeighborhood()
{
unsigned int len_triang = m_meshtriangle_data->getNGlobal();
GPUArray<uint3> neigh_to_triag(len_triang, m_sysdef->getParticleData()->getExecConf());
m_neigh_to_triag.swap(neigh_to_triag);

unsigned int len_bond = m_meshbond_data->getNGlobal();
GPUArray<uint2> neigh_to_bond(len_bond, m_sysdef->getParticleData()->getExecConf());
m_neigh_to_bond.swap(neigh_to_bond);

ArrayHandle<uint2> h_neigh_to_bond(m_neigh_to_bond,
access_location::host,
access_mode::overwrite);

ArrayHandle<uint3> h_neigh_to_triag(m_neigh_to_triag,
access_location::host,
access_mode::overwrite);

ArrayHandle<typename MeshBond::members_t> h_bonds(m_meshbond_data->getMembersArray(),
access_location::host,
access_mode::read);

ArrayHandle<typename Angle::members_t> h_triangles(m_meshtriangle_data->getMembersArray(),
access_location::host,
access_mode::read);

std::vector<uint2> bonds(3);

unsigned int bond_length = m_meshbond_data->getNGlobal();

for (unsigned int i = 0; i < bond_length; ++i)
{
h_neigh_to_bond.data[i] = make_uint2(bond_length, bond_length);
}

for (unsigned int i = 0; i < m_meshtriangle_data->getNGlobal(); i++)
{
const typename Angle::members_t& triangle = h_triangles.data[i];

if (triangle.tag[0] < triangle.tag[1])
bonds[0] = make_uint2(triangle.tag[0], triangle.tag[1]);
else
bonds[0] = make_uint2(triangle.tag[1], triangle.tag[0]);

if (triangle.tag[1] < triangle.tag[2])
bonds[1] = make_uint2(triangle.tag[1], triangle.tag[2]);
else
bonds[1] = make_uint2(triangle.tag[2], triangle.tag[1]);

if (triangle.tag[0] < triangle.tag[2])
bonds[2] = make_uint2(triangle.tag[0], triangle.tag[2]);
else
bonds[2] = make_uint2(triangle.tag[2], triangle.tag[0]);

unsigned int counter = 0;
std::vector<unsigned int> t_idx;
std::vector<bool> b_done(bond_length);

for (unsigned int j = 0; j < bond_length; ++j)
b_done[j] = false;

for (unsigned int j = 0; j < bond_length; ++j)
{
if (b_done[j])
continue;
const typename MeshBond::members_t& meshbond = h_bonds.data[j];
for (unsigned int k = 0; k < 3; ++k)
{
if (bonds[k].x == meshbond.tag[0] && bonds[k].y == meshbond.tag[1])
{
t_idx.push_back(j);
h_neigh_to_bond.data[j].y = i;
if (h_neigh_to_bond.data[j].x != bond_length)
b_done[j] = true;
else
h_neigh_to_bond.data[j].x = i;
counter++;
break;
}
}
if (counter == 3)
{
h_neigh_to_triag.data[i].x = t_idx[0];
h_neigh_to_triag.data[i].y = t_idx[1];
h_neigh_to_triag.data[i].z = t_idx[2];
break;
}
}
}
}

namespace detail
{
void export_MeshDefinition(pybind11::module& m)
Expand All @@ -153,6 +244,8 @@ void export_MeshDefinition(pybind11::module& m)
.def(pybind11::init<std::shared_ptr<SystemDefinition>, unsigned int>())
.def("getMeshTriangleData", &MeshDefinition::getMeshTriangleData)
.def("getMeshBondData", &MeshDefinition::getMeshBondData)
.def("getNeighToTriag", &MeshDefinition::getNeighToTriag)
.def("getNeighToBond", &MeshDefinition::getNeighToBond)
.def("getBondData", &MeshDefinition::getBondData)
.def("setTypes", &MeshDefinition::setTypes)
.def("getSize", &MeshDefinition::getSize)
Expand Down
18 changes: 16 additions & 2 deletions hoomd/MeshDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ class PYBIND11_EXPORT MeshDefinition
return m_globalN;
}

const GPUArray<uint2>& getNeighToBond() const
{
return m_neigh_to_bond;
}

const GPUArray<uint3>& getNeighToTriag() const
{
return m_neigh_to_triag;
}

void setTypes(pybind11::list types);

BondData::Snapshot getBondData();
Expand All @@ -100,12 +110,16 @@ class PYBIND11_EXPORT MeshDefinition

void setTriangulationData(pybind11::dict triangulation);

void createMeshNeighborhood();

private:
GPUArray<unsigned int> m_globalN;
std::shared_ptr<SystemDefinition>
m_sysdef; //!< System definition later needed for dynamic bonding
std::shared_ptr<SystemDefinition> m_sysdef; //!< System definition
std::shared_ptr<MeshBondData> m_meshbond_data; //!< Bond data for the mesh
std::shared_ptr<TriangleData> m_meshtriangle_data; //!< Triangle data for the mesh
//
GPUArray<uint2> m_neigh_to_bond; //!< triangle ids corresponding to bond
GPUArray<uint3> m_neigh_to_triag; //!< bond ids corresponding to triangle
};

namespace detail
Expand Down
Loading
Loading