本文整理汇总了C++中MutableMesh::ConstructLinearMesh方法的典型用法代码示例。如果您正苦于以下问题:C++ MutableMesh::ConstructLinearMesh方法的具体用法?C++ MutableMesh::ConstructLinearMesh怎么用?C++ MutableMesh::ConstructLinearMesh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MutableMesh
的用法示例。
在下文中一共展示了MutableMesh::ConstructLinearMesh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throw
void TestImposeBoundaryConditionWithNoWnt1d() throw(Exception)
{
// Create 1D cell population
unsigned num_cells = 5;
MutableMesh<1,1> mesh;
mesh.ConstructLinearMesh(num_cells-1);
std::vector<CellPtr> cells;
CellsGenerator<FixedDurationGenerationBasedCellCycleModel, 2> cells_generator;
cells_generator.GenerateBasic(cells, mesh.GetNumNodes());
MeshBasedCellPopulation<1> crypt(mesh, cells);
// Store the node locations
std::map<Node<1>*, c_vector<double, 1> > node_locations_before;
for (unsigned node_index=0; node_index<mesh.GetNumNodes(); node_index++)
{
node_locations_before[crypt.GetNode(node_index)] = crypt.GetNode(node_index)->rGetLocation();
}
// Now move the first cell (which should be on x=0, and a stem cell) to the left a bit
AbstractCellPopulation<1>::Iterator cell_iter = crypt.Begin();
// Check is a stem cell
TS_ASSERT_EQUALS(cell_iter->GetCellProliferativeType()->IsType<StemCellProliferativeType>(), true);
// Check initially at x=0
TS_ASSERT_DELTA(crypt.GetLocationOfCellCentre(*cell_iter)[0], 0.0, 1e-6);
// Now move to the left a bit
crypt.GetNode(0)->rGetModifiableLocation()[0] = -0.1;
TS_ASSERT_LESS_THAN(crypt.GetLocationOfCellCentre(*cell_iter)[0], 0.0);
// Pass this cell population to a boundary condition object
CryptSimulationBoundaryCondition<1> boundary_condition(&crypt);
// Impose the boundary condition without a Wnt stimulus
boundary_condition.ImposeBoundaryCondition(node_locations_before);
/*
* The first cell should have been pulled back to x=0 since it is a stem cell and
* there is no Wnt stimulus. It should be unaffected by jiggling, which is not imposed
* in 1D.
*/
TS_ASSERT_DELTA(0.0, crypt.GetLocationOfCellCentre(*cell_iter)[0], 1e-3);
// The nodes should all now be at their original locations
std::map<Node<1>*, c_vector<double, 1> > node_locations_after;
for (unsigned node_index=0; node_index<mesh.GetNumNodes(); node_index++)
{
node_locations_after[crypt.GetNode(node_index)] = crypt.GetNode(node_index)->rGetLocation();
}
for (unsigned node_index=0; node_index<mesh.GetNumNodes(); node_index++)
{
TS_ASSERT_DELTA(node_locations_before[crypt.GetNode(node_index)](0), node_locations_after[crypt.GetNode(node_index)](0), 1e-3);
}
}
示例2: throw
void TestSloughingCellKillerIn1d() throw(Exception)
{
// Create 1D mesh
unsigned num_cells = 14;
MutableMesh<1,1> mesh;
mesh.ConstructLinearMesh(num_cells-1);
// Create cells
std::vector<CellPtr> cells;
CellsGenerator<FixedDurationGenerationBasedCellCycleModel, 2> cells_generator;
cells_generator.GenerateBasic(cells, mesh.GetNumNodes());
// Create cell population
MeshBasedCellPopulation<1> cell_population(mesh, cells);
// Set the crypt length so that 2 cells should be sloughed off
double crypt_length = 12.5;
// Create cell killer and kill cells
SloughingCellKiller<1> sloughing_cell_killer(&cell_population, crypt_length);
sloughing_cell_killer.CheckAndLabelCellsForApoptosisOrDeath();
// Check that cells were labelled for death correctly
for (AbstractCellPopulation<1>::Iterator cell_iter = cell_population.Begin();
cell_iter != cell_population.End();
++cell_iter)
{
double x = cell_population.GetLocationOfCellCentre(*cell_iter)[0];
if (x > crypt_length)
{
TS_ASSERT_EQUALS(cell_iter->IsDead(), true);
}
else
{
TS_ASSERT_EQUALS(cell_iter->IsDead(), false);
}
}
// Check that dead cells were correctly removed
cell_population.RemoveDeadCells();
for (AbstractCellPopulation<1>::Iterator cell_iter = cell_population.Begin();
cell_iter != cell_population.End();
++cell_iter)
{
double x = cell_population.GetLocationOfCellCentre(*cell_iter)[0];
TS_ASSERT_LESS_THAN_EQUALS(x, crypt_length);
}
}