Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
9fa56fb
Add warning to check if particles have no mass
mzbush Mar 19, 2025
231af6b
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
ea21194
Set warnings flag to false in constructor
mzbush Mar 20, 2025
51c4124
Add warning about central particle interacting
mzbush Mar 20, 2025
247b787
Stop warning check early if both warnings trigger
mzbush Mar 20, 2025
624cd25
Add beginRigidBodyCollision method
mzbush Mar 20, 2025
1cfa27b
Add mpcd warning pytest
mzbush Mar 20, 2025
1260ec8
Add finishRigidBodyCollision
mzbush Mar 20, 2025
28969aa
Remove collision warning pytest
mzbush Mar 20, 2025
f018fde
Do not apply central particle vel change to itself
mzbush Mar 20, 2025
b263749
Add to do comment for finishRigidBodyCollision
mzbush Mar 20, 2025
bf87d74
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
df81706
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
cea4b47
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
83bbaff
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
d18048a
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
51deda4
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
437def0
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
1060ec6
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
311eded
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
80a95b3
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
a660e79
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
cf50b72
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
633b933
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 20, 2025
fead6da
Resize m_initial_velocity in collide
mzbush Mar 20, 2025
66eaca1
Accumulate constituent momenta change in arrays
mzbush Mar 26, 2025
880fd1f
Update central particles with accumulated momenta
mzbush Mar 26, 2025
c03aaed
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
7ea500a
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
44eb481
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
54a4865
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
27c19a4
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
de04ac3
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
80c99a2
Rename accumulated momentum variables
mzbush Mar 27, 2025
7061fd2
Use MPI_Reduce while checking collision warnings
mzbush Mar 27, 2025
7aa102c
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 27, 2025
e6f4f30
Use MPI_Allreduce for collision warnings
mzbush Mar 27, 2025
f623a11
Split finishRigidBodyCollision into two methods
mzbush Mar 27, 2025
3be2187
Add pytest for rigid body collision
mzbush Mar 27, 2025
81e4a8e
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 28, 2025
af9694f
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 28, 2025
f42effa
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 28, 2025
885c8bd
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 28, 2025
6e741f5
Update hoomd/mpcd/CollisionMethod.h
mzbush Mar 28, 2025
a4f8a66
Update hoomd/mpcd/CollisionMethod.h
mzbush Mar 28, 2025
e702511
Resolve typing and name changes
mzbush Mar 28, 2025
19533db
Add comments for angmom quaternion conversion
mzbush Mar 28, 2025
ccc2fbf
Forward rigid bodies to CollisionMethod
mzbush Mar 28, 2025
731d59b
Check rigid bodies exist for rigid body collision
mzbush Mar 28, 2025
a808829
Edit pytest to ensure no position update
mzbush Mar 28, 2025
df629db
Remove NOT_LOCAL check for central particle index
mzbush Mar 28, 2025
1ca84ee
Add pytest for conservation of linear momentum
mzbush Mar 28, 2025
5ebe25f
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
4f22afb
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
3c555e4
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
552f663
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
d351ea7
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
39d72b0
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
24d9faf
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
9d70c3b
Update hoomd/mpcd/CollisionMethod.cc
mzbush Mar 31, 2025
5e096b8
Change method name to transferRigidBodyMomenta
mzbush Mar 31, 2025
67295ae
Add default initialization for accumulation arrays
mzbush Mar 31, 2025
660d863
Ensure presence of rigid body for momenta transfer
mzbush Mar 31, 2025
31daa4f
Move setRigid override in mpcd Integrator
mzbush Mar 31, 2025
347806b
Zero out angmom change where inertia is zero
mzbush Mar 31, 2025
7d4d4cb
Have linear momentum test for both collision kinds
mzbush Mar 31, 2025
c686d4c
Correct space to body rotation
mzbush Mar 31, 2025
950c407
Fix displacement across images
mzbush Mar 31, 2025
0e8e2ae
Update hoomd/mpcd/CollisionMethod.cc
mzbush Apr 1, 2025
166bcc6
Update hoomd/mpcd/CollisionMethod.cc
mzbush Apr 1, 2025
0c60d8f
Rename updated_angmom to angmom
mzbush Apr 1, 2025
a9ee36a
Add linear momentum pytest for periodic boundary
mzbush Apr 1, 2025
9f68b57
Combine rigid linear momentum pytests
mzbush Apr 1, 2025
a22c3cb
Parametrize rigid body for collision pytest
mzbush Apr 1, 2025
c83ef18
Change how expected central velocity is calculated
mzbush Apr 1, 2025
d6d5532
Test more rigid bodies in test_collide.py
mzbush Apr 1, 2025
9634a51
Streamline linear momentum conservation check
mzbush Apr 2, 2025
d7d4096
Add angular momentum test
mzbush Apr 2, 2025
d049240
Add call to updateCompositeParticles to collide
mzbush Apr 2, 2025
99387f0
Declare GPU versions of rigid collision methods
mzbush Apr 2, 2025
66bc26f
Create CollisionMethod.cuh
mzbush Apr 2, 2025
0c28428
Add parameters to gpu_check_collision_warnings
mzbush Apr 2, 2025
1e9236b
Create CollisionMethod.cu
mzbush Apr 2, 2025
95dfc4c
Update hoomd/mpcd/CollisionMethod.cc
mzbush Apr 3, 2025
71c918f
Update hoomd/mpcd/CollisionMethod.cuh
mzbush Apr 3, 2025
cf797a1
Update hoomd/mpcd/CollisionMethod.h
mzbush Apr 3, 2025
b20f302
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 3, 2025
e8d7ad9
Update hoomd/mpcd/CollisionMethod.cuh
mzbush Apr 3, 2025
d68eabc
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 3, 2025
b4a0571
Remove checkCollisionWarningsGPU
mzbush Apr 3, 2025
db637e9
Move header declaration in mpcd Integrator.h
mzbush Apr 3, 2025
378b167
Implement rigid collision driver functions
mzbush Apr 3, 2025
f0d12e6
Call store velocity driver function
mzbush Apr 3, 2025
43e0496
Fix kernel input variable types
mzbush Apr 3, 2025
ad72a7e
Add CollisionMethod GPU files to CMakeLists.txt
mzbush Apr 3, 2025
7762728
Add call to accumulate momenta driver function
mzbush Apr 3, 2025
622085d
Add call to transfer momenta driver function
mzbush Apr 3, 2025
2842cb2
Disable grid shift in rigid collide pytest
mzbush Apr 3, 2025
903c33a
Add test for constituent velocities after collide
mzbush Apr 3, 2025
a4f5b1c
Add rigid collide pytests with free particle
mzbush Apr 3, 2025
0845034
Add rigid collision tests with initial angmom
mzbush Apr 3, 2025
e8a8c17
Implement rigid collision kernel functions
mzbush Apr 3, 2025
d6dea77
Update hoomd/mpcd/CollisionMethod.cc
mzbush Apr 4, 2025
3575623
Update hoomd/mpcd/CollisionMethod.cc
mzbush Apr 4, 2025
036c23c
Update hoomd/mpcd/CollisionMethod.cuh
mzbush Apr 4, 2025
620eee5
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 4, 2025
643d932
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 4, 2025
b0f9508
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 4, 2025
d8cf3c8
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 4, 2025
984df9f
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 4, 2025
30d953a
Update hoomd/mpcd/CollisionMethod.cu
mzbush Apr 4, 2025
a8d5bcc
Fix accumulate_rigid_body_momenta variable typing
mzbush Apr 4, 2025
36e1cdd
Do not create unnecessary size variables
mzbush Apr 14, 2025
0a400f4
Momentum accumulation size of local and ghost
mzbush Apr 14, 2025
9a818b9
Add declarations of communicating functions
mzbush Apr 14, 2025
38fb820
Expose Communicator's plan and reverse plan
mzbush Apr 18, 2025
f290374
Make test boxes bigger for domain decomposition
mzbush Apr 18, 2025
645f358
Add copy buffers for momentum arrays
mzbush Apr 18, 2025
82fa384
Merge branch 'trunk-minor' into rigid-body-collision
mzbush May 1, 2025
ec299c7
Standardize variable naming in collide pytests
mzbush May 1, 2025
72ba54d
Rethermostat SRD in pytest
mzbush May 1, 2025
e0cc5b1
Copy momentum data to buffers
mzbush May 2, 2025
68e452e
Revert "Expose Communicator's plan and reverse plan"
mzbush May 6, 2025
8b9839f
Remove incomplete communication in CollisionMethod
mzbush May 6, 2025
0a2ce01
Merge branch 'trunk-minor' into rigid-body-collision
mzbush May 23, 2025
37a9af5
Update hoomd/mpcd/CollisionMethod.h
mzbush May 23, 2025
d586324
Remove copybuf from CollisionMethod
mzbush May 23, 2025
17d2eb4
Combine tests of rigid and free particle collision
mzbush May 23, 2025
bb4ef75
Change paramter for rigid free collision test
mzbush May 23, 2025
b389c0f
Rename body frame angular momentum variable
mzbush Jun 5, 2025
995aed3
Revert "Rename body frame angular momentum variable"
mzbush Jun 6, 2025
b15ae96
Add thermalizeConstituentParticles function
mzbush Jun 11, 2025
ce57a45
Calculate net linear momentum
mzbush Jun 11, 2025
dfda0ed
Calculate net linear velocity
mzbush Jun 11, 2025
2134da3
Add net velocity to AltVelocities
mzbush Jun 11, 2025
0c1bd89
Add thermalize velocity to constituent particles
mzbush Jun 11, 2025
12fd6c0
Fix incorrect com position in rigid collide test
mzbush Jun 12, 2025
2428d4b
Merge branch 'rigid-body-collision' into thermalize-constituents
mzbush Jun 12, 2025
f122021
Modify thermal velocity net angmom compute
mzbush Jun 12, 2025
a123ec8
Fix com issue
mzbush Jun 12, 2025
c30b1b3
Merge branch 'rigid-body-collision' into thermalize-constituents
mzbush Jun 12, 2025
b0f843f
Fix incorrect angular momentum calculation
mzbush Jun 12, 2025
46f4870
Create thermalize constituent GPU functions
mzbush Jun 13, 2025
e2c0a4d
Add kernels to GPU
mzbush Jun 13, 2025
8c72bd9
Implement GPU kernels
mzbush Jun 13, 2025
3a5e879
Reset tuners for thermalizing
mzbush Jun 13, 2025
3e8a31a
Fix tuners applied to wrong function
mzbush Jun 13, 2025
2c33215
Uncomment apply_thermalized_velocity_vectors
mzbush Jun 13, 2025
603ea01
Fix cuda errors
mzbush Jun 13, 2025
1a2aa20
Uncomment apply thermal vectors
mzbush Jun 13, 2025
0e1d493
Add set that collects rigid body types
mzbush Jun 17, 2025
7df4fa9
Add temperature as param to collision base class
mzbush Jun 20, 2025
d69b161
Undo reverse thermalize store initial order
mzbush Jun 20, 2025
6b4df9e
Combine GPU thermalizing constituent functions
mzbush Jun 20, 2025
b7d67c6
Thermalize consituents before storing velocities
mzbush Jun 20, 2025
49204e1
Implement center of mass rigid body check
mzbush Jun 20, 2025
625c33f
Fix invalid_center_of_mass typo
mzbush Jun 20, 2025
309d07e
Fix segmentation fault
mzbush Jun 20, 2025
746aef6
Add center mass == sum of constituent mass check
mzbush Jun 24, 2025
cbe39cc
Throw errors in collision if rigid checks fail
mzbush Jun 25, 2025
27af20f
Merge branch 'trunk-minor' into rigid-body-collision
mzbush Jun 25, 2025
e188119
Merge branch 'trunk-minor' into rigid-body-collision
mzbush Jul 1, 2025
00c1fdd
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 7, 2025
07cb1fb
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 7, 2025
0b6ae06
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 7, 2025
ece29b8
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 7, 2025
8488f61
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 7, 2025
0fbfa62
Fix typo in comment
mzbush Jul 7, 2025
cd8baf4
Move collision warnings run check
mzbush Jul 7, 2025
685598c
Change zero mass warning into error
mzbush Jul 7, 2025
83e9467
Add requireTemperature
mzbush Jul 7, 2025
7dc28c9
Update hoomd/mpcd/ATCollisionMethod.cc
mzbush Jul 7, 2025
00916a5
Merge branch 'rigid-body-collision' of github.com:mzbush/hoomd-blue i…
mzbush Jul 7, 2025
e6a5fae
Add kT as a default base parameter
mzbush Jul 7, 2025
9339500
Remove kT definition from SRDCollisionMethod
mzbush Jul 7, 2025
382737a
Add semicolon
mzbush Jul 7, 2025
fbb292f
Add checkRigidAutotuners
mzbush Jul 7, 2025
9b728f1
Add m_rigid_center to CPU ForceComposite
mzbush Jul 7, 2025
2d8f078
Update number of local rigid bodies
mzbush Jul 7, 2025
6393778
Use rigid_center in CollisionMethod
mzbush Jul 7, 2025
dcb619c
Add lookup_center getter
mzbush Jul 8, 2025
cafd04d
Use lookup_center in CollisionMethod on CPU
mzbush Jul 8, 2025
9592297
Add lookup center to draw thermal velocities GPU
mzbush Jul 8, 2025
5f475e5
Remove variables inherited by ForceComposite
mzbush Jul 8, 2025
3b62046
Use lookup_center for CollisionMethod GPU
mzbush Jul 8, 2025
20c9cce
Update hoomd/md/ForceComposite.h
mzbush Jul 15, 2025
ccf6f01
Update hoomd/md/ForceComposite.h
mzbush Jul 15, 2025
2a6cbf8
Update hoomd/md/ForceCompositeGPU.h
mzbush Jul 15, 2025
e97844e
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 15, 2025
c9fc745
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 15, 2025
350b7c1
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 15, 2025
5cbe5cd
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 15, 2025
570e531
Update hoomd/md/ForceComposite.cc
mzbush Jul 15, 2025
e1df5af
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 15, 2025
4d93d0f
Update hoomd/md/ForceComposite.cc
mzbush Jul 15, 2025
533ad70
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 15, 2025
a0792b5
Call requireTemperature in ATCollisionMethod
mzbush Jul 15, 2025
f6634ef
Fix typo
mzbush Jul 15, 2025
8318679
Add and remove autotuners in checkRigidAutotuners
mzbush Jul 15, 2025
f770fed
Move thermostat error to collide
mzbush Jul 15, 2025
75473f4
Clean up checkRigidAutotuners
mzbush Jul 15, 2025
6e8368b
Add to Counter for thermalizing constituents RNG
mzbush Jul 15, 2025
2f24c52
Shorten checks if particle is in rigid body
mzbush Jul 15, 2025
ddf82cf
Rearrange methods to reflect order of steps
mzbush Jul 15, 2025
10f6902
Merge branch 'trunk-minor' into rigid-body-collision
mzbush Jul 18, 2025
94ec407
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
7715455
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
f9e8d16
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
1b1376c
Update hoomd/md/ForceComposite.cc
mzbush Jul 29, 2025
a840211
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
7cbbd1a
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
7c08417
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
cb7f27b
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
eaf48f0
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
ae5d789
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
45a18ac
Update hoomd/mpcd/CollisionMethod.cc
mzbush Jul 29, 2025
b019a3b
Rename new_autotuners to rigid_autotuners
mzbush Jul 29, 2025
94c22d1
Remove postfix increment
mzbush Jul 29, 2025
9dc9918
Update documentation on checkCollisionWarnings
mzbush Jul 29, 2025
12a4b19
Reorder protected variables
mzbush Jul 29, 2025
cb6ad0b
Split thermalize constituents into two parts
mzbush Jul 29, 2025
3435b25
Merge branch 'trunk-minor' into rigid-body-collision
mzbush Aug 8, 2025
161de25
Update hoomd/md/ForceComposite.cc
mzbush Aug 13, 2025
23e2ab1
Rearrange protected and variable in ForceComposite
mzbush Aug 13, 2025
6e19611
Remove empty rigid_types check
mzbush Aug 13, 2025
a6f7f57
Update hoomd/mpcd/CollisionMethod.cc
mzbush Aug 13, 2025
4976b69
Update hoomd/mpcd/CollisionMethod.cc
mzbush Aug 13, 2025
4bf0355
Update hoomd/mpcd/CollisionMethod.cc
mzbush Aug 13, 2025
d30fe94
Update hoomd/mpcd/CollisionMethod.cc
mzbush Aug 13, 2025
da51135
Update hoomd/mpcd/CollisionMethod.cc
mzbush Aug 13, 2025
e3c1ee1
Add const qualifiers
mzbush Aug 13, 2025
aed2094
Rearrange protected functions in CollisionMethod
mzbush Aug 13, 2025
8875814
Update hoomd/mpcd/collide.py
mzbush Aug 13, 2025
3d1a81c
Update hoomd/mpcd/collide.py
mzbush Aug 13, 2025
3844af7
Use keyword arguments in collide
mzbush Aug 13, 2025
87975e9
Parametrize collision mass error tests
mzbush Aug 14, 2025
33d42b3
Parametrize all collide error tests
mzbush Aug 14, 2025
f11e8c6
Merge branch 'trunk-minor' into rigid-body-collision
mzbush Aug 15, 2025
26e10a8
Fix array access error
mzbush Aug 15, 2025
de14ad1
Throw error using MPI with MPCD and rigid bodies
mzbush Sep 30, 2025
13a766b
Merge branch 'trunk-minor' into rigid-body-collision
mzbush Sep 30, 2025
e4e9d90
Fix collision docstring to inherit kT
mzbush Sep 30, 2025
9231f86
Update docstring for rigid body support in MPCD
mzbush Sep 30, 2025
2250bfc
Edit word
mzbush Sep 30, 2025
7280fb8
Add rigid body requirements to collision docstring
mzbush Sep 30, 2025
a08f608
Add test for constituent not in collision
mzbush Sep 30, 2025
33973b4
Add changes to change log
mzbush Sep 30, 2025
86d49ca
Edit changelog
mzbush Oct 1, 2025
2d0b83e
Mark mpcd rigid pytests as serial
mzbush Oct 1, 2025
9428e38
Fix collision method kT code example
mzbush Oct 1, 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
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Change Log
5.x
---

