本文整理汇总了C++中SymmTensor::xz方法的典型用法代码示例。如果您正苦于以下问题:C++ SymmTensor::xz方法的具体用法?C++ SymmTensor::xz怎么用?C++ SymmTensor::xz使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymmTensor
的用法示例。
在下文中一共展示了SymmTensor::xz方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Real
StressDivergence::computeQpJacobian()
{
Real sum_C3x3 = _Jacobian_mult[_qp].sum_3x3();
RealGradient sum_C3x1 = _Jacobian_mult[_qp].sum_3x1();
Real jacobian = 0.0;
// B^T_i * C * B_j
jacobian += _Jacobian_mult[_qp].stiffness(
_component, _component, _grad_test[_i][_qp], _grad_phi[_j][_qp]); // B^T_i * C *B_j
if (_volumetric_locking_correction)
{
// jacobian = Bbar^T_i * C * Bbar_j where Bbar = B + Bvol
// jacobian = B^T_i * C * B_j + Bvol^T_i * C * Bvol_j + Bvol^T_i * C * B_j + B^T_i * C * Bvol_j
// Bvol^T_i * C * Bvol_j
jacobian += sum_C3x3 * (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component)) *
(_avg_grad_phi[_j][_component] - _grad_phi[_j][_qp](_component)) / 9.0;
// B^T_i * C * Bvol_j
jacobian += sum_C3x1(_component) * _grad_test[_i][_qp](_component) *
(_avg_grad_phi[_j][_component] - _grad_phi[_j][_qp](_component)) / 3.0;
// Bvol^T_i * C * B_j
SymmTensor phi;
if (_component == 0)
{
phi.xx() = _grad_phi[_j][_qp](0);
phi.xy() = _grad_phi[_j][_qp](1);
phi.xz() = _grad_phi[_j][_qp](2);
}
else if (_component == 1)
{
phi.yy() = _grad_phi[_j][_qp](1);
phi.xy() = _grad_phi[_j][_qp](0);
phi.yz() = _grad_phi[_j][_qp](2);
}
else if (_component == 2)
{
phi.zz() = _grad_phi[_j][_qp](2);
phi.xz() = _grad_phi[_j][_qp](0);
phi.yz() = _grad_phi[_j][_qp](1);
}
SymmTensor tmp(_Jacobian_mult[_qp] * phi);
jacobian += (tmp.xx() + tmp.yy() + tmp.zz()) *
(_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component)) / 3.0;
}
if (_dt > 0)
return jacobian * (1 + _alpha + _zeta / _dt);
else
return jacobian;
}
示例2:
ColumnMajorMatrix
CrackFrontDefinition::rotateToCrackFrontCoords(const SymmTensor tensor, const unsigned int node_index) const
{
ColumnMajorMatrix tensor_CMM;
tensor_CMM(0,0) = tensor.xx();
tensor_CMM(0,1) = tensor.xy();
tensor_CMM(0,2) = tensor.xz();
tensor_CMM(1,0) = tensor.xy();
tensor_CMM(1,1) = tensor.yy();
tensor_CMM(1,2) = tensor.yz();
tensor_CMM(2,0) = tensor.xz();
tensor_CMM(2,1) = tensor.yz();
tensor_CMM(2,2) = tensor.zz();
ColumnMajorMatrix tmp = _rot_matrix[node_index] * tensor_CMM;
ColumnMajorMatrix rotT = _rot_matrix[node_index].transpose();
ColumnMajorMatrix rotated_tensor = tmp * rotT;
return rotated_tensor;
}