本文整理汇总了C++中MIP::GetJacobian方法的典型用法代码示例。如果您正苦于以下问题:C++ MIP::GetJacobian方法的具体用法?C++ MIP::GetJacobian怎么用?C++ MIP::GetJacobian使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MIP
的用法示例。
在下文中一共展示了MIP::GetJacobian方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateMatrix
static void GenerateMatrix (const AFEL & bfel, const MIP & sip,
MAT & mat, LocalHeap & lh)
{
HeapReset hr(lh);
const HDivDivFiniteElement<2> & fel =
dynamic_cast<const HDivDivFiniteElement<2>&> (bfel);
int nd = fel.GetNDof();
Mat<3,2> jac = sip.GetJacobian();
double det = fabs (sip.GetJacobiDet());
FlatMatrix<> shape(nd, 3, lh);
fel.CalcShape (sip.IP(), shape);
Mat<3,9> trans;
for (int i = 0; i < 3; i++)
{
Mat<2> sigma_ref;
sigma_ref = 0.0;
switch (i)
{
case 0: sigma_ref(0,0) = 1.0; break;
case 1: sigma_ref(1,1) = 1.0; break;
case 2: sigma_ref(0,1) = sigma_ref(1,0) = 1.0; break;
}
auto hm = jac * sigma_ref;
auto sigma = hm * Trans(jac);
sigma *= (1.0 / sqr(det));
trans ( i, 0 ) = sigma(0,0);
trans ( i, 1 ) = sigma(0,1);
trans ( i, 2 ) = sigma(0,2);
trans ( i, 3 ) = sigma(1,0);
trans ( i, 4 ) = sigma(1,1);
trans ( i, 5 ) = sigma(1,2);
trans ( i, 6 ) = sigma(2,0);
trans ( i, 7 ) = sigma(2,1);
trans ( i, 8 ) = sigma(2,2);
}
mat = Trans(trans) * Trans (shape);
}