本文整理汇总了C++中PatchData::get_domain_normals_at_corners方法的典型用法代码示例。如果您正苦于以下问题:C++ PatchData::get_domain_normals_at_corners方法的具体用法?C++ PatchData::get_domain_normals_at_corners怎么用?C++ PatchData::get_domain_normals_at_corners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchData
的用法示例。
在下文中一共展示了PatchData::get_domain_normals_at_corners方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_get_corner_normals_infinite_domain
void PatchDataTestNormals::test_get_corner_normals_infinite_domain()
{
MsqPrintError err(cout);
// Element 0 is a quad parallel to and below the Z plane.
// All corners of the element lie on the unit sphere and
// thus the normal should be the same as the location.
const size_t elem_index = 0;
std::vector<Vector3D> coords;
Vector3D normals[4];
unboundedMesh.get_element_vertex_coordinates( elem_index, coords, err );
CPPUNIT_ASSERT( !err );
CPPUNIT_ASSERT( coords.size() == 4 /*quad*/ );
unboundedMesh.get_domain_normals_at_corners( elem_index, normals, err );
CPPUNIT_ASSERT( !err );
for (size_t i = 0; i < 4; ++i)
{
ASSERT_VECTORS_EQUAL( coords[i], normals[i] );
}
}
示例2: test_get_corner_normals_bounded_domain
void PatchDataTestNormals::test_get_corner_normals_bounded_domain()
{
MsqPrintError err(cout);
std::vector<Vector3D> coords;
Vector3D normals[4];
// Element 0 is a quad in the plane X=1/sqrt(2). Two of
// the vertices of this element lie on the lower bounding
// curve of the cylinder, and the other two lie in the
// Z=0 plane
const size_t elem_index = 0;
boundedMesh.get_element_vertex_coordinates( elem_index, coords, err );
CPPUNIT_ASSERT( !err );
CPPUNIT_ASSERT( coords.size() == 4 /*quad*/ );
boundedMesh.get_domain_normals_at_corners( elem_index, normals, err );
CPPUNIT_ASSERT( !err );
for (size_t i = 0; i < 4; ++i)
{
coords[i][2] = 0; // project into Z plane
ASSERT_VECTORS_EQUAL( coords[i], normals[i] );
}
}