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

Force chains, add the arbitrary rule #1342

Merged
merged 7 commits into from
Nov 8, 2024
Merged

Conversation

OGaboriault
Copy link
Collaborator

Description

Force chains between local-ghost particle were being duplicated since the arbitrary rule with particle ids was not implemented.

Solution

The execute_contact_calculation function in the force_chain_visualization.h file is templated with the contact type. Weh nwe are dealing with ghost_particle_particle contacts, we apply the rule.

Testing

I could add a test, but I'm not sure what is the best way to do it. It would require two particles, being in two different subdomains.

Documentation

N/A

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Copyright headers are present and up to date
  • Lethe documentation is up to date
  • Fix has unit test(s) (preferred) or application test(s), and restart files are in the generator folder
  • The branch is rebased onto master
  • Changelog (CHANGELOG.md) is up to date
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent

Pull request related list:

  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If the fix is temporary, an issue is opened
  • The PR description is cleaned and ready for merge

@OGaboriault OGaboriault self-assigned this Nov 5, 2024
@OGaboriault OGaboriault changed the title Add the arbitrary rule Force chains, add the arbitrary rule Nov 5, 2024
@OGaboriault OGaboriault added WIP When a PR is open but not ready for review Ready for review and removed Ready for review WIP When a PR is open but not ready for review labels Nov 5, 2024
Comment on lines 97 to 98
std::vector<Point<3>> vertices;
std::vector<double> normal_forces_vector;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to give those a defaul value otherwise if you have a processor with nothing won't you get an error ? LIke if the vectors are empty

@@ -102,7 +111,7 @@ ParticlesForceChains<dim, contact_model, rolling_friction_model>::
Vector<float> force_values(triangulation.n_active_cells());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait why is this a Vector of float? This will be in single precision... why do that?

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smalls changes nothing big

Comment on lines 142 to 144
// Clear the containers for the next writing time step.
vertices.clear();
normal_forces_vector.clear();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Clear the containers for the next writing time step.
vertices.clear();
normal_forces_vector.clear();

You don't need to clear the containers because they will automatically be cleared out by going out of scope since the variables are local to the scope.

source/dem/force_chains_visualization.cc Show resolved Hide resolved
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last changes and ready for merge.

*/
template <ContactType contact_type>
inline void
execute_contact_calculation(
typename DEM::dem_data_structures<dim>::particle_contact_info
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be const

Copy link
Collaborator Author

@OGaboriault OGaboriault Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it cannot. It has something to do with the particle_particle_contact_force.h file.

There's an other function called execute_contact_calculation with the same input parameters. In that function, we clear the tangential overlap, thus it is not const.

I'm not sure if the ParticlesForceChains class needs to inherit from ParticleParticleContactForce, but this is why it cannot be const.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect

include/dem/force_chains_visualization.h Show resolved Hide resolved
@OGaboriault OGaboriault force-pushed the dem_force_chains_double_lines branch from 2cfd004 to ecd74ab Compare November 8, 2024 16:43
@blaisb blaisb merged commit 8d8fc54 into master Nov 8, 2024
11 checks passed
@blaisb blaisb deleted the dem_force_chains_double_lines branch November 8, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Quick fix Ready for review WIP When a PR is open but not ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants