本文整理汇总了C++中AssemblyContext::side_gradient方法的典型用法代码示例。如果您正苦于以下问题:C++ AssemblyContext::side_gradient方法的具体用法?C++ AssemblyContext::side_gradient怎么用?C++ AssemblyContext::side_gradient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssemblyContext
的用法示例。
在下文中一共展示了AssemblyContext::side_gradient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: side_qoi_derivative
void AverageNusseltNumber::side_qoi_derivative( AssemblyContext& context,
const unsigned int qoi_index )
{
for( std::set<libMesh::boundary_id_type>::const_iterator id = _bc_ids.begin();
id != _bc_ids.end(); id++ )
{
if( context.has_side_boundary_id( (*id) ) )
{
libMesh::FEBase* T_side_fe;
context.get_side_fe<libMesh::Real>(this->_T_var, T_side_fe);
const std::vector<libMesh::Real> &JxW = T_side_fe->get_JxW();
const std::vector<libMesh::Point>& normals = T_side_fe->get_normals();
unsigned int n_qpoints = context.get_side_qrule().n_points();
const unsigned int n_T_dofs = context.get_dof_indices(_T_var).size();
const std::vector<std::vector<libMesh::Gradient> >& T_gradphi = T_side_fe->get_dphi();
libMesh::DenseSubVector<libMesh::Number>& dQ_dT =
context.get_qoi_derivatives(qoi_index, _T_var);
// Loop over quadrature points
for (unsigned int qp = 0; qp != n_qpoints; qp++)
{
// Get the solution value at the quadrature point
libMesh::Gradient grad_T = 0.0;
context.side_gradient(this->_T_var, qp, grad_T);
// Update the elemental increment dR for each qp
//qoi += (this->_scaling)*(this->_k)*(grad_T*normals[qp])*JxW[qp];
for( unsigned int i = 0; i != n_T_dofs; i++ )
{
dQ_dT(i) += _scaling*_k*T_gradphi[i][qp]*normals[qp]*JxW[qp];
}
} // quadrature loop
} // end check on boundary id
}
return;
}
示例2: side_qoi
void AverageNusseltNumber::side_qoi( AssemblyContext& context,
const unsigned int qoi_index )
{
bool on_correct_side = false;
for (std::set<libMesh::boundary_id_type>::const_iterator id =
_bc_ids.begin(); id != _bc_ids.end(); id++ )
if( context.has_side_boundary_id( (*id) ) )
{
on_correct_side = true;
break;
}
if (!on_correct_side)
return;
libMesh::FEBase* side_fe;
context.get_side_fe<libMesh::Real>(this->_T_var, side_fe);
const std::vector<libMesh::Real> &JxW = side_fe->get_JxW();
const std::vector<libMesh::Point>& normals = side_fe->get_normals();
unsigned int n_qpoints = context.get_side_qrule().n_points();
libMesh::Number& qoi = context.get_qois()[qoi_index];
// Loop over quadrature points
for (unsigned int qp = 0; qp != n_qpoints; qp++)
{
// Get the solution value at the quadrature point
libMesh::Gradient grad_T = 0.0;
context.side_gradient(this->_T_var, qp, grad_T);
// Update the elemental increment dR for each qp
qoi += (this->_scaling)*(this->_k)*(grad_T*normals[qp])*JxW[qp];
} // quadrature loop
}