5.5.0 (not released yet)
^^^^^^^^^^^^^^^^^^^^^^^^^^

*Added*

* Implemented rigid body compatibility with MPCD without MPI
(`#2001 <https://github.com/glotzerlab/hoomd-blue/pull/2001>`__).

5.4.0 (2025-09-26)
^^^^^^^^^^^^^^^^^^^^

Expand Down
45 changes: 45 additions & 0 deletions hoomd/md/ForceComposite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ ForceComposite::ForceComposite(std::shared_ptr<SystemDefinition> sysdef)
h_body_len.data[i] = 0;
}

GPUVector<unsigned int> rigid_center(m_exec_conf);
m_rigid_center.swap(rigid_center);

GPUVector<unsigned int> lookup_center(m_exec_conf);
m_lookup_center.swap(lookup_center);

m_d_max.resize(m_pdata->getNTypes(), Scalar(0.0));
m_d_max_changed.resize(m_pdata->getNTypes(), false);

Expand Down Expand Up @@ -1048,6 +1054,45 @@ void ForceComposite::updateCompositeParticles(uint64_t timestep)
}
}

void ForceComposite::findRigidCenters()
{
ArrayHandle<unsigned int> h_tag(m_pdata->getTags(), access_location::host, access_mode::read);
ArrayHandle<unsigned int> h_rtag(m_pdata->getRTags(), access_location::host, access_mode::read);
ArrayHandle<unsigned int> h_body(m_pdata->getBodies(),
access_location::host,
access_mode::read);

m_rigid_center.resize(m_pdata->getN() + m_pdata->getNGhosts());
m_lookup_center.resize(m_pdata->getN() + m_pdata->getNGhosts());
ArrayHandle<unsigned int> h_rigid_center(m_rigid_center,
access_location::host,
access_mode::overwrite);
ArrayHandle<unsigned int> h_lookup_center(m_lookup_center,
access_location::host,
access_mode::overwrite);
unsigned int num_centers = 0;
const unsigned int n_particles_local = m_pdata->getN() + m_pdata->getNGhosts();
for (unsigned int idx = 0; idx < n_particles_local; ++idx)
{
unsigned int lookup_center = NO_BODY;

// if particle is in a rigid body, find its center
const unsigned int central_tag = h_body.data[idx];
if (central_tag < MIN_FLOPPY)
{
lookup_center = h_rtag.data[central_tag];
// also record rigid particles that are centers
if (lookup_center == idx)
{
h_rigid_center.data[num_centers++] = lookup_center;
}
}

h_lookup_center.data[idx] = lookup_center;
}
m_n_rigid = num_centers;
}

