39 const Eigen::Matrix<double,SegmentType::dim,1>& grain2OutNormal,
40 const Eigen::Matrix<double,SegmentType::dim,1>& b2,
41 const Eigen::Matrix<double,SegmentType::dim,1>& n2)
46 const size_t q=seg.quadraturePoints().size()/2;
47 if(seg.quadraturePoints().size()>
q)
49 const Eigen::Matrix<double,SegmentType::dim,1> pk((seg.quadraturePoint(
q).stress*b2).cross(seg.chord().normalized()));
53 const Eigen::Matrix<double,SegmentType::dim,1> pkg(pk-pk.dot(n2)*n2);
55 if( pkg.dot(grain2OutNormal)<0.0
58 const Eigen::Matrix<double,SegmentType::dim,1>& b1(seg.burgers());
59 const double tau=fabs((seg.quadraturePoint(
q).stress*b2.normalized()).dot(n2));
61 temp=0.5*
alpha*((b1-b2).squaredNorm()+b2.squaredNorm()-b1.squaredNorm())-tau*b2.norm()*
lambda;
75 const Eigen::Matrix<double,SegmentType::dim,1>& grain2OutNormal,
76 const Eigen::Matrix<double,SegmentType::dim,1>& b2,
77 const Eigen::Matrix<double,SegmentType::dim,1>& n2)
80 return dGdirect(seg,grain2OutNormal,b2,n2);