Changeset - 5564fc0d72bc
[Not reviewed]
default
1 5 2
Roeland Merks - 15 years ago 2010-06-04 15:55:15
roeland.merks@cwi.nl
Updated the Makefiles and updated testplugin to new plugin interface.

user: Roeland Merks <roeland.merks@cwi.nl>
branch 'default'
added src/Makefile
added src/build_models/Makefile
changed src/VirtualLeaf.pro
changed src/build_models/leafplugin.cpp
changed src/build_models/leafplugin.h
changed src/build_models/testplugin.cpp
changed src/build_models/testplugin.h
removed src/build_models/simplugin.h
8 files changed with 117 insertions and 133 deletions:
0 comments (0 inline, 0 general)
src/Makefile
Show inline comments
 
new file 100644
 
# $Id: Makefile,v 3f0977faba37 2010/06/03 15:54:37 michael $
 

	
 
QMAKE = qmake
 

	
 
all: VirtualLeaf libplugin plugins
 

	
 
VirtualLeaf: Makefile.VirtualLeaf
 
	make -f Makefile.VirtualLeaf
 

	
 
Makefile.VirtualLeaf: VirtualLeaf.pro
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
libplugin: Makefile.libplugin
 
	make -f Makefile.libplugin
 

	
 
Makefile.libplugin: libplugin.pro
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugins:
 
	make -C build_models
 

	
 
clean:
 
	make -f Makefile.libplugin clean
 
	make -f Makefile.VirtualLeaf clean
 
	make -C build_models clean
 

	
 
#finis
src/VirtualLeaf.pro
Show inline comments
 