namespace detail
{
void export_ForceComposite(pybind11::module& m)
Expand Down
69 changes: 69 additions & 0 deletions hoomd/md/ForceComposite.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,56 @@ class PYBIND11_EXPORT ForceComposite : public MolecularForceCompute
return m_n_free_particles_global;
}

/// Get constituent particle types per type id
const GPUArray<unsigned int>& getBodyTypes() const
{
return m_body_types;
}

/// Get constituent particle offsets per type id
const GPUArray<Scalar3>& getBodyOffsets() const
{
return m_body_pos;
}

/// Get constituent particle orientations per type id
const GPUArray<Scalar4>& getBodyOrientations() const
{
return m_body_orientation;
}

/// Get length of body per type id
const GPUArray<unsigned int>& getBodyLengths() const
{
return m_body_len;
}

/// Get body parameter indexer
const Index2D& getBodyIndexer()
{
return m_body_idx;
}

//! Get rigid centers
GPUVector<unsigned int>& getRigidCenters()
{
checkParticlesSorted();
return m_rigid_center;
}

//! Get lookup centers
GPUVector<unsigned int>& getLookupCenters()
{
checkParticlesSorted();
return m_lookup_center;
}

//! Get number of local rigid bodies
const unsigned int getNLocal() const
{
return m_n_rigid;
}

