Skip to content

Add the code for ALE large-deformation thermoplasticity#237

Merged
bangerth merged 6 commits into
dealii:masterfrom
maieneuro:master
Mar 26, 2026
Merged

Add the code for ALE large-deformation thermoplasticity#237
bangerth merged 6 commits into
dealii:masterfrom
maieneuro:master

Conversation

@maieneuro

Copy link
Copy Markdown
Contributor

Following this thread in the mailing list, I'm adding this to the code gallery.

@bangerth bangerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for submitting this code!

We need a number of metadata files in the doc/ direction. Could you take a look at https://github.com/dealii/code-gallery?tab=readme-ov-file#contributing-to-the-gallery and add those as necessary?

Comment thread ALE_Finite_Strain_Plasticity/README.md Outdated
Comment on lines +1 to +16
## To run:
```
# in a build directory:
$ cmake -DDEAL_II_DIR=<path-to-deal-ii> <path-to-plasticitylab>
$ make release
$ make -j 8 && $HOME/share/bin/mpirun -n 18 ./PlasticityLab

# The triangulation is configured in PlasticityLabProgDrivers.cpp in run()
# The material is configured in main.cpp
# The timestep is configured in PlasticityLabProg.h
```

## Citation:
If you use this code as part of your work, please cite:
Hamed, M.M.O., McBride, A.T. & Reddy, B.D. An ALE approach for large-deformation thermoplasticity with application to friction welding. Comput Mech 72, 803–826 (2023).
https://doi.org/10.1007/s00466-023-02303-0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would you be willing to add a few paragraphs that outline what the program does and how it does it? It doesn't have to be very much, but I think it would be nice to be able to read in the readme what this program is about without having to first look at the paper.

@maieneuro maieneuro force-pushed the master branch 2 times, most recently from e34a713 to b023104 Compare January 21, 2026 08:47

@bangerth bangerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I made some minor cosmetic changes to file conventions, but otherwise this is ok. Thank you for contributing the program, @maieneuro, and my apologies for not getting to this earlier!

@bangerth bangerth merged commit b664658 into dealii:master Mar 26, 2026
@maieneuro

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for merging this! I appreciate you taking the time to go through the submission and for making the formatting and naming adjustments.
Happy to make further updates or clarifications if anything comes up later.

@bangerth

Copy link
Copy Markdown
Member

@marcfehling marcfehling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please have a look.

