本文整理汇总了C++中NodeSet::have_any_mid_face_node方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeSet::have_any_mid_face_node方法的具体用法?C++ NodeSet::have_any_mid_face_node怎么用?C++ NodeSet::have_any_mid_face_node使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeSet
的用法示例。
在下文中一共展示了NodeSet::have_any_mid_face_node方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_have_any
void NodeSetTest::test_have_any()
{
NodeSet set;
set.clear();
CPPUNIT_ASSERT( !set.have_any_corner_node() );
set.set_corner_node(0);
CPPUNIT_ASSERT( set.have_any_corner_node() );
set.clear_corner_node(0);
CPPUNIT_ASSERT( !set.have_any_corner_node() );
set.set_corner_node( NodeSet::NUM_CORNER_BITS-1 );
CPPUNIT_ASSERT( set.have_any_corner_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
CPPUNIT_ASSERT( !set.have_any_mid_edge_node() );
set.set_mid_edge_node(0);
CPPUNIT_ASSERT( set.have_any_mid_edge_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear_mid_edge_node(0);
CPPUNIT_ASSERT( !set.have_any_mid_edge_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
set.set_mid_edge_node( NodeSet::NUM_EDGE_BITS-1 );
CPPUNIT_ASSERT( set.have_any_mid_edge_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear();
CPPUNIT_ASSERT( !set.have_any_mid_face_node() );
set.set_mid_face_node(0);
CPPUNIT_ASSERT( set.have_any_mid_face_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear_mid_face_node(0);
CPPUNIT_ASSERT( !set.have_any_mid_face_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
set.set_mid_face_node( NodeSet::NUM_FACE_BITS-1 );
CPPUNIT_ASSERT( set.have_any_mid_face_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear();
CPPUNIT_ASSERT( !set.have_any_mid_region_node() );
set.set_mid_region_node(0);
CPPUNIT_ASSERT( set.have_any_mid_region_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear_mid_region_node(0);
CPPUNIT_ASSERT( !set.have_any_mid_region_node() );
CPPUNIT_ASSERT( !set.have_any_mid_node() );
set.set_mid_region_node( NodeSet::NUM_REGION_BITS-1 );
CPPUNIT_ASSERT( set.have_any_mid_region_node() );
CPPUNIT_ASSERT( set.have_any_mid_node() );
set.clear();
}
示例2: coefficients
void TriLagrangeShape::coefficients( Sample loc,
NodeSet nodeset,
double* coeff_out,
size_t* indices_out,
size_t& num_coeff,
MsqError& err ) const
{
if (nodeset.have_any_mid_face_node()) {
MSQ_SETERR(err)("TriLagrangeShape does not support mid-element nodes",
MsqError::UNSUPPORTED_ELEMENT);
return;
}
switch (loc.dimension) {
case 0:
num_coeff = 1;
indices_out[0] = loc.number;
coeff_out[0] = 1.0;
break;
case 1:
if (nodeset.mid_edge_node(loc.number)) { // if mid-edge node is present
num_coeff = 1;
indices_out[0] = 3+loc.number;
coeff_out[0] = 1.0;
}
else { // no mid node on edge
num_coeff = 2;
indices_out[0] = loc.number;
indices_out[1] = (loc.number+1)%3;
coeff_out[0] = 0.5;
coeff_out[1] = 0.5;
}
break;
case 2:
num_coeff = 3;
indices_out[0] = 0;
indices_out[1] = 1;
indices_out[2] = 2;
coeff_out[0] = 1.0/3.0;
coeff_out[1] = 1.0/3.0;
coeff_out[2] = 1.0/3.0;
for (int i = 0; i < 3; ++i) { // for each mid-edge node
if (nodeset.mid_edge_node(i)) { // if node is present
indices_out[num_coeff] = i+3;
// coeff for mid-edge node
coeff_out[num_coeff] = 4.0/9.0;
// adjust coeff for adj corner nodes
coeff_out[i] -= 2.0/9.0;
coeff_out[(i+1)%3] -= 2.0/9.0;
// update count
++num_coeff;
}
}
break;
default:
MSQ_SETERR(err)(MsqError::UNSUPPORTED_ELEMENT,
"Request for dimension %d mapping function value"
"for a triangular element", loc.dimension);
}
}
示例3: derivatives
void TriLagrangeShape::derivatives( Sample loc,
NodeSet nodeset,
size_t* vertex_indices_out,
MsqVector<2>* d_coeff_d_xi_out,
size_t& num_vtx,
MsqError& err ) const
{
if (!nodeset.have_any_mid_node()) {
num_vtx = 3;
get_linear_derivatives( vertex_indices_out, d_coeff_d_xi_out );
return;
}
if (nodeset.have_any_mid_face_node()) {
MSQ_SETERR(err)("TriLagrangeShape does not support mid-element nodes",
MsqError::UNSUPPORTED_ELEMENT);
return;
}
switch (loc.dimension) {
case 0:
derivatives_at_corner( loc.number, nodeset, vertex_indices_out, d_coeff_d_xi_out, num_vtx );
break;
case 1:
derivatives_at_mid_edge( loc.number, nodeset, vertex_indices_out, d_coeff_d_xi_out, num_vtx );
break;
case 2:
derivatives_at_mid_elem( nodeset, vertex_indices_out, d_coeff_d_xi_out, num_vtx );
break;
default:
MSQ_SETERR(err)("Invalid/unsupported logical dimension",MsqError::INVALID_ARG);
}
}
示例4: test_all_nodes
void MsqMeshEntityTest::test_all_nodes( EntityTopology type, unsigned num_nodes )
{
const unsigned num_vtx = 27;
double coords[3*num_vtx] = {0.0};
size_t conn[num_vtx];
for (size_t i = 0; i < num_vtx; ++i)
conn[i] = i;
bool fixed[num_vtx] = {false};
CPPUNIT_ASSERT(num_nodes <= num_vtx);
MsqError err;
PatchData pd;
size_t n = num_nodes;
pd.fill( num_nodes, coords, 1, &type, &n, conn, fixed, err );
ASSERT_NO_ERROR(err);
MsqMeshEntity& elem = pd.element_by_index(0);
NodeSet all = elem.all_nodes(err);
ASSERT_NO_ERROR(err);
CPPUNIT_ASSERT_EQUAL( num_nodes, all.num_nodes() );
CPPUNIT_ASSERT( all.have_any_corner_node() );
bool mid_edge, mid_face, mid_reg;
TopologyInfo::higher_order( type, num_nodes, mid_edge, mid_face, mid_reg, err );
ASSERT_NO_ERROR(err);
CPPUNIT_ASSERT_EQUAL( mid_edge, !!all.have_any_mid_edge_node() );
CPPUNIT_ASSERT_EQUAL( mid_face, !!all.have_any_mid_face_node() );
CPPUNIT_ASSERT_EQUAL( mid_reg, !!all.have_any_mid_region_node() );
}