本文整理汇总了C++中Orientation::getEdgeOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ Orientation::getEdgeOrientation方法的具体用法?C++ Orientation::getEdgeOrientation怎么用?C++ Orientation::getEdgeOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orientation
的用法示例。
在下文中一共展示了Orientation::getEdgeOrientation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// Step 3: construct interpolant and check solutions
magnitude_type interpolation_error = 0, solution_norm =0;
for (int iel=0;iel<nelement;++iel) {
retrieve_element_solution(b,
b_asm,
local2global[iel],
nnodes_per_element);
if (verbose && p < 5) {
*outStream << " - Element solution, iel = " << iel << "\n";
*outStream << std::showpos;
for (int i=0;i<nbf;++i) {
*outStream << MatVal(b, i, 0) << "\n";
}
*outStream << std::noshowpos;
}
magnitude_type
element_interpolation_error = 0,
element_solution_norm = 0;
Orientation ort = Orientation::getOrientation(cell, element[iel]);
// set element nodal coordinates
fill_cell_nodes(cell_nodes,
nodes,
element[iel],
nvert, ndim);
compute_element_error(element_interpolation_error,
element_solution_norm,
element[iel],
cell_nodes,
basis_set,
b,
ort,
nx, ny);
interpolation_error += element_interpolation_error;
solution_norm += element_solution_norm;
{
int edge_orts[3];
ort.getEdgeOrientation(edge_orts, nedge);
*outStream << " iel = " << std::setw(4) << iel
<< ", orientation = "
<< edge_orts[0]
<< edge_orts[1]
<< edge_orts[2]
<< " , error = " << element_interpolation_error
<< " , solution norm = " << element_solution_norm
<< " , relative error = " << (element_interpolation_error/element_solution_norm)
<< "\n";
}
const magnitude_type relative_error = interpolation_error/solution_norm;
const magnitude_type tol = p*p*100*INTREPID_TOL;
if (relative_error > tol) {
++r_val;
*outStream << "\n\nPatch test failed: \n"
<< " exact polynomial (nx, ny) = " << std::setw(4) << nx << ", " << std::setw(4) << ny << "\n"
<< " basis order = " << std::setw(4) << p << "\n"
<< " orientation configuration = " << std::setw(4) << conf0 << std::setw(4) << conf1 << "\n"
<< " relative error = " << std::setw(4) << relative_error << "\n"
<< " tolerance = " << std::setw(4) << tol << "\n";
}
}
}
// for next iteration
std::next_permutation(elt_1, elt_1+3);
} // end of conf1
} // end of conf0
} // end of p
} // end of point type
} // end of ny
} // end of nx
}
catch (std::logic_error err) {
*outStream << err.what() << "\n\n";
r_val = -1000;
};
#else
*outStream << "\t This test is for high order element assembly. \n"
<< "\t Use -D INTREPID_USING_EXPERIMENTAL_HIGH_ORDER in CMAKE_CXX_FLAGS \n";
#endif
if (r_val != 0)
std::cout << "End Result: TEST FAILED :: r_val = " << r_val << "\n";
else
std::cout << "End Result: TEST PASSED\n";
// reset format state of std::cout
std::cout.copyfmt(oldFormatState);
Kokkos::finalize();
return r_val;
}