protected:
bool m_bodies_changed; //!< True if constituent particles have changed
bool m_particles_added_removed; //!< True if particles have been added or removed
Expand All @@ -216,6 +266,10 @@ class PYBIND11_EXPORT ForceComposite : public MolecularForceCompute
std::vector<Scalar> m_d_max; //!< Maximum body diameter per constituent particle type
std::vector<bool> m_d_max_changed; //!< True if maximum body diameter changed (per type)

unsigned int m_n_rigid; //!< Number of rigid bodies on the local rank.
GPUVector<unsigned int> m_rigid_center; //!< Local particle indices of all central particles
GPUVector<unsigned int> m_lookup_center; //!< Lookup particle index -> central particle index

#ifdef ENABLE_MPI
/// The system's communicator.
std::shared_ptr<Communicator> m_comm;
Expand All @@ -227,6 +281,21 @@ class PYBIND11_EXPORT ForceComposite : public MolecularForceCompute
m_particles_added_removed = true;
}

//! Helper function to check if particles have been sorted and rebuild indices if necessary
virtual void checkParticlesSorted()
{
if (m_rebuild_molecules)
// identify center particles for use in GPU kernel
findRigidCenters();

// Must be called second since the method sets m_rebuild_molecules
// to false if it is true.
MolecularForceCompute::checkParticlesSorted();
}

