-
Notifications
You must be signed in to change notification settings - Fork 8
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
Plasticity #142
base: main
Are you sure you want to change the base?
Plasticity #142
Conversation
@pabloseleson fixed issues on my end here - let me know if the example is working. @abisner let me know if you have thoughts on design/even more tags |
Currently blocked by #172 |
other updates for creation function needed for these modesl
src/CabanaPD_ForceModels.hpp
Outdated
{ | ||
protected: | ||
using memory_space = MemorySpace; | ||
using NeighborView = typename Kokkos::View<int**, memory_space>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It "int" correct here?
In CabanaPD_Force.hpp, we have:
using NeighborView = typename Kokkos::View<int**, memory_space>;
NeighborView _mu;
There, mu is a 2D array of integers. However, s0 should be a 2D array of double numbers, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct; changed
using mechanics_type = ElasticPerfectlyPlastic; | ||
using thermal_type = TemperatureIndependent; | ||
|
||
using base_plasticity_type::_s_0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placeholder comment: I may change s_0 to s_p. Not sure yet.
using base_type::K; | ||
|
||
// FIXME: hardcoded | ||
const double s_Y = 0.0014; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this to computer based on the yield stress.
} | ||
|
||
KOKKOS_INLINE_FUNCTION | ||
auto forceCoeff( const int, const int, const double s, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are "const int, const int," here for "i" and "n"? (Same for the energy below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the force file below where these get called in the neighbor loop
{ | ||
// FIXME: doesn't work because this kernel doesn't use n. | ||
// auto s_0 = _s_0( i, n ); | ||
if ( s < s_Y ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to write 93-96 just as as:
return c * ( s - s_0) * vol;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed this will not work in the current setup and isn't worth updating right now - I've removed for now
src/CabanaPD_ForceModels.hpp
Outdated
{ | ||
protected: | ||
using memory_space = MemorySpace; | ||
using NeighborView = typename Kokkos::View<int**, memory_space>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct; changed
// Grid spacing in y-direction | ||
double dy = inputs["dx"][1]; | ||
|
||
// Remove particles from original geometry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not technically true, the other particles are never created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "// Do not create particles outside compact tension test specimen region"?
This would be consistent with the fragmenting cylinder example? We say there "// Do not create particles outside given cylindrical region"
{ | ||
// FIXME: doesn't work because this kernel doesn't use n. | ||
// auto s_0 = _s_0( i, n ); | ||
if ( s < s_Y ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed this will not work in the current setup and isn't worth updating right now - I've removed for now
// ==================================================== | ||
// Custom particle generation and initialization | ||
// ==================================================== | ||
// Rectangular prism containing the full specimen: original geometry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never do this - if we need every particle considered, it should use a body term
else if ( s <= s_0 - s_Y ) | ||
_s_0( i, n ) = s + s_Y; | ||
// else: Elastic (in between), do not modify. | ||
s_0 = _s_0( i, n ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this unnecessary? We need to update s_0 for Line 140.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your comment didn't show - I was responding to myself..
using base_type::s0; | ||
|
||
using base_plasticity_type::_s_0; | ||
// FIXME: hardcoded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
using memory_space = typename ParticleType::memory_space; | ||
return ForceModel<ModelType, ElasticPerfectlyPlastic, Fracture, | ||
TemperatureIndependent, memory_space>( | ||
delta, K, G0, particles.localOffset() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "particles.localOffset()" for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocating the permanent stretch array
const double vol ) const | ||
{ | ||
auto s_p = _s_p( i, n ); | ||
return 0.25 * c * ( s - s_p ) * xi * vol; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to change this. It is incorrect.
Preliminary example of a compact tension test for the plasticity model. The plasticity model needs to be properly implemented. Right now, it overwrites the PMB model. The yield stretch is also currently hardcoded instead of reading it from the json file.