void NodeBasedCellPopulation<DIM>::AddReceivedHaloCells() { GetReceivedCells(); if (!PetscTools::AmMaster()) { for (typename std::vector<std::pair<CellPtr, Node<DIM>* > >::iterator iter = mpCellsRecvLeft->begin(); iter != mpCellsRecvLeft->end(); ++iter) { boost::shared_ptr<Node<DIM> > p_node(iter->second); AddHaloCell(iter->first, p_node); } } if (!PetscTools::AmTopMost()) { for (typename std::vector<std::pair<CellPtr, Node<DIM>* > >::iterator iter = mpCellsRecvRight->begin(); iter != mpCellsRecvRight->end(); ++iter) { boost::shared_ptr<Node<DIM> > p_node(iter->second); AddHaloCell(iter->first, p_node); } } mpNodesOnlyMesh->AddHaloNodesToBoxes(); }
void NodeBasedCellPopulation<DIM>::AddReceivedCells() { if (!PetscTools::AmMaster()) { for (typename std::vector<std::pair<CellPtr, Node<DIM>* > >::iterator iter = mpCellsRecvLeft->begin(); iter != mpCellsRecvLeft->end(); ++iter) { // Make a shared pointer to the node to make sure it is correctly deleted. boost::shared_ptr<Node<DIM> > p_node(iter->second); AddMovedCell(iter->first, p_node); } } if (!PetscTools::AmTopMost()) { for (typename std::vector<std::pair<CellPtr, Node<DIM>* > >::iterator iter = mpCellsRecvRight->begin(); iter != mpCellsRecvRight->end(); ++iter) { boost::shared_ptr<Node<DIM> > p_node(iter->second); AddMovedCell(iter->first, p_node); } } }
void TestGetCellUsingLocationIndexWithHaloCell() throw (Exception) { boost::shared_ptr<Node<3> > p_node(new Node<3>(10, false, 0.0, 0.0, 0.0)); // Create a cell. MAKE_PTR(WildTypeCellMutationState, p_state); MAKE_PTR(TransitCellProliferativeType, p_type); FixedDurationGenerationBasedCellCycleModel* p_model = new FixedDurationGenerationBasedCellCycleModel(); CellPtr p_cell(new Cell(p_state, p_model)); mpNodeBasedCellPopulation->AddHaloCell(p_cell, p_node); TS_ASSERT_THROWS_NOTHING(mpNodeBasedCellPopulation->GetCellUsingLocationIndex(10)); TS_ASSERT_EQUALS(mpNodeBasedCellPopulation->GetCellUsingLocationIndex(10), p_cell); }
void contextpath_from_guid(const GUID & p_guid, const GUID & p_subcommand, pfc::string_base & p_out, bool b_short) { p_out.reset(); service_enum_t<contextmenu_item> e; service_ptr_t<contextmenu_item> ptr; unsigned p_service_item_index; while (e.next(ptr)) { unsigned p_service_item_count = ptr->get_num_items(); for (p_service_item_index = 0; p_service_item_index < p_service_item_count; p_service_item_index++) { if (p_guid == ptr->get_item_guid(p_service_item_index)) { pfc::string8 name; ptr->get_item_name(p_service_item_index, name); if (!b_short) { ptr->get_item_default_path(p_service_item_index, p_out); if (p_out.get_length() && p_out[p_out.get_length() - 1] != '/') p_out.add_byte('/'); } p_out.add_string(name); if (p_subcommand != pfc::guid_null) { pfc::ptrholder_t<contextmenu_item_node_root> p_node(ptr->instantiate_item(p_service_item_index, metadb_handle_list(), contextmenu_item::caller_keyboard_shortcut_list)); if (p_node.is_valid()) if (__contextpath_from_guid_recur(p_node.get_ptr(), p_subcommand, p_out, b_short, true)) return; } } } } }