@@ -110,13 +110,13 @@ system(perl $$PERLDIR/make_pardialog_sou
 
HEADERS += \
 
 apoplastitem.h \
 
 canvas.h \
 
 cellbase.h \
 
 cell.h \
 
 cellitem.h \
 
 forwardeuler.h \
 
# forwardeuler.h \
 
 infobar.h \
 
 mainbase.h \
 
 mainbase.h \
 
 matrix.h \
 
 mesh.h \
 
 miscq.h \
 
@@ -151,13 +151,13 @@ HEADERS += \
 
SOURCES += \
 
 apoplastitem.cpp \
 
 canvas.cpp \
 
 cellbase.cpp \
 
 cell.cpp \
 
 cellitem.cpp \
 
 forwardeuler.cpp \
 
# forwardeuler.cpp \
 
 mainbase.cpp \
 
 matrix.cpp \
 
 mesh.cpp \
 
 miscq.cpp \
 
 modelcatalogue.cpp \
 
 Neighbor.cpp \
src/build_models/Makefile
Show inline comments
 
new file 100644
 
# $Id: Makefile,v 3f0977faba37 2010/06/03 15:54:37 michael $
 

	
 
QMAKE = qmake
 

	
 
all: plugin_auxingrowth plugin_leaf plugin_meinhardt plugin_test
 

	
 
plugin_auxingrowth: Makefile.plugin_auxingrowth
 
	make -f Makefile.plugin_auxingrowth
 

	
 
Makefile.plugin_auxingrowth: plugin_auxingrowth.pro
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugin_leaf: Makefile.plugin_leaf
 
	make -f Makefile.plugin_leaf
 

	
 
Makefile.plugin_leaf: plugin_leaf.pro
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugin_meinhardt: Makefile.plugin_meinhardt
 
	make -f Makefile.plugin_meinhardt
 

	
 
Makefile.plugin_meinhardt: plugin_meinhardt.pro
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugin_test: Makefile.plugin_test
 
	make -f Makefile.plugin_test
 

	
 
Makefile.plugin_test: plugin_test.pro
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
clean:
 
	make -f Makefile.plugin_auxingrowth clean
 
	make -f Makefile.plugin_leaf clean
 
	make -f Makefile.plugin_meinhardt clean
 
	make -f Makefile.plugin_test clean
 

	
 
#finis
src/build_models/leafplugin.cpp
Show inline comments
 
@@ -34,15 +34,15 @@
 

	
 
static const std::string _module_id("$Id$");
 

	
 
bool batch = false;
 

	
 
// To be executed after cell division
 
void LeafPlugin::OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) {
 
void LeafPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
		// PIN1 distributes between parent and daughter according to area
 
  double area = daughter1.Area(), daughter_area = daughter2.Area();
 
  double area = daughter1->Area(), daughter_area = daughter2->Area();
 
  double tot_area = area + daughter_area;
 
  
 
  //chem[1]*=(area/tot_area);
 
  //daughter.chem[1]*=(daughter_area/tot_area);
 
	
 
  // For lack of detailed data, or a better rule, we assume that cells remain polarized
 
@@ -51,54 +51,54 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
  // So the PIN1 is redistributed according to the original polarization over the walls
 
  
 
  // parent_info contains info about the parent 
 
  // redistribute the PIN in the endosome according to area
 
  
 
	// "Fudge" rule: if one of the cells is at the boundary, remove all AUX1 in the other cell
 
  if (daughter1.AtBoundaryP() && !daughter2.AtBoundaryP()) {
 
    //daughter2.new_chem[2]=daughter2.chem[2]=0.;
 
		daughter2.SetNewChem(2,0);
 
		daughter2.SetChemical(2,0);
 
  if (daughter1->AtBoundaryP() && !daughter2->AtBoundaryP()) {
 
    //daughter2->new_chem[2]=daughter2->chem[2]=0.;
 
		daughter2->SetNewChem(2,0);
 
		daughter2->SetChemical(2,0);
 
		//daughter.new_chem[0]=daughter.chem[0]=0.;
 
		//cerr << "Clearing daughter\n";
 
		//for (list<Wall *>::const_iterator w=daughter.walls.begin();
 
		//	 w!=daughter.walls.end();
 
		//	 w++) {
 
			
 
		//	(*w)->setTransporter(&daughter, 1, 0.);
 
		
 
		//}
 
		//new_chem[2]=chem[2]=parent_info.PINendosome;
 
		daughter1.SetNewChem(2,parent_info.PINendosome);
 
		daughter1.SetChemical(2,parent_info.PINendosome);
 
		//new_chem[2]=chem[2]=parent_info->PINendosome;
 
		daughter1->SetNewChem(2,parent_info->PINendosome);
 
		daughter1->SetChemical(2,parent_info->PINendosome);
 
 
 
	} else {
 
		if (daughter2.AtBoundaryP() && !daughter1.AtBoundaryP()) {
 
		if (daughter2->AtBoundaryP() && !daughter1->AtBoundaryP()) {
 
		  
 
		  //new_chem[2]=chem[2]=0.;
 
		  daughter1.SetNewChem(2,0);
 
		  daughter1.SetChemical(2,0);
 
		  daughter1->SetNewChem(2,0);
 
		  daughter1->SetChemical(2,0);
 
		  
 
			/*new_chem[0]=chem[0]=0.;
 
			for (list<Wall *>::const_iterator w=walls.begin();
 
				 w!=walls.end();
 
				 w++) {
 
				
 
				(*w)->setTransporter(this, 1, 0.);
 
			}*/
 
		  //daughter2.chem[2]=parent_info.PINendosome;
 
		  daughter2.SetChemical(2,parent_info.PINendosome);
 
		  //daughter2->chem[2]=parent_info->PINendosome;
 
		  daughter2->SetChemical(2,parent_info->PINendosome);
 
		  //cerr << "Clearing parent\n";
 
		  
 
		} else {
 
		  //daughter1.new_chem[2]=daughter1.chem[2] = parent_info.PINendosome*(area/tot_area);
 
		  daughter1.SetNewChem(2,parent_info.PINendosome*(area/tot_area));
 
		  daughter1.SetChemical(2, parent_info.PINendosome*(area/tot_area));
 
		  //daughter2.new_chem[2]=daughter2.chem[2] = parent_info.PINendosome*(daughter_area/tot_area);
 
		  daughter2.SetNewChem(2,parent_info.PINendosome*(daughter_area/tot_area));
 
		  daughter2.SetChemical(2,parent_info.PINendosome*(daughter_area/tot_area));
 
		  //daughter1->new_chem[2]=daughter1->chem[2] = parent_info->PINendosome*(area/tot_area);
 
		  daughter1->SetNewChem(2,parent_info->PINendosome*(area/tot_area));
 
		  daughter1->SetChemical(2, parent_info->PINendosome*(area/tot_area));
 
		  //daughter2->new_chem[2]=daughter2->chem[2] = parent_info->PINendosome*(daughter_area/tot_area);
 
		  daughter2->SetNewChem(2,parent_info->PINendosome*(daughter_area/tot_area));
 
		  daughter2->SetChemical(2,parent_info->PINendosome*(daughter_area/tot_area));
 
		  
 
		}
 
	}
 
	
 
	/*
 
	  // NB: Code commented out; not yet adapted to plugin format... RM 18/12/2009
 
@@ -109,18 +109,18 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
	
 
	// distribute wallPINs according to the circumference of the parent and daughter
 
	double circ = Circumference( );
 
	double daughter_circ = daughter.Circumference();
 
	double tot_circ = circ + daughter_circ;
 
	
 
	double wallPINs = (circ / tot_circ) * parent_info.PINmembrane;
 
	double daughter_wallPINs = (daughter_circ / tot_circ) * parent_info.PINmembrane;
 
	double wallPINs = (circ / tot_circ) * parent_info->PINmembrane;
 
	double daughter_wallPINs = (daughter_circ / tot_circ) * parent_info->PINmembrane;
 
	
 
     	//cerr << "wallPINs = " << wallPINs <<  ", daughter_wallPINs =  " << daughter_wallPINs << "sum = " << wallPINs + daughter_wallPINs << ", PINmembrane = " << parent_info.PINmembrane << endl;
 
     	//cerr << "wallPINs = " << wallPINs <<  ", daughter_wallPINs =  " << daughter_wallPINs << "sum = " << wallPINs + daughter_wallPINs << ", PINmembrane = " << parent_info->PINmembrane << endl;
 
	// distrubute it according to the overall polarity
 
	Vector polarization = parent_info.polarization.Normalised().Perp2D();
 
	Vector polarization = parent_info->polarization.Normalised().Perp2D();
 
	
 
	double sum=0.;
 
	for (list<Wall *>::const_iterator w=walls.begin();
 
		 w!=walls.end();
 
		 w++) {
 
		
 
@@ -140,36 +140,36 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
	//SetNewChem(1, Chemical(1));
 
	
 
	//cerr << "[ "  << sum_wall_Pi + Chemical(1) << "]";
 
	*/
 
}
 

	
 
void LeafPlugin::SetCellColor(CellBase &c, QColor &color) { 
 
void LeafPlugin::SetCellColor(CellBase *c, QColor *color) { 
 

	
 
	// Red: AUX1
 
	// Green: Auxin
 
	// Blue: van-3
 
  //  color.setRgb(chem[2]/(1+chem[2]) * 255.,(chem[0]/(1+chem[0]) * 255.),(chem[3]/(1+chem[3]) *255.) );
 
  color.setRgb(c.Chemical(2)/(1+c.Chemical(2)) * 255.,(c.Chemical(0)/(1+c.Chemical(0)) * 255.),(c.Chemical(3)/(1+c.Chemical(3)) *255.) );
 
  //  color->setRgb(chem[2]/(1+chem[2]) * 255.,(chem[0]/(1+chem[0]) * 255.),(chem[3]/(1+chem[3]) *255.) );
 
  color->setRgb(c->Chemical(2)/(1+c->Chemical(2)) * 255.,(c->Chemical(0)/(1+c->Chemical(0)) * 255.),(c->Chemical(3)/(1+c->Chemical(3)) *255.) );
 
  
 

	
 
}
 

	
 

	
 

	
 
void LeafPlugin::CellHouseKeeping(CellBase &c) {
 
void LeafPlugin::CellHouseKeeping(CellBase *c) {
 
	
 
  if (c.Boundary()==CellBase::None) {
 
    if (c.Area() > par->rel_cell_div_threshold * c.BaseArea() ) {
 
      //c.SetChemical(0,0);
 
      c.Divide();
 
  if (c->Boundary()==CellBase::None) {
 
    if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) {
 
      //c->SetChemical(0,0);
 
      c->Divide();
 
    }		
 
    
 
    // expand if this is not a provascular cell
 
    if (c.Chemical(3) < 0.7 ) {
 
      c.EnlargeTargetArea(par->cell_expansion_rate);
 
    if (c->Chemical(3) < 0.7 ) {
 
      c->EnlargeTargetArea(par->cell_expansion_rate);
 
    } 
 
  }  
 
  
 
}
 

	
 
void LeafPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
@@ -356,21 +356,21 @@ void LeafPlugin::WallDynamics(Wall *w, d
 
    
 
  dw1[1] = dPijdt1;
 
  dw2[1] = dPijdt2;
 
  
 
}
 

	
 
double LeafPlugin::complex_PijAj(CellBase &here, CellBase &nb, Wall &w) { 
 
double LeafPlugin::complex_PijAj(CellBase *here, CellBase *nb, Wall *w) { 
 

	
 
  // gives the amount of complex "auxinreceptor-Pin1"  at the wall (at QSS) 
 
  //return here.Chemical(1) * nb.Chemical(0) / ( par->km + here.Chemical(1));
 
  
 
  double nb_aux = (nb.BoundaryPolP() && w.AuxinSink()) ? par->sam_auxin : nb.Chemical(0);
 
  double nb_aux = (nb->BoundaryPolP() && w->AuxinSink()) ? par->sam_auxin : nb->Chemical(0);
 
  double receptor_level = nb_aux * par->r / (par->kr + nb_aux);
 

	
 
  return here.Chemical(1) * receptor_level / ( par->km + here.Chemical(1));
 
  return here->Chemical(1) * receptor_level / ( par->km + here->Chemical(1));
 
  
 
}
 

	
 

	
 
void LeafPlugin::CellDynamics(CellBase *c, double *dchem) { 
 

	
src/build_models/leafplugin.h
Show inline comments
 
@@ -34,31 +34,31 @@ class LeafPlugin : public QObject, SimPl
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void) { return QString( "Traveling wave model with influx carriers - Merks and Beemster, 2006-2008" ); }
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase &c);
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2);
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color);	
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void) { return 4; }
 

	
 
 private:
 
	double complex_PijAj(CellBase &here, CellBase &nb, Wall &w);
 
	double complex_PijAj(CellBase *here, CellBase *nb, Wall *w);
 
	
 
};
 

	
 
#endif
src/build_models/simplugin.h
Show inline comments
 
deleted file
src/build_models/testplugin.cpp
Show inline comments
 
@@ -32,32 +32,32 @@
 

	
 
static const std::string _module_id("$Id$");
 

	
 
bool batch = false;
 

	
 
// To be executed after cell division
 
void TestPlugin::OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) {
 
void TestPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
	
 
}
 

	
 
void TestPlugin::SetCellColor(CellBase &c, QColor &color) { 
 
void TestPlugin::SetCellColor(CellBase *c, QColor *color) { 
 

	
 
	static QStringList colors;
 
	if (colors.size()==0) {
 
		colors << "red" << "green" << "blue";
 
	}
 
	color = colors[c.Index()%colors.size()];
 
	color->setNamedColor(colors[c->Index()%colors.size()]);
 
}
 

	
 

	
 

	
 
void TestPlugin::CellHouseKeeping(CellBase &c) {
 
void TestPlugin::CellHouseKeeping(CellBase *c) {
 
	
 
	c.EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c.Area() > par->rel_cell_div_threshold * c.BaseArea() ) {
 
		c.Divide();
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) {
 
		c->Divide();
 
	}
 
}
 

	
 
void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {}
 
void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {}
 
void TestPlugin::CellDynamics(CellBase *c, double *dchem) { }
src/build_models/testplugin.h
Show inline comments
 
@@ -32,28 +32,28 @@ class TestPlugin : public QObject, SimPl
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void) { return QString( "Test model" ); }
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase &c);
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2);
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color);	
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void) { return 0; }
 
};
 

	
 

	
 

	
0 comments (0 inline, 0 general)