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

Phase-field model for fracture using MPI and AMR #203

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

Conversation

WasimNiyazMunshi
Copy link

This pull request adds a phase-field solver for fracture to the code gallery. The fracture model uses the MPI and Adaptive Mesh Refinement (AMR) capabilities of deal.II to solve large scale problems in 3D.

@bangerth
Copy link
Member

bangerth commented Nov 2, 2024

@WasimNiyazMunshi is a visiting student in my lab, and I've contributed to this program. I would appreciate if someone else would handle this PR!

@blaisb blaisb self-requested a review November 3, 2024 17:40
@marcfehling marcfehling self-requested a review November 26, 2024 14:50
Copy link
Member

@marcfehling marcfehling left a comment

Choose a reason for hiding this comment

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

Nice work. The code looks fine! I did not check the formulas in the code, as they overstep my expertise. According to your manuscript, you validated your code against literature data, which suffices for me.

The following two points are more suggestions than requirements for being merged. Please apply according to your own assessment :)

  • If you'd like, you can run a code indentation tool like clang-format over your source file, which further improves readability.
  • If you are feeling fancy: Consider collecting all parameters in a parameter class or multiple classes, and use the ParameterHandler.

Phase_field_fracture_model_in_3D/CMakeLists.txt Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/README.md Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/README.md Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/CMakeLists.txt Outdated Show resolved Hide resolved
Comment on lines +755 to +780
/* for (const auto &face : cell->face_iterators())
{
if (face->at_boundary() &&
face->boundary_id() == 10)

{
fe_face_values_elastic.reinit(cell, face);
for (const auto i : fe_face_values_elastic.dof_indices())

{const unsigned int component_i =
fe_elastic.system_to_component_index(i).first;
for (const auto face_q_point :
fe_face_values_elastic.quadrature_point_indices())
{

cell_rhs_elastic(i) +=
fe_face_values_elastic.shape_value( i, face_q_point)
*(traction_values_elastic[face_q_point][component_i])
*fe_face_values_elastic.JxW(face_q_point);



}
}
}
}*/
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Author

Choose a reason for hiding this comment

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

This part of the code is used to apply traction boundary conditions. We do not any have traction boundary conditions in the example considered here but I think it would be a good idea to keep this part there incase one wants to solve problems with traction boundary conditions.

Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
Comment on lines 835 to 861
/*for (const auto &cell : dof_handler_damage.active_cell_iterators())
if (cell->is_locally_owned())

{
//for (const auto &face : cell->face_iterators())

for (const auto vertex_number : cell->vertex_indices())
{
const auto vert = cell->vertex(vertex_number);
const Point<3>& node = vert;
if (((std::fabs((z_max*(node(0)-0.5*x_max + A)) - 2*A*( node(2))) <10*l)
&& node(1)>=0.9*y_max)
|| ((std::fabs((node(0)-0.5*x_max + A)*z_max+2*A*(node(2)-z_max))<10*l)
&& node(1)<=0.1*y_max))
if ((vert(0) - 0.5*(x_min+x_max) < 1e-12) &&
(std::fabs(vert(1) - 0.5*(y_min + y_max)) <= bandwidth)) // nodes on initial damage plane


{
const unsigned int dof = cell->vertex_dof_index(vertex_number, 0);
constraints_damage.add_line(dof);
constraints_damage.set_inhomogeneity(dof,1);
}

}

}*/
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Author

Choose a reason for hiding this comment

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

The problem considered here does not have any initial crack (damage). But often times, the problems one solves involves a pre-existing crack. This part of the code sets up the necessary constraints on the damage field for the initial crack.

Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
WasimNiyazMunshi and others added 7 commits December 2, 2024 15:32
Removed the *else break* line in the run function. Also moved incrementing the iteration counter to the end of the while loop.
Make the use of template arguments look more uniform.
Use LA::MPI::Vector instead of TrilinosWrappers.
Use FEValues::get_function_values().
Copy link
Member

@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.

Just a few comments there and there. Very cool work!

Phase_field_fracture_model_in_3D/README.md Show resolved Hide resolved
Phase_field_fracture_model_in_3D/doc/polyhedral_setup.png Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
Phase_field_fracture_model_in_3D/phase_field.cc Outdated Show resolved Hide resolved
@WasimNiyazMunshi
Copy link
Author

@blaisb, @Rombur and @marcfehling.
Thank you all for taking the time to review my code. I have worked on addressing most of your comments and suggestions. The only pending items are the two blocks of commented-out code that @marcfehling suggested removing. May I kindly request you to review the code once more, so we can proceed with adding it to the code gallery soon? :-)
Best regards
Wasim

@bangerth
Copy link
Member

As for the commented-out code blocks: @WasimNiyazMunshi suggests to leave them in there because many benchmarks are described with traction boundary conditions rather than displacements, and the commented out code is what you will need if you want to use the code for a traction-based modification. That seems reasonable to me.

@WasimNiyazMunshi
Copy link
Author

WasimNiyazMunshi commented Dec 16, 2024 via email

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.

4 participants