Skip to content

Commit

Permalink
Sigh, need to actually apply correction
Browse files Browse the repository at this point in the history
  • Loading branch information
reverendbedford committed Feb 12, 2025
1 parent 9aed305 commit 5bb10fa
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions src/hardening.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -899,14 +899,17 @@ void Chaboche::h_temp(const double * const s, const double * const alpha, double
double * const hv) const
{
std::fill(hv, hv+nhist(), 0.0);

std::vector<double> c = eval_vector(c_, T);
std::vector<double> dc = eval_deriv_vector(c_, T);

for (size_t i=0; i<n_; i++) {
if (c[i] == 0.0) continue;
for (size_t j=0; j<6; j++) {
hv[1+i*6+j] = -sqrt(2.0/3.0) * dc[i] / c[i] * alpha[1+i*6+j];

if (noniso_)
{
std::vector<double> c = eval_vector(c_, T);
std::vector<double> dc = eval_deriv_vector(c_, T);

for (size_t i=0; i<n_; i++) {
if (c[i] == 0.0) continue;
for (size_t j=0; j<6; j++) {
hv[1+i*6+j] = -sqrt(2.0/3.0) * dc[i] / c[i] * alpha[1+i*6+j];
}
}
}
}
Expand All @@ -921,18 +924,20 @@ void Chaboche::dh_da_temp(const double * const s, const double * const alpha, do
double * const dhv) const
{
std::fill(dhv, dhv+nhist()*nhist(), 0.0);

std::vector<double> c = eval_vector(c_, T);
std::vector<double> dc = eval_deriv_vector(c_, T);

for (size_t i=0; i<n_; i++) {
if (c[i] == 0.0) continue;
for (size_t j=0; j<6; j++) {
int ci = 1 + i*6 + j;
dhv[CINDEX(ci,ci,nhist())] = - sqrt(2.0/3.0) * dc[i] / c[i];

if (noniso_)
{
std::vector<double> c = eval_vector(c_, T);
std::vector<double> dc = eval_deriv_vector(c_, T);

for (size_t i=0; i<n_; i++) {
if (c[i] == 0.0) continue;
for (size_t j=0; j<6; j++) {
int ci = 1 + i*6 + j;
dhv[CINDEX(ci,ci,nhist())] = - sqrt(2.0/3.0) * dc[i] / c[i];
}
}
}

}

int Chaboche::n() const
Expand Down

0 comments on commit 5bb10fa

Please sign in to comment.