Changeset - c131f8cd4b54
[Not reviewed]
default
0 1 0
Roeland Merks - 15 years ago 2010-06-23 17:15:12
merks@cwi.nl
Changed auxin_growth example
1 file changed with 1 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/build_models/auxingrowthplugin.cpp
Show inline comments
 
@@ -12,97 +12,89 @@
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include "../simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "auxingrowthplugin.h"
 

	
 
#include "far_mem_5.h"
 

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

	
 
bool batch = false;
 

	
 

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

	
 
  // Auxin distributes between parent and daughter according to area
 
  double area1 = daughter1->Area(), area2 = daughter2->Area();
 
  double tot_area = area1 + area2;
 
	
 
  daughter1->SetChemical(0,daughter1->Chemical(0)*(area1/tot_area));
 
  daughter2->SetChemical(0,daughter2->Chemical(0)*(area2/tot_area));
 
	
 
  // After divisions, parent and daughter cells get a standard stock of PINs.
 
  daughter1->SetChemical(1, par->initval[1]);
 
  daughter2->SetChemical(1, par->initval[1]);
 
	
 
	
 
  // Reset transporter values of parent and daughter
 
  QList<WallBase *> walls;
 
  foreach(WallBase *w, walls) { 
 
    w->setTransporter(daughter1, 1, 0.);
 
  }
 
}
 

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

	
 
  // Red: PIN1
 
  // Green: Auxin
 
  if (c->CellType()==1)
 
    color->setNamedColor("Blue"); 
 
  else 
 
    color->setRgb(c->Chemical(1)/(1+c->Chemical(1)) * 255.,(c->Chemical(0)/(1+c->Chemical(0)) * 255.), 0);
 
  color->setRgb(c->Chemical(1)/(1+c->Chemical(1)) * 255.,(c->Chemical(0)/(1+c->Chemical(0)) * 255.), 0);
 
}
 

	
 

	
 

	
 
void AuxinGrowthPlugin::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->Chemical(0)>0.6) {
 
      c->SetCellType(1);
 
    } 
 
    // expand according to auxin concentration
 
    c->EnlargeTargetArea(par->auxin_dependent_growth?(c->Chemical(0)/(1.+c->Chemical(0)))*par->cell_expansion_rate:par->cell_expansion_rate);
 
  }  
 
}
 

	
 
void AuxinGrowthPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2)
 
{
 

	
 
  // leaf edge is const source of auxin
 
  // (Neumann boundary condition: we specify the influx)
 
  if (w->C2()->BoundaryPolP()) {
 
    if (w->AuxinSource()) {
 
      double aux_flux = par->leaf_tip_source * w->Length();
 
      dchem_c1[0]+= aux_flux;
 
      return;
 
    } else {
 
      return;
 
    }
 
  }
 
	
 
  if (w->C1()->BoundaryPolP()) {
 
		
 
    if (w->AuxinSource()) {
 
      double aux_flux = par->leaf_tip_source * w->Length();
0 comments (0 inline, 0 general)