AbstractOnLatticeCellPopulation.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
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 "AbstractOnLatticeCellPopulation.hpp"
00030 
00031 template<unsigned DIM>
00032 AbstractOnLatticeCellPopulation<DIM>::AbstractOnLatticeCellPopulation(std::vector<CellPtr>& rCells,
00033                                                                   const std::vector<unsigned> locationIndices,
00034                                                                   bool deleteMesh)
00035     : AbstractCellPopulation<DIM>(rCells, locationIndices),
00036       mDeleteMesh(deleteMesh),
00037       mUpdateNodesInRandomOrder(true),
00038       mIterateRandomlyOverUpdateRuleCollection(false)
00039 {
00040 }
00041 
00042 template<unsigned DIM>
00043 AbstractOnLatticeCellPopulation<DIM>::AbstractOnLatticeCellPopulation()
00044     : AbstractCellPopulation<DIM>(),
00045       mDeleteMesh(true),
00046       mUpdateNodesInRandomOrder(true),
00047       mIterateRandomlyOverUpdateRuleCollection(false)
00048 {
00049 }
00050 
00051 template<unsigned DIM>
00052 AbstractOnLatticeCellPopulation<DIM>::~AbstractOnLatticeCellPopulation()
00053 {
00054 }
00055 
00056 template<unsigned DIM>
00057 bool AbstractOnLatticeCellPopulation<DIM>::GetUpdateNodesInRandomOrder()
00058 {
00059     return mUpdateNodesInRandomOrder;
00060 }
00061 
00062 template<unsigned DIM>
00063 void AbstractOnLatticeCellPopulation<DIM>::SetUpdateNodesInRandomOrder(bool updateNodesInRandomOrder)
00064 {
00065     mUpdateNodesInRandomOrder = updateNodesInRandomOrder;
00066 }
00067 
00068 template<unsigned DIM>
00069 void AbstractOnLatticeCellPopulation<DIM>::SetIterateRandomlyOverUpdateRuleCollection(bool iterateRandomly)
00070 {
00071     mIterateRandomlyOverUpdateRuleCollection = iterateRandomly;
00072 }
00073 
00074 template<unsigned DIM>
00075 bool AbstractOnLatticeCellPopulation<DIM>::GetIterateRandomlyOverUpdateRuleCollection()
00076 {
00077     return mIterateRandomlyOverUpdateRuleCollection;
00078 }
00079 
00080 template<unsigned DIM>
00081 void AbstractOnLatticeCellPopulation<DIM>::SetNode(unsigned nodeIndex, ChastePoint<DIM>& rNewLocation)
00082 {
00083     EXCEPTION("SetNode() cannot be called on a subclass of AbstractOnLatticeCellPopulation.");
00084 }
00085 
00086 template<unsigned DIM>
00087 void AbstractOnLatticeCellPopulation<DIM>::OutputCellPopulationParameters(out_stream& rParamsFile)
00088 {
00089     *rParamsFile << "\t\t<UpdateNodesInRandomOrder>" << mUpdateNodesInRandomOrder << "</UpdateNodesInRandomOrder>\n";
00090     *rParamsFile << "\t\t<IterateRandomlyOverUpdateRuleCollection>" << mIterateRandomlyOverUpdateRuleCollection << "</IterateRandomlyOverUpdateRuleCollection>\n";
00091 
00092     // Call method on direct parent class
00093     AbstractCellPopulation<DIM>::OutputCellPopulationParameters(rParamsFile);
00094 }
00095 
00097 // Explicit instantiation
00099 
00100 template class AbstractOnLatticeCellPopulation<1>;
00101 template class AbstractOnLatticeCellPopulation<2>;
00102 template class AbstractOnLatticeCellPopulation<3>;
Generated on Thu Dec 22 13:00:04 2011 for Chaste by  doxygen 1.6.3