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

transport velocity in soil #685

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Shuaihao-Zhang
Copy link
Collaborator

Remove the tensile instability in cohesive soil using transport velocity.
image

//----------------------------------------------------------------------
// Unified transport velocity correction
//----------------------------------------------------------------------
template <typename... T>
Copy link
Owner

Choose a reason for hiding this comment

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

I am wondering why we need this new class. Could we use a generalization-extension approach to add this new feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am wondering why we need this new class. Could we use a generalization-extension approach to add this new feature?

Yes. It's better to use a generalized approach.
A simple approach is to just add a judgment statement in the original TransportVelocityCorrection.
When a particle is identified as a surface particle, corrections are applied only in the tangential direction. However, it is uncertain whether this approach will affect other cases.

Copy link
Owner

Choose a reason for hiding this comment

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

No. Using a switch is not a generalization-extension approach. We need first find a type in the original formulation such that it can be generalized, then change it to a template parameter (as a templated class) and reimplement the original class by realizing the template parameter with a small function object. For extension, we write the new feature as a new function object which substitute the template parameter in the generalized templated class. In this way, the choose new feature is don in compiling time not runtime.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. Using a switch is not a generalization-extension approach. We need first find a type in the original formulation such that it can be generalized, then change it to a template parameter (as a templated class) and reimplement the original class by realizing the template parameter with a small function object. For extension, we write the new feature as a new function object which substitute the template parameter in the generalized templated class. In this way, the choose new feature is don in compiling time not runtime.

I will think about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants