本文整理汇总了C++中AssemblyContext::get_qois方法的典型用法代码示例。如果您正苦于以下问题:C++ AssemblyContext::get_qois方法的具体用法?C++ AssemblyContext::get_qois怎么用?C++ AssemblyContext::get_qois使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssemblyContext
的用法示例。
在下文中一共展示了AssemblyContext::get_qois方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
}
示例2: element_qoi
void ParsedInteriorQoI::element_qoi( AssemblyContext& context,
const unsigned int qoi_index )
{
libMesh::FEBase* element_fe;
context.get_element_fe<libMesh::Real>(0, element_fe);
const std::vector<libMesh::Real> &JxW = element_fe->get_JxW();
const std::vector<libMesh::Point>& x_qp = element_fe->get_xyz();
unsigned int n_qpoints = context.get_element_qrule().n_points();
/*! \todo Need to generalize this to the multiple QoI case */
libMesh::Number& qoi = context.get_qois()[qoi_index];
for( unsigned int qp = 0; qp != n_qpoints; qp++ )
{
const libMesh::Number func_val =
(*qoi_functional)(context, x_qp[qp], context.get_time());
qoi += func_val * JxW[qp];
}
}