本文整理汇总了C++中mesquite::MeshImpl::vertices_set_fixed_flag方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshImpl::vertices_set_fixed_flag方法的具体用法?C++ MeshImpl::vertices_set_fixed_flag怎么用?C++ MeshImpl::vertices_set_fixed_flag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mesquite::MeshImpl
的用法示例。
在下文中一共展示了MeshImpl::vertices_set_fixed_flag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
Mesh::VertexHandle corners[4];
classify_boundary( &mesh, corners, curves, err );
if (MSQ_CHKERR(err)) return 1;
// new, "deformed" domain will be an 2HDx2HD planar square
const double corner_coords[][3] = { {-HD,-HD, Z},
{ HD,-HD, Z},
{ HD, HD, Z},
{-HD, HD, Z} };
LineDomain lines[4] = {
LineDomain( Vector3D(corner_coords[0]), Vector3D( 1, 0, 0) ),
LineDomain( Vector3D(corner_coords[1]), Vector3D( 0, 1, 0) ),
LineDomain( Vector3D(corner_coords[2]), Vector3D(-1, 0, 0) ),
LineDomain( Vector3D(corner_coords[3]), Vector3D( 0,-1, 0) ) };
PlanarDomain surface( PlanarDomain::XY, Z );
// save initial mesh state
DeformingCurveSmoother curve_tool;
for (int i = 0; i < 4; ++i) {
curve_tool.store_initial_mesh( &mesh, &curves[i][0], curves[i].size(), &lines[i], err );
if (MSQ_CHKERR(err)) return 1;
}
DeformingDomainWrapper dd_wrapper;
dd_wrapper.store_initial_mesh( &mesh, err );
if (MSQ_CHKERR(err)) return 1;
// move corner vertices to new location
for (int i = 0; i < 4; ++i) {
Vector3D vect(corner_coords[i]);
mesh.vertex_set_coordinates( corners[i], vect, err );
if (MSQ_CHKERR(err)) return 1;
}
std::vector<bool> fixed(4,true);
mesh.vertices_set_fixed_flag( corners, fixed, 4, err );
if (MSQ_CHKERR(err)) return 1;
// smooth curves
for (int i = 0; i < 4; ++i) {
curve_tool.smooth_curve( &mesh, &curves[i][0], curves[i].size(), &lines[i],
DeformingCurveSmoother::PROPORTIONAL, err );
if (MSQ_CHKERR(err)) return 1;
fixed.resize(curves[i].size(),true);
mesh.vertices_set_fixed_flag( &curves[i][0], fixed, curves[i].size(), err );
if (MSQ_CHKERR(err)) return 1;
}
MeshDomainAssoc mesh_and_domain1 = MeshDomainAssoc(&mesh, &surface);
t.reset();
dd_wrapper.run_instructions( &mesh_and_domain1, err );
if (MSQ_CHKERR(err)) return 1;
double dd_secs = t.since_birth();
std::cout << std::endl << "DeformingDomainWrapper file (term crit=0.01) completed in "
<< dd_secs << " seconds" << std::endl;
// Do it all again for the next test
mesh.clear();
mesh.read_vtk( deforming_domain_file_name_1, err );
if (MSQ_CHKERR(err)) return 1;
std::vector<Mesh::VertexHandle> curves2[4];
Mesh::VertexHandle corners2[4];
classify_boundary( &mesh, corners2, curves2, err );
if (MSQ_CHKERR(err)) return 1;
// new, "deformed" domain will be an 2HDx2HD planar square
const double corner_coords2[][3] = { {-HD,-HD, Z},