本文整理汇总了C++中CElement::computeGradShapefctLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ CElement::computeGradShapefctLocal方法的具体用法?C++ CElement::computeGradShapefctLocal怎么用?C++ CElement::computeGradShapefctLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CElement
的用法示例。
在下文中一共展示了CElement::computeGradShapefctLocal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeQuadratures
void ShapeFunctionPool::computeQuadratures(const std::vector<MshElemType::type>& elem_types,
const int num_elem_nodes[2][MshElemType::NUM_ELEM_TYPES],
const int dim_elem[],
CElement& quadrature, const int num_sample_gs_pnts)
{
const int order = quadrature.getOrder();
for (std::size_t i = 0; i < elem_types.size(); i++)
{
const MshElemType::type e_type = elem_types[i];
if (e_type == MshElemType::INVALID)
continue;
const int type_id = static_cast<int>(e_type) - 1;
quadrature.ConfigShapefunction(e_type);
const int nnodes = num_elem_nodes[order - 1][type_id];
const int elem_dim = dim_elem[type_id];
double* shape_function_center_values = _shape_function_center[type_id].data();
quadrature.SetCenterGP(e_type);
quadrature.ComputeShapefct(order, shape_function_center_values);
double* grad_shape_function_center_values = _grad_shape_function_center[type_id].data();
quadrature.computeGradShapefctLocal(order, grad_shape_function_center_values);
double* shape_function_values = _shape_function[type_id].data();
double* dshape_function_values = _grad_shape_function[type_id].data();
// Set number of integration points.
quadrature.SetGaussPointNumber(num_sample_gs_pnts);
quadrature.SetIntegrationPointNumber(e_type);
for (int gp = 0; gp < quadrature.GetNumGaussPoints(); gp++)
{
int gp_r, gp_s, gp_t;
quadrature.SetGaussPoint(e_type, gp, gp_r, gp_s, gp_t);
double* shape_function_values_gs = &shape_function_values[gp * nnodes];
quadrature.ComputeShapefct(order, shape_function_values_gs);
double* dshape_function_values_gs = &dshape_function_values[gp * nnodes * elem_dim];
quadrature.computeGradShapefctLocal(order, dshape_function_values_gs);
}
}
}