本文整理汇总了C++中PatchData::num_slave_vertices方法的典型用法代码示例。如果您正苦于以下问题:C++ PatchData::num_slave_vertices方法的具体用法?C++ PatchData::num_slave_vertices怎么用?C++ PatchData::num_slave_vertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchData
的用法示例。
在下文中一共展示了PatchData::num_slave_vertices方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printPatch
void NonGradient::printPatch(const PatchData &pd, MsqError &err)
{
if( mNonGradDebug==0 )
{
return;
}
const size_t numNode = pd.num_nodes(); //27, 27 what?
MSQ_PRINT(3)("Number of Vertices: %d\n",(int)pd.num_nodes());
const size_t numVert = pd.num_free_vertices(); // 1
MSQ_PRINT(3)("Num Free = %d\n",(int)pd.num_free_vertices());
const size_t numSlaveVert = pd.num_slave_vertices(); //0
const size_t numCoin = pd.num_corners(); // 64
const MsqVertex* coord = pd.get_vertex_array(err);
MSQ_PRINT(3)("Number of Vertices: %d\n",(int)pd.num_nodes());
std::cout << "Patch " << numNode << " " << numVert << " " << numSlaveVert << " " << numCoin << std::endl;
MSQ_PRINT(3)("");
std::cout << "Coordinate ";
std::cout << " " << std::endl;
for( size_t index = 0; index < numVert; index++ )
{
std::cout << coord[index][0] << " " << coord[index][1] << " " << coord[index][2] << std::endl;
}
//const size_t numElt = pd.num_elements();
if( mNonGradDebug >= 3 )
{
std::cout << "Number of Elements: " << pd.num_elements() << std::endl;
}
MSQ_PRINT(3)("Number of Elements: %d\n",(int)pd.num_elements());
}
示例2: check_global_patch_slaved
int check_global_patch_slaved( Mesh& mesh, MsqError& err )
{
Settings s;
s.set_slaved_ho_node_mode( Settings::SLAVE_FLAG );
MeshDomainAssoc mesh_and_domain = MeshDomainAssoc(&mesh, 0);
Instruction::initialize_vertex_byte( &mesh_and_domain, &s, err ); MSQ_ERRZERO(err);
PatchData pd;
pd.attach_settings( &s );
pd.set_mesh( &mesh );
pd.fill_global_patch( err ); MSQ_ERRZERO(err);
std::vector<bool> fixed, slaved;
mesh.vertices_get_fixed_flag( pd.get_vertex_handles_array(),
fixed, pd.num_nodes(), err );
MSQ_ERRZERO(err);
mesh.vertices_get_slaved_flag( pd.get_vertex_handles_array(),
slaved, pd.num_nodes(), err );
MSQ_ERRZERO(err);
const size_t first_free = 0;
const size_t first_slaved = pd.num_free_vertices();
const size_t first_fixed = pd.num_free_vertices() + pd.num_slave_vertices();
int error_count = 0;
for (size_t i = first_free; i < first_slaved; ++i) {
if (fixed[i]) {
std::cerr << "Vertex " << (size_t)pd.get_vertex_handles_array()[i]
<< " is fixed in mesh but free in PatchData" << std::endl;
++error_count;
}
if (slaved[i]) {
std::cerr << "Vertex " << (size_t)pd.get_vertex_handles_array()[i]
<< " is slaved in mesh but free in PatchData" << std::endl;
++error_count;
}
}
for (size_t i = first_slaved; i < first_fixed; ++i) {
if (fixed[i]) {
std::cerr << "Vertex " << (size_t)pd.get_vertex_handles_array()[i]
<< " is fixed in mesh but slaved in PatchData" << std::endl;
++error_count;
}
else if (!slaved[i]) {
std::cerr << "Vertex " << (size_t)pd.get_vertex_handles_array()[i]
<< " is free in Mesh but slaved in PatchData" << std::endl;
++error_count;
}
}
for (size_t i = first_fixed; i < pd.num_nodes(); ++i) {
if (!fixed[i]) {
std::cerr << "Vertex " << (size_t)pd.get_vertex_handles_array()[i]
<< " is not fixed in mesh but is in PatchData" << std::endl;
++error_count;
}
}
return 0 == error_count;
}
示例3: tag_patch_slaved
void tag_patch_slaved( Mesh& mesh,
Settings::HigherOrderSlaveMode mode,
MsqError& err )
{
int zero = 0;
TagHandle tag = mesh.tag_create( "pd_slaved", Mesh::INT, 1, &zero, err );
MSQ_ERRRTN(err);
Settings s;
s.set_slaved_ho_node_mode( mode );
PatchData pd;
pd.attach_settings( &s );
pd.set_mesh( &mesh );
pd.fill_global_patch( err );
MSQ_ERRRTN(err);
const Mesh::VertexHandle* verts = pd.get_vertex_handles_array() + pd.num_free_vertices();
std::vector<int> ones( pd.num_slave_vertices(), 1 );
mesh.tag_set_vertex_data( tag, pd.num_slave_vertices(), verts, arrptr(ones), err );
MSQ_ERRRTN(err);
}