//! Helper kernel to sort rigid bodies by their center particles
virtual void findRigidCenters();

/// Return the requested minimum ghost layer width for a body's central particle.
virtual Scalar requestBodyGhostLayerWidth(unsigned int type, Scalar* h_r_ghost);

Expand Down
18 changes: 0 additions & 18 deletions hoomd/md/ForceCompositeGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ class PYBIND11_EXPORT ForceCompositeGPU : public ForceComposite
//! Helper kernel to sort rigid bodies by their center particles
virtual void findRigidCenters();

//! Helper function to check if particles have been sorted and rebuild indices if necessary
virtual void checkParticlesSorted()
{
if (m_rebuild_molecules)
// identify center particles for use in GPU kernel
findRigidCenters();

// Must be called second since the method sets m_rebuild_molecules
// to false if it is true.
MolecularForceCompute::checkParticlesSorted();
}

/// Autotuner for block size and threads per body.
std::shared_ptr<Autotuner<2>> m_tuner_force;

Expand All @@ -67,12 +55,6 @@ class PYBIND11_EXPORT ForceCompositeGPU : public ForceComposite
std::shared_ptr<Autotuner<1>> m_tuner_update;

GPUArray<uint2> m_flag; //!< Flag to read out error condition

/// Number of rigid bodies on the local rank.
unsigned int m_n_rigid;

