Skip to content

Commit

Permalink
MAINT: Accomodated case where the previous plastic multiplier was large
Browse files Browse the repository at this point in the history
  • Loading branch information
NateAM committed Sep 28, 2024
1 parent adc8fd8 commit 8a033c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ namespace tardigradeHydra{
if ( ( *get_macroYield( ) ) > 0 ){

// Perturb the plastic multiplier
floatType delta = ( *hydra->getRelativeTolerance( ) ) * ( *get_macroYield( ) ) + ( *hydra->getAbsoluteTolerance( ) );
floatType delta = std::fmax( ( *get_plasticMultipliers( ) )[ 0 ], ( *hydra->getRelativeTolerance( ) ) * ( *get_macroYield( ) ) + ( *hydra->getAbsoluteTolerance( ) ) );
indices.push_back( ( *getStateVariableIndices( ) )[ 0 ] );
values.push_back( delta );

Expand All @@ -452,7 +452,7 @@ namespace tardigradeHydra{
if ( ( *get_microYield( ) ) > 0 ){

// Perturb the plastic multiplier
floatType delta = ( *hydra->getRelativeTolerance( ) ) * ( *get_microYield( ) ) + ( *hydra->getAbsoluteTolerance( ) );
floatType delta = std::fmax( ( *get_plasticMultipliers( ) )[ 1 ], ( *hydra->getRelativeTolerance( ) ) * ( *get_microYield( ) ) + ( *hydra->getAbsoluteTolerance( ) ) );
indices.push_back( ( *getStateVariableIndices( ) )[ 1 ] );
values.push_back( delta );

Expand All @@ -465,7 +465,7 @@ namespace tardigradeHydra{
if ( ( *get_microGradientYield( ) )[ i ] > 0 ){

// Perturb the plastic multiplier
floatType delta = ( *hydra->getRelativeTolerance( ) ) * ( *get_microGradientYield( ) )[ i ] + ( *hydra->getAbsoluteTolerance( ) );
floatType delta = std::fmax( ( *get_plasticMultipliers( ) )[ i + 2 ], ( *hydra->getRelativeTolerance( ) ) * ( *get_microGradientYield( ) )[ i ] + ( *hydra->getAbsoluteTolerance( ) ) );
indices.push_back( ( *getStateVariableIndices( ) )[ i + 2 ] );
values.push_back( delta );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,9 @@ BOOST_AUTO_TEST_CASE( test_suggestInitialIterates, * boost::unit_test::tolerance

unsigned int configuration_unknown_count = 45;

floatType tolr = 1e-2;
floatType tolr = 1e-9;

floatType tola = 1e-3;
floatType tola = 1e-9;

unsigned int maxIterations = 24;

Expand Down Expand Up @@ -1812,11 +1812,11 @@ BOOST_AUTO_TEST_CASE( test_suggestInitialIterates, * boost::unit_test::tolerance
const std::vector< unsigned int > index_answer2 = { 100, 101, 102, 103, 104 };

floatVector answer1( 10, 0 );
answer1[ 5 ] = tolr * R.macroYield + tola;
answer1[ 6 ] = tolr * R.microYield + tola;
answer1[ 7 ] = tolr * R.microGradientYield[ 0 ] + tola;
answer1[ 8 ] = tolr * R.microGradientYield[ 1 ] + tola;
answer1[ 9 ] = tolr * R.microGradientYield[ 2 ] + tola;
answer1[ 5 ] = 0.01;
answer1[ 6 ] = 0.02;
answer1[ 7 ] = 0.03;
answer1[ 8 ] = 0.04;
answer1[ 9 ] = 0.05;

floatVector answer2( 5, 0 );
answer2[ 0 ] = -R2.macroYield;
Expand Down

0 comments on commit 8a033c0

Please sign in to comment.