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


C++ TetrahedralMesh::rGetNodePermutation方法代码示例

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


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

示例1: throw

    void TestExtendedTissueHeterogeneousGgap3D() throw (Exception)
    {
        HeartConfig::Instance()->Reset();
        TrianglesMeshReader<3,3> mesh_reader("mesh/test/data/cube_2mm_12_elements");
        TetrahedralMesh<3,3> mesh;
        mesh.ConstructFromMeshReader(mesh_reader);

        std::vector<boost::shared_ptr<AbstractChasteRegion<3> > > heterogeneity_areas;
        std::vector<double> Ggap_values;

        //first cuboid include node 0
        ChastePoint<3> cornerA(-1, -1, 0);
        ChastePoint<3> cornerB(0.001, 0.001, 0.001);
        boost::shared_ptr<ChasteCuboid<3> > p_cuboid_1(new ChasteCuboid<3>(cornerA, cornerB));
        heterogeneity_areas.push_back(p_cuboid_1);

        //second cuboid include node 6
        ChastePoint<3> cornerC(0.199, 0.199, 0.199);
        ChastePoint<3> cornerD(0.25, 0.25, 0.25);
        boost::shared_ptr<ChasteCuboid<3> > p_cuboid_2(new ChasteCuboid<3>(cornerC, cornerD));
        ChasteCuboid<3> cuboid_2(cornerC, cornerD);

        heterogeneity_areas.push_back(p_cuboid_2);

        //within the first area
        Ggap_values.push_back(143.0);
        //within the second area
        Ggap_values.push_back(9143.0);
        //elsewhere
        double isotropic_ggap=586.0;

        StimulatedCellFactory stimulated_cell_factory;
        UnStimulatedCellFactory unstimulated_cell_factory;
        ExtracellularStimulusFactory extracellular_stimulus_factory;

        stimulated_cell_factory.SetMesh(&mesh);
        unstimulated_cell_factory.SetMesh(&mesh);
        extracellular_stimulus_factory.SetMesh(&mesh);

        ExtendedBidomainTissue<3>  extended_bidomain_tissue( &stimulated_cell_factory,  &unstimulated_cell_factory, &extracellular_stimulus_factory);

        extended_bidomain_tissue.SetGGap(isotropic_ggap);//this is what the problem class does first

        extended_bidomain_tissue.SetGgapHeterogeneities(heterogeneity_areas, Ggap_values);
        extended_bidomain_tissue.CreateGGapConductivities();

        unsigned probe_node_1 = 0u;
        unsigned probe_node_2 = 6u;
        unsigned probe_node_3 = 5u;

        const std::vector<unsigned>& r_permutation = mesh.rGetNodePermutation();
        if (!r_permutation.empty())
        {
            probe_node_1 = r_permutation[0u];//within first cuboid
            probe_node_2 = r_permutation[6u];//within second cuboid
            probe_node_3 = r_permutation[5u];//elsewhere
        }

        Vec vector =  mesh.GetDistributedVectorFactory()->CreateVec();
        DistributedVector dist_solution = mesh.GetDistributedVectorFactory()->CreateDistributedVector(vector);
        for (DistributedVector::Iterator index = dist_solution.Begin();
             index != dist_solution.End();
             ++index)
        {
            extended_bidomain_tissue.UpdateAdditionalCaches(index.Global, index.Local, 2.0);
        }
        extended_bidomain_tissue.ReplicateAdditionalCaches();

        //Ggap
        TS_ASSERT_EQUALS(extended_bidomain_tissue.rGetGgapCacheReplicated()[probe_node_1],143.0);//within first cuboid
        TS_ASSERT_EQUALS(extended_bidomain_tissue.rGetGgapCacheReplicated()[probe_node_2],9143.0);//within second cuboid
        TS_ASSERT_EQUALS(extended_bidomain_tissue.rGetGgapCacheReplicated()[probe_node_3],586.0);//elsewhere

        PetscTools::Destroy(vector);
    }
开发者ID:Chaste,项目名称:Old-Chaste-svn-mirror,代码行数:75,代码来源:TestExtendedBidomainTissue.hpp


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