AbstractCellPopulation.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 #include "AbstractCellPopulation.hpp"
00030 #include "AbstractOdeBasedCellCycleModel.hpp"
00031 #include "PetscTools.hpp"
00032 
00033 template<unsigned DIM>
00034 AbstractCellPopulation<DIM>::AbstractCellPopulation(std::vector<CellPtr>& rCells,
00035                                     const std::vector<unsigned> locationIndices)
00036     : mCells(rCells.begin(), rCells.end()),
00037       mCellPopulationContainsMesh(false),
00038       mpCellPropertyRegistry(CellPropertyRegistry::Instance()->TakeOwnership()),
00039       mDampingConstantNormal(1.0),
00040       mDampingConstantMutant(1.0),
00041       mOutputCellIdData(false),
00042       mOutputCellMutationStates(false),
00043       mOutputCellAncestors(false),
00044       mOutputCellProliferativeTypes(false),
00045       mOutputCellVariables(false),
00046       mOutputCellCyclePhases(false),
00047       mOutputCellAges(false),
00048       mOutputCellVolumes(false)
00049 {
00050     // There must be at least one cell
00051     assert(!mCells.empty());
00052 
00053     // To avoid double-counting problems, clear the passed-in cells vector
00054     rCells.clear();
00055 
00056     if (!locationIndices.empty())
00057     {
00058         // There must be a one-one correspondence between cells and location indices
00059         if (mCells.size() != locationIndices.size())
00060         {
00061             EXCEPTION("There is not a one-one correspondence between cells and location indices");
00062         }
00063     }
00064 
00065     // Set up the map between location indices and cells
00066     std::list<CellPtr>::iterator it = mCells.begin();
00067     for (unsigned i=0; it != mCells.end(); ++it, ++i)
00068     {
00069         unsigned index = locationIndices.empty() ? i : locationIndices[i]; // assume that the ordering matches
00070         mLocationCellMap[index] = *it;
00071         mCellLocationMap[(*it).get()] = index;
00072 
00073         // Give each cell a pointer to the property registry (we have taken ownership in this constructor).
00074         (*it)->rGetCellPropertyCollection().SetCellPropertyRegistry(mpCellPropertyRegistry.get());
00075     }
00076 
00077     // Initialise cell counts to zero
00082     mCellProliferativeTypeCount = std::vector<unsigned>(NUM_CELL_PROLIFERATIVE_TYPES);
00083     for (unsigned i=0; i<mCellProliferativeTypeCount.size(); i++)
00084     {
00085         mCellProliferativeTypeCount[i] = 0;
00086     }
00087 
00088     mCellCyclePhaseCount = std::vector<unsigned>(NUM_CELL_CYCLE_PHASES);
00089     for (unsigned i=0; i<mCellCyclePhaseCount.size(); i++)
00090     {
00091         mCellCyclePhaseCount[i] = 0;
00092     }
00093 }
00094 
00095 template<unsigned DIM>
00096 AbstractCellPopulation<DIM>::~AbstractCellPopulation()
00097 {
00098 }
00099 
00100 template<unsigned DIM>
00101 void AbstractCellPopulation<DIM>::InitialiseCells()
00102 {
00103     for (typename AbstractCellPopulation<DIM>::Iterator cell_iter=this->Begin(); cell_iter!=this->End(); ++cell_iter)
00104     {
00105         cell_iter->InitialiseCellCycleModel();
00106     }
00107 }
00108 
00109 template<unsigned DIM>
00110 std::list<CellPtr>& AbstractCellPopulation<DIM>::rGetCells()
00111 {
00112     return mCells;
00113 }
00114 
00115 template<unsigned DIM>
00116 bool AbstractCellPopulation<DIM>::IsMeshBasedCellPopulation()
00117 {
00118     return mCellPopulationContainsMesh;
00119 }
00120 
00121 template<unsigned DIM>
00122 unsigned AbstractCellPopulation<DIM>::GetNumRealCells()
00123 {
00124     unsigned counter = 0;
00125     for (typename AbstractCellPopulation<DIM>::Iterator cell_iter=this->Begin(); cell_iter!=this->End(); ++cell_iter)
00126     {
00127         counter++;
00128     }
00129     return counter;
00130 }
00131 
00132 template<unsigned DIM>
00133 void AbstractCellPopulation<DIM>::SetCellAncestorsToLocationIndices()
00134 {
00135     for (typename AbstractCellPopulation<DIM>::Iterator cell_iter=this->Begin(); cell_iter!=this->End(); ++cell_iter)
00136     {
00137         cell_iter->SetAncestor(mCellLocationMap[(*cell_iter).get()]);
00138     }
00139 }
00140 
00141 template<unsigned DIM>
00142 std::set<unsigned> AbstractCellPopulation<DIM>::GetCellAncestors()
00143 {
00144     std::set<unsigned> remaining_ancestors;
00145     for (typename AbstractCellPopulation<DIM>::Iterator cell_iter=this->Begin(); cell_iter!=this->End(); ++cell_iter)
00146     {
00147         remaining_ancestors.insert(cell_iter->GetAncestor());
00148     }
00149     return remaining_ancestors;
00150 }
00151 
00152 template<unsigned DIM>
00153 std::vector<unsigned> AbstractCellPopulation<DIM>::GetCellMutationStateCount()
00154 {
00155     if (!mOutputCellMutationStates)
00156     {
00157         EXCEPTION("Call SetOutputCellMutationStates(true) before using this function");
00158     }
00159 
00160     // An ordering must have been specified for cell mutation states
00161     SetDefaultMutationStateOrdering();
00162 
00163     const std::vector<boost::shared_ptr<AbstractCellProperty> >& r_cell_properties =
00164         mpCellPropertyRegistry->rGetAllCellProperties();
00165 
00166     std::vector<unsigned> cell_mutation_state_count;
00167     for (unsigned i=0; i<r_cell_properties.size(); i++)
00168     {
00169         if (r_cell_properties[i]->IsSubType<AbstractCellMutationState>())
00170         {
00171             cell_mutation_state_count.push_back(r_cell_properties[i]->GetCellCount());
00172         }
00173     }
00174 
00175     return cell_mutation_state_count;
00176 }
00177 
00178 template<unsigned DIM>
00179 const std::vector<unsigned>& AbstractCellPopulation<DIM>::rGetCellProliferativeTypeCount() const
00180 {
00181     if (!mOutputCellProliferativeTypes)
00182     {
00183         EXCEPTION("Call SetOutputCellProliferativeTypes(true) before using this function");
00184     }
00185     return mCellProliferativeTypeCount;
00186 }
00187 
00188 template<unsigned DIM>
00189 const std::vector<unsigned>& AbstractCellPopulation<DIM>::rGetCellCyclePhaseCount() const
00190 {
00191     if (!mOutputCellCyclePhases)
00192     {
00193         EXCEPTION("Call SetOutputCellCyclePhases(true) before using this function");
00194     }
00195     return mCellCyclePhaseCount;
00196 }
00197 
00198 template<unsigned DIM>
00199 CellPtr AbstractCellPopulation<DIM>::GetCellUsingLocationIndex(unsigned index)
00200 {
00201     // Get a pointer to the cell corresponding to this location index
00202     CellPtr p_cell = mLocationCellMap[index];
00203 
00204     // Unless this pointer is null, return the cell
00205     if (p_cell)
00206     {
00207         return p_cell;
00208     }
00209     else
00210     {
00211         EXCEPTION("Location index input argument does not correspond to a Cell");
00212     }
00213 }
00214 
00215 template<unsigned DIM>
00216 unsigned AbstractCellPopulation<DIM>::GetLocationIndexUsingCell(CellPtr pCell)
00217 {
00218     return mCellLocationMap[pCell.get()];
00219 }
00220 
00221 template<unsigned DIM>
00222 boost::shared_ptr<CellPropertyRegistry> AbstractCellPopulation<DIM>::GetCellPropertyRegistry()
00223 {
00224     return mpCellPropertyRegistry;
00225 }
00226 
00227 template<unsigned DIM>
00228 void AbstractCellPopulation<DIM>::SetDefaultMutationStateOrdering()
00229 {
00230     boost::shared_ptr<CellPropertyRegistry> p_registry = GetCellPropertyRegistry();
00231     if (!p_registry->HasOrderingBeenSpecified())
00232     {
00233         std::vector<boost::shared_ptr<AbstractCellProperty> > mutations;
00234         mutations.push_back(p_registry->Get<WildTypeCellMutationState>());
00235         mutations.push_back(p_registry->Get<ApcOneHitCellMutationState>());
00236         mutations.push_back(p_registry->Get<ApcTwoHitCellMutationState>());
00237         mutations.push_back(p_registry->Get<BetaCateninOneHitCellMutationState>());
00238         p_registry->SpecifyOrdering(mutations);
00239     }
00240 }
00241 
00243 //                             Output methods                               //
00245 
00246 
00247 template<unsigned DIM>
00248 void AbstractCellPopulation<DIM>::CreateOutputFiles(const std::string& rDirectory, bool cleanOutputDirectory)
00249 {
00250     OutputFileHandler output_file_handler(rDirectory, cleanOutputDirectory);
00251     mpVizNodesFile = output_file_handler.OpenOutputFile("results.viznodes");
00252     mpVizBoundaryNodesFile = output_file_handler.OpenOutputFile("results.vizboundarynodes");
00253     mpVizCellProliferativeTypesFile = output_file_handler.OpenOutputFile("results.vizcelltypes");
00254 
00255     if (mOutputCellAncestors)
00256     {
00257         mpVizCellAncestorsFile = output_file_handler.OpenOutputFile("results.vizancestors");
00258     }
00259     if (mOutputCellMutationStates)
00260     {
00261         // An ordering must be specified for cell mutation states
00262         SetDefaultMutationStateOrdering();
00263 
00264         mpCellMutationStatesFile = output_file_handler.OpenOutputFile("cellmutationstates.dat");
00265 
00266         *mpCellMutationStatesFile << "Time\t ";
00267 
00268         const std::vector<boost::shared_ptr<AbstractCellProperty> >& r_cell_properties =
00269             mpCellPropertyRegistry->rGetAllCellProperties();
00270 
00271         std::vector<unsigned> cell_mutation_state_count;
00272         for (unsigned i=0; i<r_cell_properties.size(); i++)
00273         {
00274             if (r_cell_properties[i]->IsSubType<AbstractCellMutationState>())
00275             {
00276                 *mpCellMutationStatesFile << r_cell_properties[i]->GetIdentifier() << "\t ";
00277             }
00278         }
00279         *mpCellMutationStatesFile << "\n";
00280     }
00281     if (mOutputCellProliferativeTypes)
00282     {
00283         mpCellProliferativeTypesFile = output_file_handler.OpenOutputFile("celltypes.dat");
00284     }
00285     if (mOutputCellVariables)
00286     {
00287         mpCellVariablesFile = output_file_handler.OpenOutputFile("cellvariables.dat");
00288     }
00289     if (mOutputCellCyclePhases)
00290     {
00291         mpCellCyclePhasesFile = output_file_handler.OpenOutputFile("cellcyclephases.dat");
00292     }
00293     if (mOutputCellAges)
00294     {
00295         mpCellAgesFile = output_file_handler.OpenOutputFile("cellages.dat");
00296     }
00297     if (mOutputCellIdData)
00298     {
00299         mpCellIdFile = output_file_handler.OpenOutputFile("loggedcell.dat");
00300     }
00301 }
00302 
00303 template<unsigned DIM>
00304 void AbstractCellPopulation<DIM>::CloseOutputFiles()
00305 {
00306     mpVizNodesFile->close();
00307     mpVizBoundaryNodesFile->close();
00308     mpVizCellProliferativeTypesFile->close();
00309 
00310     if (mOutputCellMutationStates)
00311     {
00312         mpCellMutationStatesFile->close();
00313     }
00314     if (mOutputCellProliferativeTypes)
00315     {
00316         mpCellProliferativeTypesFile->close();
00317     }
00318     if (mOutputCellVariables)
00319     {
00320         mpCellVariablesFile->close();
00321     }
00322     if (mOutputCellCyclePhases)
00323     {
00324         mpCellCyclePhasesFile->close();
00325     }
00326     if (mOutputCellAncestors)
00327     {
00328         mpVizCellAncestorsFile->close();
00329     }
00330     if (mOutputCellAges)
00331     {
00332         mpCellAgesFile->close();
00333     }
00334     if (mOutputCellIdData)
00335     {
00336         mpCellIdFile->close();
00337     }
00338 }
00339 
00340 template<unsigned DIM>
00341 void AbstractCellPopulation<DIM>::GenerateCellResults(unsigned locationIndex,
00342                                               std::vector<unsigned>& rCellProliferativeTypeCounter,
00343                                               std::vector<unsigned>& rCellCyclePhaseCounter)
00344 {
00345     unsigned colour = STEM_COLOUR;
00346 
00347     CellPtr p_cell = mLocationCellMap[locationIndex];
00348 
00349     if (mOutputCellCyclePhases)
00350     {
00351         // Update rCellCyclePhaseCounter
00352         switch (p_cell->GetCellCycleModel()->GetCurrentCellCyclePhase())
00353         {
00354             case G_ZERO_PHASE:
00355                 rCellCyclePhaseCounter[0]++;
00356                 break;
00357             case G_ONE_PHASE:
00358                 rCellCyclePhaseCounter[1]++;
00359                 break;
00360             case S_PHASE:
00361                 rCellCyclePhaseCounter[2]++;
00362                 break;
00363             case G_TWO_PHASE:
00364                 rCellCyclePhaseCounter[3]++;
00365                 break;
00366              case M_PHASE:
00367                 rCellCyclePhaseCounter[4]++;
00368                 break;
00369             default:
00370                 NEVER_REACHED;
00371         }
00372     }
00373 
00374     if (mOutputCellAncestors)
00375     {
00376         // Set colour dependent on cell ancestor and write to file
00377         colour = p_cell->GetAncestor();
00378         if (colour == UNSIGNED_UNSET)
00379         {
00380             // Set the file to -1 to mark this case.
00381             colour = 1;
00382             *mpVizCellAncestorsFile << "-";
00383         }
00384         *mpVizCellAncestorsFile << colour << " ";
00385     }
00386 
00387     // Set colour dependent on cell type
00388     switch (p_cell->GetCellCycleModel()->GetCellProliferativeType())
00389     {
00390         case STEM:
00391             colour = STEM_COLOUR;
00392             if (mOutputCellProliferativeTypes)
00393             {
00394                 rCellProliferativeTypeCounter[0]++;
00395             }
00396             break;
00397         case TRANSIT:
00398             colour = TRANSIT_COLOUR;
00399             if (mOutputCellProliferativeTypes)
00400             {
00401                 rCellProliferativeTypeCounter[1]++;
00402             }
00403             break;
00404         case DIFFERENTIATED:
00405             colour = DIFFERENTIATED_COLOUR;
00406             if (mOutputCellProliferativeTypes)
00407             {
00408                 rCellProliferativeTypeCounter[2]++;
00409             }
00410             break;
00411         default:
00412             NEVER_REACHED;
00413     }
00414 
00415     if (mOutputCellMutationStates)
00416     {
00417         // Set colour dependent on cell mutation state
00418         if (!p_cell->GetMutationState()->IsType<WildTypeCellMutationState>())
00419         {
00420             colour = p_cell->GetMutationState()->GetColour();
00421         }
00422         if (p_cell->HasCellProperty<CellLabel>())
00423         {
00424             CellPropertyCollection collection = p_cell->rGetCellPropertyCollection().GetProperties<CellLabel>();
00425             boost::shared_ptr<CellLabel> p_label = boost::static_pointer_cast<CellLabel>(collection.GetProperty());
00426             colour = p_label->GetColour();
00427         }
00428     }
00429 
00430     if (p_cell->HasCellProperty<ApoptoticCellProperty>() || p_cell->HasApoptosisBegun())
00431     {
00432         // For any type of cell set the colour to this if it is undergoing apoptosis
00433         colour = APOPTOSIS_COLOUR;
00434     }
00435 
00436     // Write cell variable data to file if required
00437     if (mOutputCellVariables && dynamic_cast<AbstractOdeBasedCellCycleModel*>(p_cell->GetCellCycleModel()) )
00438     {
00439         // Write location index corresponding to cell
00440         *mpCellVariablesFile << locationIndex << " ";
00441 
00442         // Write cell variables
00443         std::vector<double> proteins = (static_cast<AbstractOdeBasedCellCycleModel*>(p_cell->GetCellCycleModel()))->GetProteinConcentrations();
00444         for (unsigned i=0; i<proteins.size(); i++)
00445         {
00446             *mpCellVariablesFile << proteins[i] << " ";
00447         }
00448     }
00449 
00450     // Write cell age data to file if required
00451     if (mOutputCellAges)
00452     {
00453         // Write location index corresponding to cell
00454         *mpCellAgesFile << locationIndex << " ";
00455 
00456         // Write cell location
00457         c_vector<double, DIM> cell_location = GetLocationOfCellCentre(p_cell);
00458 
00459         for (unsigned i=0; i<DIM; i++)
00460         {
00461             *mpCellAgesFile << cell_location[i] << " ";
00462         }
00463 
00464         // Write cell age
00465         *mpCellAgesFile << p_cell->GetAge() << " ";
00466     }
00467 
00468     *mpVizCellProliferativeTypesFile << colour << " ";
00469 }
00470 
00471 template<unsigned DIM>
00472 void AbstractCellPopulation<DIM>::WriteCellResultsToFiles(std::vector<unsigned>& rCellProliferativeTypeCounter,
00473                                                   std::vector<unsigned>& rCellCyclePhaseCounter)
00474 {
00475     *mpVizCellProliferativeTypesFile << "\n";
00476 
00477     if (mOutputCellAncestors)
00478     {
00479         *mpVizCellAncestorsFile << "\n";
00480     }
00481 
00482     // Write cell mutation state data to file if required
00483     if (mOutputCellMutationStates)
00484     {
00485         std::vector<unsigned> mutation_state_count = GetCellMutationStateCount();
00486 
00487         for (unsigned i=0; i<mutation_state_count.size(); i++)
00488         {
00489             *mpCellMutationStatesFile << mutation_state_count[i] << "\t";
00490         }
00491         *mpCellMutationStatesFile << "\n";
00492     }
00493 
00494     // Write cell type data to file if required
00495     if (mOutputCellProliferativeTypes)
00496     {
00497         for (unsigned i=0; i<mCellProliferativeTypeCount.size(); i++)
00498         {
00499             mCellProliferativeTypeCount[i] = rCellProliferativeTypeCounter[i];
00500             *mpCellProliferativeTypesFile << rCellProliferativeTypeCounter[i] << "\t";
00501         }
00502         *mpCellProliferativeTypesFile << "\n";
00503     }
00504 
00505     if (mOutputCellVariables)
00506     {
00507         *mpCellVariablesFile << "\n";
00508     }
00509 
00510     // Write cell cycle phase data to file if required
00511     if (mOutputCellCyclePhases)
00512     {
00513         for (unsigned i=0; i<mCellCyclePhaseCount.size(); i++)
00514         {
00515             mCellCyclePhaseCount[i] = rCellCyclePhaseCounter[i];
00516             *mpCellCyclePhasesFile << rCellCyclePhaseCounter[i] << "\t";
00517         }
00518         *mpCellCyclePhasesFile << "\n";
00519     }
00520 
00521     // Write cell age data to file if required
00522     if (mOutputCellAges)
00523     {
00524         *mpCellAgesFile << "\n";
00525     }
00526 }
00527 
00528 template<unsigned DIM>
00529 void AbstractCellPopulation<DIM>::WriteTimeAndNodeResultsToFiles()
00530 {
00531     double time = SimulationTime::Instance()->GetTime();
00532 
00533     *mpVizNodesFile << time << "\t";
00534     *mpVizBoundaryNodesFile << time << "\t";
00535 
00536     // Write node data to file
00537     for (unsigned node_index=0; node_index<GetNumNodes(); node_index++)
00538     {
00539         if ( !GetNode(node_index)->IsDeleted())
00540         {
00541             const c_vector<double,DIM>& position = GetNode(node_index)->rGetLocation();
00542 
00543             for (unsigned i=0; i<DIM; i++)
00544             {
00545                 *mpVizNodesFile << position[i] << " ";
00546             }
00547             *mpVizBoundaryNodesFile << GetNode(node_index)->IsBoundaryNode() << " ";
00548         }
00549     }
00550     *mpVizNodesFile << "\n";
00551     *mpVizBoundaryNodesFile << "\n";
00552 }
00553 
00554 template<unsigned DIM>
00555 void AbstractCellPopulation<DIM>::WriteResultsToFiles()
00556 {
00557     WriteTimeAndNodeResultsToFiles();
00558 
00559     double time = SimulationTime::Instance()->GetTime();
00560 
00561     *mpVizCellProliferativeTypesFile << time << "\t";
00562 
00563     if (mOutputCellAncestors)
00564     {
00565         *mpVizCellAncestorsFile << time << "\t";
00566     }
00567     if (mOutputCellMutationStates)
00568     {
00569         *mpCellMutationStatesFile << time << "\t";
00570     }
00571     if (mOutputCellProliferativeTypes)
00572     {
00573         *mpCellProliferativeTypesFile << time << "\t";
00574     }
00575     if (mOutputCellVariables)
00576     {
00577         *mpCellVariablesFile << time << "\t";
00578     }
00579     if (mOutputCellCyclePhases)
00580     {
00581         *mpCellCyclePhasesFile << time << "\t";
00582     }
00583     if (mOutputCellAges)
00584     {
00585         *mpCellAgesFile << time << "\t";
00586     }
00587 
00588     GenerateCellResultsAndWriteToFiles();
00589 
00590     // Write logged cell data if required
00591     if (mOutputCellIdData)
00592     {
00593         WriteCellIdDataToFile();
00594     }
00595 }
00596 
00597 template<unsigned DIM>
00598 void AbstractCellPopulation<DIM>::WriteCellIdDataToFile()
00599 {
00600     // Write time to file
00601     *mpCellIdFile << SimulationTime::Instance()->GetTime();
00602 
00603     for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = Begin();
00604          cell_iter != End();
00605          ++cell_iter)
00606     {
00607         unsigned cell_id = cell_iter->GetCellId();
00608         unsigned location_index = mCellLocationMap[(*cell_iter).get()];
00609         *mpCellIdFile << " " << cell_id << " " << location_index;
00610 
00611         c_vector<double, DIM> coords = GetLocationOfCellCentre(*cell_iter);
00612         for (unsigned i=0; i<DIM; i++)
00613         {
00614             *mpCellIdFile << " " << coords[i];
00615         }
00616     }
00617     *mpCellIdFile << "\n";
00618 }
00619 
00620 template<unsigned DIM>
00621 void AbstractCellPopulation<DIM>::OutputCellPopulationInfo(out_stream& rParamsFile)
00622 {
00623     std::string cell_population_type = GetIdentifier();
00624 
00625     *rParamsFile <<  "\t<" << cell_population_type << ">" "\n";
00626     OutputCellPopulationParameters(rParamsFile);
00627     *rParamsFile <<  "\t</" << cell_population_type << ">" "\n";
00628 }
00629 
00630 template<unsigned DIM>
00631 void AbstractCellPopulation<DIM>::OutputCellPopulationParameters(out_stream& rParamsFile)
00632 {
00633     *rParamsFile <<  "\t\t<DampingConstantNormal>"<< mDampingConstantNormal << "</DampingConstantNormal>\n";
00634     *rParamsFile <<  "\t\t<DampingConstantMutant>"<< mDampingConstantMutant << "</DampingConstantMutant>\n";
00635     *rParamsFile <<  "\t\t<OutputCellIdData>"<<  mOutputCellIdData << "</OutputCellIdData> \n" ;
00636     *rParamsFile <<  "\t\t<OutputCellMutationStates>"<<  mOutputCellMutationStates << "</OutputCellMutationStates> \n" ;
00637     *rParamsFile <<  "\t\t<OutputCellAncestors>"<<  mOutputCellAncestors << "</OutputCellAncestors> \n" ;
00638     *rParamsFile <<  "\t\t<OutputCellProliferativeTypes>"<<  mOutputCellProliferativeTypes << "</OutputCellProliferativeTypes> \n" ;
00639     *rParamsFile <<  "\t\t<OutputCellVariables>"<<  mOutputCellVariables << "</OutputCellVariables> \n" ;
00640     *rParamsFile <<  "\t\t<OutputCellCyclePhases>"<<  mOutputCellCyclePhases << "</OutputCellCyclePhases> \n" ;
00641     *rParamsFile <<  "\t\t<OutputCellAges>"<<  mOutputCellAges << "</OutputCellAges> \n" ;
00642     *rParamsFile <<  "\t\t<OutputCellVolumes>"<<  mOutputCellVolumes << "</OutputCellVolumes> \n" ;
00643 }
00644 
00646 // Getter methods
00648 
00649 template<unsigned DIM>
00650 double AbstractCellPopulation<DIM>::GetDampingConstantNormal()
00651 {
00652     return mDampingConstantNormal;
00653 }
00654 
00655 template<unsigned DIM>
00656 double AbstractCellPopulation<DIM>::GetDampingConstantMutant()
00657 {
00658     return mDampingConstantMutant;
00659 }
00660 
00661 template<unsigned DIM>
00662 bool AbstractCellPopulation<DIM>::GetOutputCellIdData()
00663 {
00664     return mOutputCellIdData;
00665 }
00666 
00667 template<unsigned DIM>
00668 bool AbstractCellPopulation<DIM>::GetOutputCellMutationStates()
00669 {
00670     return mOutputCellMutationStates;
00671 }
00672 
00673 template<unsigned DIM>
00674 bool AbstractCellPopulation<DIM>::GetOutputCellAncestors()
00675 {
00676     return mOutputCellAncestors;
00677 }
00678 
00679 template<unsigned DIM>
00680 bool AbstractCellPopulation<DIM>::GetOutputCellProliferativeTypes()
00681 {
00682     return mOutputCellProliferativeTypes;
00683 }
00684 
00685 template<unsigned DIM>
00686 bool AbstractCellPopulation<DIM>::GetOutputCellVariables()
00687 {
00688     return mOutputCellVariables;
00689 }
00690 
00691 template<unsigned DIM>
00692 bool AbstractCellPopulation<DIM>::GetOutputCellCyclePhases()
00693 {
00694     return mOutputCellCyclePhases;
00695 }
00696 
00697 template<unsigned DIM>
00698 bool AbstractCellPopulation<DIM>::GetOutputCellAges()
00699 {
00700     return mOutputCellAges;
00701 }
00702 
00703 template<unsigned DIM>
00704 bool AbstractCellPopulation<DIM>::GetOutputCellVolumes()
00705 {
00706     return mOutputCellVolumes;
00707 }
00708 
00710 // Setter methods
00712 
00713 template<unsigned DIM>
00714 void AbstractCellPopulation<DIM>::SetDampingConstantNormal(double dampingConstantNormal)
00715 {
00716     assert(dampingConstantNormal > 0.0);
00717     mDampingConstantNormal = dampingConstantNormal;
00718 }
00719 
00720 template<unsigned DIM>
00721 void AbstractCellPopulation<DIM>::SetDampingConstantMutant(double dampingConstantMutant)
00722 {
00723     assert(dampingConstantMutant > 0.0);
00724     mDampingConstantMutant = dampingConstantMutant;
00725 }
00726 
00727 template<unsigned DIM>
00728 void AbstractCellPopulation<DIM>::SetOutputCellIdData(bool writeCellIdData)
00729 {
00730     mOutputCellIdData = writeCellIdData;
00731 }
00732 
00733 template<unsigned DIM>
00734 void AbstractCellPopulation<DIM>::SetOutputCellMutationStates(bool outputCellMutationStates)
00735 {
00736     mOutputCellMutationStates = outputCellMutationStates;
00737 }
00738 
00739 template<unsigned DIM>
00740 void AbstractCellPopulation<DIM>::SetOutputCellAncestors(bool outputCellAncestors)
00741 {
00742     mOutputCellAncestors = outputCellAncestors;
00743 }
00744 
00745 template<unsigned DIM>
00746 void AbstractCellPopulation<DIM>::SetOutputCellProliferativeTypes(bool outputCellProliferativeTypes)
00747 {
00748     mOutputCellProliferativeTypes = outputCellProliferativeTypes;
00749 }
00750 
00751 template<unsigned DIM>
00752 void AbstractCellPopulation<DIM>::SetOutputCellVariables(bool outputCellVariables)
00753 {
00754     mOutputCellVariables = outputCellVariables;
00755 }
00756 
00757 template<unsigned DIM>
00758 void AbstractCellPopulation<DIM>::SetOutputCellCyclePhases(bool outputCellCyclePhases)
00759 {
00760     mOutputCellCyclePhases = outputCellCyclePhases;
00761 }
00762 
00763 template<unsigned DIM>
00764 void AbstractCellPopulation<DIM>::SetOutputCellAges(bool outputCellAges)
00765 {
00766     mOutputCellAges = outputCellAges;
00767 }
00768 
00769 template<unsigned DIM>
00770 void AbstractCellPopulation<DIM>::SetOutputCellVolumes(bool outputCellVolumes)
00771 {
00772     mOutputCellVolumes = outputCellVolumes;
00773 }
00774 
00776 // Explicit instantiation
00778 
00779 template class AbstractCellPopulation<1>;
00780 template class AbstractCellPopulation<2>;
00781 template class AbstractCellPopulation<3>;

Generated on Mon Nov 1 12:35:16 2010 for Chaste by  doxygen 1.5.5