generated from Chaste/template_project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:Chaste/OpenVT
- Loading branch information
Showing
18 changed files
with
3,491 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
clear; close all; | ||
|
||
load ../../../testoutput_2/Test02aMonolayerGrowth/results_from_time_0/tissuewidth.dat | ||
|
||
plot(tissuewidth(:,1),tissuewidth(:,4), 'k') | ||
|
||
xlabel("Time(h)") | ||
ylabel("Tissue Width (\mu m)") | ||
|
||
SaveAsPngEpsAndFig(-1,['Figs/ChasteMonolayerGrowth'], 12, 7/5, 12); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
% Save a figure as a .png .eps and .fig and adjust font sizes according to the | ||
% expected graph size in the .pdf file | ||
% filename file name WITHOUT EXTENSION | ||
% h list of plot handles in the current figure whose marker size or | ||
% line width should be modified. If h is -1, then all | ||
% markers/lines in the figure have their sizes changed | ||
% pdfwidth graph width in the pdf file | ||
% widthheightratio 16/9, 4/3, Pi whatever you prefer | ||
% pdflabelsize desired label font size in the pdf file. Axis tick | ||
% labels and legends have a fontsize of 0.8xpdflabelsize | ||
% | ||
% | ||
% Warnings: | ||
% 1 - the current figure should be the one we want to export (i.e. function acts on 'gcf') | ||
% 2 - at the end of the function axis object is in manual mode. Type 'axis | ||
% auto' to put them in 'auto mode'. Units of the gcf are also modified to | ||
% "centimeters" | ||
% 3 - the first 5 parameters defined just after the function declaration | ||
% could be parameters. Sensibly modifying their value should not cause the | ||
% function to fail. Reasonable ranges are indicated between brackets. | ||
% 4 - generated pdf and eps do not look exactly the same. Nothing I can't | ||
% do about that. | ||
% 5 - Not tested for 3D plots. It might work though. | ||
% | ||
% Edited by Ozzy on 11/08/2011 | ||
|
||
function SaveAsPngEpsandFig(h,filename, pdfwidth, widthheightratio,pdflabelsize) | ||
|
||
|
||
linewidth = 0.8; % line width in ? (between 1 and 3) | ||
markersize = 1; % size of markers in pt (1-20) | ||
labeloveraxislabelratio = 0.8; % ratio between label font size and axis label font size (between 0 and 1) | ||
gridwidth = 0.5; % line width of the grid (between 1 and 3) | ||
resolution = 300; % resolution in dpi (between 150 and 600) | ||
|
||
|
||
set(gcf, 'Units','centimeters') % Change units of the gcf to centimeters | ||
dimensions = [pdfwidth (pdfwidth/widthheightratio)] % Work out new dimensions | ||
labelsize = pdflabelsize; | ||
axeslabelsize =floor(labeloveraxislabelratio*labelsize); % Work out axis label font size | ||
|
||
hold on; | ||
axis manual % to prevent scale change when resizing | ||
|
||
set(gca,'fontsize',axeslabelsize); % set font size of the axes tick labels | ||
set(gca,'linewidth',gridwidth); % set line width of axis and grid (not plots) | ||
set(gcf,'position', [0,0, dimensions]); % set display size | ||
set(gcf,'PaperPositionMode','auto'); % Prevent redimensioning by the print function | ||
set(get(gca,'XLabel'),'fontsize',labelsize); % set font size for xlabel | ||
set(get(gca,'YLabel'),'fontsize',labelsize); % set font size for ylabel | ||
set(get(gca,'ZLabel'),'fontsize',labelsize); % set font size for zlabel | ||
set(get(gca,'Title'),'fontsize',labelsize); % set font size for title | ||
|
||
if (h == -1) % if plot handles that need line width change is -1 | ||
h = get(gca,'Children'); % do it for all | ||
end | ||
|
||
for i=1:length(h) | ||
set(h(i), 'linewidth' , linewidth); % set line width | ||
%set(h(i), 'MarkerSize' , markersize); % set marker size | ||
end | ||
|
||
resolution_str = ['-r' num2str(resolution)]; | ||
|
||
%Rescale so dont cut off xLabel | ||
set(gca,'OuterPosition',[0.01 0.01 0.99 0.99]) | ||
|
||
print('-depsc2',resolution_str, filename); % export .eps (In fact, eps does not really care about the resolution) | ||
print('-dpng',resolution_str, filename); % export .png | ||
|
||
savefig(filename); %save the fig for backup | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
106 changes: 106 additions & 0 deletions
106
src/Test02aMonolayerGrowth/FixedDurationCellCycleModel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
Copyright (c) 2005-2022, 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 "AbstractSimplePhaseBasedCellCycleModel.hpp" | ||
#include "DifferentiatedCellProliferativeType.hpp" | ||
|
||
#include "FixedDurationCellCycleModel.hpp" | ||
|
||
template<class Archive> | ||
void FixedDurationCellCycleModel::serialize(Archive & archive, const unsigned int version) | ||
{ | ||
// Archive cell-cycle model using serialization code from AbstractSimplePhaseBasedCellCycleModel | ||
archive & boost::serialization::base_object<AbstractSimplePhaseBasedCellCycleModel>(*this); | ||
} | ||
|
||
FixedDurationCellCycleModel::FixedDurationCellCycleModel() | ||
: AbstractSimplePhaseBasedCellCycleModel() | ||
{ | ||
SetPhaseDurations(); | ||
} | ||
|
||
void FixedDurationCellCycleModel::SetPhaseDurations() | ||
{ | ||
SetStemCellG1Duration(7.0); | ||
SetTransitCellG1Duration(7.0); | ||
SetSDuration(6.0); | ||
SetG2Duration(3.0); | ||
SetMDuration(2.0); | ||
SetMinimumGapDuration(3.0); | ||
} | ||
|
||
void FixedDurationCellCycleModel::SetG1Duration() | ||
{ | ||
assert(mpCell != NULL); // Make sure cell exists | ||
|
||
mG1Duration = 7.0; | ||
} | ||
|
||
AbstractCellCycleModel* FixedDurationCellCycleModel::CreateCellCycleModel() | ||
{ | ||
// Create a new cell-cycle model | ||
FixedDurationCellCycleModel* pCellCycleModel = new FixedDurationCellCycleModel(); | ||
return pCellCycleModel; | ||
} | ||
|
||
void FixedDurationCellCycleModel::UpdateCellCyclePhase() | ||
{ | ||
double timeSinceBirth = GetAge(); | ||
assert(timeSinceBirth >= 0); | ||
|
||
if (mpCell->GetCellProliferativeType()->IsType<DifferentiatedCellProliferativeType>()) | ||
{ | ||
mCurrentCellCyclePhase = G_ZERO_PHASE; | ||
} | ||
else if (timeSinceBirth < GetG1Duration()) | ||
{ | ||
mCurrentCellCyclePhase = G_ONE_PHASE; | ||
} | ||
else if (timeSinceBirth < GetG1Duration() + GetSDuration()) | ||
{ | ||
mCurrentCellCyclePhase = S_PHASE; | ||
} | ||
else if (timeSinceBirth < GetG1Duration() + GetSDuration() + GetG2Duration()) | ||
{ | ||
mCurrentCellCyclePhase = G_TWO_PHASE; | ||
} | ||
else if (timeSinceBirth < GetG1Duration() + GetSDuration() + GetG2Duration() + GetMDuration()) | ||
{ | ||
mCurrentCellCyclePhase = M_PHASE; | ||
} | ||
} | ||
|
||
#include "SerializationExportWrapperForCpp.hpp" | ||
CHASTE_CLASS_EXPORT(FixedDurationCellCycleModel) |
69 changes: 69 additions & 0 deletions
69
src/Test02aMonolayerGrowth/FixedDurationCellCycleModel.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
Copyright (c) 2005-2022, 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 FIXEDDURATIONCELLCYCLEMODEL_HPP_ | ||
#define FIXEDDURATIONCELLCYCLEMODEL_HPP_ | ||
|
||
#include "AbstractSimplePhaseBasedCellCycleModel.hpp" | ||
|
||
// "Simple" cell-cycle model: phase durations are set when the model is created. | ||
class FixedDurationCellCycleModel : public AbstractSimplePhaseBasedCellCycleModel | ||
{ | ||
private: | ||
// For archiving (saving or loading) the cell-cycle model object in a cell-based simulation. | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive & archive, const unsigned int version); | ||
|
||
void SetPhaseDurations(); | ||
void SetG1Duration() override; | ||
|
||
public: | ||
FixedDurationCellCycleModel(); | ||
|
||
// Override builder method for new copies of the cell-cycle model. | ||
AbstractCellCycleModel* CreateCellCycleModel() override; | ||
|
||
// Override to start phase from G1 | ||
void UpdateCellCyclePhase() override; | ||
}; | ||
|
||
// Provides a unique identifier for the custom cell-cycle model. | ||
// Needed for archiving and for writing out parameters file. | ||
// Simulations will throw errors if missing. | ||
#include "SerializationExportWrapper.hpp" | ||
CHASTE_CLASS_EXPORT(FixedDurationCellCycleModel) | ||
|
||
#endif // FIXEDDURATIONCELLCYCLEMODEL_HPP_ |
Oops, something went wrong.