GPUVector<unsigned int> m_rigid_center; //!< Contains particle indices of all central particles
GPUVector<unsigned int> m_lookup_center; //!< Lookup particle index -> central particle index
};

} // end namespace md
Expand Down
2 changes: 1 addition & 1 deletion hoomd/md/IntegratorTwoStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class PYBIND11_EXPORT IntegratorTwoStep : public Integrator
return m_rigid_bodies;
}

void setRigid(std::shared_ptr<ForceComposite> new_rigid)
virtual void setRigid(std::shared_ptr<ForceComposite> new_rigid)
{
m_rigid_bodies = new_rigid;
}
Expand Down
9 changes: 4 additions & 5 deletions hoomd/mpcd/ATCollisionMethod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ mpcd::ATCollisionMethod::ATCollisionMethod(std::shared_ptr<SystemDefinition> sys
uint64_t period,
int phase,
std::shared_ptr<Variant> T)
: mpcd::CollisionMethod(sysdef, cur_timestep, period, phase), m_T(T)
: mpcd::CollisionMethod(sysdef, cur_timestep, period, phase)
{
setTemperature(T);
requireTemperature();
m_exec_conf->msg->notice(5) << "Constructing MPCD AT collision method" << std::endl;
}

Expand Down Expand Up @@ -278,10 +280,7 @@ void export_ATCollisionMethod(pybind11::module& m)
uint64_t,
uint64_t,
int,
std::shared_ptr<Variant>>())
.def_property("kT",
&mpcd::ATCollisionMethod::getTemperature,
&mpcd::ATCollisionMethod::setTemperature);
std::shared_ptr<Variant>>());
}
} // namespace detail
} // namespace mpcd
Expand Down
13 changes: 0 additions & 13 deletions hoomd/mpcd/ATCollisionMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,9 @@ class PYBIND11_EXPORT ATCollisionMethod : public mpcd::CollisionMethod

