WIP: feat: prepare for fast explicit implementations#33
Draft
alexdummer wants to merge 4 commits intoMAteRialMOdelingToolbox:next_v26.05from
Draft
WIP: feat: prepare for fast explicit implementations#33alexdummer wants to merge 4 commits intoMAteRialMOdelingToolbox:next_v26.05from
alexdummer wants to merge 4 commits intoMAteRialMOdelingToolbox:next_v26.05from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces explicit-time-integration entry points across materials and elements (e.g., “explicit” stress update without tangents), and adds API hooks for density/damping needed by explicit dynamics.
Changes:
- Add
computeStressExplicit(...)default implementations to material base classes and an optimized override forVonMisesModel. - Add element-side explicit internal force assembly (
computeYourselfExplicit) and a new lumped damping interface. - Add a damping-coefficient material API and tighten default
getDensity()behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/materials/VonMises/src/VonMises.cpp | Adds getDampingCoefficient() and computeStressExplicit() implementation for Von Mises. |
| modules/materials/VonMises/include/Marmot/VonMises.h | Exposes the new explicit stress API + damping coefficient getter. |
| modules/elements/DisplacementFiniteElement/include/Marmot/DisplacementFiniteElement.h | Adds explicit element assembly, changes lumped inertia approach, adds lumped damping computation. |
| modules/core/MarmotMechanicsCore/include/Marmot/MarmotMaterialHypoElastic.h | Adds default computeStressExplicit, adds getDampingCoefficient, changes default getDensity() to throw. |
| modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrain.h | Adds default finite-strain computeStressExplicit wrapper. |
| modules/core/MarmotFiniteElementCore/include/Marmot/MarmotElement.h | Adds virtual computeYourselfExplicit and computeLumpedDamping with throwing defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Map< RhsSized > LCM( C ); | ||
| LCM.setZero(); | ||
|
|
||
| constexpr int nNodesLinear = pow( 2, nDim ); |
| else if ( sectionType == SectionType::PlaneStrain ) { | ||
|
|
||
| Vector6d dE6 = planeVoigtToVoigt( dE ); | ||
| Matrix6d C66; |
| double dT, | ||
| double& pNewdT ); | ||
|
|
||
| /** # |
| /* } */ | ||
| /* Eigen::VectorXd stress1D( 1 ); */ | ||
| /* stress1D( 0 ) = state.stress; */ | ||
| /* qp.managedStateVars->stress = make3DVoigt< ParentGeometryElement::voigtSize >( stress1D ); */ # |
| KeSizedMatrix CMM; | ||
| CMM.setZero(); | ||
| computeConsistentInertia( CMM.data() ); | ||
| constexpr int nNodesLinear = pow( 2, nDim ); |
Comment on lines
+878
to
+881
| VectorXd N_weighted = 0.5 * ( N_ ); | ||
| // add the linear contribution to the first nNodesLinear nodes | ||
| N_weighted.head( nNodesLinear ) += 0.5 * N_lin; | ||
|
|
Comment on lines
+907
to
+911
| const double rho = qp.material->getDensity(); | ||
| VectorXd m_ = N_weighted * qp.detJ * qp.weight * rho; | ||
| for ( int i = 0; i < nNodes; i++ ) { | ||
| for ( int d = 0; d < nDim; d++ ) | ||
| LCM( i * nDim + d ) += m_( i ); |
| } | ||
|
|
||
| virtual double getDensity() { return -1; } | ||
| virtual double getDensity() { throw std::runtime_error( "getDensity() not implemented for this material." ); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.