Real StressDivergenceRSphericalTensors::calculateJacobian(unsigned int ivar, unsigned int jvar) { RealGradient test_r, phi_r; if (ivar == 0) //Case grad_test for r, requires contributions from stress_{rr}, stress_{\theta \theta}, and stress_{\phi \phi} { test_r(0) = _grad_test[_i][_qp](0); test_r(1) = _test[_i][_qp] / _q_point[_qp](0); test_r(2) = _test[_i][_qp] / _q_point[_qp](0); } if (jvar == 0) { phi_r(0) = _grad_phi[_j][_qp](0); phi_r(1) = _phi[_j][_qp] / _q_point[_qp](0); phi_r(2) = _phi[_j][_qp] / _q_point[_qp](0); } if (ivar == 0 && jvar == 0) // Only nonzero case for a 1D simulation { return _Jacobian_mult[_qp].elasticJacobian(ivar, jvar, test_r, phi_r); } else mooseError("Invalid component in Jacobian Calculation"); }
// Approximates the second derivative of phi double CbPotential::phi_rr(const double &r) const { const double dr = r*EPS; return (phi_r(r+dr)-phi_r(r)) / dr; }