void setCellList(std::shared_ptr<mpcd::CellList> cl) override;

//! Get the temperature
std::shared_ptr<Variant> getTemperature() const
{
return m_T;
}

//! Set the temperature
void setTemperature(std::shared_ptr<Variant> T)
{
m_T = T;
}

protected:
std::shared_ptr<mpcd::CellThermoCompute> m_thermo; //!< Cell thermo
std::shared_ptr<mpcd::CellThermoCompute> m_rand_thermo; //!< Cell thermo for random velocities
std::shared_ptr<Variant> m_T; //!< Temperature for thermostat

//! Implementation of the collision rule
virtual void rule(uint64_t timestep) override;
Expand Down
2 changes: 2 additions & 0 deletions hoomd/mpcd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ if(ENABLE_HIP)
CellThermoComputeGPU.h
CellListGPU.cuh
CellListGPU.h
CollisionMethod.cuh
CommunicatorGPU.cuh
CommunicatorGPU.h
ParallelPlateGeometryFillerGPU.cuh
Expand All @@ -114,6 +115,7 @@ if(ENABLE_HIP)
BounceBackNVEGPU.cu
CellThermoComputeGPU.cu
CellListGPU.cu
CollisionMethod.cu
CommunicatorGPU.cu
ParticleData.cu
ParallelPlateGeometryFillerGPU.cu
Expand Down
Loading