本文整理汇总了C++中MeshType类的典型用法代码示例。如果您正苦于以下问题:C++ MeshType类的具体用法?C++ MeshType怎么用?C++ MeshType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MeshType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: internaledges
boost::tuple<mpl::size_t<MESH_EDGES>,
typename MeshTraits<MeshType>::location_edge_const_iterator,
typename MeshTraits<MeshType>::location_edge_const_iterator>
internaledges( MeshType const& mesh, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_EDGES>(),
mesh.beginInternalEdge(),
mesh.endInternalEdge() );
}
示例2: load
MeshType* load(const xml::Node& desc, gcm::Body* body)
{
MeshType* mesh = new MeshType();
mesh->setId(desc["id"]);
mesh->setCalc(desc.getAttributeByName("calc", "false") == "true");
mesh->setBody(body);
loadMesh(desc, mesh);
return mesh;
}
示例3: idedfaces
boost::tuple<mpl::size_t<MESH_FACES>,
typename MeshTraits<MeshType>::face_const_iterator,
typename MeshTraits<MeshType>::face_const_iterator>
idedfaces( MeshType const& mesh, size_type id, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_FACES>(),
mesh.beginFaceWithId( id ),
mesh.endFaceWithId( id ) );
}
示例4: internalpoints
boost::tuple<mpl::size_t<MESH_POINTS>,
typename MeshTraits<MeshType>::location_point_const_iterator,
typename MeshTraits<MeshType>::location_point_const_iterator>
internalpoints( MeshType const& mesh, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_POINTS>(),
mesh.beginInternalPoint( ),
mesh.endInternalPoint() );
}
示例5: boundaryedges
boost::tuple<mpl::size_t<MESH_EDGES>,
typename MeshTraits<MeshType>::location_edge_const_iterator,
typename MeshTraits<MeshType>::location_edge_const_iterator>
boundaryedges( MeshType const& mesh, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_EDGES>(),
mesh.beginEdgeOnBoundary(),
mesh.endEdgeOnBoundary() );
}
示例6: allelements
boost::tuple<mpl::size_t<MESH_ELEMENTS>,
typename MeshTraits<MeshType>::element_const_iterator,
typename MeshTraits<MeshType>::element_const_iterator>
allelements( MeshType const& mesh, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_ELEMENTS>(),
mesh.beginElement(),
mesh.endElement() );
}
示例7: markedpoints
boost::tuple<mpl::size_t<MESH_POINTS>,
typename MeshTraits<MeshType>::marker_point_const_iterator,
typename MeshTraits<MeshType>::marker_point_const_iterator>
markedpoints( MeshType const& mesh, size_type flag, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_POINTS>(),
mesh.beginPointWithMarker( flag ),
mesh.endPointWithMarker( flag ) );
}
示例8: elements
boost::tuple<mpl::size_t<MESH_ELEMENTS>,
typename MeshTraits<MeshType>::element_const_iterator,
typename MeshTraits<MeshType>::element_const_iterator>
elements( MeshType const& mesh, rank_type pid, mpl::bool_<false> )
{
return boost::make_tuple( mpl::size_t<MESH_ELEMENTS>(),
mesh.beginElementWithProcessId( pid ),
mesh.endElementWithProcessId( pid ) );
}
示例9: marked3faces
boost::tuple<mpl::size_t<MESH_FACES>,
typename MeshTraits<MeshType>::marker3_face_const_iterator,
typename MeshTraits<MeshType>::marker3_face_const_iterator>
marked3faces( MeshType const& mesh, rank_type __pid, mpl::bool_<false> )
{
typedef typename MeshTraits<MeshType>::marker3_face_const_iterator iterator;
auto beg = mesh.beginFaceWithMarker3();
auto end = mesh.endFaceWithMarker3();
return boost::make_tuple( mpl::size_t<MESH_FACES>(),
beg, end );
}
示例10: initialize_node_values
double initialize_node_values(MeshType& mesh) const {
double max_height = 0;
for (auto nit = mesh.node_begin(); nit != mesh.node_end(); ++nit) {
unsigned H = 0;
if ((*nit).position().x < 0) H = 1;
(*nit).value() = QVar(1 + 0.75 * H * (pow(((*nit).position().x - 0.75), 2) +
pow((*nit).position().y, 2) - 0.15 * 0.15), 0, 0);
max_height = std::max(max_height, (*nit).value().h);
}
return max_height;
}
示例11: operator
std::pair<double, double> operator()(MeshType& mesh) const {
double max_height = derived().initialize_node_values(mesh);
double min_edge_length = (*mesh.edge_begin()).length();
for (auto eit = mesh.edge_begin(); eit != mesh.edge_end(); ++eit) {
min_edge_length = std::min(min_edge_length, (*eit).length());
}
for (auto tri_it = mesh.triangle_begin(); tri_it != mesh.triangle_end(); ++tri_it) {
(*tri_it).value() = ((*tri_it).node(0).value() + (*tri_it).node(1).value() + (*tri_it).node(2).value()) / 3.0;
}
return std::make_pair(max_height, min_edge_length);
}
示例12: createPointNeighbors
void createPointNeighbors ( MeshType const& mesh, neighborList_Type& neighborList )
{
neighborList.resize ( mesh.numGlobalPoints() );
// generate point neighbors by watching edges
// note: this can be based also on faces or volumes
for ( UInt ie = 0; ie < mesh.numEdges(); ie++ )
{
ID id0 = mesh.edge ( ie ).point ( 0 ).id();
ID id1 = mesh.edge ( ie ).point ( 1 ).id();
ASSERT ( mesh.point ( id0 ).id() == id0 && mesh.point ( id1 ).id() == id1,
"the mesh has been reordered, the point must be found" );
neighborList[ id0 ].insert ( id1 );
neighborList[ id1 ].insert ( id0 );
}
}
示例13: boundaryelements
boost::tuple<mpl::size_t<MESH_ELEMENTS>,
typename MeshTraits<MeshType>::location_element_const_iterator,
typename MeshTraits<MeshType>::location_element_const_iterator>
boundaryelements( MeshType const& mesh, uint16_type entity_min_dim, uint16_type entity_max_dim, rank_type pid, mpl::bool_<false> )
{
typedef typename MeshTraits<MeshType>::location_element_const_iterator iterator;
std::pair<iterator, iterator> p = mesh.boundaryElements( entity_min_dim, entity_max_dim, pid );
return boost::make_tuple( mpl::size_t<MESH_ELEMENTS>(), p.first, p.second );
}
示例14: internalelements
boost::tuple<mpl::size_t<MESH_ELEMENTS>,
typename MeshTraits<MeshType>::location_element_const_iterator,
typename MeshTraits<MeshType>::location_element_const_iterator>
internalelements( MeshType const& mesh, rank_type pid, mpl::bool_<false> )
{
typedef typename MeshTraits<MeshType>::location_element_const_iterator iterator;
std::pair<iterator, iterator> p = mesh.internalElements( pid );
return boost::make_tuple( mpl::size_t<MESH_ELEMENTS>(), p.first, p.second );
}
示例15: faces
boost::tuple<mpl::size_t<MESH_FACES>,
typename MeshTraits<MeshType>::pid_face_const_iterator,
typename MeshTraits<MeshType>::pid_face_const_iterator>
faces( MeshType const& mesh, rank_type __pid, mpl::bool_<false> )
{
typedef typename MeshTraits<MeshType>::pid_face_const_iterator pid_face_const_iterator;
pid_face_const_iterator it,en;
boost::tie( it, en ) = mesh.facesWithProcessId( __pid );
return boost::make_tuple( mpl::size_t<MESH_FACES>(), it, en );
}