本文整理汇总了C++中AssemblyContext::side_value方法的典型用法代码示例。如果您正苦于以下问题:C++ AssemblyContext::side_value方法的具体用法?C++ AssemblyContext::side_value怎么用?C++ AssemblyContext::side_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssemblyContext
的用法示例。
在下文中一共展示了AssemblyContext::side_value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool GasRecombinationCatalyticWall<Chemistry>::eval_flux( bool compute_jacobian,
AssemblyContext& context,
libMesh::Real sign,
bool is_axisymmetric )
{
libMesh::FEGenericBase<libMesh::Real>* side_fe = NULL;
context.get_side_fe( _reactant_var_idx, side_fe );
// The number of local degrees of freedom in each variable.
const unsigned int n_var_dofs = context.get_dof_indices(_reactant_var_idx).size();
libmesh_assert_equal_to( n_var_dofs, context.get_dof_indices(_product_var_idx).size() );
// Element Jacobian * quadrature weight for side integration.
const std::vector<libMesh::Real> &JxW_side = side_fe->get_JxW();
// The var shape functions at side quadrature points.
const std::vector<std::vector<libMesh::Real> >& var_phi_side = side_fe->get_phi();
// Physical location of the quadrature points
const std::vector<libMesh::Point>& var_qpoint = side_fe->get_xyz();
// reactant residual
libMesh::DenseSubVector<libMesh::Number> &F_r_var = context.get_elem_residual(_reactant_var_idx);
// product residual
libMesh::DenseSubVector<libMesh::Number> &F_p_var = context.get_elem_residual(_product_var_idx);
unsigned int n_qpoints = context.get_side_qrule().n_points();
for (unsigned int qp=0; qp != n_qpoints; qp++)
{
libMesh::Real jac = JxW_side[qp];
if(is_axisymmetric)
{
const libMesh::Number r = var_qpoint[qp](0);
jac *= r;
}
std::vector<libMesh::Real> mass_fractions(this->_chem_ptr->n_species());
for( unsigned int s = 0; s < this->_chem_ptr->n_species(); s++ )
mass_fractions[s] = context.side_value(this->_species_vars[s], qp);
libMesh::Real Y_r = mass_fractions[this->_reactant_species_idx];
libMesh::Real T = context.side_value(this->_T_var, qp);
libMesh::Real R_mix = this->_chem_ptr->R_mix(mass_fractions);
libMesh::Real rho = this->rho( T, this->_p0, R_mix );
const libMesh::Real r_value = this->compute_reactant_mass_flux(rho, Y_r, T);
const libMesh::Real p_value = -r_value;
for (unsigned int i=0; i != n_var_dofs; i++)
{
F_r_var(i) += sign*r_value*var_phi_side[i][qp]*jac;
F_p_var(i) += sign*p_value*var_phi_side[i][qp]*jac;
if( compute_jacobian )
libmesh_not_implemented();
}
}
// We're not computing the Jacobian yet
return false;
}