本文整理汇总了C++中Mat3::getPoly方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat3::getPoly方法的具体用法?C++ Mat3::getPoly怎么用?C++ Mat3::getPoly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat3
的用法示例。
在下文中一共展示了Mat3::getPoly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: work
void work() {
PiezoTensor pt = makePiezoTensor(3.655, 2.407, 0.328, 1.894);
MaterialTensor mt = makeMaterialTensor(19.886e10, 5.467e10, 6.799e10, 0.783e10, 23.418e10, 5.985e10, 7.209e10);
double rho = 4642.8;
double eps0 = 8.8542e-12;
double exx = eps0 * 44.9;
double ezz = eps0 * 26.7;
Vec3 n(0, 0, 1);
Mat3 christ = makePiezoChristoffel(pt, mt, n, exx, ezz);
Poly3 christPoly = christ.getPoly();
double g1, g2, g3;
christPoly.solve(&g1, &g2, &g3);
double v1 = sqrt(g1 / rho);
double v2 = sqrt(g2 / rho);
double v3 = sqrt(g3 / rho);
cout << "piezo tensor: " << endl << pt << endl;
cout << "material tensor: " << endl << mt << endl;
cout << "christoffel matrix: " << endl << christ << endl;
cout << "polynome " << christPoly << endl;
cout << "velocities = " << v1 << " " << v2 << " " << v3 << endl;
}
示例2: residual
double residual(const VNVels& vnv) {
PiezoTensor pt = makePiezoTensor(3.655, 2.407, 0.328, 1.894);
MaterialTensor mt = makeMaterialTensor(19.886e10, 5.467e10, 6.799e10, 0.783e10, 23.418e10, 5.985e10, 7.209e10);
double rho = 4642.8;
double eps0 = 8.8542e-12;
double exx = eps0 * 44.9;
double ezz = eps0 * 26.7;
double ret = 0;
for(VNVels::const_iterator it = vnv.begin(); it != vnv.end(); ++it) {
Vec3 n(it -> first);
Mat3 christ = makePiezoChristoffel(pt, mt, n, exx, ezz);
Poly3 christPoly = christ.getPoly();
double g1, g2, g3;
christPoly.solve(&g1, &g2, &g3);
double v1 = sqrt(g1 / rho);
double v2 = sqrt(g2 / rho);
double v3 = sqrt(g3 / rho);
double maxv = max(max(v1, v2), v3);
double minv = min(min(v1, v2), v3);
double medv = v1 + v2 + v3 - maxv - minv;
Vec3 tv(minv, medv, maxv);
Vec3 ex = it -> second;
double curResidual = (ex - tv).norm();
ret += curResidual;
if (curResidual > 30000) {
cout << "curResidual = " << curResidual << " n = " << it -> first
<< " experimental = " << it -> second << " theory = " << tv << endl;
}
}
return ret;
}