Skip to content

Commit

Permalink
Changed: Use new utl::vector::append() method
Browse files Browse the repository at this point in the history
  • Loading branch information
kmokstad committed Jan 28, 2025
1 parent 9be08a3 commit 002ac95
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions FractureElasticity.C
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ bool FractureElasticity::evalSol (Vector& s, const Vectors& eV,
{
// Insert the sigma_zz component for 2D plane strain
double nu = 0.5*lambda/(lambda+mu);
s.insert(s.begin()+2,nu*(sigma(1,1)+sigma(2,2)));
s.resize(4,utl::RETAIN);
s(4) = s(3);
s(3) = nu * (sigma(1,1)+sigma(2,2));
}

if (toLocal)
Expand All @@ -632,7 +634,7 @@ bool FractureElasticity::evalSol (Vector& s, const Vectors& eV,

if (toLocal)
{
s.insert(s.end(),Phi,Phi+3);
s.append(Phi,Phi+3);
s.push_back(Gc);
}

Expand Down Expand Up @@ -667,11 +669,12 @@ double FractureElasticity::evalPhaseField (Vec3& gradD,

// Invert the nodal phase field values, D = 1 - C,
// since that is the convention used in the Miehe papers
Vector eD(eV[eC].size()), tmp(nsd);
Vector eD(eV[eC].size());
for (size_t i = 0; i < eD.size(); i++)
eD[i] = 1.0 - eV[eC][i];

// Compute the phase field gradient, dD/dX
RealArray tmp(nsd);
if (dNdX.multiply(eD,tmp,true))
gradD = tmp;
else
Expand Down

0 comments on commit 002ac95

Please sign in to comment.