Skip to content

Remove thermo trait from thermo solid trait#2075

Open
rjoussen wants to merge 6 commits into
4C-multiphysics:mainfrom
rjoussen:remove-thermo-trait-from-thermo-solid-trait
Open

Remove thermo trait from thermo solid trait#2075
rjoussen wants to merge 6 commits into
4C-multiphysics:mainfrom
rjoussen:remove-thermo-trait-from-thermo-solid-trait

Conversation

@rjoussen

@rjoussen rjoussen commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description and Context

This removes the Trait::Thermo and hence the thermo base material from the Trait::ThermoSolid. Before, thermo-solid materials, which are mostly used to indicate that a solid material has thermo-mechanical coupling, needed to implement all functions that a normal thermo material (= the fourier thermo material) needs. All current thermo-solid materials solved that by wrapping an internal thermo-material with the input parameter THERMOMAT, which was, though, completely unused except for one occurrence in thermo-fluid-structure-interaction.

The main motivation for removing this is to allow new solid materials that want to implement thermo-mechanical coupling to avoid implementing many functions they don't need -> see #2083.

The commits are split as follows:

  1. The first commit fixes a completely independent bug in the ale fluid restart code: the grid velocity wasnt correctly re-initialized, which led to a numerical drift when restarting for example tfsi problems.
  2. Address the usage of the internally wrapped thermo-material of the thermo-SVK material. The scatra2 discretization now learns the solid material (of which it needs the density) from a material map clone. The tfsi test is adapted accordingly. This also works for restarts now, I added a test for that.
  3. The thermo-solid specific reinit function is temporarily replaced by the pure thermo reinit function. All existing materials used this function only to get the current temperature from the thermo field anyway. This thermo reinit function becomes non-inherited once thermo trait inheritance is removed (in commit 4).
  4. The THERMOMAT input parameter is removed. It is no longer needed.
  5. The ThermoSolid trait is no longer inheriting from the pure Thermo trait. All implemented functions are removed. The unnecessary extra inheritance layer ThermoMechanicalMaterial is removed as well.
  6. The Solid trait is removed. It was empty anyway, and the thermo solid trait was the only place that used it.

Related Issues and Pull Requests

Copilot AI review requested due to automatic review settings June 5, 2026 15:38
@rjoussen rjoussen self-assigned this Jun 5, 2026
@rjoussen rjoussen added type: clean code Clean coding and good programming practices breaking change Pull requests that require manual user actions after merging labels Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the thermo-solid material trait hierarchy by removing Trait::Thermo inheritance from Trait::ThermoSolid (and removing the legacy THERMOMAT indirection), so thermo-mechanically coupled solid materials no longer need to implement the full Fourier thermo-material interface. To keep structure-based scalar transport working (notably for low-Mach / loma), the PR shifts density acquisition to a secondary “structural” material attached to the scatra element via cloning/material-pointer reattachment, and updates affected input files accordingly.

Changes:

  • Removes THERMOMAT from material input specs and from many test input files; updates cloning-material-map usage where needed.
  • Simplifies Mat::Trait::ThermoSolid::reinit() to only take (temperature, gp) and updates call sites; removes legacy ThermoMechanicalMaterial/Trait::Solid scaffolding.
  • Updates structure-based scatra (loma) material evaluation to use a Fourier thermo material plus a secondary structural material for density, and adds FS3I utilities to reattach cross-field material pointers.

Reviewed changes

