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

Nonlocal cracktip material #29576

Open
wants to merge 14 commits into
base: next
Choose a base branch
from

Conversation

lynnmunday
Copy link
Contributor

closes #29575

@moosebuild
Copy link
Contributor

moosebuild commented Dec 19, 2024

Job Documentation, step Docs: sync website on ad6bdcc wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link
Contributor

Job Conda (Rocky) on 3740102 : invalidated by @lynnmunday

@moosebuild
Copy link
Contributor

Job OpenMPI on 3740102 : invalidated by @lynnmunday

@moosebuild
Copy link
Contributor

Job Test HPC on 3740102 : invalidated by @lynnmunday

@lynnmunday
Copy link
Contributor Author

@bwspenc Will you review?

@moosebuild
Copy link
Contributor

moosebuild commented Dec 20, 2024

Job Coverage, step Generate coverage on ad6bdcc wanted to post the following:

Framework coverage

Coverage did not change

Modules coverage

Solid mechanics

2974c5 #29576 ad6bdc
Total Total +/- New
Rate 84.95% 84.96% +0.01% 91.84%
Hits 28318 28341 +23 90
Misses 5015 5017 +2 8

Diff coverage report

Full coverage report

Xfem

2974c5 #29576 ad6bdc
Total Total +/- New
Rate 82.38% 82.37% -0.01% 91.18%
Hits 6907 6916 +9 31
Misses 1477 1480 +3 3

Diff coverage report

Full coverage report

Full coverage reports

Reports

This comment will be updated on new commits.

@lynnmunday lynnmunday marked this pull request as draft December 20, 2024 16:41
@lynnmunday lynnmunday marked this pull request as ready for review December 20, 2024 21:28
@lynnmunday lynnmunday force-pushed the nonlocal_cracktip_matl branch 2 times, most recently from 8da5e53 to 81f8043 Compare December 20, 2024 22:51
…nt Kcrit or kcrit from vpp crack growth. Added error checking and testing for these options.
@lynnmunday lynnmunday force-pushed the nonlocal_cracktip_matl branch from 81f8043 to 22a9519 Compare December 23, 2024 17:18
@moosebuild
Copy link
Contributor

All jobs on 22a9519 : invalidated by @lynnmunday

@@ -0,0 +1,19 @@
# CrackFrontNonlocalScalar
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like CrackFrontNonlocalScalarMaterial would be more descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


## Description

This object computes the average scalar material property at the crack front points defined by [CrackFrontDefinition.md]. The main use case for this `VectorPostprocessor` is to compute an average fracture toughness or $k_crit$ at the crack front for use with the `MeshCut2DFractureUserObject` to grow cracks. This allows for spatially varying $k_crit$ values defined by a `Material`.
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
This object computes the average scalar material property at the crack front points defined by [CrackFrontDefinition.md]. The main use case for this `VectorPostprocessor` is to compute an average fracture toughness or $k_crit$ at the crack front for use with the `MeshCut2DFractureUserObject` to grow cracks. This allows for spatially varying $k_crit$ values defined by a `Material`.
This object computes the average of a scalar material property over regions ahead of the crack tip, as defined by the front points obtained from [CrackFrontDefinition.md]. The main use cases for this `VectorPostprocessor` is to compute an average fracture toughness or $k_crit$ at the crack front for use with the `MeshCut2DFractureUserObject` to grow cracks, but this can be used for other scalar material properties as well. This allows for spatially varying $k_crit$ values defined by a `Material`.

modules/xfem/src/userobjects/MeshCut2DFractureUserObject.C Outdated Show resolved Hide resolved
@lynnmunday lynnmunday force-pushed the nonlocal_cracktip_matl branch from ed48de3 to 91b45b9 Compare December 23, 2024 21:42
@moosebuild
Copy link
Contributor

Job Precheck, step Clang format on 91b45b9 wanted to post the following:

Your code requires style changes.

A patch was auto generated and copied here
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/docs/PRs/29576/clang_format/style.patch | git apply -v

Alternatively, with your repository up to date and in the top level of your repository:

git clang-format 2974c54c5269c9b763547954236d33e3a55a8710

@lynnmunday lynnmunday force-pushed the nonlocal_cracktip_matl branch 2 times, most recently from 1c83119 to 4b6d396 Compare December 23, 2024 22:01
@moosebuild
Copy link
Contributor

