Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
macavali committed Feb 7, 2017
1 parent e4da726 commit 609afba
Show file tree
Hide file tree
Showing 16 changed files with 1,326 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

# You can set which Chaste components (or other projects) your project depends on by editing the
# find_package() call for Chaste. E.g.
# find_package(Chaste COMPONENTS cell_based)
find_package(Chaste COMPONENTS cell_based)
# for a project just using the cell_based component (and its dependencies), or
# find_package(Chaste COMPONENTS heart lung)
# for a project combining heart & lung simulations.
#
# Note that the order in which components are specified does not matter.

# Here we just depend on core components (nothing application-specific).
find_package(Chaste COMPONENTS continuum_mechanics global io linalg mesh ode pde)
#find_package(Chaste COMPONENTS cell_based global io linalg mesh ode pde)

# Alternatively, to specify a Chaste installation directory use a line like that below.
# This is needed if your project is not contained in the projects folder within a Chaste source tree.
#find_package(Chaste COMPONENTS heart crypt PATHS /path/to/chaste-install NO_DEFAULT_PATH)

# Change the project name in the line below to match the folder this file is in,
# i.e. the name of your project.
chaste_do_project(template_project)
chaste_do_project(matteo_chaste)
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# This allows us to build executables (apps) using the project.
# Simply set the project name in the line below.
chaste_do_apps_project(template_project)
chaste_do_apps_project(matteo_chaste)
73 changes: 73 additions & 0 deletions src/ConstantTargetAreaModifier.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
Copyright (c) 2005-2016, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "ConstantTargetAreaModifier.hpp"

template<unsigned DIM>
ConstantTargetAreaModifier<DIM>::ConstantTargetAreaModifier()
: AbstractTargetAreaModifier<DIM>()
{
}

template<unsigned DIM>
ConstantTargetAreaModifier<DIM>::~ConstantTargetAreaModifier()
{
}

template<unsigned DIM>
void ConstantTargetAreaModifier<DIM>::UpdateTargetAreaOfCell(CellPtr pCell)
{
// Get target area A of a healthy cell in S, G2 or M phase
double cell_target_area = this->mReferenceTargetArea;

// Set cell data
pCell->GetCellData()->SetItem("target area", cell_target_area);
}

template<unsigned DIM>
void ConstantTargetAreaModifier<DIM>::OutputSimulationModifierParameters(out_stream& rParamsFile)
{
// No parameters to output, so just call method on direct parent class
AbstractTargetAreaModifier<DIM>::OutputSimulationModifierParameters(rParamsFile);
}

// Explicit instantiation
template class ConstantTargetAreaModifier<1>;
template class ConstantTargetAreaModifier<2>;
template class ConstantTargetAreaModifier<3>;

// Serialization for Boost >= 1.36
#include "SerializationExportWrapperForCpp.hpp"
EXPORT_TEMPLATE_CLASS_SAME_DIMS(ConstantTargetAreaModifier)
94 changes: 94 additions & 0 deletions src/ConstantTargetAreaModifier.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
Copyright (c) 2005-2016, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef CONSTANTTARGETAREAMODIFIER_HPP_
#define CONSTANTTARGETAREAMODIFIER_HPP_

#include "ChasteSerialization.hpp"
#include "AbstractTargetAreaModifier.hpp"

/**
* A modifier class in which the target area property of each cell is held constant over time.
*/
template<unsigned DIM>
class ConstantTargetAreaModifier : public AbstractTargetAreaModifier<DIM>
{
/** Needed for serialization. */
friend class boost::serialization::access;
/**
* Boost Serialization method for archiving/checkpointing.
* Archives the object and its member variables.
*
* @param archive The boost archive.
* @param version The current version of this class.
*/
template<class Archive>
void serialize(Archive & archive, const unsigned int version)
{
archive & boost::serialization::base_object<AbstractTargetAreaModifier<DIM> >(*this);
}

public:

/**
* Default constructor.
*/
ConstantTargetAreaModifier();

/**
* Destructor.
*/
virtual ~ConstantTargetAreaModifier();

/**
* Overridden UpdateTargetAreaOfCell() method.
*
* @param pCell pointer to the cell
*/
virtual void UpdateTargetAreaOfCell(const CellPtr pCell);

/**
* Overridden OutputSimulationModifierParameters() method.
* Output any simulation modifier parameters to file.
*
* @param rParamsFile the file stream to which the parameters are output
*/
void OutputSimulationModifierParameters(out_stream& rParamsFile);
};

#include "SerializationExportWrapper.hpp"
EXPORT_TEMPLATE_CLASS_SAME_DIMS(ConstantTargetAreaModifier)

#endif /*CONSTANTTARGETAREAMODIFIER_HPP_*/
81 changes: 81 additions & 0 deletions src/MatteoCellCycleModel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

#include "MatteoCellCycleModel.hpp"
#include "DifferentiatedCellProliferativeType.hpp"
#include "Debug.hpp"

MatteoCellCycleModel::MatteoCellCycleModel()
: AbstractSimpleCellCycleModel(),
mMinCellCycleDuration(12.0), // Hours
mMaxCellCycleDuration(14.0) // Hours
{
}

/*called every time step and tells if a cell is aready to divide (using the cell cycle model)*/

bool MatteoCellCycleModel::ReadyToDivide()
{
bool ready = mpCell->GetCellData()->GetItem("divide");
mpCell->GetCellData()->SetItem("divide", 0);
return ready;


}

MatteoCellCycleModel::MatteoCellCycleModel(const MatteoCellCycleModel& rModel)
: AbstractSimpleCellCycleModel(rModel),
mMinCellCycleDuration(rModel.mMinCellCycleDuration),
mMaxCellCycleDuration(rModel.mMaxCellCycleDuration)
{
}

AbstractCellCycleModel* MatteoCellCycleModel::CreateCellCycleModel()
{
return new MatteoCellCycleModel(*this);
}

void MatteoCellCycleModel::SetCellCycleDuration()
{
}

double MatteoCellCycleModel::GetMinCellCycleDuration()
{
return mMinCellCycleDuration;
}

void MatteoCellCycleModel::SetMinCellCycleDuration(double minCellCycleDuration)
{
mMinCellCycleDuration = minCellCycleDuration;
}

double MatteoCellCycleModel::GetMaxCellCycleDuration()
{
return mMaxCellCycleDuration;
}

void MatteoCellCycleModel::SetMaxCellCycleDuration(double maxCellCycleDuration)
{
mMaxCellCycleDuration = maxCellCycleDuration;
}

double MatteoCellCycleModel::GetAverageTransitCellCycleTime()
{
return 0.5*(mMinCellCycleDuration + mMaxCellCycleDuration);
}

double MatteoCellCycleModel::GetAverageStemCellCycleTime()
{
return 0.5*(mMinCellCycleDuration + mMaxCellCycleDuration);
}

void MatteoCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
{
*rParamsFile << "\t\t\t<MinCellCycleDuration>" << mMinCellCycleDuration << "</MinCellCycleDuration>\n";
*rParamsFile << "\t\t\t<MaxCellCycleDuration>" << mMaxCellCycleDuration << "</MaxCellCycleDuration>\n";

// Call method on direct parent class
AbstractSimpleCellCycleModel::OutputCellCycleModelParameters(rParamsFile);
}

// Serialization for Boost >= 1.36
#include "SerializationExportWrapperForCpp.hpp"
CHASTE_CLASS_EXPORT(MatteoCellCycleModel)
Loading

0 comments on commit 609afba

Please sign in to comment.