Comment on lines +29 to +31
find_package(deal.II 9.7.0
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Our CI fails the 9.6.0 check because of this requirement.

@marcfehling

Copy link
Copy Markdown
Member

In Debug mode with the current master branch of deal.II, an assertion is triggered when calling VectorTools::interpolate_boundary_values() regarding the ComponentMask.

--------------------------------------------------------
An error occurred in line <65> of file <dealii/include/deal.II/numerics/vector_tools_boundary.templates.h> in function
    void dealii::VectorTools::internal::do_interpolate_boundary_values(const M_or_MC<dim, spacedim>&, const dealii::DoFHandler<dim, spacedim>&, const std::map<unsigned int, const dealii::Function<spacedim, number>*>&, std::map<unsigned int, number>&, const dealii::ComponentMask&) [with int dim = 2; int spacedim = 2; number = double; M_or_MC = dealii::Mapping]
The violated condition was: 
    component_mask.represents_n_components(dof.get_fe(0).n_components())
Additional information: 
    The number of components in the mask has to be either zero or equal to
    the number of components in the finite element.

Stacktrace:
-----------
#0  dealii/lib/libdeal_II.g.so.9.8.0-pre: void dealii::VectorTools::internal::do_interpolate_boundary_values<2, 2, double, dealii::Mapping>(dealii::Mapping<2, 2> const&, dealii::DoFHandler<2, 2> const&, std::map<unsigned int, dealii::Function<2, double> const*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, dealii::Function<2, double> const*> > > const&, std::map<unsigned int, double, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, double> > >&, dealii::ComponentMask const&)
#1  dealii/lib/libdeal_II.g.so.9.8.0-pre: void dealii::VectorTools::interpolate_boundary_values<2, 2, double>(dealii::Mapping<2, 2> const&, dealii::DoFHandler<2, 2> const&, std::map<unsigned int, dealii::Function<2, double> const*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, dealii::Function<2, double> const*> > > const&, std::map<unsigned int, double, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, double> > >&, dealii::ComponentMask const&)
#2  dealii/lib/libdeal_II.g.so.9.8.0-pre: void dealii::VectorTools::interpolate_boundary_values<2, 2, double>(dealii::Mapping<2, 2> const&, dealii::DoFHandler<2, 2> const&, std::map<unsigned int, dealii::Function<2, double> const*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, dealii::Function<2, double> const*> > > const&, dealii::AffineConstraints<double>&, dealii::ComponentMask const&)
#3  ./PlasticityLab: PlasticityLab::InterpolatoryConstraintApplier<2, double>::apply(dealii::Mapping<2, 2> const&, dealii::DoFHandler<2, 2>&, dealii::AffineConstraints<double>&, bool) const
#4  ./PlasticityLab: PlasticityLab::LBCSystem<2, double, 3>::apply_constraints(PlasticityLab::DoFSystem<2, double>&) const
#5  ./PlasticityLab: PlasticityLab::PlasticityLabProg<2, double>::run()
#6  ./PlasticityLab: main
--------------------------------------------------------

Abort() was called during dealing with an assertion or exception.

@maieneuro -- Could you have a look?

maieneuro added a commit to maieneuro/code-gallery that referenced this pull request Jul 3, 2026
…p build

Fixes the assertion reported in dealii#237 and makes the
example build warning-free in both Debug and Release with deal.II 9.7.

Correctness fixes
-----------------
* Mechanical FE component count: mech_fe was declared as
  FESystem(FE_Q, dim, FE_Q, 2), giving dim+2 components, while the rest of
  the program consistently assumes dim+1 (displacement + angular twist):
  the ComponentMasks, LBCSystem<dim, Number, dim+1>, the zero_function,
  Material<dim+1>, the FEValuesExtractors (displacements 0..dim-1, angular
  velocity at dim) and the output component names/interpretations. The
  extra component made
    component_mask.represents_n_components(fe.n_components())
  fail inside VectorTools::interpolate_boundary_values(), aborting in
  Debug during apply_constraints(). Changed the multiplicity 2 -> 1 so the
  FE has dim+1 components, matching everything else.

* Removed a dead, singular MixedFEProjector setup over mech_fe. The result
  (mech_fe_projectors) was never used, and assembling an L2 projector over
  the full mech_fe (dim+1 components, 12 dofs/cell for Q1) from only 4
  quadrature points yields a rank-deficient mass matrix, which aborted in
  FullMatrix::gauss_jordan() once the ComponentMask assertion was past.
  With this removed the example runs the time-stepping loop.

Warning cleanup (Debug and Release now compile with zero project warnings)
--------------------------------------------------------------------------
* -Wdeprecated-declarations: DoFSystem now uses the returning form of
  DoFTools::extract_locally_relevant_dofs() and the two-index-set
  AffineConstraints::reinit().
* -Wsuggest-override: added override to the Material overrides in
  ThermoPlasticMaterial and ExponentialHardeningElastoplasticMaterial, and
  to the Function / std::exception subclasses.
* -Wreorder: fixed member initialization order in
  BoundaryUnidirectionalPenaltySpec and ScaleComponentFunction.
* -Wsign-compare: cast boundary_id() comparisons against the int keys of
  the boundary-load / convection appliers to types::boundary_id.
* -Wcatch-value: catch MaterialDomainException by const reference.
* -Wunused-variable / -Wunused-but-set-variable / -Wunused-parameter:
  tagged genuinely-unused locals and parameters with [[maybe_unused]]
  (preserving the computations), dropped an unused local in main.cpp, and
  elided unused parameter names in stub material methods.
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.

3 participants