All jobs on 4b6d396 : invalidated by @lynnmunday

@lynnmunday lynnmunday force-pushed the nonlocal_cracktip_matl branch 3 times, most recently from c7bdcd9 to 4512c85 Compare December 31, 2024 15:17
@lynnmunday lynnmunday force-pushed the nonlocal_cracktip_matl branch from 4512c85 to ad6bdcc Compare January 2, 2025 00:49
@moosebuild
Copy link
Contributor

Job OpenMPI on ad6bdcc : invalidated by @lynnmunday

@moosebuild
Copy link
Contributor

Job Test HPC on ad6bdcc : invalidated by @lynnmunday

2 similar comments
@moosebuild
Copy link
Contributor

Job Test HPC on ad6bdcc : invalidated by @lynnmunday

@moosebuild
Copy link
Contributor

Job Test HPC on ad6bdcc : invalidated by @lynnmunday

@lynnmunday
Copy link
Contributor Author

@bwspenc Will you review this again and merge?

Comment on lines +16 to +20
/**
* Computes the average material property in regions near points provided by the
* crack_front_definition vectorpostprocessor.
*/

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
* Computes the average material property in regions near points provided by the
* crack_front_definition vectorpostprocessor.
*/
/**
* Computes the average material property in regions near points provided by the
* crack_front_definition vectorpostprocessor.
*/

CrackFrontNonlocalScalarMaterial(const InputParameters & parameters);

protected:
/// The scalar material property
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// The scalar material property
/// Property that is averaged over the crack front points

*/
class CrackFrontNonlocalStress : public ElementVectorPostprocessor

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

: ElementVectorPostprocessor(parameters),
_property_name(property_name),
_box_length(getParam<Real>("box_length")),
_box_width(isParamValid("box_width") ? getParam<Real>("box_width") : 1),
Copy link
Member

Choose a reason for hiding this comment

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

Why not default that parameter to 1.0?

CrackFrontNonlocalMaterialBase::execute()
{
// icfp crack front point index
for (std::size_t icfp = 0; icfp < _avg_crack_tip_scalar.size(); icfp++)
Copy link
Member

@dschwen dschwen Jan 11, 2025

Choose a reason for hiding this comment

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

Suggested change
for (std::size_t icfp = 0; icfp < _avg_crack_tip_scalar.size(); icfp++)
for (const auto icfp: index_range(_avg_crack_tip_scalar))

gatherSum(_avg_crack_tip_scalar);
gatherSum(_volume);

for (std::size_t icfp = 0; icfp < _avg_crack_tip_scalar.size(); ++icfp)
Copy link
Member

Choose a reason for hiding this comment

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

index_range

{
const auto & uo = static_cast<const CrackFrontNonlocalMaterialBase &>(y);

for (auto i = beginIndex(_avg_crack_tip_scalar); i < _avg_crack_tip_scalar.size(); ++i)
Copy link
Member

Choose a reason for hiding this comment

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

index_range etc.

Comment on lines +143 to +152
Real q = 0.0;
if ((crack_node_to_current_node_rot(0) > 0) &&
(crack_node_to_current_node_rot(0) <= _box_length) &&
(std::abs(crack_node_to_current_node_rot(1)) <= _box_height / 2) &&
(std::abs(crack_node_to_current_node_rot(2)) <= _box_width / 2))
{
q = 1.0;
}

return q;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Real q = 0.0;
if ((crack_node_to_current_node_rot(0) > 0) &&
(crack_node_to_current_node_rot(0) <= _box_length) &&
(std::abs(crack_node_to_current_node_rot(1)) <= _box_height / 2) &&
(std::abs(crack_node_to_current_node_rot(2)) <= _box_width / 2))
{
q = 1.0;
}
return q;
if ((crack_node_to_current_node_rot(0) > 0) &&
(crack_node_to_current_node_rot(0) <= _box_length) &&
(std::abs(crack_node_to_current_node_rot(1)) <= _box_height / 2) &&
(std::abs(crack_node_to_current_node_rot(2)) <= _box_width / 2))
return 1.0;
return 0.0;

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

Successfully merging this pull request may close these issues.

Create a vector postprocessor that can sample the materials at a crack front
4 participants