当前位置: 首页>>代码示例>>C++>>正文


C++ Phase::pairCreator方法代码示例

本文整理汇总了C++中Phase::pairCreator方法的典型用法代码示例。如果您正苦于以下问题:C++ Phase::pairCreator方法的具体用法?C++ Phase::pairCreator怎么用?C++ Phase::pairCreator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phase的用法示例。


在下文中一共展示了Phase::pairCreator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setup


//.........这里部分代码省略.........
          v2 = m_container->findVertex(wall->corner(1) - m_inlet_length * m_inlet_normal, g_geom_eps);
          v3 = m_container->findVertex(wall->corner(2) - m_inlet_length * m_inlet_normal, g_geom_eps);

          m_container->addWall
            (new WallTriangle(m_container, m_container->reflector(),
                              v1, v2, v3));
        }

        /* Easy version */
/*        vector<point_t> &vertices = m_container->vertices();
        for (vector<point_t>::iterator i = vertices.begin(); i != vertices.end(); i++) {
            if (abs((*i)[dir] - coord) < g_geom_eps) {
                (*i)[dir] -= m_inlet_normal[dir]*m_inlet_length;
            }
            }*/

        m_container->vertexChanged();
        m_container->updateBoundingBox();
    
        m_proposedSize = m_container->boundingBox().corner2;
        
        // next will also call Boundary::setup => this may lead to addition of a frame
        BoundaryWithInlet::setup(sim, mgr);

        point_t inlet_c1, inlet_c2, r_c1, r_c2;

	Phase* phase = (Phase*) m_parent;

        if (m_inlet_pos_str == "bottom") {
            inlet_c1 = m_container->boundingBox().corner1;
            inlet_c2 = m_container->boundingBox().corner2;
            inlet_c2[dir] = inlet_c1[dir] + m_inlet_length;

            r_c1 = m_container->boundingBox().corner1;
//             r_c1[dir] += m_inlet_length;
            r_c2 = m_container->boundingBox().corner2;
            
            // take the frame into account if existent
            if(m_frontFrame[dir]) inlet_c2[dir] += phase->pairCreator()->interactionCutoff();
//             if(m_frontFrame[dir]) inlet_c2[dir] += sim->maxCutoff;

            r_c1[dir] = inlet_c2[dir];
                        
        } else {
            inlet_c1 = m_container->boundingBox().corner1;
            inlet_c2 = m_container->boundingBox().corner2;
            inlet_c1[dir] = inlet_c2[dir] - m_inlet_length;

            r_c1 = m_container->boundingBox().corner1;
            r_c2 = m_container->boundingBox().corner2;
//             r_c2[dir] -= m_inlet_length;
            
            // take the frame into account if existent
            if(m_endFrame[dir]) inlet_c1[dir] -= phase->pairCreator()->interactionCutoff();
//             if(m_endFrame[dir]) inlet_c1[dir] -= sim->maxCutoff;
            
            r_c2[dir] = inlet_c1[dir];
        }

                
        /* *New style* inlets with constant density */
//        periodic[dir] = true;
        periodic[dir] = false;
        inlet = mgr->cellSubdivide(sim->maxCutoff, inlet_c1, inlet_c2, periodic, 1, pc, 
          dir, (int) m_inlet_normal[dir], P_CREATE);

        pc->setRegion(inlet);

//        mgr->setPeriodicity(periodic);

        periodic[dir] = false;
        r = mgr->cellSubdivide(sim->maxCutoff, r_c1, r_c2, periodic, 0, pc, dir, 
          (int) -m_inlet_normal[dir], P_DELETE);
            
        MSG_DEBUG("BoundarySTL::setup", "r->n_cells = " << r->n_cells <<
                  ", inlet->n_cells = " << inlet->n_cells);

//        ManagerCell::connect
//            ((int) m_inlet_normal[dir]*dir-(m_inlet_normal[dir] < 0 ? 1 : 0), inlet, r, periodic, OUTLET);
        ManagerCell::connect
            ((int) m_inlet_normal[dir]*dir-(m_inlet_normal[dir] < 0 ? 1 : 0), inlet, r, periodic, NEIGHBOR);
    } else {
        m_proposedSize = m_container->boundingBox().corner2;
        
        // next could add a frame
        BoundaryWithInlet::setup(sim, mgr);

        r = mgr->cellSubdivide
          (sim->maxCutoff, m_container->boundingBox().corner1, m_container->boundingBox().corner2, periodic, 0);
    }

    mgr->cellSubdivisionFinished();
    
    mgr->assignContainer(m_container);
    
    int counter = 0;

    MSG_DEBUG("BoundarySTL::setup", "Writing geometry information to '" << m_geometry_filename << "'.");
    m_container->toVTK(m_geometry_filename);
}
开发者ID:hemanth1947,项目名称:sympler,代码行数:101,代码来源:boundary_stl.cpp


注:本文中的Phase::pairCreator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。