Copilot reviewed 77 out of 77 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/input_files/volmortar3D_tsi_tet4_tet4.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/volmortar3D_tsi_tet4_tet4_tes.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/volmortar3D_tsi_tet10_hex20_trafo.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/volmortar3D_tsi_hex8_tet4.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/volmortar3D_tsi_hex8_hex8.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/volmortar3D_tsi_hex27_hex27.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/volmortar3D_tsi_error.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_simplrocketnozzle_monolithic.4C.yaml Removes THERMOMAT from multiple thermo-solid material blocks.
tests/input_files/tsi_simplrocketnozzle_monolithic_muelu.4C.yaml Removes THERMOMAT from multiple thermo-solid material blocks.
tests/input_files/tsi_plexichannel_varyE_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_plastic_heating_monolithic.4C.yaml Removes THERMOMAT from thermo-plastic material block.
tests/input_files/tsi_meshtying_nurbs.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_locsys_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lindilatation_geolin.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_sequstaggtemp.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_sequstaggdisp.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_monolithic_muelu.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_monolithic_mergeTSImatrix.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_iterstaggtemp.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_iterstaggdisp.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_iterstaggaitken.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_lincompression_1waydisp.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatflux_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatflux_monolithic_pbc.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatflux_iterstaggaitken.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatflux_iterstagg.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatflux_flexoutsurf_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatconvection_thrplastic_monolithic.4C.yaml Removes THERMOMAT from thermo-plastic material block.
tests/input_files/tsi_heatconvection_thrplastic_genalpha_monolithic.4C.yaml Removes THERMOMAT from thermo-plastic material block.
tests/input_files/tsi_heatconvection_monolithic.4C.json Removes THERMOMAT from JSON thermo-solid material entry.
tests/input_files/tsi_heatconvection_monolithic_muelu.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatconvection_monolithic_fine.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_heatconvection_iterstagg.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_tsiload_hex27_flexoutsurf_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_tet4_heatflux_flexoutsurf_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_simplrocketnozzle_monolithic.4C.yaml Removes THERMOMAT from multiple thermo-solid material blocks.
tests/input_files/tsi_geonln_plexichannel_varyE_OST_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_plexichannel_varyE_OST_monolithic_mergeTSImatrix.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_lincompression_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_lincompression_monolithic_hyperelast.4C.yaml Removes THERMOMAT from thermo-hyperelast material block.
tests/input_files/tsi_geonln_lincompression_iterstaggdisp.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_heatflux_flexoutsurf_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_heatconvection_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_heatconvection_iterstagg.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_heatconvection_fbar_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_geonln_heatconvection_fbar_genalpha_monolithic.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tsi_contact3D_conduction.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/tfsi_plate.4C.yaml Removes THERMOMAT and updates CLONING MATERIAL MAP target material ID.
tests/input_files/consinter3D_tsi_hex8_tet4.4C.yaml Removes THERMOMAT from thermo-solid material block.
tests/input_files/consinter3D_tsi_hex27_hex27.4C.yaml Removes THERMOMAT from thermo-solid material block.
src/thermo/src/element/4C_thermo_ele_impl.cpp Updates thermo-solid reinit call sites to the new (temperature, gp) signature and removes legacy branches/includes.
src/ssi/4C_ssi_clonestrategy.cpp Adjusts admissible cloned material types for scalar transport (switch to Fourier thermo).
src/scatra/4C_scatra_utils_clonestrategy.cpp Removes m_thermostvenant from admissible material types for fluid scatra clone strategy.
src/scatra_ele/4C_scatra_ele.cpp Removes m_thermostvenant from transport element material-type allowlist.
src/scatra_ele/4C_scatra_ele_calc_loma.hpp Replaces thermo-StVK helper declaration with Fourier+structural-density helper; adds Fourier include.
src/scatra_ele/4C_scatra_ele_calc_loma.cpp Implements Fourier thermo material path using structural density from secondary material.
src/scatra_ele/4C_scatra_ele_boundary_calc.cpp Restricts convective heat transfer boundary handling to Fourier thermo material.
src/poroelast_scatra/4C_poroelast_scatra_utils_clonestrategy.cpp Aligns admissible cloned material types with Fourier thermo.
src/mat/4C_mat_trait_thermo_solid.hpp Removes Thermo/Solid trait inheritance and simplifies reinit API for thermo-solid materials.
src/mat/4C_mat_trait_solid.hpp Deletes empty Trait::Solid interface.
src/mat/4C_mat_thermostvenantkirchhoff.hpp Switches ThermoStVK to Trait::ThermoSolid and drops legacy thermo-material forwarding members/APIs.
src/mat/4C_mat_thermostvenantkirchhoff.cpp Removes THERMOMAT handling and internal thermo-material creation/forwarding.
src/mat/4C_mat_thermoplasticlinelast.hpp Switches ThermoPlasticLinElast to Trait::ThermoSolid and drops legacy thermo-material forwarding APIs.
src/mat/4C_mat_thermoplasticlinelast.cpp Removes THERMOMAT handling and internal thermo-material creation/forwarding.
src/mat/4C_mat_thermoplastichyperelast.hpp Switches ThermoPlasticHyperElast to Trait::ThermoSolid and drops legacy thermo-material forwarding APIs.
src/mat/4C_mat_thermoplastichyperelast.cpp Removes THERMOMAT handling and internal thermo-material creation/forwarding.
src/mat/4C_mat_thermomechanical.hpp Deletes unused ThermoMechanicalMaterial interface layer.
src/mat/4C_mat_robinson.hpp Switches Robinson to Trait::ThermoSolid and drops legacy thermo-material forwarding APIs.
src/mat/4C_mat_robinson.cpp Removes THERMOMAT handling and internal thermo-material creation/forwarding.
src/global_legacy_module/4C_global_legacy_module_validmaterials.cpp Removes THERMOMAT from valid material input specs for affected thermo-solid materials.
src/fs3i/4C_fs3i_utils.hpp Adds FS3I utility declaration for reattaching cross-field materials on matching grids.
src/fs3i/4C_fs3i_utils.cpp Implements FS3I cross-field material reattachment helper.
src/fs3i/4C_fs3i_partitioned.hpp Adds virtual validation hook for clone configuration (specialized by 2Wc).
src/fs3i/4C_fs3i_partitioned.cpp Calls clone validation and (currently unconditional) material pointer reattachment; reattaches again on restart.
src/fs3i/4C_fs3i_partitioned_2wc.hpp Overrides clone validation hook for two-way coupling.
src/fs3i/4C_fs3i_partitioned_2wc.cpp Enforces presence of a cloning material map entry for loma-based structure scatra cloning.

Comment thread src/fs3i/4C_fs3i_utils.cpp
Comment thread src/fs3i/4C_fs3i_partitioned.cpp Outdated
Comment thread src/fs3i/4C_fs3i_partitioned.cpp Outdated
Comment thread src/scatra_ele/4C_scatra_ele_calc_loma.cpp
@rjoussen rjoussen marked this pull request as draft June 6, 2026 11:30
@rjoussen rjoussen force-pushed the remove-thermo-trait-from-thermo-solid-trait branch from 07e6856 to 3286366 Compare June 17, 2026 23:34
@rjoussen rjoussen marked this pull request as ready for review June 18, 2026 09:00
@rjoussen rjoussen requested a review from maxfirmbach June 18, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Pull requests that require manual user actions after merging type: clean code Clean coding and good programming practices

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants