Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh volume conservation #1794

Merged
merged 73 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a67ef52
first files for volume constraint
Jan 26, 2022
2cc9b72
add gpu_pos_list to mesh gpu list generator
Jan 26, 2022
d4be842
fix volume factor
Jan 26, 2022
6e0a197
setup GPU code for MeshVolumeConstraint
Jan 27, 2022
ce5dc46
rename VolumeConstraint class and link CPU code to hoomd
Jan 27, 2022
163141d
writing API
Jan 27, 2022
b254c30
add test for volume
Jan 27, 2022
1a555f8
update VolumeConstraintGPU code and write partial sum code
Jan 28, 2022
5cdeee3
link Volume constraint to hoomd
Jan 28, 2022
88df923
compiling GPU code (VolumeConstraint)
Jan 28, 2022
230484b
working GPU version (VolumeConstraint)
Jan 28, 2022
ea8550a
add get Volume
Jan 30, 2022
6ba39b9
Merge branch 'mesh-data-structure' into mesh_volume_conservation
Apr 19, 2022
7b2a134
Merge branch 'trunk-minor' into mesh_volume_conservation
May 12, 2022
c836597
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Dec 31, 2022
17a4948
update VolumeCompute
Dec 31, 2022
71559dd
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Dec 31, 2022
1323536
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Dec 31, 2022
2d0c0c6
fix Autotuner
Dec 31, 2022
fadc08e
add equation to Docs
Dec 31, 2022
badbdaa
create sphinx files for doc
Dec 31, 2022
5936800
allow multi mesh types
Jan 9, 2023
26c95e3
fix Volume GPU code
Jan 10, 2023
1aeabc3
minor improvements
Jan 10, 2023
8102fb2
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Jan 12, 2023
e2cc012
update GPU Volume code
Jan 12, 2023
fd6d4d9
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Feb 2, 2023
f26079a
remove old file
Feb 2, 2023
ba76983
remove another old file
Feb 2, 2023
c8a8422
another removed file
Feb 2, 2023
bf24b1b
another removed file
Feb 2, 2023
8658228
fix pytest
Feb 2, 2023
c9b4820
improve Volume calculations
Feb 2, 2023
ee26c66
remove old file
Feb 2, 2023
cc3de69
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Feb 21, 2023
d45f0f0
make VolumeConstraint MPI ready
Feb 28, 2023
90bfac3
Merge branch 'mesh_volume_conservation' of https://github.com/glotzer…
Feb 28, 2023
228c558
fix GlobalN in volume conservation
Mar 2, 2023
6760e42
Merge branch 'mesh_rewrite' into mesh_volume_conservation
Mar 2, 2023
e370649
Merge branch 'trunk-major' into mesh_volume_conservation
Mar 9, 2023
12a8621
free memory in Volume calculation
Mar 17, 2023
7212e41
fix Cuda issue for large systems
Mar 21, 2023
fdc73aa
Merge branch 'trunk-major' into mesh_volume_conservation
Apr 7, 2023
447306d
Merge branch 'trunk-minor' into mesh_volume_conservation
Jul 19, 2023
d28d793
change "alpha"to "default_gamma" in pytests
Jul 19, 2023
0e0dd92
Merge branch 'trunk-patch' into mesh_volume_conservation
Sep 27, 2023
9b8c1d1
fix energy calculation and add ignore_type feature
Sep 28, 2023
bbea2c2
fix energy when ignore_type
Sep 29, 2023
4ae0dc0
Merge branch 'trunk-patch' into mesh_volume_conservation
Oct 6, 2023
522d76c
Merge branch 'trunk-patch' into mesh_volume_conservation
Jan 15, 2024
e277155
Merge branch 'trunk-patch' into mesh_volume_conservation
Mar 25, 2024
e379e1c
Merge branch 'trunk-patch' into mesh_volume_conservation
May 31, 2024
e2b55d6
add conservation class description
May 31, 2024
f2f659a
remove commented out code
Jun 1, 2024
8c8a0c1
Merge branch 'trunk-minor' into mesh_volume_conservation
Jun 1, 2024
ba8ff8b
Merge branch 'trunk-minor' into mesh_volume_conservation
joaander Jun 3, 2024
0d2c8b3
Merge branch 'trunk-minor' into mesh_volume_conservation
Oct 9, 2024
1cb4bf0
fix docstrings
Oct 9, 2024
270bcc0
fix docs
Oct 9, 2024
69a8174
remove flags
Oct 9, 2024
2e2490a
update params
Oct 9, 2024
f55b2da
remove comments
Oct 9, 2024
5cae06b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 9, 2024
788d228
fix docstrings
Oct 9, 2024
c25f05c
Merge branch 'trunk-minor' into mesh_volume_conservation
Oct 16, 2024
1374506
add documentation for ignore_type
Oct 16, 2024
2d3ee45
combine m_volume and m_volume_GPU
Oct 16, 2024
9dbc29c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2024
6e9f421
rephrase docs
Oct 16, 2024
add9a71
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2024
e3c0c72
fix typo
Oct 16, 2024
ec1682d
Merge branch 'mesh_volume_conservation' of https://github.com/glotzer…
Oct 16, 2024
35ffca6
final rephrasing
Oct 16, 2024
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
12 changes: 12 additions & 0 deletions hoomd/MeshDefinition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ MeshDefinition::MeshDefinition(std::shared_ptr<SystemDefinition> sysdef, unsigne
std::shared_ptr<TriangleData>(new TriangleData(m_sysdef->getParticleData(), n_types)))

