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 area conservation #1795

Merged
merged 106 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 101 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
e743a53
Added area conservation potential of mesh structure. pytest not start…
syjlee Jan 19, 2022
63f24f6
fix invalid second loop and keep only single loop which calculates bo…
syjlee Jan 19, 2022
6f7cec1
add comments on the variable At which is A0 divided by Nt
syjlee Jan 19, 2022
6035adf
fixes missing lines to connect area conservation in python to cpp
syjlee Jan 20, 2022
b6ab04d
Merge branch 'mesh-data-structure' into mesh_area_conservation
syjlee Jan 21, 2022
f88f2c1
fixes len_key in area_conservation.py
syjlee Jan 21, 2022
febeca0
fixes mistakes in computeForces and add get method for area
syjlee Jan 21, 2022
670858f
add three statepoints for area conservation in test_meshbond file of …
syjlee Jan 24, 2022
0b9a747
implement GPU code
syjlee Jan 26, 2022
0bedd84
Merge branch 'mesh-data-structure' into mesh_area_conservation
syjlee Jan 26, 2022
4aea9cc
fixes pytest values and remove unnecessary loop for getArea
syjlee Jan 26, 2022
e675003
remove a space
syjlee Jan 26, 2022
4131ec1
temporarily removed m_area in GPU
syjlee Jan 28, 2022
f9914bb
simplify Area conservation
Jan 28, 2022
5362300
Clean up Area conservation GPU code
Jan 28, 2022
dce6ebe
Merge branch 'mesh_area_conservation' of https://github.com/glotzerla…
Jan 28, 2022
57c417a
simplify GPU code
Jan 29, 2022
0654f73
fix GPU anc CPU code for area conservation
Jan 29, 2022
294e63f
set up area getter for GPU
Jan 30, 2022
64f5f33
fix minor bugs in Area conservation getter
Jan 30, 2022
ce6de06
pytest for Area getter
Jan 30, 2022
813ac7a
rename AreaConservation to TriangleAreaConservation
Feb 18, 2022
9ca84cf
add whole Area conservation
Feb 18, 2022
65ff0c0
fix minor bugs in GPU calculations
Feb 18, 2022
e14e7b5
Merge branch 'mesh-data-structure' into mesh_area_conservation
Apr 19, 2022
879ce08
Merge branch 'trunk-minor' into mesh_area_conservation
May 12, 2022
cb4be87
remove debug printf line
May 12, 2022
91159ba
Merge branch 'mesh_rewrite' into mesh_area_conservation
Dec 31, 2022
c8701ed
update Area conservation
Dec 31, 2022
9d3ce91
update headers
Dec 31, 2022
444fcad
fix Autotuner
Dec 31, 2022
fec55b9
add sphinx filees for docs
Dec 31, 2022
49cd19d
update CPU to per type area calculations
Jan 10, 2023
f7e941e
update GPU code
Jan 10, 2023
1b03799
update TriangleArea conservation
Jan 10, 2023
2afc58e
update pytests
Jan 10, 2023
d05d51d
fixed GPU errors
Jan 10, 2023
e1ddca7
Merge branch 'mesh_rewrite' into mesh_area_conservation
Jan 12, 2023
d2e12de
update GPU area code
Jan 12, 2023
b932d38
Merge branch 'mesh_rewrite' into mesh_area_conservation
Feb 2, 2023
2533c1c
improve area calculation code
Feb 2, 2023
f815225
Merge branch 'mesh_rewrite' into mesh_area_conservation
Feb 21, 2023
14709d7
make Area calculation MPI ready
Feb 28, 2023
7ab9988
make TriangleArea ready for MPI
Feb 28, 2023
6cc0939
fix some issues with MPI
Feb 28, 2023
7b319a8
change getN to getNGlobal for accurate Area conservation in MPI
Mar 2, 2023
e850389
Merge branch 'mesh_rewrite' into mesh_area_conservation
Mar 2, 2023
3499ff9
Merge branch 'mesh_rewrite' into mesh_area_conservation
Mar 2, 2023
bf42625
Merge branch 'trunk-major' into mesh_area_conservation
Mar 9, 2023
dc514ab
free memory in area calculation
Mar 17, 2023
d014bba
fix Area calculations for MPI
Mar 17, 2023
7b4281c
fix typo
Mar 17, 2023
dfda587
fix doube declartion
Mar 17, 2023
c823497
fix typo
Mar 17, 2023
90157bf
fix cuda issue for large systems
Mar 21, 2023
1ade840
improve TriangleArea class
Mar 21, 2023
7b6a5ed
update pytests
Mar 21, 2023
47ccfd4
Merge branch 'trunk-major' into mesh_area_conservation
Apr 7, 2023
54c44eb
Merge branch 'trunk-minor' into mesh_area_conservation
Jul 19, 2023
374eacb
change "alpha" to "default_gamma" in pytests
Jul 19, 2023
ce020bc
Merge branch 'trunk-patch' into mesh_area_conservation
Sep 27, 2023
59a357d
rewrite Trainagle area for virials
Sep 27, 2023
1d47538
rewrite AReaConservation to calculate virials
Sep 27, 2023
7be891e
fix energy calculation
Sep 27, 2023
1c7fc52
implement ignore_type option in area conservation
Sep 27, 2023
27467b5
add pytest
Sep 27, 2023
4a79732
Merge branch 'trunk-patch' into mesh_area_conservation
Sep 27, 2023
362d687
fix energy when ignore_type
Sep 29, 2023
4318879
Merge branch 'trunk-patch' into mesh_area_conservation
Oct 6, 2023
2b661b7
Merge branch 'trunk-patch' into mesh_area_conservation
Jan 15, 2024
fd38493
Merge branch 'trunk-patch' into mesh_area_conservation
Mar 25, 2024
5d88bd1
improve docs
Mar 25, 2024
cb9ee93
improve more docs
Mar 25, 2024
adef759
update comments in TriangleAreaConservationMeshForceCompute
Mar 25, 2024
19fb814
tidy up comments
Mar 25, 2024
1762646
Merge branch 'trunk-patch' into mesh_area_conservation
May 31, 2024
3e68531
minor fixes to documentation and comments
May 31, 2024
ca0629b
add conservation class description
May 31, 2024
92596f4
Merge branch 'trunk-patch' into mesh_area_conservation
May 31, 2024
bcb1044
remove commented out code
Jun 1, 2024
854e8fa
Merge branch 'trunk-minor' into mesh_area_conservation
Jun 1, 2024
321aa99
Merge branch 'trunk-minor' into mesh_area_conservation
joaander Jun 3, 2024
9b620fa
Merge branch 'trunk-minor' into mesh_area_conservation
Oct 8, 2024
d1cc446
improving docs
Oct 8, 2024
f3c7fdf
combine params
Oct 8, 2024
67e1b87
update struct
Oct 8, 2024
01b01dd
remove unnecesarry code
Oct 8, 2024
ee5c37d
improve Area code
Oct 8, 2024
de90ec7
fix docstrings
Oct 9, 2024
7af7715
fix docstring
Oct 9, 2024
1e6438d
fix docstring
Oct 9, 2024
1ae51e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 9, 2024
447a861
reduce lines
Oct 9, 2024
cdb0fc6
Merge branch 'mesh_area_conservation' of https://github.com/glotzerla…
Oct 9, 2024
5a15461
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 9, 2024
5380016
combine triangle_area_parameter and area_parameter
Oct 9, 2024
45b4724
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 9, 2024
a94f1d3
combine m_area and m_area_GPU
Oct 16, 2024
9e336b5
combine m_area and m_area_GPU everywhere
Oct 16, 2024
514f461
Merge branch 'trunk-minor' into mesh_area_conservation
Oct 16, 2024
ea3e03a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2024
ed10888
Merge branch 'trunk-minor' into mesh_area_conservation
Oct 23, 2024
61f33aa
add Josh's comments
Oct 23, 2024
65c7e81
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 23, 2024
573a0c3
fix params
Oct 23, 2024
07cb3bf
Merge branch 'mesh_area_conservation' of https://github.com/glotzerla…
Oct 23, 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
Loading