本文整理汇总了C++中TetrahedralMesh::GetNumAllNodes方法的典型用法代码示例。如果您正苦于以下问题:C++ TetrahedralMesh::GetNumAllNodes方法的具体用法?C++ TetrahedralMesh::GetNumAllNodes怎么用?C++ TetrahedralMesh::GetNumAllNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TetrahedralMesh
的用法示例。
在下文中一共展示了TetrahedralMesh::GetNumAllNodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestExtendedProblemVsMartincCode
/**
* This test is aimed at comparing the extended bidomain implementation in Chaste with
* the original Finite Difference code developed by Martin Buist.
*
* All the parameters are chosen to replicate the same conditions as in his code.
*/
void TestExtendedProblemVsMartincCode() throw (Exception)
{
SetupParameters();
TetrahedralMesh<1,1> mesh;
unsigned number_of_elements = 100;//this is nGrid in Martin's code
double length = 10.0;//100mm as in Martin's code
mesh.ConstructRegularSlabMesh(length/number_of_elements, length);
TS_ASSERT_EQUALS(mesh.GetNumAllNodes(), number_of_elements + 1);
double Am_icc = 1000.0;
double Am_smc = 1000.0;
double Am_gap = 1.0;
double Cm_icc = 1.0;
double Cm_smc = 1.0;
double G_gap = 20.0;//mS/cm^2
HeartConfig::Instance()->SetSimulationDuration(1000.0); //ms.
ICC_Cell_factory icc_factory;
SMC_Cell_factory smc_factory;
std::string dir = "ICCandSMC";
std::string filename = "extended1d";
HeartConfig::Instance()->SetOutputDirectory(dir);
HeartConfig::Instance()->SetOutputFilenamePrefix(filename);
ExtendedBidomainProblem<1> extended_problem( &icc_factory , &smc_factory);
extended_problem.SetMesh(&mesh);
extended_problem.SetExtendedBidomainParameters(Am_icc,Am_smc, Am_gap, Cm_icc, Cm_smc, G_gap);
extended_problem.SetIntracellularConductivitiesForSecondCell(Create_c_vector(1.0));
std::vector<unsigned> outputnodes;
outputnodes.push_back(50u);
HeartConfig::Instance()->SetRequestedNodalTimeTraces(outputnodes);
extended_problem.Initialise();
extended_problem.Solve();
HeartEventHandler::Headings();
HeartEventHandler::Report();
/**
* Compare with valid data.
* As Martin's code is an FD code, results will never match exactly.
* The comparison below is done against a 'valid' h5 file.
*
* The h5 file (1DValid.h5) is a Chaste (old phi_i formulation) file with is valid because, when extrapolating results from it, they look very similar
* (except for a few points at the end of the upstroke) to the results taken
* directly from Martin's code.
* A plot of Chaste results versus Martin's result (at node 50) is stored
* in the file 1DChasteVsMartin.eps for reference.
*
* A second plot comparing the old formulation (with phi_i) to the new formulation with V_m is contained in
*.1DChasteNewFormulation.png
*
*/
TS_ASSERT( CompareFilesViaHdf5DataReader("heart/test/data/extendedbidomain", "1DValid", false,
dir, filename, true,
0.2));
/*
* Here we compare the new formulation (V_m1, V_m2, phi_e)
* with the previous formulation (phi_i1, phi_i2, phi_e) running with GMRES and an absolute KSP tolerance of 1e-8.
*/
TS_ASSERT( CompareFilesViaHdf5DataReader("heart/test/data/extendedbidomain", "extended1d_previous_chaste_formulation_abs_tol_1e-8", false,
dir, filename, true,
1e-2));
}