{
// allocate the max number of neighbors per type allowed
GlobalArray<unsigned int> globalN(n_types, m_sysdef->getParticleData()->getExecConf());
m_globalN.swap(globalN);
TAG_ALLOCATION(m_globalN);
}

void MeshDefinition::setTypes(pybind11::list types)
{
m_globalN.resize(len(types));
for (unsigned int i = 0; i < len(types); i++)
{
m_meshbond_data->setTypeName(i, types[i].cast<string>());
Expand Down Expand Up @@ -106,13 +111,20 @@ void MeshDefinition::setTriangulationData(pybind11::dict triangulation)
triangle_data.resize(static_cast<unsigned int>(len_triang));
TriangleData::members_t triangle_new;

ArrayHandle<unsigned int> h_globalN(m_globalN, access_location::host, access_mode::overwrite);

for (unsigned int i = 0; i < m_meshtriangle_data->getNTypes(); i++)
h_globalN.data[i] = 0;

for (size_t i = 0; i < len_triang; i++)
{
triangle_new.tag[0] = ptr1[i * 3];
triangle_new.tag[1] = ptr1[i * 3 + 1];
triangle_new.tag[2] = ptr1[i * 3 + 2];
triangle_data.groups[i] = triangle_new;
triangle_data.type_id[i] = ptr2[i];

h_globalN.data[triangle_data.type_id[i]] += 1;
}

m_meshtriangle_data = std::shared_ptr<TriangleData>(
Expand Down
8 changes: 8 additions & 0 deletions hoomd/MeshDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#error This header cannot be compiled by nvcc
#endif

#include "hoomd/GlobalArray.h"

#include "BondedGroupData.h"
#include "MeshGroupData.h"
#include "SystemDefinition.h"
Expand Down Expand Up @@ -85,6 +87,11 @@ class PYBIND11_EXPORT MeshDefinition
return triangles.getSize();
}

const GlobalArray<unsigned int>& getPerTypeSize() const
{
return m_globalN;
}

void setTypes(pybind11::list types);

BondData::Snapshot getBondData();
Expand All @@ -96,6 +103,7 @@ class PYBIND11_EXPORT MeshDefinition
void setTriangulationData(pybind11::dict triangulation);

private:
GlobalArray<unsigned int> m_globalN;
std::shared_ptr<SystemDefinition>
m_sysdef; //!< System definition later needed for dynamic bonding
std::shared_ptr<MeshBondData> m_meshbond_data; //!< Bond data for the mesh
Expand Down
6 changes: 6 additions & 0 deletions hoomd/md/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ set(_md_sources module-md.cc
Thermostat.cc
TwoStepNVTAlchemy.cc
WallData.cc
VolumeConservationMeshForceCompute.cc
ZeroMomentumUpdater.cc
)

Expand Down Expand Up @@ -206,6 +207,9 @@ set(_md_headers ActiveForceComputeGPU.h
TwoStepConstantPressure.h
AlchemostatTwoStep.h
TwoStepNVTAlchemy.h
VolumeConservationMeshForceCompute.h
VolumeConservationMeshForceComputeGPU.h
AlchemostatTwoStep.h
WallData.h
ZeroMomentumUpdater.h
)
Expand Down Expand Up @@ -241,6 +245,7 @@ list(APPEND _md_sources ActiveForceComputeGPU.cc
TableDihedralForceComputeGPU.cc
TwoStepBDGPU.cc
TwoStepLangevinGPU.cc
VolumeConservationMeshForceComputeGPU.cc
TwoStepConstantVolumeGPU.cc
TwoStepConstantPressureGPU.cc
MuellerPlatheFlowGPU.cc
Expand Down Expand Up @@ -283,6 +288,7 @@ set(_md_cu_sources ActiveForceComputeGPU.cu
TwoStepConstantVolumeGPU.cu
TwoStepNVEGPU.cu
TwoStepRATTLENVEGPU.cu
VolumeConservationMeshForceComputeGPU.cu
MuellerPlatheFlowGPU.cu
CosineSqAngleForceGPU.cu
)
Expand Down
Loading